From 3b4f86276eea7f8267be1452960b67723da4440b Mon Sep 17 00:00:00 2001 From: lfs3 Date: Fri, 26 Jul 2019 15:44:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=8A=B5=E4=BD=BF=E7=94=A8bu?= =?UTF-8?q?g=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/month-card.vue | 46 ++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/src/view/month-card.vue b/src/view/month-card.vue index e700d43..8027a18 100644 --- a/src/view/month-card.vue +++ b/src/view/month-card.vue @@ -124,11 +124,24 @@ export default { } }); }, + countExtend() { + return new Promise((resolve, reject) => { + var params = { + buryingPointType: 0, + salesmanUniqueIdentity: this.uniqueId, + timeStr: this.getTime(Date.now()) + }; + homeApi.countExtend(params).then(res => { + + resolve(); + }); + }); + }, // 立即使用优惠券 handleUseCoupon() { window.location.href = - locationUrl + "/mall/web/vgoods/detail/" + this.getData.goodsNo+ '?uniqueId='+ uniqueId; + locationUrl + "/mall/web/vgoods/detail/" + this.getData.goodsNo+ '?uniqueId='+ this.uniqueId; }, // 领取优惠券 @@ -187,16 +200,33 @@ export default { let uuniqueId = Qs.parse(location.search.substring(1)).uniqueId var url = location.href.split('?')[0] if(this.uniqueId !== undefined && this.uniqueId !== null && this.uniqueId !== ""){ - + this.uniqueId = '' } // 初始化 this.handleInit(); - console.log('url:'+ url.split('?')[0]) - this.wxShare({ - couponNo: this.batchNo, - source: 20, - url: encodeURIComponent(url) - }); + return new Promise((resolve, reject) => { + var params = { + salesmanUniqueIdentity: this.uniqueId, + }; + homeApi.updateUniqueId(params).then(res => { + this.showLoading = false; + if (res.code == 0) { + this.uniqueId=this.$cookies.get('1hjz_mall_unique_id') + if(this.uniqueId !== undefined && this.uniqueId !== null && this.uniqueId !== ""){ + this.countExtend(); + } + this.wxShare({ + couponNo: this.batchNo, + source: 20, + url: encodeURIComponent(url) + }); + } else { + this.$vux.toast.text(res.msg, "middle"); + } + resolve(); + }); + }); + } };