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

12
src/view/poster.vue

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

Loading…
Cancel
Save