fanfan 7 months ago
commit 3b518696b3
  1. 5
      api/activity.js
  2. 110
      pages/activity/seckill.vue

@ -24,6 +24,11 @@ export const list = () => {
load: false
})
}
//秒杀商品列表
export const sharplist = (data) => {
console.log(data)
return request.get(api.list, data)
}
// 秒杀活动首页
export const data = () => {
return request.get(api.data, {}, {

@ -4,27 +4,22 @@
<u-navbar title="限时秒杀" back-icon-color="#fff" :border-bottom="false" title-color="#fff"
:background="background"></u-navbar>
</view>
<view class="title" :style="{backgroundImage:'url('+backgroundImg+')'}" style="background-size: 100% 100%;">
<view class="title" :style="{backgroundImage:'url('+backgroundImg+')'}" style="background-size: 100% 100%;" >
<image src="/static/seckill/topHeader.png" mode="" class="bgImg"></image>
<view class="limitTitle">
<image src="/static/seckill/limit.png" mode="" class="img"></image>
</view>
<view class="time" v-if="tabbar.length">
<scroll-view class="typeList" scroll-x="true">
<view class="" style="display: flex;">
<view class="timeItem" v-for="(item,index) in tabbar" :key="index">
<view class="num">
{{item.active_time}}
</view>
<view class="desc">
{{item.status_text}}
</view>
</view>
<view class="timeItem" v-for="(item,index) in tabbar" :key="index" @click="handleTab(index)" >
<view class="num" :class="[index==curTabIndex ? 'numselected' : '']">
{{item.active_time}}
</view>
</scroll-view>
</view>
<view class="desc" :class="[index==curTabIndex ? 'descselected' : '']">
{{item.status_text}}
</view>
</view>
</view>
</view>
<view class="main">
<view class="over" v-if="tabbar.length">
@ -130,7 +125,7 @@
background: 'url(https://www.royaum.com.cn/static/rank/rank1.png) center top no-repeat',
backgroundSize: '100% auto',
},
backgroundImg: '',
backgroundImg:'',
}
},
/**
@ -164,8 +159,8 @@
.then(result => {
app.tabbar = result.data.tabbar;
app.goodsList = result.data.goodsList.data
if (app.goodsList && app.goodsList.length > 0) {
app.goodsList.map(a => {
if(app.goodsList && app.goodsList.length > 0){
app.goodsList.map(a=>{
a.original_price = Number(a.original_price)
a.seckill_price_max = Number(a.seckill_price_max)
a.seckill_price_min = Number(a.seckill_price_min)
@ -188,12 +183,13 @@
getListData(pageNo = 1) {
const app = this
const activeTimeId = app.getCurTabbarId()
let pamars = {
// store_id: 10001,
activeTimeId: activeTimeId,
}
console.log(activeTimeId)
return new Promise((resolve, reject) => {
Api.list(activeTimeId, {
page: pageNo
}, {
load: false
})
Api.sharplist(pamars)
.then(result => {
//
let newList = result.data.list
@ -230,10 +226,12 @@
// ()
handleTab(index) {
const app = this
console.log(this)
app.curTabIndex = index
//
app.goodsList = getEmptyPaginateObj()
app.mescroll.resetUpScroll()
app.goodsList = app.getListData()
// //
// app.goodsList = getEmptyPaginateObj()
// app.mescroll.resetUpScroll()
},
//
@ -244,21 +242,19 @@
// ID
getCurTabbarId() {
const curTabbar = this.getCurTabbar()
console.log(curTabbar)
return curTabbar ? curTabbar.active_time_id : 0
},
//
handleTargetGoods(sharpGoodsId) {
let count_down_time = new Date(this.tabbar[this.curTabIndex].count_down_time.replace(/-/g, '/'))
.getTime() - new Date().getTime()
let count_down_time = new Date(this.tabbar[this.curTabIndex].count_down_time.replace(/-/g, '/')).getTime()-new Date().getTime()
uni.navigateTo({
url: '/pages/goods/detail?goodsId=' + sharpGoodsId + "&isSeckill=" + true + '&isBuy=' +
count_down_time + '&seckillText=' + (this.tabbar[this.curTabIndex].status == this
.ActiveStatusEnum.STATE_BEGIN.value ? '结束' : '开始')
url: '/pages/goods/detail?goodsId=' + sharpGoodsId+"&isSeckill="+true+'&isBuy='+count_down_time+'&seckillText='+(this.tabbar[this.curTabIndex].status == this.ActiveStatusEnum.STATE_BEGIN.value ? '结束' : '开始' )
})
},
//
setWxofficialShareData() {
this.updateShareCardData({
@ -302,10 +298,12 @@
width: 100%;
height: 100%;
}
.active{
background-color: #A9A9A9;
}
.title {
width: 100%;
height: 220rpx;
height: 500rpx;
position: relative;
.bgImg {
@ -333,41 +331,45 @@
.time {
display: flex;
align-items: center;
padding: 0 24rpx;
align-items: center;
width: 100%;
//justify-content: space-around;
z-index: 30;
.typeList {
white-space: nowrap;
}
overflow: auto;
bottom: 0;
position: absolute;
.timeItem {
margin-right: 15rpx;
margin-bottom: 5px;
.num {
width: 135rpx;
width: 150rpx;
font-size: 28rpx;
font-weight: 500;
color: #FFFFFF;
color: #C3C3C3;
line-height: 33rpx;
text-shadow: 0px 0px 11px #FB3A22;
text-align: center;
margin-top: 10rpx;
}
.numselected{
color:#ffffff;
}
.desc {
width: 135rpx;
width: 150rpx;
height: 36rpx;
background: #FFFFFF;
//background: #FFFFFF;
border-radius: 62rpx 62rpx 62rpx 62rpx;
opacity: 1;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FB3D27;
color: #C3C3C3;
line-height: 36rpx;
margin-top: 10rpx;
text-align: center;
}
.descselected{
color:#FB3D27;
background: #FFFFFF;
}
}
}
}
@ -425,7 +427,6 @@
.goodsList {
overflow: hidden;
.goodItem {
width: 686rpx;
height: 342rpx;
@ -436,12 +437,10 @@
padding: 48rpx 32rpx 36rpx 0;
margin: 0 auto;
margin-top: 22rpx;
.itemImg {
width: 258rpx;
height: 258rpx;
margin-right: 10rpx;
.goodsImg {
width: 100%;
height: 100%;
@ -472,7 +471,6 @@
.info {
display: flex;
.price {
height: 40rpx;
font-size: 28rpx;
@ -491,7 +489,6 @@
background-image: url('https://www.royaum.com.cn/static/seckill/bottom.png');
background-size: 100% 100%;
margin: 0 12rpx 0 14rpx;
.delText {
width: 132rpx;
text-align: center;
@ -534,13 +531,12 @@
background-size: 100% 100%;
.killPrice {
font-size: 24rpx;
font-size: 20rpx;
font-weight: 500;
color: #FF423D;
margin-left: 26rpx;
text {
font-size: 36rpx;
text{
font-size: 34rpx;
}
}

Loading…
Cancel
Save