class.js
875 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
39
40
41
import App from '../../utils/api.js'
import util from '../../utils/util.js'
Component({
properties:{
seller:Object,
classidx:{
type:Number,
value:0
}
},
data:{
},
attached(){
this.getclasslist();
let systeminfo=util.cache('system.info');
let ratio=750/systeminfo.windowWidth;
let headerHeight=util.cache('headerHeight')
let contentheight=systeminfo.windowHeight-headerHeight-(418/ratio);
this.setData({
contentheight:Math.floor(contentheight)
})
},
methods:{
getclasslist(){
App.Cookbook.GetCookbookClassBySellerId({SellerId:this.data.seller.id,type:2}).then((json)=>{
console.log(json)
this.setData({
classlist:json.data[0]
})
})
},
selectclass(e){
let classidx=e.currentTarget.dataset.index;
if(classidx!=this.data.classidx){
this.triggerEvent('tellclass',{classidx:classidx})
}
}
}
})