const Http = require("../../utils/HttpBasics") //获取应用实例 const app = getApp() Page({ data: { market: app.globalData.market, imgUrls: [ 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg', 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg' ], swiperCurrent: 0, scrollTop: 0 }, swiperChange: function (e) { this.setData({ swiperCurrent: e.detail.current }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, onLoad: function (options) { var that = this; if (app.globalData.token && app.globalData.token != null) { console.log("index ++ " + app.globalData.token); if (that.couponChannelListCallback) { that.couponChannelListCallback(res.data.token); } if (that.couponListCallback) { that.couponListCallback(res.data.token); } } else { // 由于是网络请求,可能会在 Page.onLoad 之后才返回 // 所以此处加入 callback 以防止这种情况 app.tokenCallback = token => { console.log("index + " + token); if (that.couponChannelListCallback) { that.couponChannelListCallback(res.data.token); } if (that.couponListCallback) { that.couponListCallback(res.data.token); } } } wx.showLoading({ title: '加载中', }) var scene = decodeURIComponent(options.scene); var that = this; setTimeout(function () { wx.hideLoading() }, 2200) }, // 用户点击右上角分享 onShareAppMessage: function () { return { title: '富茂链客', desc: '分享个小程序,希望你喜欢', success: function (res) { wx.showToast({ title: "分享成功", duration: 1000, icon: "success" }) } } } })