mall-uniapp/pages/index/components/a_seckill.vue

231 lines
78 KiB
Vue
Raw Normal View History

<template>
<!-- 秒杀 -->
<view class="seckill" v-if="spikeList.length">
<view class="title acea-row row-between-wrapper">
<view class="acea-row row-middle">
<view class="pictrue">
<image src="/static/images/seckillTitle.png"></image>
</view>
<view class="lines"></view>
<view class="point">{{point}} </view>
<countDown :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="' : '" :minute-text="' : '" :second-text="' '"
:datatime="datatime" :is-col="true"></countDown>
</view>
<navigator url="/pages/activity/goods_seckill/index" hover-class="none" class="more acea-row row-center-wrapper">GO<text class="iconfont icon-xiangyou"></text></navigator>
</view>
<view class="conter">
<scroll-view scroll-x="true" style="white-space: nowrap; vertical-align: middle;" show-scrollbar="false">
<view class="itemCon" v-for="(item, index) in spikeList" :key="index" @click="goDetail(item)">
<view class="item">
<view class="pictrue">
<image :src="item.image"></image>
</view>
<view class="name line1">{{item.title}}</view>
<view class="x_money line1">¥<text class="num">{{item.price}}</text></view>
<view class="y_money line1">¥{{item.otPrice}}</view>
</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
let app = getApp();
import countDown from "@/components/countDown";
import {
getSeckillHeaderApi,
getSeckillList
} from '@/api/activity.js';
export default {
name: 'a_seckill',
components: {
countDown
},
data() {
return {
spikeList: [], // 秒杀
point: '',
datatime: 0,
status: 0
}
},
created() {
this.getSeckillIndexTime();
},
methods: {
getSeckillIndexTime() {
let limit = this.$config.LIMIT;
let params = {
page: 1,
limit: limit,
type: 'index'
}
getSeckillHeaderApi().then(res => {
if(res.data.seckillTime.length){
this.datatime = parseFloat(res.data.seckillTime[res.data.seckillTimeIndex].timeSwap);
let id = res.data.seckillTime[res.data.seckillTimeIndex].id;
this.point = res.data.seckillTime[res.data.seckillTimeIndex].time.split(',')[0];
this.status = res.data.seckillTime[res.data.seckillTimeIndex].status;
getSeckillList(id, params).then(({data}) => {
data.list.forEach((item) => {
let num = 0
if (item.price > 0 && item.otPrice > 0) num = ((parseFloat(item.price) / parseFloat(item.otPrice)).toFixed(
2))
item.discountNum = this.$util.$h.Mul(num, 10)
})
this.spikeList = data.list
})
}
})
},
goDetail(item){
uni.navigateTo({
url: '/pages/activity/goods_seckill_details/index?id=' + item.id + '&time=' + this.datatime + '&status=' + this.status + '&productId=' + item.productId
})
}
}
}
</script>
<style lang="scss" scoped>
.default{
width: 690rpx;
height: 300rpx;
border-radius: 14rpx;
margin: 26rpx auto 0 auto;
background-color: #ccc;
text-align: center;
line-height: 300rpx;
.iconfont{
font-size: 80rpx;
}
}
.seckill {
width: 710rpx;
height: 420rpx;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArsAAAGpCAYAAACNlf6PAAAgAElEQVR4Xuy9e7BvyVXf179778xIjCBIoxlZCOyKcRJMJY6xsHnIgGQeBvO0zQwGbF56AeJRJNhFCsoMhWObYGJb2H845Qx+JU5MUlQoXM6zXC4KDEm5Ev8R/UElRBIyIySY0XPu65zzS3X/evVv9ervevT+/X7nnnvvntLVOWfvfqxe3bvXp9de3XuT1v9WDawaWDWwamDVwKqBVQOrBlYNPKAa2Dyg7VqbtWpg1cCqgVUDqwZWDawaWDWwaiBNwe72e7/3sXTjpcfTx28/lm7dvrbq7yHWwCfcy7a//HIrP2Z1j9zYXq7wB9T2Cfe0kw8QfCLrqfrjnqqOKn9JKOKeCmV3yqOPXu5zcYVVMTF6x6Q3HvFt+mOP7HT98fx/NEYeVIUcpM2FmeVzx4oh3S8s+aHIduPld9PLH7+VvurtNzebdLR5wX0wtm9++lXpgx/7PWmz/cb0Wy/+3vQJL/uMdC09lc4vXpY2IPtWkS2aFqXLPfwglBvVQW7vjB6OVW7rzvoL/X2NBhzr767rr6W2bOLX81DgZcrhguTmaay89NSXNJv8v93Ak3VsN5tyTbsvM3T5c7mbfkC3+9t9yl2anBjLQLK25SHSo6bbknm7E9NMs58Ho2m5fkm2Czad8uWs7Ctz5rhW5a1llbTbTdpy/VAB236M8Nkc1XFN9EdfU0o7mV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CKCnLMsY514pg/9NFo3w0lko/TY7x1l7nWZrZdKY1lqoo8Zz8+eKn
background-repeat: no-repeat;
background-size: 100% 100%;
border-radius: 14rpx;
margin: 26rpx auto 0 auto;
padding: 23rpx 18rpx 13rpx 12rpx;
.title {
.pictrue {
width: 148rpx;
height: 40rpx;
image {
width: 100%;
height: 100%;
}
}
.lines {
width: 1rpx;
height: 24rpx;
background-color: #fff;
opacity: 0.6;
margin-left: 16rpx;
}
.point {
font-size: 30rpx;
font-weight: bold;
color: #fff;
margin-left: 16rpx;
}
// /deep/.time {
// font-size: 24rpx;
.styleAll {
width: 35rpx;
height: 35rpx;
background-color: #2F2F2F;
border-radius: 6rpx;
color: #fff;
text-align: center;
}
.more {
width: 86rpx;
height: 40rpx;
background: linear-gradient(142deg, #FFE9CE 0%, #FFD6A7 100%);
opacity: 1;
border-radius: 18px;
font-size: 22rpx;
color: #FE960F;
padding-left: 8rpx;
.iconfont {
font-size: 21rpx;
}
}
}
.conter {
width: 666rpx;
height: 320rpx;
border-radius: 12px;
padding: 24rpx 0 25rpx 16rpx;
margin-top: 14rpx;
.itemCon {
display: inline-block;
width: 174rpx;
margin-right: 24rpx;
.item {
width: 100%;
.pictrue {
width: 100%;
height: 174rpx;
border-radius: 6rpx;
image {
width: 100%;
height: 100%;
border-radius: 6rpx;
}
}
.name {
font-size: 24rpx;
color: #000;
margin-top: 14rpx;
}
.y_money {
font-size: 20rpx;
color: #999999;
text-decoration: line-through;
}
.x_money {
color: #FD502F;
font-size: 28rpx;
height: 100%;
font-weight: bold;
margin: 2rpx 0;
.num {
font-size: 28rpx;
}
}
.money {
2021-01-20 07:54:45 +00:00
// background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK4AAAAiCAMAAADxoBJ/AAAC9FBMVEUAAAD/v4D/AAD/JCT/34D/dEb/MCD/Hh7/gFX4Ixz/fFH/25r53Jf/KiX/3Jb7Hx/72ZX7JSH8Ih//gFH/gU/825j8KSP83Zf/gFL8KiT/gE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