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.
40 lines
870 B
40 lines
870 B
const app = getApp();
|
|
|
|
Page({
|
|
data:{
|
|
statusBarHeight:20,
|
|
current:0,
|
|
show:[1],
|
|
list:[
|
|
{text:"课堂", type:"course"},
|
|
{text:"实训", type:"shixun"},
|
|
//{text:"课程"}
|
|
]
|
|
},
|
|
onLoad(){
|
|
wx.getSystemInfo({
|
|
success: res=>{
|
|
let {statusBarHeight} = res;
|
|
this.setData({statusBarHeight});
|
|
},
|
|
})
|
|
},
|
|
enterSearch(){
|
|
let type = this.data.list[this.data.current].type||'';
|
|
app.navigateTo({url:`{search}?type=${type}`});
|
|
},
|
|
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 })
|
|
}
|
|
},
|
|
onShareAppMessage(){
|
|
|
|
}
|
|
}) |