From e5ce894fede89eaf47b2d9503d09168f0bb3cc1f Mon Sep 17 00:00:00 2001 From: fengchengzhi Date: Wed, 19 Sep 2018 21:30:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/home.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/view/home.vue b/src/view/home.vue index b4331e3..5804c2c 100644 --- a/src/view/home.vue +++ b/src/view/home.vue @@ -109,7 +109,7 @@ this.getdefaultAddress() }, defaultCity (val,old){ - this.wxShare({"merchantNo":this.merchantNo,"source":0,"url":encodeURIComponent(location.href)}) + this.ShareWenXin() } }, computed: { @@ -226,14 +226,19 @@ this.getGoodsList() this.getCityName () }); + }, + ShareWenXin (){ + var merchantNo = this.merchantNo + if ( !merchantNo ){ + merchantNo = 2 + } + this.wxShare({"merchantNo":merchantNo,"source":0,"url":encodeURIComponent(location.href)}) } }, mounted() { //异步加载 this.getdefaultAddress() this.getAddress() - this.wxShare({"merchantNo":2,"source":0,"url":encodeURIComponent(location.href)}) - // console.log('url',encodeURIComponent(location.href)) }, destroyed () {