|
|
|
@ -2,17 +2,15 @@ |
|
|
|
<template> |
|
|
|
<div class="poster"> |
|
|
|
<img class="weixin" src="../assets/images/poster/weixin.png" v-show="ImgFix" @click="ImgFix = false" /> |
|
|
|
<div style="height: 0.9rem;"></div> |
|
|
|
<div class="page-top"> |
|
|
|
<div style="height: 0.9rem;" v-if="sourceType != 3"></div> |
|
|
|
<div class="page-top" v-if="sourceType != 3"> |
|
|
|
<a @click="goBack()" class="goBack"><img src="../assets/images/my-money/left.png" /></a> |
|
|
|
<i class="name">分销海报</i> |
|
|
|
<i class="text" @click="show = true" v-if=" defaultCity != '' ">{{defaultCity}}</i> |
|
|
|
</div> |
|
|
|
<div class="page-content"> |
|
|
|
<img class="poster-img" v-if="imgSrc != ''" :src="imgSrc"> |
|
|
|
<!--<img src="" v-if="imgSrc != ''" :src="imgSrc"> |
|
|
|
<img src="../assets/images/hill.png">--> |
|
|
|
<button class="create-poster" @click="createImg()">重新生成海报</button> |
|
|
|
<button v-if="sourceType != 3" class="create-poster" @click="createImg()">重新生成海报</button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<popup v-model="show"> |
|
|
|
@ -39,6 +37,7 @@ |
|
|
|
return { |
|
|
|
show: false, |
|
|
|
imgSrc: "", |
|
|
|
imgUrl: '', |
|
|
|
merchantNo: 2, //商户编号 |
|
|
|
isAuthorize: false, |
|
|
|
authorizeSrc : "", |
|
|
|
@ -86,6 +85,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
if ( res.data.imageUrl ){ |
|
|
|
this.imgUrl = res.data.imageUrl |
|
|
|
this.imgSrc = res.data.imageUrl + "?" + Date.now(); |
|
|
|
} else { |
|
|
|
if ( res.data.hasOAuth == 0 ){ |
|
|
|
@ -118,7 +118,7 @@ |
|
|
|
this.showLoading = false |
|
|
|
},500) |
|
|
|
if ( res.code == 0 ){ |
|
|
|
this.imgSrc = '' |
|
|
|
this.imgUrl = res.response |
|
|
|
this.imgSrc = res.response + "?" + Date.now(); |
|
|
|
} else { |
|
|
|
this.$vux.toast.text(res.msg,"middle"); |
|
|
|
@ -139,7 +139,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
if ( res.data.imageUrl ){ |
|
|
|
this.imgSrc = '' |
|
|
|
this.imgUrl = res.data.imageUrl |
|
|
|
this.imgSrc = res.data.imageUrl + "?" + Date.now(); |
|
|
|
} else { |
|
|
|
if ( res.data.hasOAuth == 0 ){ |
|
|
|
@ -172,7 +172,7 @@ |
|
|
|
this.showLoading = false |
|
|
|
},500) |
|
|
|
if ( res.code == 0 ){ |
|
|
|
this.imgSrc = '' |
|
|
|
this.imgUrl = res.response |
|
|
|
this.imgSrc = res.response + "?" + Date.now(); |
|
|
|
} else { |
|
|
|
this.$vux.toast.text(res.msg,"middle"); |
|
|
|
@ -219,18 +219,21 @@ |
|
|
|
}, |
|
|
|
//获取连接上的数据 进行判断 |
|
|
|
getNo (){ |
|
|
|
this.getCityName() |
|
|
|
this.getAddress() |
|
|
|
|
|
|
|
this.no = this.getParam("no") |
|
|
|
this.sourceType = this.getParam("sourceType") |
|
|
|
this.shareWenXin() |
|
|
|
|
|
|
|
if ( this.sourceType != 3){ |
|
|
|
this.getCityName() |
|
|
|
this.getAddress() |
|
|
|
} |
|
|
|
if ( this.sourceType == 2 ){ //指定优惠券 |
|
|
|
// this.defaultCity = '' |
|
|
|
this.getPoster2() |
|
|
|
} else { //通过商户默认推荐 |
|
|
|
} else if (this.sourceType == 1){ //通过商户默认推荐 |
|
|
|
this.getPoster() |
|
|
|
} |
|
|
|
this.shareWenXin() |
|
|
|
|
|
|
|
}, |
|
|
|
//点击生成海报按钮 |
|
|
|
createImg (){ |
|
|
|
@ -244,15 +247,18 @@ |
|
|
|
//分享微信 |
|
|
|
shareWenXin (){ |
|
|
|
var coupon = this.getParam("no") |
|
|
|
var sourceType = this.getParam("sourceType") |
|
|
|
var sourceType = this.sourceType |
|
|
|
var merchantNo = this.getParam("merchantNo") |
|
|
|
|
|
|
|
var urls = encodeURIComponent(location.href) |
|
|
|
if ( sourceType == 2 ){ //指定优惠券 |
|
|
|
this.wxShare({"couponNo":coupon,"source":10,"url":encodeURIComponent(location.href)}) |
|
|
|
this.wxShare({"couponNo":coupon,"source":10,"url":urls,imgUrl:this.imgUrl}) |
|
|
|
} else if( sourceType == 1) { //通过商户默认推荐 |
|
|
|
this.wxShare({"merchantNo":merchantNo,"source":10,"url":encodeURIComponent(location.href)}) |
|
|
|
this.wxShare({"merchantNo":merchantNo,"source":10,"url":urls,imgUrl:this.imgUrl}) |
|
|
|
} else if (sourceType == 3){ //通过别人分享 |
|
|
|
this.wxShare({"source":40,"url":urls,imgUrl:this.imgUrl}) |
|
|
|
this.imgSrc = "http://1hjz.3ncto.com.cn" + coupon |
|
|
|
} else { |
|
|
|
this.wxShare({"merchantNo":this.merchantNo,"source":10,"url":encodeURIComponent(location.href)}) |
|
|
|
this.wxShare({"merchantNo":this.merchantNo,"source":10,"url":urls,imgUrl:this.imgUrl}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|