resources.js
1.07 KB
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 resourcesModel from '../../models/resources/index';
Component({
properties: {
contentCode: {
type: String,
value: ''
},
refresh: {
type: Boolean,
observer: '_contentCodeChange'
}
},
data: {
floors: []
},
ready: function() {
this._contentCodeChange();
},
methods: {
_contentCodeChange: function() {
return resourcesModel.getContent(this.data.contentCode).then(floors => {
if (floors.length && global.fashionFloors) { // 楼层信息存储,用于yas上报
global.fashionFloors.F_INDEX += floors.length;
if (floors[floors.length - 1].template_id) {
global.fashionFloors.F_ID = floors[floors.length - 1].template_id;
global.fashionFloors.F_NAME = floors[floors.length - 1].template_name;
}
}
this.setData({
floors
});
});
}
}
});