Browse Source

分享海报

feature/feature-compatible
fengchengzhi 7 years ago
parent
commit
b48fe92cf6
1 changed files with 24 additions and 18 deletions
  1. 42
      src/view/poster.vue

42
src/view/poster.vue

@ -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})
}
}

Loading…
Cancel
Save