From 28007196159f4208bcb2bcfaa2c47bc062b519b3 Mon Sep 17 00:00:00 2001 From: GJW200011 <2399547226@qq.com> Date: Wed, 1 Dec 2021 11:46:51 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E5=85=91=E6=8D=A2=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E6=B7=BB=E5=8A=A0=E9=AA=8C=E8=AF=81=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/opera/show/show_detail.wxml | 2 +- .../user/discount/discount_ex/discount_ex.js | 219 +++++++++--------- project.config.json | 5 +- 3 files changed, 115 insertions(+), 111 deletions(-) diff --git a/pages/opera/show/show_detail.wxml b/pages/opera/show/show_detail.wxml index 8357f48..6ee074e 100644 --- a/pages/opera/show/show_detail.wxml +++ b/pages/opera/show/show_detail.wxml @@ -67,7 +67,7 @@ bindplay="bindPlayCallBack" id="video_{{index}}" /> - 查看更多 + 查看更多 diff --git a/pages/user/discount/discount_ex/discount_ex.js b/pages/user/discount/discount_ex/discount_ex.js index 29d303a..d117cf8 100644 --- a/pages/user/discount/discount_ex/discount_ex.js +++ b/pages/user/discount/discount_ex/discount_ex.js @@ -1,133 +1,136 @@ // pages/user/discount/discount_ex/discount_ex.js import { - http + http, + login_check } from '../../../../utils/util' import { host } from '../../../../Gdata' Page({ - /** - * 页面的初始数据 - */ - data: { - active: 0 - }, - ex(e) { - let token = getApp().globalData.token - let uid = getApp().globalData.uid - let url = ["/api/v1/coupon-exchange", "/api/v1/wenhui-exchange", "/api/v1/card-exchange"] - if(e.currentTarget.dataset.index == 2){ - wx.request({ - url: host + url[e.currentTarget.dataset.index], - data: { - card_sn: this.data.code - }, - method: "post", - header: { - 'token': token, - 'uid': uid - }, - success: res => { - if (200 == res.data.status) { - this.setData({code:null}) - wx.showToast({ - title: "兑换成功", - icon: "success", - duration: 2000 - }) - } else { - wx.showToast({ - title: "兑换码错误", - icon: 'error', - duration: 2000 - }) - } + /** + * 页面的初始数据 + */ + data: { + active: 0 + }, + ex(e) { + if (login_check(1)) { + let token = getApp().globalData.token + let uid = getApp().globalData.uid + let url = ["/api/v1/coupon-exchange", "/api/v1/wenhui-exchange", "/api/v1/card-exchange"] + if (e.currentTarget.dataset.index == 2) { + wx.request({ + url: host + url[e.currentTarget.dataset.index], + data: { + card_sn: this.data.code + }, + method: "post", + header: { + 'token': token, + 'uid': uid + }, + success: res => { + if (200 == res.data.status) { + this.setData({ code: null }) + wx.showToast({ + title: "兑换成功", + icon: "success", + duration: 2000 + }) + } else { + wx.showToast({ + title: "兑换码错误", + icon: 'error', + duration: 2000 + }) } - }) - }else{ - wx.request({ - url: host + url[e.currentTarget.dataset.index], - data: { - coupon_sn: this.data.code - }, - method: "post", - header: { - 'token': token, - 'uid': uid - }, - success: res => { - if (200 == res.data.status) { - this.setData({code:null}) - wx.showToast({ - title: "兑换成功", - icon: "success", - duration: 2000 - }) - } else { - wx.showToast({ - title: "兑换码错误", - icon: 'error', - duration: 2000 - }) - } + } + }) + } else { + wx.request({ + url: host + url[e.currentTarget.dataset.index], + data: { + coupon_sn: this.data.code + }, + method: "post", + header: { + 'token': token, + 'uid': uid + }, + success: res => { + if (200 == res.data.status) { + this.setData({ code: null }) + wx.showToast({ + title: "兑换成功", + icon: "success", + duration: 2000 + }) + } else { + wx.showToast({ + title: "兑换码错误", + icon: 'error', + duration: 2000 + }) } - }) - } - }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { + } + }) + } + } + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { - }, + }, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { - }, + }, - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { - }, + }, - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { - }, + }, - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { - }, + }, - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { - }, + }, - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { - }, + }, - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { - } - }) \ No newline at end of file + } +}) \ No newline at end of file diff --git a/project.config.json b/project.config.json index bf1aae0..13d8bee 100644 --- a/project.config.json +++ b/project.config.json @@ -6,7 +6,7 @@ "setting": { "urlCheck": false, "es6": true, - "enhance": false, + "enhance": true, "postcss": true, "preloadBackgroundData": false, "minified": true, @@ -30,6 +30,7 @@ "outputPath": "" }, "enableEngineNative": false, + "bundle": false, "useIsolateContext": true, "useCompilerModule": true, "userConfirmedUseCompilerModuleSwitch": false, @@ -39,7 +40,7 @@ "minifyWXSS": true }, "compileType": "miniprogram", - "libVersion": "2.20.0", + "libVersion": "2.21.0", "appid": "wx35bc60d481961c1d", "projectname": "miniprogram2", "debugOptions": {