This commit is contained in:
2020-07-17 17:34:42 +08:00
parent 5a4e302899
commit 7b9479d56c
10 changed files with 308 additions and 291 deletions

View File

@@ -38,16 +38,16 @@
</view>
<view class="hr" style="margin-top:80rpx"></view>
<recommend v-if="JSON.stringify(recommendedSpike) != '{}'" :recommendData="recommendedSpike" type="spike"></recommend>
<view v-if="JSON.stringify(recommendedSpike) != '{}'" class="hr" style="margin-top:40rpx"></view>
<view v-if="JSON.stringify(recommendedSpike) != '{}'" class="hr" style="margin-top:40rpx"></view>
<seckill v-if="spikeList.length" :list="spikeList" :time="seckillTime"></seckill>
<view v-if="spikeList.length" class="hr" style="margin-top:40rpx"></view>
<recommend v-if="0"></recommend>
<view class="hr" style="margin-top:40rpx" v-if="0"></view>
<recommend v-if="JSON.stringify(pinTuanPush) != '{}'" :recommendData="pinTuanPush" type='group'></recommend>
<view class="hr" style="margin-top:40rpx" v-if="JSON.stringify(pinTuanPush) != '{}'"></view>
<group></group>
<image class="lingquan"></image>
<youhq></youhq>
<view class="hr" style="margin-top:40rpx"></view>
<list :classifyList="classifyList" :goodsList="goodsList"></list>
<list v-if="couponGroupList.length" :classifyList="couponGroupList"></list>
<view class="cart" @click="toCartPage">
<image src="/static/image/common/3.png"></image>
</view>
@@ -85,20 +85,22 @@ export default {
list:[],
goodsClassify: [], // 商品分类
classifyList: [],
goodsList: [],
recommendedSpike: {}, // 秒杀推荐
spikeList: [], // 全部秒杀列表
seckillTime: {}, // 秒杀时间
couponGroupList: [], // 优惠券拼团分类
pinTuanList: [], // 拼团商品
pinTuanPush: {}, // 拼团推荐
}
},
onLoad() {
this.getShopTopList();
this.getGoodsRecommend();
},
onShow() {
this.getRecommendedSpike();
this.getSpikeList();
this.getPinTuanList();
this.getGoodsClass();
this.getPinTuanPush();
},
methods: {
sousuo(){
@@ -129,6 +131,23 @@ export default {
// console.log(this.recommendedSpike);
})
},
// 拼团推荐
getPinTuanPush() {
this.$u.api.getPinTuanPush().then(res => {
if(res.errCode == 0) {
this.pinTuanPush = res.data;
}
})
},
// 获取优惠券拼团分类
getGoodsClass() {
this.$u.api.getGoodsClass().then(res => {
if(res.errCode == 0) {
this.couponGroupList = res.data;
this.getPinTuanList(this.couponGroupList[0].gc_id);
}
})
},
// 全部秒杀
getSpikeList() {
this.$u.api.getSpikeList({ page: 0 }).then(res => {
@@ -142,21 +161,12 @@ export default {
})
},
// 拼团列表
getPinTuanList() {
this.$u.api.getPinTuanList().then(res => {
})
},
getGoodsRecommend() {
this.$u.api.getGoodsRecommend({
page: 1,
}).then((res)=>{
if (res.errCode == 0) {
this.classifyList = res.data.classifyList;
this.goodsList = res.data.goodsList;
// console.log(this.classifyList);
}
getPinTuanList(id) {
this.$u.api.getPinTuanList({
page: 0,
gc_id: id,
}).then(res => {
this.pinTuanList = res.data;
})
},
clickImage(index) {