Browse Source

no message

feature/feature-compatible
fengchengzhi 7 years ago
parent
commit
fd02e3f76c
2 changed files with 31 additions and 14 deletions
  1. 28
      src/view/home.vue
  2. 17
      src/view/poster.vue

28
src/view/home.vue

@ -2,8 +2,8 @@
<template> <template>
<div class="home"> <div class="home">
<input type="hidden" id="openedDistrict" th:value="${openedDistrict}"/> <input type="hidden" id="openedDistrict" th:value="${openedDistrict}"/>
<input type="hidden" id="merchantNo" th:value="${merchantNo}" value="2" /> <!--商户标号-->
<input type="hidden" id="districtId" th:value="${districtId}" value="" /> <!--选定区县id-->
<input type="hidden" id="merchantNo" th:value="${merchantNo}"/> <!--商户标号-->
<input type="hidden" id="districtId" th:value="${districtId}"/> <!--选定区县id-->
<div class="page-top"> <div class="page-top">
<i class="position" @click="show = true"><img src="../assets/images/icon/position.png"/>{{defaultCity}}</i> <i class="position" @click="show = true"><img src="../assets/images/icon/position.png"/>{{defaultCity}}</i>
<i class="logo"><img src="../assets/images/icon/logo.png" /></i> <i class="logo"><img src="../assets/images/icon/logo.png" /></i>
@ -13,7 +13,7 @@
<div class="banner"> <div class="banner">
<div class="swiper-container focus-box-swiper"> <div class="swiper-container focus-box-swiper">
<div class="swiper-wrapper"> <div class="swiper-wrapper">
<div class="swiper-slide" v-for="item in bannerImgList">
<div class="swiper-slide" v-for="item in bannerImgList" v-if="bannerImgList.length > 0">
<img :src="item.imgUrl"/> <img :src="item.imgUrl"/>
</div> </div>
</div> </div>
@ -21,7 +21,7 @@
</div> </div>
</div> </div>
<div class="coupon"> <div class="coupon">
<a :href="promotionImgList.linkUrl"><img :src="promotionImgList.imgUrl"/></a>
<a v-if="promotionImgList" :href="promotionImgList.linkUrl"><img :src="promotionImgList.imgUrl"/></a>
</div> </div>
<div class="new-card" v-for="item in goodsList"> <div class="new-card" v-for="item in goodsList">
<div class="new-card-top"> <div class="new-card-top">
@ -46,14 +46,13 @@
</li> </li>
</ul> </ul>
</div> </div>
</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" @click="getNameValues">完成</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>
@ -88,13 +87,12 @@
}, },
methods: { methods: {
getNameValues (){
console.log(this.addressValue)
return
var that = this;
console.log(this.addressValue[2])
$("#merchantNo").val(this.addressValue[2])
getName (){
let arr = this.addressValue[2].split('&')
$("#districtId").val(arr[0])
this.getGoodsList() this.getGoodsList()
this.defaultCity = arr[1]
this.show = false
}, },
change (name) { change (name) {
this.addressValue = name this.addressValue = name
@ -146,7 +144,11 @@
}); });
}, },
toJSON (data){ toJSON (data){
return JSON.parse(data)[0].labelText
if (data){
return JSON.parse(data)[0].labelText
}else {
return ;
}
}, },
// //
getdefaultAddress (){ getdefaultAddress (){

17
src/view/poster.vue

@ -1,6 +1,7 @@
<template> <template>
<div class="poster"> <div class="poster">
<input type="hidden" id="merchantNo" th:value="${merchantNo}" value="2"/>
<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>
@ -25,6 +26,7 @@
<script> <script>
import homeApi from "../models/home-model.js"; import homeApi from "../models/home-model.js";
import posterApi from "../models/poster-model.js";
import Swiper from 'swiper'; import Swiper from 'swiper';
import { Alert, Toast,Popup,Picker } from "vux"; import { Alert, Toast,Popup,Picker } from "vux";
export default { export default {
@ -44,8 +46,20 @@
}, },
methods: { methods: {
getPoster (){
var merchantNo = $("#merchantNo").val()
console.log(merchantNo)
posterApi.getPoster(merchantNo).then(res => {
console.log("海报",res)
if ( res.code == 0 ){
} else {
this.$vux.toast.text(res.msg,"middle");
}
})
},
change (name) { change (name) {
// console.log('new Value', name)
console.log('new Value', name)
}, },
getAddress (){ getAddress (){
homeApi.getAddress().then(res => { homeApi.getAddress().then(res => {
@ -63,6 +77,7 @@
}, },
mounted() { mounted() {
this.getAddress() this.getAddress()
this.getPoster()
} }
}; };
</script> </script>

Loading…
Cancel
Save