diff --git a/packageA/pages/hongBao/hongBao.js b/packageA/pages/hongBao/hongBao.js index 18f1263..e69b09f 100644 --- a/packageA/pages/hongBao/hongBao.js +++ b/packageA/pages/hongBao/hongBao.js @@ -12,6 +12,7 @@ Page({ data: { url: app.globalData.setting.imghost, qiangHongBao: false, + qianging: false, time: null, // hongBaoData: null, //保存抢红包活动的相关时间等信息 @@ -223,42 +224,47 @@ Page({ }, qiangHongBao() { - app.request.promisePost('/api/weshop/redmoney/redRecord/saveRecord', { - data: { - store_id: app.globalData.setting.stoid, - user_id: app.globalData.user_id, - redid: this.data.hongBaoData.id, - } - }) - .then(res => { - if(res.data.code == 0){ - // wx.hideLoading(); - // wx.showToast({ - // title: '领取成功', - // icon: 'success', - // duration: 2000 - // }); - console.log('请求提交成功',res.data); - // if(callback) { - // callback(res.data.data); - // } - } else if(res.data.code === -1) { - // wx.hideLoading(); - // wx.showToast({ - // title: '领取失败:' + res.data.msg, - // icon: 'none', - // duration: 2000 - // }); - // self.setData({ - // result: res.data - // }); - - }; - self.setData({ - result: res.data, - qiangHongBao: true, - }); - }) + if(!this.data.qianging) { + this.data.qianging = true; + app.request.promisePost('/api/weshop/redmoney/redRecord/saveRecord', { + data: { + store_id: app.globalData.setting.stoid, + user_id: app.globalData.user_id, + redid: this.data.hongBaoData.id, + } + }) + .then(res => { + // if(res.data.code == 0){ + // // wx.hideLoading(); + // // wx.showToast({ + // // title: '领取成功', + // // icon: 'success', + // // duration: 2000 + // // }); + // console.log('请求提交成功',res.data); + + // // if(callback) { + // // callback(res.data.data); + // // } + // } else if(res.data.code === -1) { + // // wx.hideLoading(); + // // wx.showToast({ + // // title: '领取失败:' + res.data.msg, + // // icon: 'none', + // // duration: 2000 + // // }); + // // self.setData({ + // // result: res.data + // // }); + + // }; + self.setData({ + result: res.data, + qiangHongBao: true, + }); + }) + } + }, @@ -310,6 +316,7 @@ Page({ closePopup() { this.setData({ qiangHongBao: false, + qianging: false, }); },