fashion-news.js
1023 Bytes
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
import cmsModel from '../../models/cms/index';
import event from '../../common/event';
import config from '../../common/config';
Component({
properties: {
refresh: {
type: Boolean,
observer: 'refresh'
}
},
data: {
fashionNews: []
},
ready: function() {
this.refresh();
},
methods: {
goDetail: function(e) {
let url = `${config.MINI_APP_DOMAIN}/pages/cms/newsDetail?id=${e.currentTarget.id}`;
let reportParams = Object.assign(global.fashionFloors, {
F_URL: url || '',
I_INDEX: (e.currentTarget.dataset.index + 1) || 1
});
event.emit('anchor-click', reportParams); // 点击资讯 埋点上报
global.router.goUrl(url);
},
refresh: function() {
cmsModel.getList().then((result) => {
this.setData({
fashionNews: result
});
});
}
}
});