Browse Source

首页热门榜单跳转调整

home_hotList^2
ld0104 2 years ago
parent
commit
f9b1e67473
  1. 2
      pages/activity/GroupDetails/index.vue
  2. 2
      pages/activity/activity/index.vue
  3. 50
      pages/home/index.vue
  4. 32
      pages/shop/HotNewGoods/index.vue

2
pages/activity/GroupDetails/index.vue

@ -599,7 +599,7 @@ export default {
openTeam: function() { openTeam: function() {
var that = this var that = this
console.log(this.attr) console.log(this.attr)
if(this.subType) this.subscribeMessage() if(this.subType && this.$yroute.query.tabType==0) this.subscribeMessage()
if (that.attr.cartAttr == false) { // if (that.attr.cartAttr == false) { //
console.log(this.attr.cartAttr) console.log(this.attr.cartAttr)
that.attr.cartAttr = !this.attr.cartAttr that.attr.cartAttr = !this.attr.cartAttr

2
pages/activity/activity/index.vue

@ -257,7 +257,7 @@
} else if (this.activityType === 1) { } else if (this.activityType === 1) {
this.$yrouter.push({ this.$yrouter.push({
path: '/pages/activity/GroupDetails/index', path: '/pages/activity/GroupDetails/index',
query: { id } query: { id,tabType:this.tabType }
}) })
} else { } else {
let isParticipation=item.isParticipation let isParticipation=item.isParticipation

50
pages/home/index.vue

@ -134,10 +134,10 @@
<view class="title">热门榜单</view> <view class="title">热门榜单</view>
</view> </view>
</view> </view>
<swiper previous-margin="32rpx" class="scroll-hot" :style="'height:'+heightSwiper+'rpx;'"> <swiper previous-margin="32rpx" class="scroll-hot" :style="'height:'+heightSwiper+'rpx;'" @change="hotNum">
<swiper-item class="scroll-box" v-for="(item,index) in hotList" :key="index"> <swiper-item class="scroll-box" v-for="(item,index) in hotList" :key="index">
<view class="hot-item acea-row row-column"> <view class="hot-item acea-row row-column">
<view class="title-box acea-row row-middle"> <view class="title-box acea-row row-middle" @click="goHot(item)">
<image src="@/static/images/icon-list.png" mode="aspectFill"></image> <image src="@/static/images/icon-list.png" mode="aspectFill"></image>
<text>{{item.listName}}</text> <text>{{item.listName}}</text>
</view> </view>
@ -602,6 +602,11 @@
}, },
methods: { methods: {
...mapActions(['getLocation']), ...mapActions(['getLocation']),
//
hotNum(e){
this.classifyType = e.detail.current
this.goodsList = this.sortData(this.hotList[this.classifyType].productInfo, 4);
},
// //
getBargainList() { getBargainList() {
if (this.bargainLoaded) return; if (this.bargainLoaded) return;
@ -757,28 +762,30 @@
// }, // },
// }) // })
// }, // },
// goGoodsCon(item) { goHot(item){
// if(item.isIntegral === 1) {
// this.$yrouter.push({
// path: '/pages/shop/IntegralGoodsCon/index',
// query: {
// id: item.id,
// },
// })
// } else {
// this.$yrouter.push({
// path: '/pages/shop/GoodsCon/index',
// query: {
// id: item.id,
// },
// })
// }
// },
goGoodsCon(item) {
this.$yrouter.push({ this.$yrouter.push({
path: '/pages/shop/HotNewGoods/index', path: '/pages/shop/HotNewGoods/index',
query: {
hotName: item.listName,
},
}) })
},
goGoodsCon(item) {
if(item.isIntegral === 1) {
this.$yrouter.push({
path: '/pages/shop/IntegralGoodsCon/index',
query: {
id: item.id,
},
})
} else {
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
id: item.id,
},
})
}
}, },
// goGoodsPromotion() { // goGoodsPromotion() {
// this.$yrouter.push('/pages/shop/GoodsPromotion/index') // this.$yrouter.push('/pages/shop/GoodsPromotion/index')
@ -796,6 +803,7 @@
// }).exec(); // }).exec();
// }, 160) // }, 160)
// }, // },
// //
sortData(oArr, length) { sortData(oArr, length) {
let arr = []; let arr = [];

32
pages/shop/HotNewGoods/index.vue

@ -162,6 +162,7 @@ export default {
}; };
}, },
mounted: function() { mounted: function() {
// this.titleInfo(); // this.titleInfo();
// this.getIndexGroomList(); // this.getIndexGroomList();
getBanner(4).then(res => { getBanner(4).then(res => {
@ -191,20 +192,27 @@ export default {
}) })
return this.hotListData.hotListDTOS return this.hotListData.hotListDTOS
}) })
this.form.mouth = this.mouthList[0]; this.form.mouth = this.mouthList[0];
this.classifyList = this.hotListData[this.form.mouth].hotListDTOS; this.classifyList = this.hotListData[this.form.mouth].hotListDTOS;
// this.form.hotListId = this.classifyList[this.classifyType].id; if(this.$yroute.query.hotName){
this.form.hotListId = ''; this.classifyList.forEach((hot,hotIndex)=>{
this.subclassList = this.classifyList[this.classifyType].cateDtos; if(hot.listName===this.$yroute.query.hotName) {
// this.subclassList.unshift({ this.subclassList = this.classifyList[hotIndex].cateDtos;
// cateId:'', this.subclass = this.subclassList[0];
// cateName:'', this.form.cateId = this.subclass.cateId;
// }) this.changeClassify(hotIndex)
this.subclass = this.subclassList[0]; }
// this.form.cateId = this.subclass.cateId; })
this.form.cateId = ' '; }else{
this.getHotList(); // this.form.hotListId = this.classifyList[this.classifyType].id;
this.form.hotListId = '';
this.subclassList = this.classifyList[this.classifyType].cateDtos;
this.subclass = this.subclassList[0];
// this.form.cateId = this.subclass.cateId;
this.form.cateId = ' ';
this.getHotList();
}
}) })
}, },
// //

Loading…
Cancel
Save