You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
735 B
36 lines
735 B
5 years ago
|
const app = getApp();
|
||
|
|
||
|
Page({
|
||
|
data:{
|
||
|
statusBarHeight:20,
|
||
|
current:0,
|
||
|
show:[1],
|
||
|
list:[
|
||
|
{text:"课堂"},
|
||
|
{text:"实训"},
|
||
|
//{text:"课程"}
|
||
|
]
|
||
|
},
|
||
|
onLoad(){
|
||
|
wx.getSystemInfo({
|
||
|
success: res=>{
|
||
|
let {statusBarHeight} = res;
|
||
|
this.setData({statusBarHeight});
|
||
|
},
|
||
|
})
|
||
|
},
|
||
|
enterSearch(){
|
||
|
app.navigateTo({url:"{search}"});
|
||
|
},
|
||
|
switchNav({target:{dataset:{current}}}){
|
||
|
this.setData({current});
|
||
|
this.setData({['show['+current+']']:1})
|
||
|
},
|
||
|
switchTab({detail:{current, source, value}}){
|
||
|
console.log(current, source, value);
|
||
|
if(source=="touch"){
|
||
|
this.setData({ current });
|
||
|
this.setData({ ['show[' + current + ']']: 1 })
|
||
|
}
|
||
|
}
|
||
|
})
|