@ -0,0 +1,25 @@
|
||||
/*
|
||||
* @Author: ch
|
||||
* @Date: 2022-04-12 13:56:24
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-04-12 16:06:34
|
||||
* @Description: file content
|
||||
*/
|
||||
import {ToAsyncAwait, MsbRequestTk} from '@/common/utils';
|
||||
|
||||
const BASE_URL = '/mall/marketing';
|
||||
|
||||
export const ApiGetHomeSeckill = () =>
|
||||
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/activity/home`));
|
||||
|
||||
/**
|
||||
* 获取当天秒杀时段
|
||||
*/
|
||||
export const ApiGetSeckillTimes = () =>
|
||||
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/activity/time`));
|
||||
/**
|
||||
* 获取当天秒杀时段
|
||||
*/
|
||||
export const ApiGetSeckillGoods = (params) =>
|
||||
ToAsyncAwait(MsbRequestTk.get(`${BASE_URL}/app/activity/product`, params));
|
||||
|
@ -0,0 +1,88 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-04-12 10:37:24
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-04-12 13:37:57
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<u-popup :show="show" @close="close" round="16rpx" closeable>
|
||||
<view class="ui-select--title" v-if="title">{{title}}</view>
|
||||
<radio-group class="ui-select--cell" @change="change">
|
||||
<UiCell :title="item.label" v-for="item in options" :key="item.value">
|
||||
<radio slot="right-icon" class="ui-select--radio" color="#FF875B"
|
||||
:value="item.value" :checked="item.value === selected.value"/>
|
||||
</UiCell>
|
||||
</radio-group>
|
||||
<view class="ui-select--footer">
|
||||
<UiButton type="gradual" size="max" @click="confirm">确认</UiButton>
|
||||
</view>
|
||||
|
||||
</u-popup>
|
||||
</template>
|
||||
<script>
|
||||
import UiCell from '@/components/UiCell.vue';
|
||||
import UiButton from '@/components/UiButton.vue';
|
||||
export default {
|
||||
components: { UiButton, UiCell },
|
||||
props : {
|
||||
options : {
|
||||
type : Array,
|
||||
default : []
|
||||
},
|
||||
title : {
|
||||
type : String,
|
||||
default : ''
|
||||
},
|
||||
value : {
|
||||
type : [Object, String, Number],
|
||||
default (){
|
||||
return {}
|
||||
}
|
||||
},
|
||||
show : {
|
||||
type : Boolean,
|
||||
default : false
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
selected : {}
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
},
|
||||
methods:{
|
||||
change(val){
|
||||
this.selected = this.options.find(item => val.detail.value === item.value);
|
||||
},
|
||||
confirm(){
|
||||
this.close();
|
||||
this.$emit('input', this.selected);
|
||||
},
|
||||
close(){
|
||||
this.$emit('update:show', false);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.ui-select{
|
||||
&--title{
|
||||
text-align: center;
|
||||
font-size: 34rpx;
|
||||
margin: 40rpx 0 30rpx;
|
||||
}
|
||||
&--cell{
|
||||
padding: 0 40rpx;
|
||||
}
|
||||
&--radio{
|
||||
transform: scale(60%);
|
||||
}
|
||||
&--footer{
|
||||
padding: 68rpx 40rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,109 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-04-12 17:33:42
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-04-12 18:12:45
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<view class="seckill">
|
||||
<view class="seckill--price-box">
|
||||
<text class="seckill--price-icon">¥</text>
|
||||
<text class="seckill--price">9.9</text>
|
||||
<text class="seckill--price-org">¥29</text>
|
||||
</view>
|
||||
<view class="seckill--timer">
|
||||
<view>00</view>
|
||||
<text>:</text>
|
||||
<view>00</view>
|
||||
<text>:</text>
|
||||
<view>00</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props : {
|
||||
data : {
|
||||
type : Object,
|
||||
default : () => ({})
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
secondNum : 0
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
hours(){
|
||||
let hours = parseInt(this.secondNum / 3600);
|
||||
return hours > 9 ? hours : `0${hours}`;
|
||||
},
|
||||
minute(){
|
||||
let minute = parseInt((this.secondNum - hours * 3600) / 60);
|
||||
return minute > 9 ? hours : `0${minute}`;
|
||||
},
|
||||
second(){
|
||||
let second = parseInt(this.secondNum % 60);
|
||||
return second > 9 ? second : `0${second}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.seckill{
|
||||
height: 100rpx;
|
||||
width: 690rpx;
|
||||
margin: 20rpx auto;
|
||||
background:linear-gradient(180deg, #FFF3EF 0%, #FFFFFF 100%);
|
||||
border-radius: 16rpx;
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 20rpx 0 234rpx;
|
||||
&::after{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
display: block;
|
||||
content: '';
|
||||
width: 266rpx;
|
||||
height: 100rpx;
|
||||
background: url('@/static/goods/seckill.png') no-repeat -8rpx -16rpx;
|
||||
background-size: 290rpx;
|
||||
}
|
||||
&--price-box{
|
||||
padding-top: 30rpx;
|
||||
}
|
||||
&--price-icon{
|
||||
color: $color-yellow4;
|
||||
}
|
||||
&--price{
|
||||
color: $color-yellow4;
|
||||
font-size: 52rpx;
|
||||
}
|
||||
&--price-org{
|
||||
color: $color-grey4;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
&--timer{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
view{
|
||||
background: #000;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
text{
|
||||
margin: 0 5rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,190 +0,0 @@
|
||||
<!--
|
||||
* @Author: ch
|
||||
* @Date: 2022-03-23 10:07:48
|
||||
* @LastEditors: ch
|
||||
* @LastEditTime: 2022-04-09 17:46:32
|
||||
* @Description: file content
|
||||
-->
|
||||
<template>
|
||||
<view class="sekill">
|
||||
<view class="sekill-title">
|
||||
<view class="sekill-title--left">
|
||||
<text class="sekill-title--text">限时秒杀</text>
|
||||
<view class="sekill-title--time">
|
||||
<text class="sekill-title--time-name">14点场</text>
|
||||
<image class="sekill-title--time-icon" src="@/static/index/time.png"></image>
|
||||
<text class="sekill-title--time-time">14:20:30</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sekill-title--more" @click="$Router.push('/pages/sekill/index')">
|
||||
<text>查看更多</text>
|
||||
<image class="sekill-title--more-icon" src="@/static/common/arrow.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sekill--group">
|
||||
<view>
|
||||
<image class="sekill--item-img"></image>
|
||||
<view class="sekill--item-pirce-box">
|
||||
<text class="sekill--item-pirce-title">秒杀价</text>
|
||||
<text class="sekill--item-pirce">¥29</text>
|
||||
</view>
|
||||
<text class="sekill--item-original-pirce">¥50</text>
|
||||
</view>
|
||||
<view>
|
||||
<image class="sekill--item-img"></image>
|
||||
<view class="sekill--item-pirce-box">
|
||||
<text class="sekill--item-pirce-title">秒杀价</text>
|
||||
<text class="sekill--item-pirce">¥29</text>
|
||||
</view>
|
||||
<text class="sekill--item-original-pirce">¥50</text>
|
||||
</view>
|
||||
<view>
|
||||
<image class="sekill--item-img"></image>
|
||||
<view class="sekill--item-pirce-box">
|
||||
<text class="sekill--item-pirce-title">秒杀价</text>
|
||||
<text class="sekill--item-pirce">¥29</text>
|
||||
</view>
|
||||
<text class="sekill--item-original-pirce">¥50</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props : {
|
||||
data : {
|
||||
type : Array,
|
||||
default : []
|
||||
}
|
||||
},
|
||||
computed:{}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.sekill{
|
||||
height: 424rpx;
|
||||
width: 690rpx;
|
||||
margin: 0 auto;
|
||||
padding: 30rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
&-title{
|
||||
height: 36rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
&--text{
|
||||
font-size: 36rpx;
|
||||
}
|
||||
&--left{
|
||||
display: flex;
|
||||
}
|
||||
&--time{
|
||||
display: flex;
|
||||
height: 38rpx;
|
||||
line-height: 36rpx;
|
||||
border-radius: 18rpx;
|
||||
margin-left: 36rpx;
|
||||
background: #FFEDE9;
|
||||
overflow: hidden;
|
||||
align-items: center;
|
||||
}
|
||||
&--time-name{
|
||||
height: 100%;
|
||||
padding: 0 22rpx 0 15rpx;
|
||||
background: #FF512B;
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
position: relative;
|
||||
&::after{
|
||||
display: block;
|
||||
content: '';
|
||||
width: 16rpx;
|
||||
height: 36rpx;
|
||||
background: #FF512B;
|
||||
transform: rotate(40deg);
|
||||
position: absolute;
|
||||
right: -10rpx;
|
||||
top: -12rpx;
|
||||
}
|
||||
|
||||
}
|
||||
&--time-time{
|
||||
margin-right: 15rpx;
|
||||
font-size: 22rpx;
|
||||
color: #FF512B;
|
||||
position: relative;
|
||||
&::before{
|
||||
display: block;
|
||||
content: '';
|
||||
width: 14rpx;
|
||||
height: 36rpx;
|
||||
background: #FFEDE9;
|
||||
transform: rotate(40deg);
|
||||
position: absolute;
|
||||
left: -52rpx;
|
||||
top: 8rpx;
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
||||
&--time-icon{
|
||||
width: 22rpx;
|
||||
height: 22rpx;
|
||||
padding-left: 20rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
&--more{
|
||||
display: inline-block;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
&--more-icon{
|
||||
width: 10rpx;
|
||||
height: 20rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
&--group{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
&--item{
|
||||
&-img{
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
border-radius: 8rpx;
|
||||
background: #F8F8F8;
|
||||
}
|
||||
&-pirce-box{
|
||||
width: 180rpx;
|
||||
height: 44rpx;
|
||||
line-height: 44rpx;
|
||||
background: linear-gradient(90deg, #FFE7DE 0%, #FFFFFF 100%);
|
||||
border-radius: 20rpx;
|
||||
padding-left:20rpx;
|
||||
margin: 20rpx 0 10rpx 0;
|
||||
}
|
||||
&-pirce-title{
|
||||
font-size: 22rpx;
|
||||
color: $color-grey5;
|
||||
}
|
||||
&-pirce{
|
||||
color: #FF512B;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
&-original-pirce{
|
||||
display: block;
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
text-decoration: line-through;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
</style>
|
After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 284 KiB After Width: | Height: | Size: 284 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
Before Width: | Height: | Size: 435 B After Width: | Height: | Size: 435 B |