From 9b1bded855d331ad583ebcfe17e121988a9f94e9 Mon Sep 17 00:00:00 2001 From: nesxy Date: Tue, 23 Jul 2019 02:32:38 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E8=AF=95=E5=88=86=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/wxShare.js | 5 +++-- src/view/home.vue | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/models/wxShare.js b/src/models/wxShare.js index d4930d7..0fe61eb 100644 --- a/src/models/wxShare.js +++ b/src/models/wxShare.js @@ -7,14 +7,15 @@ 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; + alter(shareConfig) wx.config({ debug: true, // 开启调试模式,开发时可以开启 appId: jsApiSignConfig.appId, // 必填,公众号的唯一标识 由接口返回 diff --git a/src/view/home.vue b/src/view/home.vue index d909a97..496acf6 100644 --- a/src/view/home.vue +++ b/src/view/home.vue @@ -250,7 +250,7 @@ export default { merchantNo: merchantNo, uniqueId:this.uniqueId, source: 0, - url: encodeURIComponent(location.href) + url: encodeURIComponent(location.href.split('#')[0]) }); }, countExtend() { @@ -261,7 +261,7 @@ export default { timeStr: this.getTime(Date.now()) }; homeApi.countExtend(params).then(res => { - + resolve(); }); }); @@ -413,7 +413,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 = ''; @@ -433,7 +433,7 @@ export default { resolve(); }); }); - + } }; From 4488c594194f645a5e79504739209d6e006d908a Mon Sep 17 00:00:00 2001 From: nesxy Date: Tue, 23 Jul 2019 02:36:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E8=AF=95=E5=88=86=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/wxShare.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/wxShare.js b/src/models/wxShare.js index 0fe61eb..df63943 100644 --- a/src/models/wxShare.js +++ b/src/models/wxShare.js @@ -15,7 +15,7 @@ Vue.prototype.wxShare = function(params) { var jsApiSignConfig = response.response.jsApiSignConfig; var shareConfig = response.response.shareConfig; - alter(shareConfig) + alert(shareConfig) wx.config({ debug: true, // 开启调试模式,开发时可以开启 appId: jsApiSignConfig.appId, // 必填,公众号的唯一标识 由接口返回 From 93fa08b3901023f9913cd8835696f7b0de83c4ad Mon Sep 17 00:00:00 2001 From: nesxy Date: Tue, 23 Jul 2019 02:45:06 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=B0=83=E8=AF=95=E5=88=86=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/wxShare.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/models/wxShare.js b/src/models/wxShare.js index df63943..f82c0de 100644 --- a/src/models/wxShare.js +++ b/src/models/wxShare.js @@ -15,7 +15,10 @@ Vue.prototype.wxShare = function(params) { var jsApiSignConfig = response.response.jsApiSignConfig; var shareConfig = response.response.shareConfig; - alert(shareConfig) + alert(shareConfig.title) + alert(shareConfig.desc) + alert(shareConfig.url) + alert(shareConfig.img) wx.config({ debug: true, // 开启调试模式,开发时可以开启 appId: jsApiSignConfig.appId, // 必填,公众号的唯一标识 由接口返回