沈斌
2017-12-15 f9b157566af34b8dc28ba10b34d025ac04f3168b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { Component, OnInit } from '@angular/core';
import { NzMessageService } from 'ng-zorro-antd';
import { ModalHelper } from '@delon/theme';
import { _HttpClient } from '@delon/theme';
import { ExtrasPoiEditComponent } from './edit/edit.component';
 
@Component({
    selector: 'app-extras-poi',
    templateUrl: './poi.component.html'
})
export class ExtrasPoiComponent implements OnInit {
 
    list: any[] = [];
    s: any = {
        pi: 1,
        ps: 10,
        s: ''
    };
    total = 0;
 
    constructor(
        public http: _HttpClient,
        public msgSrv: NzMessageService,
        private modalHelper: ModalHelper) { }
 
    ngOnInit() {
        this.load();
    }
 
    load(reload: boolean = false) {
        if (reload) {
            this.s.pi = 1;
        }
        this.http.get('./assets/pois.json', this.s).subscribe((res: any) => {
            this.list = res.data;
            this.total = res.total;
        });
    }
 
    edit(i) {
        this.modalHelper.static(ExtrasPoiEditComponent, { i }).subscribe(() => {
            this.load();
            this.msgSrv.info('回调,重新发起列表刷新');
        });
    }
 
    photo(i) {
        this.msgSrv.success('click photo');
    }
 
    sku(i) {
        this.msgSrv.success('click sku');
    }
}