used.js
903 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
42
43
44
45
46
47
48
49
50
51
52
53
54
import util from '../../utils/util';
import App from '../../utils/api';
Page({
data:{
tablist:[
{
name:'已使用',
status:0
},
{
name:'已失效',
status:0
}
],
tabidx:0
},
onLoad(){
this.init();
this.getlist();
},
getlist(){
App.Activity.GetListByStatus().then((json)=>{
console.log(json);
if(json.ret==200){
this.setData({
list:json.data
})
}
})
},
init(){
let systemInfo = wx.getSystemInfoSync();
let reg = /ios/i;
let pt = 20;//导航状态栏上内边距
let h = 44;//导航状态栏高度
if(reg.test(systemInfo.system)){
pt = systemInfo.statusBarHeight;
h = 44;
}else{
pt = systemInfo.statusBarHeight;
h = 48;
}
this.setData({
headerHeight:pt+h,
contentHeight:systemInfo.windowHeight-pt-h
})
},
selecttab(e){
let idx=util.attr(e,'index');
this.setData({
tabidx:idx
})
}
})