Browse Source

海报

feature/feature-compatible
fengchengzhi 7 years ago
parent
commit
433f0cb71a
2 changed files with 14 additions and 6 deletions
  1. 8
      src/view/home.vue
  2. 12
      src/view/poster.vue

8
src/view/home.vue

@ -106,7 +106,8 @@
},
watch: {
$route(to,from){
this.getdefaultAddress()
//this.getdefaultAddress()
this.getCityName ()
},
// defaultCity (val,old){
// this.ShareWenXin()
@ -128,7 +129,10 @@
getCityName (){
let name = localStorage.getItem("cityName")||''
if(!name){
return
this.defaultCity = '天河区'
this.merchantNo = 2 //
this.districtId = '440106000' //id
return;
}
//440000000&广,440100000&广,440106000&&2
console.log(name)

12
src/view/poster.vue

@ -39,7 +39,7 @@
return {
show: false,
imgSrc: "",
merchantNo: "", //
merchantNo: 2, //
isAuthorize: false,
authorizeSrc : "",
ImgFix: true,
@ -66,14 +66,15 @@
console.log(name)
if(!name){
this.merchantNo = 2
this.defaultCity = '天河区'
return
}
let arr = name.split(',')
this.addressValue = arr
let cityNameArr = arr[2].split('&')
let cityName = cityNameArr[1]
this.defaultCity = cityName
this.merchantNo = cityNameArr[2]
this.defaultCity = cityName || '天河区'
this.merchantNo = cityNameArr[2] || 2
},
getPoster (){
let merchantNo = this.merchantNo
@ -193,6 +194,7 @@
this.addressValue = name
/// this.getName()
},
//
getAddress (){
homeApi.getAddress().then(res => {
if ( res.code == 0 ){
@ -206,6 +208,7 @@
goBack() {
history.go(-1);
},
//
getParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var url = window.location.href;
@ -222,7 +225,7 @@
this.sourceType = this.getParam("sourceType")
if ( this.sourceType == 2 ){ //
this.defaultCity = ''
// this.defaultCity = ''
this.getPoster2()
} else { //
this.getPoster()
@ -243,6 +246,7 @@
var coupon = this.getParam("no")
var sourceType = this.getParam("sourceType")
var merchantNo = this.getParam("merchantNo")
if ( sourceType == 2 ){ //
this.wxShare({"couponNo":coupon,"source":10,"url":encodeURIComponent(location.href)})
} else if( sourceType == 1) { //

Loading…
Cancel
Save