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.

39 lines
943 B

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