diff --git a/wx-combining.html b/wx-combining.html index 6bdc80b..ccf036d 100644 --- a/wx-combining.html +++ b/wx-combining.html @@ -213,7 +213,7 @@ const emailReg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; new Vue({ el: "#app", - data () { + data() { return { goods: '', backAble: (~~sessionStorage.getItem('goodsCount')) > 1, @@ -248,7 +248,7 @@ }; }, - mounted () { + mounted() { document.title = localStorage.getItem('title'); this.code_batch_id = JSON.parse(sessionStorage.getItem('goodsInfo')).entity.code_batch_id; this.getProductDetail(); @@ -271,7 +271,7 @@ }, computed: { - dynamicStyle () { + dynamicStyle() { switch (Number(this.goods.group_info.channel)) { case 1: return { @@ -325,7 +325,7 @@ methods: { //获取商品详情 - getProductDetail () { + getProductDetail() { const self = this; req.axiosGet('/key/group/v2/groupProductDetail', { token: self.token, @@ -340,6 +340,10 @@ // send_status 1发放中,2全部成功 ,3全部失败,4部分失败 ,5未领取 self.popMsg = self.goods.send_status === 2 || self.goods.send_status === 3 || self.goods.send_status === 4 ? true : false; + if (self.goods.send_status === 2 || self.goods.send_status === 3) { + clearInterval(self.timeGet); + self.timeGet = null; + } // 部分失败 if (self.goods.send_status === 4) { let all_product_voucher = []; @@ -350,6 +354,8 @@ let is_err_length = all_product_voucher.filter(item => item.status === 9).length; self.isOKLength = all_product_voucher.length - is_err_length; self.isErrLength = is_err_length; + clearInterval(self.timeGet); + self.timeGet = null; } // 1.发放中 轮循 if (res.data.send_status === 1) { @@ -377,7 +383,7 @@ }).catch(); }, // 轮循 - groupProductVoucherDetail () { + groupProductVoucherDetail() { let self = this; req.axiosPost('/key/group/groupProductVoucherDetail', { token: this.token, @@ -493,7 +499,7 @@ /* ******************************************** 官方领取 ******************************************** */ /* 直接领取 */ - directSubmit () { + directSubmit() { const self = this; self.loading = true; setTimeout(() => { @@ -540,7 +546,7 @@ }, /* 公众号领取 */ - publicCollection () { + publicCollection() { let params = { token: this.token, code_batch_id: this.code_batch_id, @@ -560,7 +566,7 @@ }, /* 支付宝官方领取H5跳转 */ - toLinkAlipay () { + toLinkAlipay() { let self = this; let banklink = encodeURIComponent( window.location.origin + @@ -583,7 +589,7 @@ /* ******************************************** 账号领取 ******************************************** */ /* 立即领取 */ - submit () { + submit() { if (this.goods.group_info.channel == 3 || this.goods.group_info.channel == 1 && this.goods.group_info.receive_mode == 2) { const { confirm, receive_account } = this.form; if (this.loading) return; @@ -600,7 +606,7 @@ }, // 提交函数 - submitOne (data) { + submitOne(data) { /* 领取立减金 */ req.axiosPost("/key/couponGroupUsage", data) .then(({ code, message }) => { @@ -614,7 +620,7 @@ }, // 重试函数 - resetSubmit (data) { + resetSubmit(data) { /* 领取立减金 */ req.axiosPost("/voucher/groupVoucherRetry", data) .then(({ code, message }) => { @@ -628,7 +634,7 @@ }, /* 验证后 最终提交 */ - finalSubmit () { + finalSubmit() { const self = this; self.loading = true; setTimeout(() => { @@ -655,7 +661,7 @@ }, /* 返回 */ - backGoodsFn () { + backGoodsFn() { if (this.backAble) { window.location.replace('./homepage.html'); } else { @@ -664,7 +670,7 @@ }, /* 接口异常处理 */ - axiosErrorFun (code, message) { + axiosErrorFun(code, message) { this.loading = false; if (code == 403) { if (this.backAble) { @@ -681,7 +687,7 @@ }, //复制文本 - copyFn () { + copyFn() { var textArea = document.createElement("textarea"); textArea.value = this.copyLink; document.body.appendChild(textArea); @@ -696,7 +702,7 @@ }, /* 触发提示 */ - tips (text) { + tips(text) { this.cls && clearTimeout(this.cls); this.prompt_text = text; this.promptShow = true; @@ -705,18 +711,18 @@ }, 3000); }, // 错误弹出框关闭 - knowFn () { + knowFn() { this.popboxshow = false; this.maskshow = false; }, // 错误弹窗 - openErrorDialog (tip) { + openErrorDialog(tip) { this.maskshow = true; this.tiptext = tip; this.popboxshow = true; }, // 6发放中 1待使用 9领取失败 20待领取 轮循+详情 - formatStatusText (status) { + formatStatusText(status) { switch (status) { case 6: return "发放中"; @@ -733,7 +739,7 @@ } }, // 计算 num - computeNum (data) { + computeNum(data) { const self = this; let new_product = data.map(item => { let result = item.voucher.reduce((acc, curr) => {