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

217 lines
32 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" :bgColor="bgColor" />
</view>
2023-06-17 18:01:24 +00:00
<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">
2023-06-17 18:01:24 +00:00
<image :src="item.picUrl"></image>
</view>
2023-06-17 18:01:24 +00:00
<view class="name line1">{{ item.name }}</view>
<view class="x_money line1">¥<text class="num">{{ fen2yuan(item.seckillPrice ) }}</text></view>
<view class="y_money line1">¥{{ fen2yuan(item.marketPrice) }}</view>
</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
2023-06-17 18:01:24 +00:00
let app = getApp();
import countDown from "@/components/countDown";
2023-06-17 18:01:24 +00:00
import * as SeckillApi from '@/api/promotion/seckill.js';
import * as Util from '@/utils/util.js';
export default {
name: 'a_seckill',
components: {
countDown
},
data() {
return {
bgColor: {
'bgColor': '#fff',
'Color': '#E93323',
'width': '44rpx',
'timeTxtwidth': '16rpx',
'isDay': true
},
2023-06-17 18:01:24 +00:00
spikeList: [], // 秒杀活动数组
point: '', // 秒杀开始时间
datatime: 0 // 秒杀剩余结束时间
}
},
created() {
2023-06-17 18:01:24 +00:00
SeckillApi.getNowSeckillActivity().then(res => {
// 如果为空,说明没有活动
const config = res.data.config;
if (!config) {
return;
}
this.spikeList = res.data.activities;
this.point = config.startTime;
// 计算结束时间
const now = new Date();
this.datatime = new Date(now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate()
+ ' ' + config.endTime).getTime() / 1000;
})
},
methods: {
goDetail(item){
uni.navigateTo({
url: '/pages/activity/goods_seckill_details/index?id=' + item.id
})
2023-06-17 18:01:24 +00:00
},
fen2yuan(price) {
return Util.fen2yuan(price)
}
}
}
</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: auto;
height: 420rpx;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArIAAAGkCAMAAAD6wDapAAAC/VBMVEUAAAD/8e3/////////////rZX/////bF//////cGP/em3/////lID/noD/oYT/////qpD/qZD/qpH//////////////////////Pz/MTH/dk7/+vr/9/f/bk3/Zkr/aUz/cU7/9fT/e1b/Y0n/dlL/YEj/8/L/XUb/7u3/V0T/ST3/2NT/3tv/zMf/RTv/0s7/WkX/eFT/a0z/UUH/TD7/uK7/TkD/8O//6Ob/Pzj/7Or/o5P/29n/yML/clH/6uj/v7f/0Mv/ysT/5OL/tKj/Qjn/zsn/5eT/tqv/4N3/vbb/w73/2tb/wrv/sab/rqH/vLP/qp3/NjP/VEP/fFb/x8D/wbn/knn/r6P/rJ//oI7/oZH/OTX/pZX/j3b/PDb/ubD/xb7/p5j/U0P/urL/qZr/m4f/nIr/4t//mYX/1dL/1ND/loD/nov/ln3/mIL/lHv/jXT/hWf/1dD/gF7/jHD/i3P/hWT/iGr/h3D/im//iGz/iHv/knz/fGf/hHD/b1z/j3n/f2r/gmz/ta3/gmH/bVH/s6v/fVv/hG3/iXH/pZj/aVL/jnP/kof/oJb/bVn/d2T/nIL/san/nZH/fmj/i3j/Wkr/lor/jH//k3//dVb/mX//gG//cln/rqb/ZlX/n4T/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q0Fa4AU7Rkfha1W3p7luZ1QsRrS/wVN9ITrvYnoZBNZo/BSzBFC5xGd47BPsTZdJYJxGby+84aRwaWKBXMFvuK++LEhgQ3FW0EG8sULSjO
background-repeat: no-repeat;
background-size: 100% 100%;
border-radius: 14rpx;
margin: 0 auto 30rpx auto;
padding: 24rpx;
box-sizing: border-box;
.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;
color: #fff;
margin-left: 21rpx;
margin-right: 4rpx;
font-weight: 800;
}
.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;
font-weight: 800;
.iconfont {
font-size: 21rpx;
}
}
}
.conter {
width: 666rpx;
height: 320rpx;
border-radius: 12px;
margin-top: 24rpx;
.itemCon {
display: inline-block;
width: 186rpx;
margin-right: 24rpx;
.item {
width: 100%;
.pictrue {
width: 100%;
height: 186rpx;
border-radius: 6rpx;
image {
width: 100%;
height: 100%;
border-radius: 6rpx;
}
}
.name {
font-size: 24rpx;
color: #000;
margin-top: 14rpx;
}
.y_money {
font-size: 24rpx;
color: #999999;
text-decoration: line-through;
}
2023-06-17 18:01:24 +00:00
.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/3Jb7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