//index.js //获取应用实例 const app = getApp() Page({ data: { status: false, statusimg: '', statustext: '', navData: [{ name: "首页", //文本 current: 0, //是否是当前页,0不是 1是 style: 0, //样式 typea: "https://yuesuo.yueguanjia.com/MiniProgram/images/home.png", //不同图标 typec: "https://yuesuo.yueguanjia.com/MiniProgram/images/homec.png", fn: 'index' //对应处理函数 }, { name: "套餐", current: 0, style: 0, typea: "https://yuesuo.yueguanjia.com/MiniProgram/images/packages.png", //不同图标 typec: "https://yuesuo.yueguanjia.com/MiniProgram/images/packagesc.png", fn: 'packages' }, { name: "悦所", current: 0, style: 2, ico: '', fn: 'yuesuo' }, { name: "活动", current: 0, style: 0, typea: "https://yuesuo.yueguanjia.com/MiniProgram/images/promotion.png", //不同图标 typec: "https://yuesuo.yueguanjia.com/MiniProgram/images/promotionc.png", fn: 'promotion' }, { name: "我的", current: 0, style: 0, typea: "https://yuesuo.yueguanjia.com/MiniProgram/images/mine.png", //不同图标 typec: "https://yuesuo.yueguanjia.com/MiniProgram/images/minec.png", fn: 'mine' }, ] }, index: function() { app.gopage("/pages/index/index"); }, promotion: function() { app.gopage("/pages/promotion/promotion"); }, yuesuo: function() { app.gopage("/pages/yuesuo/yuesuo"); }, packages: function() { app.gopage("/pages/packages/packages"); }, mine: function() { app.gopage("/pages/mine/mine"); }, //事件处理函数 bindViewTap: function() { wx.navigateTo({ url: '../logs/logs' }) }, onLoad: function(options) { if (options.status === 'yes') { this.setData({ statusimg: 'https://yuesuo.yueguanjia.com/MiniProgram/promotion/offline/get.png', statustext: '恭喜您,领取成功' }) } else { this.setData({ statusimg: 'https://yuesuo.yueguanjia.com/MiniProgram/promotion/offline/none.png', statustext: '很遗憾,您在之前的活动中已经领取过了' }) } let _this = this; _this.setData({ navH: app.globalData.navHeight }) }, // hrefCl: function(e) { // wx.navigateTo({ // url: '/pages/consultant/consultant' // }) // }, // hrefPm: function(e) { // wx.navigateTo({ // url: '/pages/promotion/promotion' // }) // }, // hrefEq: function(e) { // wx.navigateTo({ // url: '/pages/equipment/equipment' // }) // } })