秒杀详情调整,禅道Bug解决

msb_beta
ch 2 years ago
parent fea35b72d1
commit 948f3993f5

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-17 19:15:10
* @LastEditors: ch
* @LastEditTime: 2022-03-22 17:30:38
* @LastEditTime: 2022-04-24 18:15:27
* @Description: 一些无法归类的公共方法容器
*/
@ -73,7 +73,51 @@ const IsDouble = (str) => {
if (result == null) return false
return true
}
/**
*
* 时间格式化
* @param {number|string|Date} d 时间参数能被new Date识别的数字字符串日期
* @param {string} fmt 时间格式参数 字符串类型 默认'yyyy/mm/dd'
*/
const formatDate = (date, fmt = 'yyyy/mm/dd' ) =>{
// 处理不识别的时间表示字符串如2020年01月01日00时00分00秒
const dateType = getVarType(date);
if(dateType === 'string'){
date = date.replace(/\D+/ig,'/');
let arr = date.split('/');
// 长度大于3说明带了时分秒信息 特殊时间处理格式
if(arr.length > 3){
let time = ` ${arr[3]}:${arr[4]}:${arr[5]}`
arr.length = 3;
date = arr.join('/') + time;
}
};
try{
date = date ? dateType === 'date' ? date : new Date(date) : new Date();
} catch(e){
throw new Error('不能识别的时间格式');
}
const o = {
'm+': date.getMonth() + 1, //月份
'd+': date.getDate(), //日
'h+': date.getHours(), //小时
'i+': date.getMinutes(), //分
's+': date.getSeconds(), //秒ji“
'q+': Math.floor((date.getMonth() + 3) / 3), //季度
'l+': date.getMilliseconds() //毫秒
};
if (/(y+)/i.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear().toString()).substr(4 - RegExp.$1.length));
}
for (let k in o) {
if (new RegExp(`(${k})`, 'i').test(fmt)) {
const str = o[k].toString();
fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : (`0${str}`).substr(str.length-1));
}
}
return fmt;
}
// 工具类的文件需要把文件提供的工具类统一放最下方做一个统一输出
export {
// async await 标识结果处理
@ -87,5 +131,7 @@ export {
// 判断是否为整数
IsInteger,
// 判断是否double或float
IsDouble
IsDouble,
// 时间格式化
formatDate
}

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-25 10:11:37
* @LastEditors: ch
* @LastEditTime: 2022-04-22 14:16:14
* @LastEditTime: 2022-04-24 15:36:57
* @Description: file content
-->
<template>
@ -44,7 +44,7 @@ export default {
&--back{
width: 14rpx;
height: 28rpx;
margin-right: 20rpx;
margin-right: 36rpx;
}
&--title{
flex: 1;

@ -1,2 +1,2 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>马士兵严选</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.b5602bf5.js></script><script src=/static/js/index.6ab2a97e.js></script></body></html>
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.b5602bf5.js></script><script src=/static/js/index.05ec0e3f.js></script></body></html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-28 15:38:23
* @LastEditors: ch
* @LastEditTime: 2022-04-22 19:16:20
* @LastEditTime: 2022-04-24 18:24:33
* @Description: file content
-->
<template>
@ -39,6 +39,7 @@ export default {
return false;
}
this.$store.commit('SET_USER_INFO', {...this.userInfo});
this.$Router.back();
}
}
}

