Browse Source

调试分享

feature/3.0.0-推广员
nesxy 6 years ago
parent
commit
9b1bded855
2 changed files with 7 additions and 6 deletions
  1. 5
      src/models/wxShare.js
  2. 8
      src/view/home.vue

5
src/models/wxShare.js

@ -7,14 +7,15 @@ import homeApi from "../models/home-model.js";
Vue.prototype.wxShare = function(params) { Vue.prototype.wxShare = function(params) {
var params = params || {}; var params = params || {};
wxShareModel.getShare(params).then(response => { wxShareModel.getShare(params).then(response => {
if (response.code != 0) { if (response.code != 0) {
return; return;
} }
var jsApiSignConfig = response.response.jsApiSignConfig; var jsApiSignConfig = response.response.jsApiSignConfig;
var shareConfig = response.response.shareConfig; var shareConfig = response.response.shareConfig;
alter(shareConfig)
wx.config({ wx.config({
debug: true, // 开启调试模式,开发时可以开启 debug: true, // 开启调试模式,开发时可以开启
appId: jsApiSignConfig.appId, // 必填,公众号的唯一标识 由接口返回 appId: jsApiSignConfig.appId, // 必填,公众号的唯一标识 由接口返回

8
src/view/home.vue

@ -250,7 +250,7 @@ export default {
merchantNo: merchantNo, merchantNo: merchantNo,
uniqueId:this.uniqueId, uniqueId:this.uniqueId,
source: 0, source: 0,
url: encodeURIComponent(location.href)
url: encodeURIComponent(location.href.split('#')[0])
}); });
}, },
countExtend() { countExtend() {
@ -261,7 +261,7 @@ export default {
timeStr: this.getTime(Date.now()) timeStr: this.getTime(Date.now())
}; };
homeApi.countExtend(params).then(res => { homeApi.countExtend(params).then(res => {
resolve(); resolve();
}); });
}); });
@ -413,7 +413,7 @@ export default {
// this.getLocation(); // this.getLocation();
this.getData(); this.getData();
let uuniqueId = Qs.parse(location.search.substring(1)).uniqueId let uuniqueId = Qs.parse(location.search.substring(1)).uniqueId
if(uuniqueId !== undefined && uuniqueId !== null && uuniqueId !== ""){ if(uuniqueId !== undefined && uuniqueId !== null && uuniqueId !== ""){
this.countExtend(); this.countExtend();
uuniqueId = ''; uuniqueId = '';
@ -433,7 +433,7 @@ export default {
resolve(); resolve();
}); });
}); });
} }
}; };
</script> </script>

Loading…
Cancel
Save