import common from '../../utils/util'; import main from '../../utils/main'; const app = getApp(); Page({ data: { Menu:0, List:[], TestList:[], CurrentIndex1:0, CurrentIndex2:0, ImagePath: app.globalData.uploadImageUrl, }, onLoad: function (options) { var that = this; that.setData({ Containnerheight: main.getWindowHeight(), }); }, onShow:function(){ var that = this; wx.showLoading({ title: '请稍候', mask: true, }); main.getData('GetMiaoguoTestIndex?UserID='+app.globalData.userInfo.UserID, function (data) { wx.hideLoading(); if (data) { that.setData({ List:data.List1, TestList:data.List2, }); } }); }, setMenu:function(e){ var that=this; var index=e.currentTarget.dataset.index; that.setData({ Menu:index, }); }, goto: function (e) { var url = e.currentTarget.dataset.url; wx.navigateTo({ url: url, }); }, bindChange:function(e){ let index=e.currentTarget.dataset.index; if (index==1){ this.setData({ CurrentIndex1:e.detail.current, }); } else { this.setData({ CurrentIndex2:e.detail.current, }); } }, setCurrentIndex:function(e){ let index=e.currentTarget.dataset.index; if (e.currentTarget.dataset.target=="CurrentIndex1"){ this.setData({ CurrentIndex1:index, }); } else{ this.setData({ CurrentIndex2:index, }); } }, catchTouchMove:function(e) { // 这个函数不需要做任何事情,只需要捕获事件防止冒泡 return false; }, onShareAppMessage: function () { return { title: app.globalData.ShareTitle, path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID, imageUrl: app.globalData.ShareImage, } }, })