|
|
@ -5,18 +5,18 @@ |
|
|
<div class="page-top"> |
|
|
<div class="page-top"> |
|
|
<a @click="goBack()"><img src="../assets/images/my-money/left.png" /></a> |
|
|
<a @click="goBack()"><img src="../assets/images/my-money/left.png" /></a> |
|
|
<i class="name">分销海报</i> |
|
|
<i class="name">分销海报</i> |
|
|
<i class="text" @click="show = true">天河区</i> |
|
|
|
|
|
|
|
|
<i class="text" @click="show = true">{{defaultCity}}</i> |
|
|
</div> |
|
|
</div> |
|
|
<div class="page-content"> |
|
|
<div class="page-content"> |
|
|
<img class="poster-img" src="../assets/images/girl.jpg"> |
|
|
|
|
|
<button class="create-poster">重新生成海报</button> |
|
|
|
|
|
|
|
|
<img class="poster-img" :src="imghost + imgSrc"> |
|
|
|
|
|
<button class="create-poster" @click="createPoster(1)">重新生成海报</button> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<popup v-model="show"> |
|
|
<popup v-model="show"> |
|
|
<div class="picke-address"> |
|
|
<div class="picke-address"> |
|
|
<div class="status-btn"> |
|
|
<div class="status-btn"> |
|
|
<a class="cel-btn" @click="show = false">取消</a> |
|
|
<a class="cel-btn" @click="show = false">取消</a> |
|
|
<a class="complete-btn">完成</a> |
|
|
|
|
|
|
|
|
<a class="complete-btn" @click="getName()">完成</a> |
|
|
</div> |
|
|
</div> |
|
|
<picker :data='addressData' :columns=3 v-model='addressValue' @on-change='change' ref="picker1"></picker> |
|
|
<picker :data='addressData' :columns=3 v-model='addressValue' @on-change='change' ref="picker1"></picker> |
|
|
</div> |
|
|
</div> |
|
|
@ -33,8 +33,11 @@ |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
show: false, |
|
|
show: false, |
|
|
|
|
|
imgSrc: "", |
|
|
|
|
|
defaultCity: '天河区', |
|
|
addressData: [], |
|
|
addressData: [], |
|
|
addressValue: [], |
|
|
addressValue: [], |
|
|
|
|
|
imghost: "http://medou.oss-cn-shenzhen.aliyuncs.com/", |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
components: { |
|
|
components: { |
|
|
@ -46,20 +49,61 @@ |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
getCityName (){ |
|
|
|
|
|
let name = localStorage.getItem("cityName") |
|
|
|
|
|
let arr = name.split(',') |
|
|
|
|
|
this.addressValue = arr |
|
|
|
|
|
let cityNameArr = arr[2].split('&') |
|
|
|
|
|
let cityName = cityNameArr[1] |
|
|
|
|
|
this.defaultCity = cityName |
|
|
|
|
|
}, |
|
|
getPoster (){ |
|
|
getPoster (){ |
|
|
var merchantNo = $("#merchantNo").val() |
|
|
var merchantNo = $("#merchantNo").val() |
|
|
console.log(merchantNo) |
|
|
console.log(merchantNo) |
|
|
posterApi.getPoster(merchantNo).then(res => { |
|
|
posterApi.getPoster(merchantNo).then(res => { |
|
|
console.log("海报",res) |
|
|
console.log("海报",res) |
|
|
if ( res.code == 0 ){ |
|
|
if ( res.code == 0 ){ |
|
|
|
|
|
|
|
|
|
|
|
if ( res.data.hasOAuth == 0 ){ |
|
|
|
|
|
location.href = res.data.oauthUrl |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if ( res.data.imageUrl ){ |
|
|
|
|
|
this.imgSrc = res.data.imageUrl |
|
|
|
|
|
} else { |
|
|
|
|
|
createPoster() |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
this.$vux.toast.text(res.msg,"middle"); |
|
|
this.$vux.toast.text(res.msg,"middle"); |
|
|
|
|
|
if ( res.code == 667 ){ |
|
|
|
|
|
location.href = '/mall/web/user/login' |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
createPoster (status){ |
|
|
|
|
|
var merchantNo = $("#merchantNo").val() |
|
|
|
|
|
posterApi.createPoster({"merchantNo":merchantNo}).then(res => { |
|
|
|
|
|
if ( res.code == 0 ){ |
|
|
|
|
|
if ( status ){ |
|
|
|
|
|
this.$vux.toast.text(res.msg,"middle"); |
|
|
|
|
|
} |
|
|
|
|
|
this.imgSrc = res.response |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$vux.toast.text(res.msg,"middle"); |
|
|
|
|
|
if ( res.code == 666 ){ |
|
|
|
|
|
location.href = '/mall/web/user/login' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
getName (){ |
|
|
|
|
|
let arr = this.addressValue[2].split('&') |
|
|
|
|
|
this.defaultCity = arr[1] |
|
|
|
|
|
this.show = false |
|
|
|
|
|
}, |
|
|
change (name) { |
|
|
change (name) { |
|
|
console.log('new Value', name) |
|
|
|
|
|
|
|
|
this.addressValue = name |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
getAddress (){ |
|
|
getAddress (){ |
|
|
homeApi.getAddress().then(res => { |
|
|
homeApi.getAddress().then(res => { |
|
|
@ -76,8 +120,8 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
this.getAddress() |
|
|
|
|
|
this.getPoster() |
|
|
|
|
|
|
|
|
this.getAddress() |
|
|
|
|
|
this.getCityName() |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
|