diff --git a/src/models/wxShare.js b/src/models/wxShare.js index d4930d7..f82c0de 100644 --- a/src/models/wxShare.js +++ b/src/models/wxShare.js @@ -7,14 +7,18 @@ import homeApi from "../models/home-model.js"; Vue.prototype.wxShare = function(params) { var params = params || {}; - + wxShareModel.getShare(params).then(response => { if (response.code != 0) { return; } - + var jsApiSignConfig = response.response.jsApiSignConfig; var shareConfig = response.response.shareConfig; + alert(shareConfig.title) + alert(shareConfig.desc) + alert(shareConfig.url) + alert(shareConfig.img) wx.config({ debug: true, // 开启调试模式,开发时可以开启 appId: jsApiSignConfig.appId, // 必填,公众号的唯一标识 由接口返回 diff --git a/src/view/home.vue b/src/view/home.vue index 793cdc8..f5fda6e 100644 --- a/src/view/home.vue +++ b/src/view/home.vue @@ -253,7 +253,7 @@ export default { merchantNo: merchantNo, uniqueId:this.uniqueId, source: 0, - url: encodeURIComponent(location.href) + url: encodeURIComponent(location.href.split('#')[0]) }); }, countExtend() { @@ -264,7 +264,7 @@ export default { timeStr: this.getTime(Date.now()) }; homeApi.countExtend(params).then(res => { - + resolve(); }); }); @@ -416,7 +416,7 @@ export default { // this.getLocation(); this.getData(); let uuniqueId = Qs.parse(location.search.substring(1)).uniqueId - + if(uuniqueId !== undefined && uuniqueId !== null && uuniqueId !== ""){ this.countExtend(); uuniqueId = ''; @@ -436,7 +436,7 @@ export default { resolve(); }); }); - + } };