Browse Source

优惠劵分享设置

feature/3.0.0-推广员
lfs3 6 years ago
parent
commit
18564f5a27
2 changed files with 13 additions and 4 deletions
  1. 11
      src/models/wxShare.js
  2. 6
      src/view/month-card.vue

11
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(() => {
//获取“分享给朋友”按钮点击状态及自定义分享内容接口

6
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)
});
}
};

Loading…
Cancel
Save