import common from '../../utils/util'; import main from '../../utils/main'; const app = getApp(); Page({ data: { List:[], }, onLoad: function (options) { var that = this; that.setData({ Containnerheight: main.getWindowHeight(), }); that.init(); }, init: function (e) { var that = this; main.getData("GetMiaoguoCoupon?UserID=" + app.globalData.userInfo.UserID, function (data) { if (data){ that.setData({ List: data, }); } }); }, getCoupon: function (e) { var that = this; var coupontype = e.currentTarget.dataset.coupontype; var isloseefficacy = e.currentTarget.dataset.isloseefficacy; if (!isloseefficacy && coupontype==134){ wx.showModal({ title: '兑换成功', content: '必须重新启动小程序,然后到“用户手册”检查有效期。', showCancel: false, confirmText: "重启程序", success(res) { if (res.confirm) { wx.reLaunch({ url: '../index/index?type=userbook', }); } }, }); setTimeout(function(){ main.getData("UseMiaoguoCoupon?UserID=" + app.globalData.userInfo.UserID + "&CouponType=" + coupontype, function (data) {}); },500); } }, onShareAppMessage: function () { return { title: app.globalData.ShareTitle, path: app.globalData.SharePath + '?LessonID=all&UserID=' + app.globalData.userInfo.UserID, imageUrl: app.globalData.ShareImage, } }, })