| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- 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,
- }
- },
- })
|