Browse Source

修改bug

feature/feature-compatible
fengchengzhi 7 years ago
parent
commit
fa7abece35
4 changed files with 32 additions and 17 deletions
  1. 2
      package.json
  2. 1
      src/main.js
  3. 25
      src/view/home.vue
  4. 21
      src/view/poster.vue

2
package.json

@ -15,7 +15,7 @@
"element-ui": "^2.4.6",
"lodash": "^4.17.4",
"vue": "^2.5.9",
"vue-awesome-swiper": "^3.1.3",
"vue-awesome-swiper": "3.4.2",
"vue-router": "^2.8.1",
"vue-template-compiler": "^2.5.9",
"vue-weui": "^0.3.2",

1
src/main.js

@ -12,6 +12,7 @@ import '@/common/rem.js'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import $ from 'jquery'
//import Swiper from 'swiper/dist/js/swiper.js';
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'//这里注意具体看使用的版本是否需要引入样式,以及具体位置。

25
src/view/home.vue

@ -13,10 +13,14 @@
<div class="banner">
<swiper :options="swiperOption">
<swiper-slide v-for="(item,index) in bannerImgList" v-if="bannerImgList.length > 0" :key="index">
<swiper-slide v-for="(item,index) in bannerImgList" v-if="bannerImgList.length > 0" :key="index">
<div class="swiper-img" :style="{backgroundImage:'url('+item.imgUrl+')'}"></div>
<!--<img src="../../dist/static/img/slider-img.21dc32f.png"/>-->
</swiper-slide>
<!--<swiper-slide v-for="(item,index) in bannerImgList" v-if="bannerImgList.length > 0" :key="index">
<img :src="item.imgUrl"/>
</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div>
</swiper-slide>-->
<!--<div class="swiper-pagination" slot="pagination"></div>-->
</swiper>
</div>
@ -234,12 +238,25 @@
.home .page-content {
background:rgba(255,255,255,1);
}
.home .page-content .banner {
height: 2.56rem;
}
.home .page-content .banner > div {
height: 2.56rem;
}
.home .page-content .banner a {
display: block;
}
.home .page-content .banner img {
.home .page-content .banner div img {
width: 100%;
display: block;
margin: auto;
}
.swiper-img {
width: 100%;
height: 2.56rem;
background-size: cover;
background-position: center center;
}
.home .page-content .coupon {
margin-top: 0.3rem;

21
src/view/poster.vue

@ -52,7 +52,10 @@
},
methods: {
getCityName (){
let name = localStorage.getItem("cityName")
let name = localStorage.getItem("cityName")||''
if(!name){
return
}
let arr = name.split(',')
this.addressValue = arr
let cityNameArr = arr[2].split('&')
@ -62,14 +65,6 @@
},
getPoster (){
var merchantNo = $("#merchantNo").val()
console.log(merchantNo)
//
// var ua = window.navigator.userAgent.toLowerCase();
// //uaMicroMessenger
// if(ua.match(/MicroMessenger/i) != 'micromessenger'){
// this.ImgFix = true
// return;
// }
posterApi.getPoster(merchantNo).then(res => {
if ( res.code == 0 ){
@ -137,9 +132,11 @@
}
},
mounted() {
this.getAddress()
this.getCityName()
this.getPoster()
window.onload=()=>{
this.getPoster();
this.getAddress()
this.getCityName()
}
}
};
</script>

Loading…
Cancel
Save