Browse Source

联调首页、商品分类

feature/feature-compatible
wenghaocan 7 years ago
parent
commit
56bc35a1be
2 changed files with 21 additions and 15 deletions
  1. 25
      src/view/goods-classify.vue
  2. 11
      src/view/home.vue

25
src/view/goods-classify.vue

@ -105,6 +105,14 @@
that.showLoading = false that.showLoading = false
if ( res.code == 0 ){ if ( res.code == 0 ){
this.goodsList = res.data || [] this.goodsList = res.data || []
this.$nextTick(function(){
//scroll
this._initScroll()
//
this._calculateHeight();
//
this.autoSelect()
})
} else { } else {
this.$vux.toast.text(res.msg,"middle"); this.$vux.toast.text(res.msg,"middle");
} }
@ -139,7 +147,7 @@
let item = foodList[i]; let item = foodList[i];
height += item.clientHeight; height += item.clientHeight;
this.listHeight.push(height); this.listHeight.push(height);
}
}
}, },
selectMenu(index, event) { selectMenu(index, event) {
if(event && !event._constructed) { if(event && !event._constructed) {
@ -155,18 +163,15 @@
this.selectMenu(i) this.selectMenu(i)
} }
} }
}
},
ShareWenXin (){
var merchantNo = this.no
this.wxShare({"merchantNo":merchantNo,"source":0,"url":encodeURIComponent(location.href)})
}
}, },
mounted() { mounted() {
this.getParams() this.getParams()
window.onload = () =>{
//scroll
this._initScroll()
//
this._calculateHeight();
//
this.autoSelect()
}
this.ShareWenXin()
}, },
} }
</script> </script>

11
src/view/home.vue

@ -20,7 +20,7 @@
<div class="service f-flex" v-if="iconList.length != 0"> <div class="service f-flex" v-if="iconList.length != 0">
<div class="item" v-for="(item,index) in iconList" :key="index" v-on:click="goods(item.combinationNo)"> <div class="item" v-for="(item,index) in iconList" :key="index" v-on:click="goods(item.combinationNo)">
<a href="javascript:void(0)" class="f-relative f-inb"> <a href="javascript:void(0)" class="f-relative f-inb">
<img :src="item.icon" class="icon" />
<img :src="imghost + item.icon" class="icon" />
<img src="../assets/images/icon/hot.png" class="hot" v-if="item.label == '2'" /> <img src="../assets/images/icon/hot.png" class="hot" v-if="item.label == '2'" />
<img src="../assets/images/icon/new.png" class="new" v-if="item.label == '1'"/> <img src="../assets/images/icon/new.png" class="new" v-if="item.label == '1'"/>
</a> </a>
@ -57,10 +57,10 @@
</div> </div>
<div class="new-card" :class="{'new-card-first': index == 0}" v-for="(item,index) in goodsList" :key="index"> <div class="new-card" :class="{'new-card-first': index == 0}" v-for="(item,index) in goodsList" :key="index">
<div class="new-card-top"> <div class="new-card-top">
<img :src=" imghost + item.list[0].combinationImage">
<img :src=" imghost + item.image">
</div> </div>
<ul class="card-list"> <ul class="card-list">
<li v-for="item1 in item.list">
<li v-for="item1 in item.goodsList">
<a :href="'/mall/web/vgoods/detail/' + item1.goodsNo"> <a :href="'/mall/web/vgoods/detail/' + item1.goodsNo">
<div class="left"> <div class="left">
<a :href="'/mall/web/vgoods/detail/' + item1.goodsNo"> <a :href="'/mall/web/vgoods/detail/' + item1.goodsNo">
@ -198,7 +198,8 @@
this.activityImgList = res.response.activityImgList || [] this.activityImgList = res.response.activityImgList || []
this.iconList = res.response.iconList || [] this.iconList = res.response.iconList || []
this.promotionImgList = res.response.promotionImgList[0] || {}; this.promotionImgList = res.response.promotionImgList[0] || {};
let goodsList = res.response.goodsList
this.goodsList = res.response.goodsList
/*let goodsList = res.response.goodsList
let arr = []; let arr = [];
for(let i=0;i<goodsList.length;i++){ for(let i=0;i<goodsList.length;i++){
goodsList[i].combinationNo&&goodsList[i].isRelease==1?arr.push(goodsList[i].combinationNo):""; goodsList[i].combinationNo&&goodsList[i].isRelease==1?arr.push(goodsList[i].combinationNo):"";
@ -218,7 +219,7 @@
} }
} }
} }
this.goodsList = lastList.slice();
this.goodsList = lastList.slice();*/
} else { } else {
this.$vux.toast.text(res.msg,"middle"); this.$vux.toast.text(res.msg,"middle");

Loading…
Cancel
Save