diff --git a/src/models/wxShare.js b/src/models/wxShare.js index beb7fd8..ac448de 100644 --- a/src/models/wxShare.js +++ b/src/models/wxShare.js @@ -15,6 +15,7 @@ Vue.prototype.wxShare = function(params) { var jsApiSignConfig = response.response.jsApiSignConfig; var shareConfig = response.response.shareConfig; + var couponNo = response.response.couponNo wx.config({ debug: false, // 开启调试模式,开发时可以开启 appId: jsApiSignConfig.appId, // 必填,公众号的唯一标识 由接口返回 @@ -31,8 +32,16 @@ Vue.prototype.wxShare = function(params) { }); var urlParams = ''; let uuniqueId = this.$cookies.get('1hjz_mall_unique_id') + if(couponNo !== undefined && couponNo !== null && couponNo !== ""){ + urlParams = '?batchNo='+ couponNo + } if(uuniqueId !== undefined && uuniqueId !== null && uuniqueId !== ""){ - urlParams = '?uniqueId='+ uuniqueId + if(urlParams.length > 0){ + urlParams+='&uniqueId='+ uuniqueId + } else{ + urlParams = '?uniqueId='+ uuniqueId + } + } wx.ready(() => { //获取“分享给朋友”按钮点击状态及自定义分享内容接口 diff --git a/src/view/month-card.vue b/src/view/month-card.vue index c0d3c16..e700d43 100644 --- a/src/view/month-card.vue +++ b/src/view/month-card.vue @@ -185,17 +185,17 @@ export default { }, mounted() { let uuniqueId = Qs.parse(location.search.substring(1)).uniqueId - var url = location.href + var url = location.href.split('?')[0] if(this.uniqueId !== undefined && this.uniqueId !== null && this.uniqueId !== ""){ } // 初始化 this.handleInit(); - console.log('uniqueId:'+ this.uniqueId) + console.log('url:'+ url.split('?')[0]) this.wxShare({ couponNo: this.batchNo, source: 20, - url: encodeURIComponent(location.href) + url: encodeURIComponent(url) }); } };