From 71003e6d2abc17c6361bb85a714527a5b58071c7 Mon Sep 17 00:00:00 2001 From: fengchengzhi Date: Wed, 19 Sep 2018 23:09:59 +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/poster.vue | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/view/poster.vue b/src/view/poster.vue index 8e1a7b1..d9ff9be 100644 --- a/src/view/poster.vue +++ b/src/view/poster.vue @@ -85,7 +85,6 @@ } if ( res.data.imageUrl ){ - this.imgSrc = '' this.imgSrc = res.data.imageUrl + "?" + Date.now(); } else { if ( res.data.hasOAuth == 0 ){ @@ -161,10 +160,10 @@ }) }, createPoster2 (){ -// if ( !this.isAuthorize ){ -// location.href = this.authorizeSrc -// return; -// } + if ( !this.isAuthorize ){ + location.href = this.authorizeSrc + return; + } var no = this.no this.showLoading = true posterApi.createPoster2({"couponNo":no}).then(res => { @@ -222,13 +221,13 @@ this.no = this.getParam("no") this.sourceType = this.getParam("sourceType") - if ( this.sourceType == 2 ){ + if ( this.sourceType == 2 ){ //指定优惠券 this.defaultCity = '' this.getPoster2() - } else { + } else { //通过商户默认推荐 this.getPoster() } - + this.shareWenXin() }, //点击生成海报按钮 createImg (){ @@ -241,18 +240,22 @@ }, //分享微信 shareWenXin (){ - var merchantNo = this.getParam("merchantNo") - if ( merchantNo ){ + var coupon = this.getParam("no") + var sourceType = this.getParam("sourceType") + var merchantNo = this.getParam("merchantNo") + if ( sourceType == 2 ){ //指定优惠券 + this.wxShare({"couponNo":coupon,"source":1,"url":encodeURIComponent(location.href)}) + } else if( sourceType == 1) { //通过商户默认推荐 this.wxShare({"merchantNo":merchantNo,"source":1,"url":encodeURIComponent(location.href)}) } else { - var coupon = this.getParam("no") - this.wxShare({"coupon":coupon,"source":1,"url":encodeURIComponent(location.href)}) + this.wxShare({"merchantNo":this.merchantNo,"source":1,"url":encodeURIComponent(location.href)}) } + } }, mounted() { this.getNo() - this.shareWenXin() + } };