@ -2,30 +2,40 @@
* @Author: ch
* @Date: 2022-04-12 17:33:42
* @LastEditors: ch
* @LastEditTime: 2022-04-22 21:02:11
* @LastEditTime: 2022-04-24 18:20:42
* @Description: file content
-->
<template>
<view class="seckill" :class="activityStatus === 'startActivity' && 'seckill__start'">
<view class="seckill--price-box" v-if="activityStatus === 'noStartActivity'">
<text class="seckill--price-icon"></text>
<text class="seckill--price">{{data.originalPrice}}</text>
</view>
<view class="seckill--price-box " v-else>
<text class="seckill--price-icon"></text>
<text class="seckill--price">{{data.activityPrice}}</text>
<text class="seckill--price-org">{{data.originalPrice}}</text>
</view>
<view class="seckill--timer">
<view>{{hours}}</view>
<text>:</text>
<view>{{minute}}</view>
<text>:</text>
<view>{{second}}</view>
<view>
<view class="seckill" :class="activityStatus === 'startActivity' && 'seckill__start'">
<view class="seckill--price-box" v-if="activityStatus === 'noStartActivity'">
<text class="seckill--price-icon"></text>
<text class="seckill--price">{{data.originalPrice}}</text>
</view>
<view class="seckill--price-box " v-else>
<text class="seckill--price-icon"></text>
<text class="seckill--price">{{data.activityPrice}}</text>
<text class="seckill--price-org">{{data.originalPrice}}</text>
</view>
<view>
<view class="seckill--timer-title">
{{activityStatus === 'startActivity' ? '距结束仅剩' : '即将开始秒杀' }}
</view>
<view v-if="isDay">{{startDate}}</view>
<view class="seckill--timer">
<view>{{hours}}</view>
<text>:</text>
<view>{{minute}}</view>
<text>:</text>
<view>{{second}}</view>
</view>
</view>
</view>
<view class="title">{{title}}</view>
</view>
</template>
<script>
import {formatDate} from '@/common/utils';
export default {
props : {
data : {
@ -35,6 +45,10 @@ export default {
activityStatus : {
type : String,
default : 'noStartActivity'
},
title : {
type : String,
default : ''
}
},
data(){
@ -63,6 +77,14 @@ export default {
second(){
let second = parseInt(this.secondNum % 60);
return second > 9 ? second : `0${second}`;
},
isDay(){
const currentTime = new Date(this.data.currentTime);
const activityTime = new Date(this.data.activityStartTime);
return currentTime.getDate() === activityTime.getDate();
},
startDate(){
return formatDate(this.data.activityStartTime, 'm月d日hh:ii')
}
},
methods:{
@ -113,66 +135,70 @@ export default {
<style lang="scss" scoped>
.seckill{
height: 100rpx;
height: 110rpx;
width: 690rpx;
margin: 20rpx auto;
background:linear-gradient(180deg, #FFF3EF 0%, #FFFFFF 100%);
border-radius: 16rpx;
margin: 20rpx auto 0;
position: relative;
display: flex;
justify-content: space-between;
padding: 0 20rpx 0 260rpx;
&::after{
position: absolute;
left: 0;
top: 0;
display: block;
content: '';
width: 367rpx;
height: 100rpx;
background: url('@/static/goods/seckill.png') no-repeat -8rpx -16rpx;
background-size: 327rpx;
}
background-image: url('@/static/goods/seckill.png');
background-repeat : no-repeat;
background-size: 100%;
&__start{
padding: 0 20rpx 0 234rpx;
&::after{
width: 327rpx;
background: url('@/static/goods/seckill_start.png') no-repeat -8rpx -16rpx;
background-size: 290rpx;
}
padding: 0 20rpx 0 108rpx;
background-image: url('@/static/goods/seckill_start.png');
}
&--price-box{
padding-top: 30rpx;
}
&--price-icon{
color: $color-yellow4;
color: $color-grey0;
font-weight: bold;
font-size: 32rpx;
}
&--price{
color: $color-yellow4;
font-size: 52rpx;
color: $color-grey0;
font-weight: bold;
font-size: 50rpx;
}
&--price-org{
color: $color-grey4;
color: $color-grey0;
text-decoration: line-through;
margin-left: 15rpx;
}
&--timer-title{
margin: 20rpx 0 10rpx 0;
color: $color-grey0;
text-align: right;
font-size: $font-size-sm;
}
&--timer{
display: flex;
align-items: center;
view{
background: #000;
width: 48rpx;
height: 48rpx;
line-height: 48rpx;
background: #E83710;
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
color: #fff;
text-align: center;
border-radius: 8rpx;
font-size: 24rpx;
font-size: $font-size-sm;
}
text{
margin: 0 5rpx;
color: #fff;
}
}
}
.title{
margin: 0 30rpx ;
background: $color-grey0;
border-radius: 16rpx;
padding: 30rpx;
font-size: $font-size-lg;
line-height: 48rpx;
}
</style>

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-24 11:30:55
* @LastEditors: ch
* @LastEditTime: 2022-04-22 20:21:28
* @LastEditTime: 2022-04-24 17:37:53
* @Description: file content
-->
<template>
@ -220,14 +220,21 @@ export default {
uni.$u.toast('请选择规格~');
return false;
}
let query = {
mode : 'buyNow',
skuId : this.curSku.skuId,
num : this.curBuyNum,
activityType : 1
}
const {productActivityVO} = this.goodsInfo;
if(this.activityStatus === 'startActivity'){
query.activityType = 2;
query.activityId = productActivityVO.activityId;
query.activityTimeId = productActivityVO.activityTimeId;
}
this.$Router.push({
path : '/orderSubmit',
query: {
mode : 'buyNow',
skuId : this.curSku.skuId,
num : this.curBuyNum,
activityType : this.activityStatus === 'startActivity' ? 2 : 1
}
query
})
},
confirm(){

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-23 17:27:21
* @LastEditors: ch
* @LastEditTime: 2022-04-22 21:04:17
* @LastEditTime: 2022-04-24 17:51:34
* @Description: file content
-->
<template>
@ -12,9 +12,10 @@
</view>
<SlideImage :images="goods.pictureList"></SlideImage>
<SeckillPrice :data.sync="productActivityVO" :activityStatus="activityStatus"
v-if="productActivityVO.isActivity" @change="getGoodsDetail"></SeckillPrice>
<view class="goods-info">
<view class="pirce" v-if="!productActivityVO.isActivity">
v-if="productActivityVO.isActivity" @change="getGoodsDetail"
:title="goods.name"></SeckillPrice>
<view class="goods-info" v-if="!productActivityVO.isActivity">
<view class="pirce">
<text></text>
<text class="pirce--max">{{goods.startingPrice}}</text>
<text></text>
@ -37,7 +38,7 @@
<view class="icon cart" @click="$Router.push('/cart')"></view>
</view>
<view class="footer--btns">
<UiButton class="btn" :disable="stock == 0 || activityStatus == startActivity" @click="onShowSkuPopup(2)"></UiButton>
<UiButton class="btn" :disable="stock == 0 || activityStatus == 'startActivity'" @click="onShowSkuPopup(2)"></UiButton>
<UiButton class="btn btn--buy" :disable="stock == 0" @click="onShowSkuPopup(3)"> </UiButton>
</view>
</view>

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-23 16:37:30
* @LastEditors: ch
* @LastEditTime: 2022-04-09 15:03:50
* @LastEditTime: 2022-04-24 15:47:06
* @Description: file content
-->
<template>
@ -73,8 +73,8 @@ export default {
display: flex;
align-items: center;
color: $color-grey5;
&__active{
color: $color-grey6;
&__active text{
color: $color-yellow4;
}
}
&--label{

@ -2,15 +2,15 @@
* @Author: ch
* @Date: 2022-03-21 10:31:54
* @LastEditors: ch
* @LastEditTime: 2022-04-19 18:09:02
* @LastEditTime: 2022-04-24 16:55:46
* @Description: file content
-->
<template>
<view>
<view class="header">
<UiPageHeader>
<u--input slot="custom" class="search--input" prefixIconStyle="font-size:48rpx;color:#ccc"
prefixIcon="search" placeholderClass="search--input__placeholder" clearable
<u--input slot="custom" class="search--input" suffixIconStyle="font-size:48rpx;color:#ccc"
suffixIcon="search" placeholderClass="search--input__placeholder" clearable
placeholder="请输入您想要搜索的商品名称" :value="$Route.query.search"
@focus="$Router.push('/search')"/>
</UiPageHeader>
@ -28,7 +28,6 @@
<view class="title">为您精选</view>
<BsChoiceGoods class="goods-group" ref="choiceGoods"></BsChoiceGoods>
</template>
</view>
</template>
<script>
@ -115,6 +114,7 @@ page {
position: sticky;
top: var(--window-top);
z-index: 99;
background: $color-grey0;
}
.search--input{
display: block;

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-21 11:29:38
* @LastEditors: ch
* @LastEditTime: 2022-04-22 14:14:25
* @LastEditTime: 2022-04-24 15:39:13
* @Description: file content
-->
<template>
@ -10,9 +10,9 @@
<UiPageHeader class="header">
<view slot="custom" class="search">
<u--input class="search--input" focus placeholder="请输入您想搜索的商品名称"
prefixIcon="search" ref="search" clearable prefixIconStyle="font-size:48rpx;color:#ccc"
v-model="searchValue" placeholderClass="search--input__placeholder"></u--input>
<text class="search--btn" @click="onSearch"></text>
suffixIcon="search" ref="search" clearable suffixIconStyle="font-size:48rpx;color:#ccc"
v-model="searchValue" placeholderClass="search--input__placeholder"
@confirm="onSearch" />
</view>
</UiPageHeader>
<view class="history" v-if="historyList.length">
@ -60,7 +60,7 @@ export default {
const { searchValue } = this;
if (searchValue) {
this.setHistory(searchValue);
this.$Router.push({path:'/goodsList', query :{
this.$Router.replace({path:'/goodsList', query :{
search: searchValue
}
});
@ -100,7 +100,7 @@ export default {
*/
handleQuick(searchValue) {
this.setHistory(searchValue);
this.$Router.push({path:'/goodsList', query :{
this.$Router.replace({path:'/goodsList', query :{
search: searchValue
}
});
@ -124,7 +124,6 @@ page{
align-items: center;
&--input{
display: block;
margin-right: 40rpx;
height: 70rpx;
border:none;
box-sizing: border-box;
@ -148,12 +147,14 @@ page{
.history {
padding: 0 40rpx;
&--head {
font-size: 26rpx;
color: $color-grey5;
text{
font-size: 26rpx;
color: $color-grey4;
}
display: flex;
justify-content: space-between;
align-items: center;
margin: 40rpx 0;
margin: 40rpx 0 20rpx;
}
&--del{
width: 27rpx;
@ -164,16 +165,17 @@ page{
flex-wrap: wrap;
}
&--item{
max-width: 276rpx;
max-width: 460rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 70rpx;
line-height: 70rpx;
padding: 0 20rpx;
font-size: 26rpx;
color: $color-grey5;
background: $color-grey1;
margin: 10rpx 18rpx 10rpx 0;
margin: 10rpx;
}
}

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-20 14:14:53
* @LastEditors: ch
* @LastEditTime: 2022-04-22 19:51:14
* @LastEditTime: 2022-04-24 17:45:41
* @Description: file content
-->
<template>
@ -123,6 +123,8 @@ export default {
res = await ApiGetBeforeOrder({
productSkuId : query.skuId,
quantity : query.num,
activityId : query.activityId,
activityTimeId : query.activityTimeId,
// 1 2
activityType : query.activityType,
recipientAddressId : addressId
@ -155,6 +157,8 @@ export default {
recipientAddressId : this.address.id,
shoppingCartIds : query.ids ? query.ids.split(',') : [],
products : this.orderInfo.products.map(i => ({
activityId : query.activityId,
activityTimeId : query.activityTimeId,
productId : i.productId,
productSkuId : i.productSkuId,
quantity : i.quantity,

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-21 18:08:07
* @LastEditors: ch
* @LastEditTime: 2022-04-24 11:46:48
* @LastEditTime: 2022-04-24 17:11:09
* @Description: file content
-->
<template>
@ -16,34 +16,32 @@
<text>{{item.isInProgress ? '抢购中' : '即将开抢'}}</text>
</view>
</view>
<view class="goods">
<view class="goods-item" v-for="item in goodsList" :key="item.productId"
@click="$Router.push(`/goodsDetail?id=${item.productId}`)">
<image class="goods-item--image" :src="item.productMainPicture"/>
<view class="goods-item--con">
<text class="goods-item--title">{{item.productName}}</text>
<view class="goods-item--prog-box">
<u-line-progress class="goods-item--prog" :percentage="30" :showText="false" height="11rpx" activeColor="#FE0A16" inactiveColor="#FF8E8F" />
<text>仅剩{{item.stock}}</text>
<view class="goods-item" v-for="item in goodsList" :key="item.productId"
@click="$Router.push(`/goodsDetail?id=${item.productId}`)">
<image class="goods-item--image" :src="item.productMainPicture"/>
<view class="goods-item--con">
<text class="goods-item--title">{{item.productName}}</text>
<view class="goods-item--prog-box">
<u-line-progress class="goods-item--prog" :percentage="30" :showText="false" height="11rpx" activeColor="#FE0A16" inactiveColor="#FF8E8F" />
<text>仅剩{{item.stock}}</text>
</view>
<view class="goods-item--operation">
<view>
<view class="goods-item--price">{{item.activityPrice}}</view>
<text class="goods-item--orgPrice">{{item.originalPrice}}</text>
</view>
<view class="goods-item--operation">
<view>
<view class="goods-item--price">{{item.activityPrice}}</view>
<text class="goods-item--orgPrice">{{item.originalPrice}}</text>
</view>
<template v-if="activityTime.isInProgress">
<button v-if="item.stock > 0" class="goods-item--btn" >立即抢购
</button>
<button v-else class="goods-item--btn goods-item--btn__disable">已售罄
</button>
</template>
<button v-else class="goods-item--btn">即将开抢
<template v-if="activityTime.isInProgress">
<button v-if="item.stock > 0" class="goods-item--btn" >立即抢购
</button>
</view>
<button v-else class="goods-item--btn goods-item--btn__disable">已售罄
</button>
</template>
<button v-else class="goods-item--btn">即将开抢
</button>
</view>
</view>
<u-loadmore :status="loadingStatus" color="#fff" iconColor="#fff" nomoreText="我也是有底线的啦~"/>
</view>
<u-loadmore :status="loadingStatus" color="#fff" iconColor="#fff" nomoreText="我也是有底线的啦~"/>
</view>
</template>
@ -110,6 +108,7 @@ export default {
<style lang="scss" scoped>
page{
background: #F53739;
padding-bottom: 30rpx;
}
.back{
width: 14rpx;
@ -167,16 +166,8 @@ page{
font-size: $font-size-lg;
}
}
.goods{
min-height: calc(100vh - 826rpx);
overflow: hidden;
margin: 0 20rpx;
padding: 10rpx 30rpx 0;
background: #DF1F21;
box-shadow: 0 10rpx 20rpx rgba($color: #000000, $alpha: .1) inset;
}
.goods-item{
width: 650rpx;
width: 690rpx;
height: 258rpx;
margin: 30rpx auto;
border-radius: 12rpx;
@ -185,14 +176,14 @@ page{
box-sizing: border-box;
background: linear-gradient(181deg, #FFF1D5 0%, #FBE0BB 21%, #F7CFA1 88%, #F7CFA1 100%);
&--image{
width: 190rpx;
height: 190rpx;
width: 200rpx;
height: 200rpx;
background: #F0EEE6;
border-radius: 12rpx;
margin-right: 30rpx;
}
&--con{
width: 378rpx;
width: 400rpx;
padding-top: 10rpx;
}
&--title{
@ -200,12 +191,14 @@ page{
line-height: 32rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
width: 378rpx;
display: block;
color: #791704;
}
&--prog-box{
margin-top: 24rpx;
margin-top: 16rpx;
display: flex;
justify-content: start;
align-items: center;
@ -223,7 +216,7 @@ page{
&--operation{
display: flex;
justify-content: space-between;
margin-top: 24rpx;
margin-top: 16rpx;
align-items: flex-end;
}
&--price{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Loading…
Cancel
Save