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() + } };