|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<template> |
|
|
|
|
<view class="bargain on"> |
|
|
|
|
<view class="header"> |
|
|
|
|
<cu-custom :isBack="true" :isCenter="true"> |
|
|
|
|
<cu-custom :isBack="true" :isCenter="true" :bgColor="bgColor"> |
|
|
|
|
<block slot="backText"> |
|
|
|
|
<view class="backImg"> |
|
|
|
|
<image src="@/static/images/back-btn.png" mode=""></image> |
|
|
|
@ -26,7 +26,7 @@
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="activity-content"> |
|
|
|
|
<view class="top-nav-box" :style="activityType !== 0?'height: 104rpx;':''"> |
|
|
|
|
<view class="top-nav-box" :style="(activityType !== 0?'height: 104rpx;':'')+(navStyle?'position: fixed;top:'+CustomBar+'px;left: 0;':'')"> |
|
|
|
|
<view class="activity-type-box acea-row row-center"> |
|
|
|
|
<view class="item" @click="setActivityType(0)"> |
|
|
|
|
<view :class="'title ' + (activityType === 0? 'active' : '')">秒杀专区</view> |
|
|
|
@ -43,7 +43,7 @@
|
|
|
|
|
<view :class="'tab ' + (tabType === 1 ? 'active' : '')" @click="setTabType(1)">下期预告</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="list-box" :style="activityType !== 0?'height: calc(100% - 104rpx);':''"> |
|
|
|
|
<view class="list-box" :style="navStyle?(activityType !== 0?'padding-top:104rpx':'padding-top:186rpx'):''"> |
|
|
|
|
<view class="countdown-box acea-row row-between-wrapper" v-if="activityType === 0 && tabType === 0 && timeList[seckillActive].stop"> |
|
|
|
|
<view class="acea-row row-middle"> |
|
|
|
|
<view class="text">{{timeList[seckillActive].status == 2 ? timeList[seckillActive].time + '即将开始' : '本轮结束仅剩'}}</view> |
|
|
|
@ -105,10 +105,13 @@
|
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
CustomBar: this.CustomBar, |
|
|
|
|
bgColor: '', |
|
|
|
|
banner: [], |
|
|
|
|
swiperCurrent: 0, |
|
|
|
|
activityType: 0, |
|
|
|
|
tabType: 0, |
|
|
|
|
navStyle: false, |
|
|
|
|
goodsList: [], |
|
|
|
|
timeList: [], |
|
|
|
|
seckillList: [], |
|
|
|
@ -133,15 +136,13 @@
|
|
|
|
|
bargainList: [], |
|
|
|
|
bargainLoaded: false, |
|
|
|
|
isShowRule: false, // 显示砍价规则弹框 |
|
|
|
|
active: false, |
|
|
|
|
active: false, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.seckillInfo(); |
|
|
|
|
this.getGrouponList(); |
|
|
|
|
this.getBargainList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
getBanner(3).then( |
|
|
|
@ -149,6 +150,30 @@
|
|
|
|
|
this.$set(this,'banner',res.data.banner) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
onPageScroll(e) { |
|
|
|
|
if (e.scrollTop > 130) { |
|
|
|
|
this.bgColor = '#F1F1F1'; |
|
|
|
|
this.navStyle = true; |
|
|
|
|
} else { |
|
|
|
|
this.bgColor = '', |
|
|
|
|
this.navStyle = false; |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
onReachBottom() { |
|
|
|
|
switch (this.activityType) { |
|
|
|
|
case 0: |
|
|
|
|
this.getSeckillList(); |
|
|
|
|
break; |
|
|
|
|
case 1: |
|
|
|
|
this.getGrouponList(); |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
this.getBargainList(); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 关闭弹窗 |
|
|
|
|
close: function () { |
|
|
|
@ -177,7 +202,6 @@
|
|
|
|
|
// this.goodsList = this.seckillList; |
|
|
|
|
} else if (i === 1) { |
|
|
|
|
this.goodsList = this.grouponList; |
|
|
|
|
console.log('this.goodsList', this.goodsList) |
|
|
|
|
} else { |
|
|
|
|
this.goodsList = this.bargainList; |
|
|
|
|
} |
|
|
|
@ -274,14 +298,20 @@
|
|
|
|
|
this.grouponList = this.grouponList.concat(res.data.storeCombinationQueryVos) |
|
|
|
|
this.groupForm.page++; |
|
|
|
|
this.groupLoaded = res.data.storeCombinationQueryVos.length < this.groupForm.limit; |
|
|
|
|
if(this.activityType === 1) { |
|
|
|
|
this.goodsList = this.grouponList; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getBargainList() { |
|
|
|
|
if (this.bargainLoaded) return; |
|
|
|
|
getBargainList(this.bargainForm).then(res => { |
|
|
|
|
this.bargainLoaded = res.data.length < this.bargainForm.limit; |
|
|
|
|
this.bargainList.push.apply(this.bargainList, res.data); |
|
|
|
|
this.bargainForm.page++; |
|
|
|
|
this.bargainLoaded = res.data.length < this.bargainForm.limit; |
|
|
|
|
if(this.activityType === 2) { |
|
|
|
|
this.goodsList = this.bargainList; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
@ -304,6 +334,11 @@
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.header { |
|
|
|
|
position: fixed; |
|
|
|
|
top: 0; |
|
|
|
|
left: 0; |
|
|
|
|
z-index: 20; |
|
|
|
|
width: 750rpx; |
|
|
|
|
.tab-title { |
|
|
|
|
font-size: 32rpx; |
|
|
|
|
font-family: PingFang SC; |
|
|
|
@ -325,9 +360,6 @@
|
|
|
|
|
.banner-box { |
|
|
|
|
width: 750rpx; |
|
|
|
|
height: 488rpx; |
|
|
|
|
position: absolute; |
|
|
|
|
top: 0; |
|
|
|
|
z-index: -1; |
|
|
|
|
.swiper { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 100%; |
|
|
|
@ -361,15 +393,13 @@
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.activity-content { |
|
|
|
|
position: absolute; |
|
|
|
|
bottom: 0; |
|
|
|
|
position: relative; |
|
|
|
|
top: -64rpx; |
|
|
|
|
width: 750rpx; |
|
|
|
|
height: calc(100vh - 424rpx); |
|
|
|
|
background: #FFFFFF; |
|
|
|
|
border-radius: 28rpx 28rpx 0rpx 0rpx; |
|
|
|
|
.top-nav-box { |
|
|
|
|
height: 186rpx; |
|
|
|
|
position: relative; |
|
|
|
|
width: 750rpx; |
|
|
|
|
background: #FFFFFF; |
|
|
|
|
border-radius: 28rpx 28rpx 0rpx 0rpx; |
|
|
|
|
.activity-type-box { |
|
|
|
|
height: 104rpx; |
|
|
|
|
padding: 34rpx 0rpx 26rpx; |
|
|
|
@ -411,7 +441,6 @@
|
|
|
|
|
|
|
|
|
|
.tab-box { |
|
|
|
|
width: 100%; |
|
|
|
|
position: absolute; |
|
|
|
|
bottom: 0; |
|
|
|
|
height: 82rpx; |
|
|
|
|
overflow: hidden; |
|
|
|
|