修复详情页

pull/100/head
岳琳红 2024-09-12 16:42:52 +08:00
parent e4da107e69
commit d1eea3280c
8 changed files with 1702 additions and 1716 deletions

View File

@ -2,10 +2,7 @@
<template> <template>
<s-layout navbar="inner" :bgStyle="{ color: 'rgb(245,28,19)' }"> <s-layout navbar="inner" :bgStyle="{ color: 'rgb(245,28,19)' }">
<!--顶部背景图--> <!--顶部背景图-->
<view <view class="page-bg" :style="[{ marginTop: '-' + Number(statusBarHeight + 88) + 'rpx' }]"></view>
class="page-bg"
:style="[{ marginTop: '-' + Number(statusBarHeight + 88) + 'rpx' }]"
></view>
<!-- 时间段轮播图 --> <!-- 时间段轮播图 -->
<view class="header" v-if="activeTimeConfig?.sliderPicUrls?.length > 0"> <view class="header" v-if="activeTimeConfig?.sliderPicUrls?.length > 0">
<swiper indicator-dots="true" autoplay="true" :circular="true" interval="3000" duration="1500" <swiper indicator-dots="true" autoplay="true" :circular="true" interval="3000" duration="1500"
@ -26,13 +23,12 @@
</view> </view>
<scroll-view class="time-list" :scroll-into-view="activeTimeElId" scroll-x scroll-with-animation> <scroll-view class="time-list" :scroll-into-view="activeTimeElId" scroll-x scroll-with-animation>
<view v-for="(config, index) in timeConfigList" :key="index" <view v-for="(config, index) in timeConfigList" :key="index"
:class="['item', { active: activeTimeIndex === index}]" :class="['item', { active: activeTimeIndex === index}]" :id="`timeItem${index}`"
:id="`timeItem${index}`" @tap="handleChangeTimeConfig(index,config.id)">
@tap="handleChangeTimeConfig(index)">
<!-- 活动起始时间 --> <!-- 活动起始时间 -->
<view class="time">{{ config.startTime }}</view> <view class="time">{{ config.startTime }}</view>
<!-- 活动状态 --> <!-- 活动状态 -->
<view class="status">{{ config.status }}</view> <view class="status">{{ config?.status }}</view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
@ -57,69 +53,89 @@
</view> </view>
<!-- 活动列表 --> <!-- 活动列表 -->
<scroll-view <scroll-view class="scroll-box" :style="{ height: pageHeight + 'rpx' }" scroll-y="true"
class="scroll-box" :scroll-with-animation="false" :enable-back-to-top="true">
:style="{ height: pageHeight + 'rpx' }"
scroll-y="true"
:scroll-with-animation="false"
:enable-back-to-top="true"
>
<view class="goods-box ss-m-b-20" v-for="activity in activityList" :key="activity.id"> <view class="goods-box ss-m-b-20" v-for="activity in activityList" :key="activity.id">
<s-goods-column <s-goods-column size="lg" :data="{ ...activity, price: activity.seckillPrice }"
size="lg" :goodsFields="goodsFields" :seckillTag="true">
:data="{ ...activity, price: activity.seckillPrice }"
:goodsFields="goodsFields"
:seckillTag="true"
@click="sheep.$router.go('/pages/goods/seckill', { id: activity.id })"
>
<!-- 抢购进度 --> <!-- 抢购进度 -->
<template #activity> <template #activity>
<view class="limit">限量 <text class="ss-m-l-5">{{ activity.stock}} {{activity.unitName}}</text></view> <view class="limit">限量 <text class="ss-m-l-5">{{ activity.stock}}
{{activity.unitName}}</text></view>
<su-progress :percentage="activity.percent" strokeWidth="10" textInside isAnimate /> <su-progress :percentage="activity.percent" strokeWidth="10" textInside isAnimate />
</template> </template>
<!-- 抢购按钮 --> <!-- 抢购按钮 -->
<template #cart> <template #cart>
<button :class="['ss-reset-button cart-btn', { disabled: activeTimeConfig.status === TimeStatusEnum.END }]"> <button
<span v-if="activeTimeConfig?.status === TimeStatusEnum.WAIT_START"></span> :class="['ss-reset-button cart-btn', { disabled: activeTimeConfig?.status === TimeStatusEnum.END}]"
<span v-else-if="activeTimeConfig?.status === TimeStatusEnum.STARTED">马上抢</span> v-if="activeTimeConfig?.status === TimeStatusEnum.WAIT_START">
<span v-else></span> <span>未开始</span>
</button>
<button
:class="['ss-reset-button cart-btn', { disabled: activeTimeConfig?.status === TimeStatusEnum.END}]"
@click="sheep.$router.go('/pages/goods/seckill', { id: activity.id })"
v-else-if='activeTimeConfig?.status === TimeStatusEnum.STARTED'>
<span>马上抢</span>
</button>
<button
:class="['ss-reset-button cart-btn', { disabled: activeTimeConfig?.status === TimeStatusEnum.END}]"
v-else>
<span>已结束</span>
</button> </button>
</template> </template>
</s-goods-column> </s-goods-column>
</view> </view>
<uni-load-more <uni-load-more v-if="activityTotal > 0" :status="loadStatus" :content-text="{
v-if="activityTotal > 0"
:status="loadStatus"
:content-text="{
contentdown: '上拉加载更多', contentdown: '上拉加载更多',
}" }" @tap="loadMore" />
@tap="loadMore"
/>
</scroll-view> </scroll-view>
</view> </view>
</s-layout> </s-layout>
</template> </template>
<script setup> <script setup>
import {reactive, computed, ref, nextTick} from 'vue'; import {
import { onLoad, onReachBottom } from '@dcloudio/uni-app'; reactive,
computed,
ref,
nextTick
} from 'vue';
import {
onLoad,
onReachBottom
} from '@dcloudio/uni-app';
import sheep from '@/sheep'; import sheep from '@/sheep';
import { useDurationTime } from '@/sheep/hooks/useGoods'; import {
useDurationTime
} from '@/sheep/hooks/useGoods';
import SeckillApi from "@/sheep/api/promotion/seckill"; import SeckillApi from "@/sheep/api/promotion/seckill";
import dayjs from "dayjs"; import dayjs from "dayjs";
import {TimeStatusEnum} from "@/sheep/util/const"; import {
TimeStatusEnum
} from "@/sheep/util/const";
// //
const { safeAreaInsets, safeArea } = sheep.$platform.device; const {
safeAreaInsets,
safeArea
} = sheep.$platform.device;
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2; const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
const pageHeight = (safeArea.height + safeAreaInsets.bottom) * 2 + statusBarHeight - sheep.$platform.navbar - 350; const pageHeight = (safeArea.height + safeAreaInsets.bottom) * 2 + statusBarHeight - sheep.$platform.navbar - 350;
const headerBg = sheep.$url.css('/static/img/shop/goods/seckill-header.png'); const headerBg = sheep.$url.css('/static/img/shop/goods/seckill-header.png');
// //
const goodsFields = { const goodsFields = {
name: { show: true }, name: {
introduction: { show: true }, show: true
price: { show: true }, },
marketPrice: { show: true }, introduction: {
show: true
},
price: {
show: true
},
marketPrice: {
show: true
},
}; };
//#region //#region
@ -127,25 +143,37 @@
const timeConfigList = ref([]) const timeConfigList = ref([])
// //
const getSeckillConfigList = async () => { const getSeckillConfigList = async () => {
const { data } = await SeckillApi.getSeckillConfigList() const {
data
} = await SeckillApi.getSeckillConfigList()
const now = dayjs(); const now = dayjs();
const today = now.format('YYYY-MM-DD') const today = now.format('YYYY-MM-DD')
const select = ref([])
console.log('数据', data)
// //
data.forEach((config, index) => { data.forEach((config, index) => {
const startTime = dayjs(`${today} ${config.startTime}`) const startTime = dayjs(`${today} ${config.startTime}`)
const endTime = dayjs(`${today} ${config.endTime}`) const endTime = dayjs(`${today} ${config.endTime}`)
select.value[index] = config.id;
if (now.isBefore(startTime)) { if (now.isBefore(startTime)) {
config.status = TimeStatusEnum.WAIT_START; config.status = TimeStatusEnum.WAIT_START;
// select.value[index] = config.id;
console.log('未开始',select.value,activeTimeIndex.value)
} else if (now.isAfter(endTime)) { } else if (now.isAfter(endTime)) {
config.status = TimeStatusEnum.END; config.status = TimeStatusEnum.END;
// select.value[index] = config.id;
console.log('已结束',select.value,activeTimeIndex.value)
} else { } else {
config.status = TimeStatusEnum.STARTED; config.status = TimeStatusEnum.STARTED;
activeTimeIndex.value = index; // select.value[index] = config.id;
activeTimeIndex.value = index
console.log('进行中',select.value,activeTimeIndex.value)
} }
}) })
timeConfigList.value = data timeConfigList.value = data
console.log('传递',select.value,activeTimeIndex.value)
// //
handleChangeTimeConfig(activeTimeIndex.value); handleChangeTimeConfig(activeTimeIndex.value, select.value[activeTimeIndex.value]);
// //
scrollToTimeConfig(activeTimeIndex.value) scrollToTimeConfig(activeTimeIndex.value)
} }
@ -159,11 +187,13 @@
// //
const activeTimeIndex = ref(0) // const activeTimeIndex = ref(0) //
const activeTimeConfig = computed(() => timeConfigList.value[activeTimeIndex.value]) // const activeTimeConfig = computed(() => timeConfigList.value[activeTimeIndex.value]) //
const handleChangeTimeConfig = (index) => { const handleChangeTimeConfig = (index, id) => {
console.log('点击',index + '+' + id)
activeTimeIndex.value = index activeTimeIndex.value = index
// //
activityPageParams.pageNo = 1 activityPageParams.pageNo = 1
activityPageParams.configId = id;
activityList.value = [] activityList.value = []
getActivityList(); getActivityList();
} }
@ -182,7 +212,7 @@
// //
const activityPageParams = reactive({ const activityPageParams = reactive({
id: 0, // ID configId: 0, // ID
pageNo: 1, // pageNo: 1, //
pageSize: 5, // pageSize: 5, //
}) })
@ -191,7 +221,9 @@
const loadStatus = ref('') // const loadStatus = ref('') //
async function getActivityList() { async function getActivityList() {
loadStatus.value = 'loading'; loadStatus.value = 'loading';
const { data } = await SeckillApi.getSeckillActivityPage(activityPageParams) const {
data
} = await SeckillApi.getSeckillActivityPage(activityPageParams)
data.list.forEach(activity => { data.list.forEach(activity => {
// //
activity.percent = parseInt(100 * (activity.totalStock - activity.stock) / activity.totalStock); activity.percent = parseInt(100 * (activity.totalStock - activity.stock) / activity.totalStock);
@ -235,7 +267,8 @@
margin: -276rpx auto 0 auto; margin: -276rpx auto 0 auto;
border-radius: 14rpx; border-radius: 14rpx;
overflow: hidden; overflow: hidden;
swiper{
swiper {
height: 330rpx !important; height: 330rpx !important;
border-radius: 14rpx; border-radius: 14rpx;
overflow: hidden; overflow: hidden;
@ -246,7 +279,8 @@
height: 100%; height: 100%;
border-radius: 14rpx; border-radius: 14rpx;
overflow: hidden; overflow: hidden;
img{
img {
border-radius: 14rpx; border-radius: 14rpx;
} }
} }
@ -257,10 +291,12 @@
width: 75rpx; width: 75rpx;
height: 70rpx; height: 70rpx;
} }
// //
.time-list { .time-list {
width: 596rpx; width: 596rpx;
white-space: nowrap; white-space: nowrap;
// //
.item { .item {
display: inline-block; display: inline-block;
@ -270,17 +306,20 @@
box-sizing: border-box; box-sizing: border-box;
margin-right: 30rpx; margin-right: 30rpx;
width: 130rpx; width: 130rpx;
// //
.time { .time {
font-size: 36rpx; font-size: 36rpx;
font-weight: 600; font-weight: 600;
color: #333; color: #333;
} }
// //
&.active { &.active {
.time { .time {
color: var(--ui-BG-Main); color: var(--ui-BG-Main);
} }
// //
.status { .status {
height: 30rpx; height: 30rpx;
@ -301,6 +340,7 @@
margin: 0 20rpx 0 20rpx; margin: 0 20rpx 0 20rpx;
background: #fff; background: #fff;
border-radius: 20rpx 20rpx 0 0; border-radius: 20rpx 20rpx 0 0;
.content-header { .content-header {
width: 100%; width: 100%;
border-radius: 20rpx 20rpx 0 0; border-radius: 20rpx 20rpx 0 0;
@ -312,6 +352,7 @@
height: 64rpx; height: 64rpx;
background: rgba($color: #fff, $alpha: 0.66); background: rgba($color: #fff, $alpha: 0.66);
border-radius: 32px; border-radius: 32px;
// //
.countdown-title { .countdown-title {
font-size: 28rpx; font-size: 28rpx;
@ -319,10 +360,12 @@
color: #333333; color: #333333;
line-height: 28rpx; line-height: 28rpx;
} }
// //
.countdown-time { .countdown-time {
font-size: 28rpx; font-size: 28rpx;
color: rgba(#ed3c30, 0.23); color: rgba(#ed3c30, 0.23);
// //
.countdown-h { .countdown-h {
font-size: 24rpx; font-size: 24rpx;
@ -334,6 +377,7 @@
background: rgba(#ed3c30, 0.23); background: rgba(#ed3c30, 0.23);
border-radius: 6rpx; border-radius: 6rpx;
} }
// //
.countdown-num { .countdown-num {
font-size: 24rpx; font-size: 24rpx;
@ -348,12 +392,15 @@
} }
} }
} }
// //
.scroll-box { .scroll-box {
height: 900rpx; height: 900rpx;
// //
.goods-box { .goods-box {
position: relative; position: relative;
// //
.cart-btn { .cart-btn {
position: absolute; position: absolute;
@ -373,6 +420,7 @@
color: #fff; color: #fff;
} }
} }
// //
.limit { .limit {
font-size: 22rpx; font-size: 22rpx;

View File

@ -207,7 +207,7 @@
// //
function onBuy(e) { function onBuy(e) {
if (!state.selectedSku.id) { if (!e.id) {
sheep.$helper.toast('请选择商品规格'); sheep.$helper.toast('请选择商品规格');
return; return;
} }
@ -536,7 +536,7 @@
} }
.disContT1 { .disContT1 {
width: 300rpx; width: 400rpx;
height: 50rpx; height: 50rpx;
// background-color: green; // background-color: green;
display: flex; display: flex;
@ -545,10 +545,10 @@
} }
.disContT2 { .disContT2 {
width: 300rpx; width: 200rpx;
height: 50rpx; height: 50rpx;
line-height: 50rpx; line-height: 50rpx;
// background-color: green; // background-color: gold;
font-size: 30rpx; font-size: 30rpx;
text-align: end; text-align: end;
color: white; color: white;

View File

@ -6,26 +6,13 @@
<!-- 骨架屏 --> <!-- 骨架屏 -->
<detailSkeleton v-if="state.skeletonLoading" /> <detailSkeleton v-if="state.skeletonLoading" />
<!-- 下架/售罄提醒 --> <!-- 下架/售罄提醒 -->
<s-empty <s-empty v-else-if="state.goodsInfo === null || state.goodsInfo.activity_type !== 'seckill'" text="活动不存在或已结束"
v-else-if="state.goodsInfo === null || state.goodsInfo.activity_type !== 'seckill'" icon="/static/soldout-empty.png" showAction actionText="再逛逛" actionUrl="/pages/goods/list" />
text="活动不存在或已结束"
icon="/static/soldout-empty.png"
showAction
actionText="再逛逛"
actionUrl="/pages/goods/list"
/>
<block v-else> <block v-else>
<view class="detail-swiper-selector"> <view class="detail-swiper-selector">
<!-- 商品图轮播 --> <!-- 商品图轮播 -->
<su-swiper <su-swiper class="ss-m-b-14" isPreview :list="state.goodsSwiper" dotStyle="tag" imageMode="widthFix"
class="ss-m-b-14" dotCur="bg-mask-40" :seizeHeight="750" />
isPreview
:list="state.goodsSwiper"
dotStyle="tag"
imageMode="widthFix"
dotCur="bg-mask-40"
:seizeHeight="750"
/>
<!-- 价格+标题 --> <!-- 价格+标题 -->
<view class="title-card ss-m-y-14 ss-m-x-20 ss-p-x-20 ss-p-y-34"> <view class="title-card ss-m-y-14 ss-m-x-20 ss-p-x-20 ss-p-y-34">
@ -72,14 +59,9 @@
<detail-cell-sku :sku="state.selectedSku" @tap="state.showSelectSku = true" /> <detail-cell-sku :sku="state.selectedSku" @tap="state.showSelectSku = true" />
</view> </view>
<!-- 规格与数量弹框 --> <!-- 规格与数量弹框 -->
<s-select-seckill-sku <s-select-seckill-sku v-model="state.goodsInfo" :show="state.showSelectSku"
v-model="state.goodsInfo" :single-limit-count="activity.singleLimitCount" @buy="onBuy" @change="onSkuChange"
:show="state.showSelectSku" @close="state.showSelectSku = false" />
:single-limit-count="activity.singleLimitCount"
@buy="onBuy"
@change="onSkuChange"
@close="state.showSelectSku = false"
/>
</view> </view>
<!-- 评价 --> <!-- 评价 -->
@ -91,36 +73,25 @@
<detail-tabbar v-model="state.goodsInfo"> <detail-tabbar v-model="state.goodsInfo">
<!-- TODO: 缺货中 已售罄 判断 设计--> <!-- TODO: 缺货中 已售罄 判断 设计-->
<view class="buy-box ss-flex ss-col-center ss-p-r-20"> <view class="buy-box ss-flex ss-col-center ss-p-r-20">
<button <button class="ss-reset-button origin-price-btn ss-flex-col" v-if="state.goodsInfo.marketPrice"
class="ss-reset-button origin-price-btn ss-flex-col" @tap="sheep.$router.go('/pages/goods/index', { id: state.goodsInfo.id })">
v-if="state.goodsInfo.marketPrice"
@tap="sheep.$router.go('/pages/goods/index', { id: state.goodsInfo.id })"
>
<view> <view>
<view class="btn-price">{{ fen2yuan(state.goodsInfo.marketPrice) }}</view> <view class="btn-price">{{ fen2yuan(state.goodsInfo.marketPrice) }}</view>
<view>原价购买</view> <view>原价购买</view>
</view> </view>
</button> </button>
<button v-else class="ss-reset-button origin-price-btn ss-flex-col"> <button v-else class="ss-reset-button origin-price-btn ss-flex-col">
<view <view class="no-original" :class="
class="no-original"
:class="
state.goodsInfo.stock === 0 || timeStatusEnum !== TimeStatusEnum.STARTED ? '' : '' state.goodsInfo.stock === 0 || timeStatusEnum !== TimeStatusEnum.STARTED ? '' : ''
" ">
>
秒杀价 秒杀价
</view> </view>
</button> </button>
<button <button class="ss-reset-button btn-box ss-flex-col" @tap="state.showSelectSku = true" :class="
class="ss-reset-button btn-box ss-flex-col"
@tap="state.showSelectSku = true"
:class="
timeStatusEnum === TimeStatusEnum.STARTED && state.goodsInfo.stock != 0 timeStatusEnum === TimeStatusEnum.STARTED && state.goodsInfo.stock != 0
? 'check-btn-box' ? 'check-btn-box'
: 'disabled-btn-box' : 'disabled-btn-box'
" " :disabled="state.goodsInfo.stock === 0 || timeStatusEnum !== TimeStatusEnum.STARTED">
:disabled="state.goodsInfo.stock === 0 || timeStatusEnum !== TimeStatusEnum.STARTED"
>
<view class="btn-price">{{ fen2yuan(state.goodsInfo.price) }}</view> <view class="btn-price">{{ fen2yuan(state.goodsInfo.price) }}</view>
<view v-if="timeStatusEnum === TimeStatusEnum.STARTED"> <view v-if="timeStatusEnum === TimeStatusEnum.STARTED">
<view v-if="state.goodsInfo.stock === 0"></view> <view v-if="state.goodsInfo.stock === 0"></view>
@ -135,11 +106,26 @@
</template> </template>
<script setup> <script setup>
import { reactive, computed, ref, unref } from 'vue'; import {
import { onLoad, onPageScroll } from '@dcloudio/uni-app'; reactive,
computed,
ref,
unref
} from 'vue';
import {
onLoad,
onPageScroll
} from '@dcloudio/uni-app';
import sheep from '@/sheep'; import sheep from '@/sheep';
import { isEmpty, min } from 'lodash-es'; import {
import { useDurationTime, formatGoodsSwiper, fen2yuan } from '@/sheep/hooks/useGoods'; isEmpty,
min
} from 'lodash-es';
import {
useDurationTime,
formatGoodsSwiper,
fen2yuan
} from '@/sheep/hooks/useGoods';
import detailNavbar from './components/detail/detail-navbar.vue'; import detailNavbar from './components/detail/detail-navbar.vue';
import detailCellSku from './components/detail/detail-cell-sku.vue'; import detailCellSku from './components/detail/detail-cell-sku.vue';
import detailTabbar from './components/detail/detail-tabbar.vue'; import detailTabbar from './components/detail/detail-tabbar.vue';
@ -149,7 +135,10 @@
import detailProgress from './components/detail/detail-progress.vue'; import detailProgress from './components/detail/detail-progress.vue';
import SeckillApi from '@/sheep/api/promotion/seckill'; import SeckillApi from '@/sheep/api/promotion/seckill';
import SpuApi from '@/sheep/api/product/spu'; import SpuApi from '@/sheep/api/product/spu';
import { getTimeStatusEnum, TimeStatusEnum } from '@/sheep/util/const'; import {
getTimeStatusEnum,
TimeStatusEnum
} from '@/sheep/util/const';
const headerBg = sheep.$url.css('/static/img/shop/goods/seckill-bg.png'); const headerBg = sheep.$url.css('/static/img/shop/goods/seckill-bg.png');
const btnBg = sheep.$url.css('/static/img/shop/goods/seckill-btn.png'); const btnBg = sheep.$url.css('/static/img/shop/goods/seckill-btn.png');
@ -186,12 +175,10 @@
order_type: 'goods', order_type: 'goods',
buy_type: 'seckill', buy_type: 'seckill',
seckillActivityId: activity.value.id, seckillActivityId: activity.value.id,
items: [ items: [{
{
skuId: sku.id, skuId: sku.id,
count: sku.count, count: sku.count,
}, }, ],
],
}), }),
}); });
} }
@ -199,23 +186,20 @@
// //
const shareInfo = computed(() => { const shareInfo = computed(() => {
if (isEmpty(unref(activity))) return {}; if (isEmpty(unref(activity))) return {};
return sheep.$platform.share.getShareInfo( return sheep.$platform.share.getShareInfo({
{
title: activity.value.name, title: activity.value.name,
image: sheep.$url.cdn(state.goodsInfo.picUrl), image: sheep.$url.cdn(state.goodsInfo.picUrl),
params: { params: {
page: '4', page: '4',
query: activity.value.id, query: activity.value.id,
}, },
}, }, {
{
type: 'goods', // type: 'goods', //
title: activity.value.name, // title: activity.value.name, //
image: sheep.$url.cdn(state.goodsInfo.picUrl), // image: sheep.$url.cdn(state.goodsInfo.picUrl), //
price: state.goodsInfo.price, // price: state.goodsInfo.price, //
marketPrice: state.goodsInfo.marketPrice, // marketPrice: state.goodsInfo.marketPrice, //
}, }, );
);
}); });
const activity = ref(); const activity = ref();
@ -223,9 +207,12 @@
// //
const getActivity = async (id) => { const getActivity = async (id) => {
const { data } = await SeckillApi.getSeckillActivity(id); const {
data
} = await SeckillApi.getSeckillActivity(id);
activity.value = data; activity.value = data;
timeStatusEnum.value = getTimeStatusEnum(activity.startTime, activity.endTime); timeStatusEnum.value = getTimeStatusEnum(activity.value.startTime, activity.value.endTime);
console.log('处理后',timeStatusEnum.value)
state.percent = 100 - data.stock / data.totalStock * 100; state.percent = 100 - data.stock / data.totalStock * 100;
// //
await getSpu(data.spuId); await getSpu(data.spuId);
@ -233,7 +220,9 @@
// //
const getSpu = async (id) => { const getSpu = async (id) => {
const { data } = await SpuApi.getSpuDetail(id); const {
data
} = await SpuApi.getSpuDetail(id);
data.activity_type = 'seckill'; data.activity_type = 'seckill';
state.goodsInfo = data; state.goodsInfo = data;
// //
@ -266,7 +255,7 @@
}); });
state.skeletonLoading = false; state.skeletonLoading = false;
console.log('shuju',state) console.log('shuju', state)
}; };
onLoad((options) => { onLoad((options) => {
@ -285,6 +274,7 @@
.disabled-btn-box[disabled] { .disabled-btn-box[disabled] {
background-color: transparent; background-color: transparent;
} }
.detail-card { .detail-card {
background-color: $white; background-color: $white;
margin: 14rpx 20rpx; margin: 14rpx 20rpx;
@ -375,6 +365,7 @@
font-size: 26rpx; font-size: 26rpx;
font-weight: 500; font-weight: 500;
color: #ffffff; color: #ffffff;
.countdown-h { .countdown-h {
font-size: 24rpx; font-size: 24rpx;
font-family: OPPOSANS; font-family: OPPOSANS;
@ -385,6 +376,7 @@
background: rgba(#000000, 0.1); background: rgba(#000000, 0.1);
border-radius: 6rpx; border-radius: 6rpx;
} }
.countdown-num { .countdown-num {
font-size: 24rpx; font-size: 24rpx;
font-family: OPPOSANS; font-family: OPPOSANS;
@ -468,6 +460,7 @@
line-height: normal; line-height: normal;
border-radius: 0px 40rpx 40rpx 0px; border-radius: 0px 40rpx 40rpx 0px;
} }
.btn-price { .btn-price {
font-family: OPPOSANS; font-family: OPPOSANS;
@ -485,6 +478,7 @@
line-height: normal; line-height: normal;
font-size: 24rpx; font-size: 24rpx;
font-weight: 500; font-weight: 500;
.no-original { .no-original {
font-size: 28rpx; font-size: 28rpx;
} }

View File

@ -1,30 +1,18 @@
<template> <template>
<s-layout title="确认订单"> <s-layout title="确认订单">
<!-- 头部地址选择配送地址自提地址 --> <!-- 头部地址选择配送地址自提地址 -->
<AddressSelection v-model="addressState" @change="getOrderInfo()"/> <AddressSelection v-model="addressState" @change="getOrderInfo()" />
<!-- 商品信息 --> <!-- 商品信息 -->
<view class="order-card-box ss-m-b-14"> <view class="order-card-box ss-m-b-14">
<s-goods-item <s-goods-item v-for="item in state.orderInfo.items" :key="item.skuId" :img="item.picUrl"
v-for="item in state.orderInfo.items" :title="item.spuName" :skuText="item.properties.map((property) => property.valueName).join(' ')"
:key="item.skuId" :price="item.price" :num="item.count" marginBottom="10" />
:img="item.picUrl"
:title="item.spuName"
:skuText="item.properties.map((property) => property.valueName).join(' ')"
:price="item.price"
:num="item.count"
marginBottom="10"
/>
<view class="order-item ss-flex ss-col-center ss-row-between ss-p-x-20 bg-white ss-r-10"> <view class="order-item ss-flex ss-col-center ss-row-between ss-p-x-20 bg-white ss-r-10">
<view class="item-title">订单备注</view> <view class="item-title">订单备注</view>
<view class="ss-flex ss-col-center"> <view class="ss-flex ss-col-center">
<uni-easyinput <uni-easyinput maxlength="20" placeholder="建议留言前先与商家沟通" v-model="state.orderPayload.remark"
maxlength="20" :inputBorder="false" :clearable="false" />
placeholder="建议留言前先与商家沟通"
v-model="state.orderPayload.remark"
:inputBorder="false"
:clearable="false"
/>
</view> </view>
</view> </view>
</view> </view>
@ -40,22 +28,17 @@
</text> </text>
</view> </view>
</view> </view>
<view <view class="order-item ss-flex ss-col-center ss-row-between" v-if="state.orderInfo.type === 0">
class="order-item ss-flex ss-col-center ss-row-between"
v-if="state.orderInfo.type === 0"
>
<view class="item-title">积分抵扣</view> <view class="item-title">积分抵扣</view>
<view class="ss-flex ss-col-center"> <view class="ss-flex ss-col-center">
{{ state.pointStatus ? '剩余积分' : '当前积分' }} {{ state.pointStatus ? '剩余积分' : '当前积分' }}
<image <image :src="sheep.$url.static('/static/img/shop/goods/score1.svg')" class="score-img" />
:src="sheep.$url.static('/static/img/shop/goods/score1.svg')"
class="score-img"
/>
<text class="item-value ss-m-r-24"> <text class="item-value ss-m-r-24">
{{ state.pointStatus ? state.orderInfo.totalPoint - state.orderInfo.usePoint : (state.orderInfo.totalPoint || 0) }} {{ state.pointStatus ? state.orderInfo.totalPoint - state.orderInfo.usePoint : (state.orderInfo.totalPoint || 0) }}
</text> </text>
<checkbox-group @change="changeIntegral"> <checkbox-group @change="changeIntegral">
<checkbox :checked='state.pointStatus' :disabled="!state.orderInfo.totalPoint || state.orderInfo.totalPoint <= 0" /> <checkbox :checked='state.pointStatus'
:disabled="!state.orderInfo.totalPoint || state.orderInfo.totalPoint <= 0" />
</checkbox-group> </checkbox-group>
</view> </view>
</view> </view>
@ -73,42 +56,25 @@
<view class="order-item ss-flex ss-col-center ss-row-between" v-if='addressState.deliveryType === 2'> <view class="order-item ss-flex ss-col-center ss-row-between" v-if='addressState.deliveryType === 2'>
<view class="item-title">联系人</view> <view class="item-title">联系人</view>
<view class="ss-flex ss-col-center"> <view class="ss-flex ss-col-center">
<uni-easyinput <uni-easyinput maxlength="20" placeholder="请填写您的联系姓名" v-model="addressState.receiverName"
maxlength="20" :inputBorder="false" :clearable="false" />
placeholder="请填写您的联系姓名"
v-model="addressState.receiverName"
:inputBorder="false"
:clearable="false"
/>
</view> </view>
</view> </view>
<view class="order-item ss-flex ss-col-center ss-row-between" v-if='addressState.deliveryType === 2'> <view class="order-item ss-flex ss-col-center ss-row-between" v-if='addressState.deliveryType === 2'>
<view class="item-title">联系电话</view> <view class="item-title">联系电话</view>
<view class="ss-flex ss-col-center"> <view class="ss-flex ss-col-center">
<uni-easyinput <uni-easyinput maxlength="20" placeholder="请填写您的联系电话" v-model="addressState.receiverMobile"
maxlength="20" :inputBorder="false" :clearable="false" />
placeholder="请填写您的联系电话"
v-model="addressState.receiverMobile"
:inputBorder="false"
:clearable="false"
/>
</view> </view>
</view> </view>
<!-- 优惠劵只有 type = 0 普通订单非拼团秒杀砍价才可以使用优惠劵 --> <!-- 优惠劵只有 type = 0 普通订单非拼团秒杀砍价才可以使用优惠劵 -->
<view <view class="order-item ss-flex ss-col-center ss-row-between" v-if="state.orderInfo.type === 0">
class="order-item ss-flex ss-col-center ss-row-between"
v-if="state.orderInfo.type === 0"
>
<view class="item-title">优惠券</view> <view class="item-title">优惠券</view>
<view class="ss-flex ss-col-center" @tap="state.showCoupon = true"> <view class="ss-flex ss-col-center" @tap="state.showCoupon = true">
<text class="item-value text-red" v-if="state.orderPayload.couponId > 0"> <text class="item-value text-red" v-if="state.orderPayload.couponId > 0">
-{{ fen2yuan(state.orderInfo.price.couponPrice) }} -{{ fen2yuan(state.orderInfo.price.couponPrice) }}
</text> </text>
<text <text class="item-value" :class="couponNumber > 0 ? 'text-red' : 'text-disabled'" v-else>
class="item-value"
:class="couponNumber > 0 ? 'text-red' : 'text-disabled'"
v-else
>
{{ {{
couponNumber > 0 ? couponNumber + ' 张可用' : '暂无可用优惠券' couponNumber > 0 ? couponNumber + ' 张可用' : '暂无可用优惠券'
}} }}
@ -116,10 +82,8 @@
<text class="_icon-forward item-icon" /> <text class="_icon-forward item-icon" />
</view> </view>
</view> </view>
<view <view class="order-item ss-flex ss-col-center ss-row-between"
class="order-item ss-flex ss-col-center ss-row-between" v-if="state.orderInfo.price.discountPrice > 0">
v-if="state.orderInfo.price.discountPrice > 0"
>
<view class="item-title">活动优惠</view> <view class="item-title">活动优惠</view>
<view class="ss-flex ss-col-center" @tap="state.showDiscount = true"> <view class="ss-flex ss-col-center" @tap="state.showDiscount = true">
<text class="item-value text-red"> <text class="item-value text-red">
@ -128,10 +92,7 @@
<text class="_icon-forward item-icon" /> <text class="_icon-forward item-icon" />
</view> </view>
</view> </view>
<view <view class="order-item ss-flex ss-col-center ss-row-between" v-if="state.orderInfo.price.vipPrice > 0">
class="order-item ss-flex ss-col-center ss-row-between"
v-if="state.orderInfo.price.vipPrice > 0"
>
<view class="item-title">会员优惠</view> <view class="item-title">会员优惠</view>
<view class="ss-flex ss-col-center"> <view class="ss-flex ss-col-center">
<text class="item-value text-red"> <text class="item-value text-red">
@ -150,19 +111,11 @@
</view> </view>
<!-- 选择优惠券弹框 --> <!-- 选择优惠券弹框 -->
<s-coupon-select <s-coupon-select v-model="state.couponInfo" :show="state.showCoupon" @confirm="onSelectCoupon"
v-model="state.couponInfo" @close="state.showCoupon = false" />
:show="state.showCoupon"
@confirm="onSelectCoupon"
@close="state.showCoupon = false"
/>
<!-- 满额折扣弹框 TODO 芋艿后续要把优惠信息打进去 --> <!-- 满额折扣弹框 TODO 芋艿后续要把优惠信息打进去 -->
<s-discount-list <s-discount-list v-model="state.orderInfo" :show="state.showDiscount" @close="state.showDiscount = false" />
v-model="state.orderInfo"
:show="state.showDiscount"
@close="state.showDiscount = false"
/>
<!-- 底部 --> <!-- 底部 -->
<su-fixed bottom :opacity="false" bg="bg-white" placeholder :noFixed="false" :index="200"> <su-fixed bottom :opacity="false" bg="bg-white" placeholder :noFixed="false" :index="200">
@ -172,10 +125,7 @@
{{ fen2yuan(state.orderInfo.price.payPrice) }} {{ fen2yuan(state.orderInfo.price.payPrice) }}
</view> </view>
</view> </view>
<button <button class="ss-reset-button ui-BG-Main-Gradient ss-r-40 submit-btn ui-Shadow-Main" @tap="onConfirm">
class="ss-reset-button ui-BG-Main-Gradient ss-r-40 submit-btn ui-Shadow-Main"
@tap="onConfirm"
>
提交订单 提交订单
</button> </button>
</view> </view>
@ -184,13 +134,20 @@
</template> </template>
<script setup> <script setup>
import { reactive, ref } from 'vue'; import {
import { onLoad } from '@dcloudio/uni-app'; reactive,
ref
} from 'vue';
import {
onLoad
} from '@dcloudio/uni-app';
import AddressSelection from '@/pages/order/addressSelection.vue'; import AddressSelection from '@/pages/order/addressSelection.vue';
import sheep from '@/sheep'; import sheep from '@/sheep';
import OrderApi from '@/sheep/api/trade/order'; import OrderApi from '@/sheep/api/trade/order';
import CouponApi from '@/sheep/api/promotion/coupon'; import CouponApi from '@/sheep/api/promotion/coupon';
import { fen2yuan } from '@/sheep/hooks/useGoods'; import {
fen2yuan
} from '@/sheep/hooks/useGoods';
const state = reactive({ const state = reactive({
orderPayload: {}, orderPayload: {},
@ -259,15 +216,18 @@
// & // &
async function submitOrder() { async function submitOrder() {
const { code, data } = await OrderApi.createOrder({ const {
code,
data
} = await OrderApi.createOrder({
items: state.orderPayload.items, items: state.orderPayload.items,
couponId: state.orderPayload.couponId, couponId: state.orderPayload.couponId,
remark: state.orderPayload.remark, remark: state.orderPayload.remark,
deliveryType: addressState.value.deliveryType, deliveryType: addressState.value.deliveryType,
addressId: addressState.value.addressInfo.id, // addressId: addressState.value.addressInfo.id, //
pickUpStoreId: addressState.value.pickUpInfo.id,// pickUpStoreId: addressState.value.pickUpInfo.id, //
receiverName: addressState.value.receiverName,// receiverName: addressState.value.receiverName, //
receiverMobile: addressState.value.receiverMobile,// receiverMobile: addressState.value.receiverMobile, //
pointStatus: state.pointStatus, pointStatus: state.pointStatus,
combinationActivityId: state.orderPayload.combinationActivityId, combinationActivityId: state.orderPayload.combinationActivityId,
combinationHeadId: state.orderPayload.combinationHeadId, combinationHeadId: state.orderPayload.combinationHeadId,
@ -290,20 +250,28 @@
// & // &
async function getOrderInfo() { async function getOrderInfo() {
// //
const { data, code } = await OrderApi.settlementOrder({ const {
data,
code
} = await OrderApi.settlementOrder({
items: state.orderPayload.items, items: state.orderPayload.items,
couponId: state.orderPayload.couponId, couponId: state.orderPayload.couponId,
deliveryType: addressState.value.deliveryType, deliveryType: addressState.value.deliveryType,
addressId: addressState.value.addressInfo.id, // addressId: addressState.value.addressInfo.id, //
pickUpStoreId: addressState.value.pickUpInfo.id,// pickUpStoreId: addressState.value.pickUpInfo.id, //
receiverName: addressState.value.receiverName,// receiverName: addressState.value.receiverName, //
receiverMobile: addressState.value.receiverMobile,// receiverMobile: addressState.value.receiverMobile, //
pointStatus: state.pointStatus, pointStatus: state.pointStatus,
combinationActivityId: state.orderPayload.combinationActivityId, combinationActivityId: state.orderPayload.combinationActivityId,
combinationHeadId: state.orderPayload.combinationHeadId, combinationHeadId: state.orderPayload.combinationHeadId,
seckillActivityId: state.orderPayload.seckillActivityId, seckillActivityId: state.orderPayload.seckillActivityId,
}); });
if (code !== 0) { if (code !== 0) {
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 1500)
return; return;
} }
state.orderInfo = data; state.orderInfo = data;
@ -316,7 +284,10 @@
// //
let couponNumber = ref(0) let couponNumber = ref(0)
async function getCoupons() { async function getCoupons() {
const { code, data } = await CouponApi.getMatchCouponList( const {
code,
data
} = await CouponApi.getMatchCouponList(
state.orderInfo.price.payPrice, state.orderInfo.price.payPrice,
state.orderInfo.items.map((item) => item.spuId), state.orderInfo.items.map((item) => item.spuId),
state.orderPayload.items.map((item) => item.skuId), state.orderPayload.items.map((item) => item.skuId),
@ -336,7 +307,7 @@
state.orderPayload = JSON.parse(options.data); state.orderPayload = JSON.parse(options.data);
await getOrderInfo(); await getOrderInfo();
await getCoupons(); await getCoupons();
console.log('数据',state) console.log('数据', state)
}); });
</script> </script>

View File

@ -2,21 +2,12 @@
<template> <template>
<s-layout title="我的订单"> <s-layout title="我的订单">
<su-sticky bgColor="#fff"> <su-sticky bgColor="#fff">
<su-tabs <su-tabs :list="tabMaps" :scrollable="false" @change="onTabsChange" :current="state.currentTab" />
:list="tabMaps"
:scrollable="false"
@change="onTabsChange"
:current="state.currentTab"
/>
</su-sticky> </su-sticky>
<s-empty v-if="state.pagination.total === 0" icon="/static/order-empty.png" text="暂无订单" /> <s-empty v-if="state.pagination.total === 0" icon="/static/order-empty.png" text="暂无订单" />
<view v-if="state.pagination.total > 0"> <view v-if="state.pagination.total > 0">
<view <view class="bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20" v-for="order in state.pagination.list"
class="bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20" :key="order.id" @tap="onOrderDetail(order.id)">
v-for="order in state.pagination.list"
:key="order.id"
@tap="onOrderDetail(order.id)"
>
<view class="order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20"> <view class="order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20">
<view class="order-no">订单号{{ order.no }}</view> <view class="order-no">订单号{{ order.no }}</view>
<view class="order-state ss-font-26" :class="formatOrderColor(order)"> <view class="order-state ss-font-26" :class="formatOrderColor(order)">
@ -24,81 +15,49 @@
</view> </view>
</view> </view>
<view class="border-bottom" v-for="item in order.items" :key="item.id"> <view class="border-bottom" v-for="item in order.items" :key="item.id">
<s-goods-item <s-goods-item :img="item.picUrl" :title="item.spuName"
:img="item.picUrl" :skuText="item.properties.map((property) => property.valueName).join(' ')" :price="item.price"
:title="item.spuName" :num="item.count" />
:skuText="item.properties.map((property) => property.valueName).join(' ')"
:price="item.price"
:num="item.count"
/>
</view> </view>
<view class="pay-box ss-m-t-30 ss-flex ss-row-right ss-p-r-20"> <view class="pay-box ss-m-t-30 ss-flex ss-row-right ss-p-r-20">
<view class="ss-flex ss-col-center"> <view class="ss-flex ss-col-center">
<view class="discounts-title pay-color" <view class="discounts-title pay-color"> {{ order.productCount }} 件商品,总金额:</view>
> {{ order.productCount }} 件商品,总金额:</view
>
<view class="discounts-money pay-color"> {{ fen2yuan(order.payPrice) }} </view> <view class="discounts-money pay-color"> {{ fen2yuan(order.payPrice) }} </view>
</view> </view>
</view> </view>
<view <view class="order-card-footer ss-flex ss-col-center ss-p-x-20"
class="order-card-footer ss-flex ss-col-center ss-p-x-20" :class="order.buttons.length > 3 ? 'ss-row-between' : 'ss-row-right'">
:class="order.buttons.length > 3 ? 'ss-row-between' : 'ss-row-right'"
>
<view class="ss-flex ss-col-center"> <view class="ss-flex ss-col-center">
<button <button v-if="order.buttons.includes('combination') && order.status !== 0 && order.status !== 40" class="tool-btn ss-reset-button"
v-if="order.buttons.includes('combination')" @tap.stop="onOrderGroupon(order)">
class="tool-btn ss-reset-button"
@tap.stop="onOrderGroupon(order)"
>
拼团详情 拼团详情
</button> </button>
<button <button v-if="order.buttons.length === 0" class="tool-btn ss-reset-button"
v-if="order.buttons.length === 0" @tap.stop="onOrderDetail(order.id)">
class="tool-btn ss-reset-button"
@tap.stop="onOrderDetail(order.id)"
>
查看详情 查看详情
</button> </button>
<button <button v-if="order.buttons.includes('confirm')" class="tool-btn ss-reset-button"
v-if="order.buttons.includes('confirm')" @tap.stop="onConfirm(order)">
class="tool-btn ss-reset-button"
@tap.stop="onConfirm(order)"
>
确认收货 确认收货
</button> </button>
<button <button v-if="order.buttons.includes('express')" class="tool-btn ss-reset-button"
v-if="order.buttons.includes('express')" @tap.stop="onExpress(order.id)">
class="tool-btn ss-reset-button"
@tap.stop="onExpress(order.id)"
>
查看物流 查看物流
</button> </button>
<button <button v-if="order.buttons.includes('cancel')" class="tool-btn ss-reset-button"
v-if="order.buttons.includes('cancel')" @tap.stop="onCancel(order.id)">
class="tool-btn ss-reset-button"
@tap.stop="onCancel(order.id)"
>
取消订单 取消订单
</button> </button>
<button <button v-if="order.buttons.includes('comment')" class="tool-btn ss-reset-button"
v-if="order.buttons.includes('comment')" @tap.stop="onComment(order.id)">
class="tool-btn ss-reset-button"
@tap.stop="onComment(order.id)"
>
评价 评价
</button> </button>
<button <button v-if="order.buttons.includes('delete')" class="delete-btn ss-reset-button"
v-if="order.buttons.includes('delete')" @tap.stop="onDelete(order.id)">
class="delete-btn ss-reset-button"
@tap.stop="onDelete(order.id)"
>
删除订单 删除订单
</button> </button>
<button <button v-if="order.buttons.includes('pay')"
v-if="order.buttons.includes('pay')" class="tool-btn ss-reset-button ui-BG-Main-Gradient" @tap.stop="onPay(order.payOrderId)">
class="tool-btn ss-reset-button ui-BG-Main-Gradient"
@tap.stop="onPay(order.payOrderId)"
>
继续支付 继续支付
</button> </button>
</view> </view>
@ -107,20 +66,21 @@
</view> </view>
<!-- 加载更多 --> <!-- 加载更多 -->
<uni-load-more <uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
v-if="state.pagination.total > 0"
:status="state.loadStatus"
:content-text="{
contentdown: '上拉加载更多', contentdown: '上拉加载更多',
}" }" @tap="loadMore" />
@tap="loadMore"
/>
</s-layout> </s-layout>
</template> </template>
<script setup> <script setup>
import { reactive } from 'vue'; import {
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'; reactive
} from 'vue';
import {
onLoad,
onReachBottom,
onPullDownRefresh
} from '@dcloudio/uni-app';
import { import {
fen2yuan, fen2yuan,
formatOrderColor, formatOrderColor,
@ -129,9 +89,13 @@
} from '@/sheep/hooks/useGoods'; } from '@/sheep/hooks/useGoods';
import sheep from '@/sheep'; import sheep from '@/sheep';
import _ from 'lodash-es'; import _ from 'lodash-es';
import { isEmpty } from 'lodash-es'; import {
isEmpty
} from 'lodash-es';
import OrderApi from '@/sheep/api/trade/order'; import OrderApi from '@/sheep/api/trade/order';
import { resetPagination } from '@/sheep/util'; import {
resetPagination
} from '@/sheep/util';
// //
const state = reactive({ const state = reactive({
@ -145,8 +109,7 @@
loadStatus: '', loadStatus: '',
}); });
const tabMaps = [ const tabMaps = [{
{
name: '全部', name: '全部',
}, },
{ {
@ -224,7 +187,9 @@
} }
// //
const { code } = await OrderApi.receiveOrder(order.id); const {
code
} = await OrderApi.receiveOrder(order.id);
if (code === 0) { if (code === 0) {
resetPagination(state.pagination); resetPagination(state.pagination);
await getOrderList(); await getOrderList();
@ -275,11 +240,13 @@
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '确定要取消订单吗?', content: '确定要取消订单吗?',
success: async function (res) { success: async function(res) {
if (!res.confirm) { if (!res.confirm) {
return; return;
} }
const { code } = await OrderApi.cancelOrder(orderId); const {
code
} = await OrderApi.cancelOrder(orderId);
if (code === 0) { if (code === 0) {
// //
let index = state.pagination.list.findIndex((order) => order.id === orderId); let index = state.pagination.list.findIndex((order) => order.id === orderId);
@ -296,9 +263,11 @@
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '确定要删除订单吗?', content: '确定要删除订单吗?',
success: async function (res) { success: async function(res) {
if (res.confirm) { if (res.confirm) {
const { code } = await OrderApi.deleteOrder(orderId); const {
code
} = await OrderApi.deleteOrder(orderId);
if (code === 0) { if (code === 0) {
// //
let index = state.pagination.list.findIndex((order) => order.id === orderId); let index = state.pagination.list.findIndex((order) => order.id === orderId);
@ -312,7 +281,10 @@
// //
async function getOrderList() { async function getOrderList() {
state.loadStatus = 'loading'; state.loadStatus = 'loading';
let { code, data } = await OrderApi.getOrderPage({ let {
code,
data
} = await OrderApi.getOrderPage({
pageNo: state.pagination.pageNo, pageNo: state.pagination.pageNo,
pageSize: state.pagination.pageSize, pageSize: state.pagination.pageSize,
status: tabMaps[state.currentTab].value, status: tabMaps[state.currentTab].value,
@ -352,7 +324,7 @@
onPullDownRefresh(() => { onPullDownRefresh(() => {
resetPagination(state.pagination); resetPagination(state.pagination);
getOrderList(); getOrderList();
setTimeout(function () { setTimeout(function() {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, 800); }, 800);
}); });
@ -421,8 +393,7 @@
font-weight: 500; font-weight: 500;
} }
.order-state { .order-state {}
}
} }
.pay-box { .pay-box {

View File

@ -3,7 +3,7 @@
<su-popup :show="show" type="bottom" round="20" @close="emits('close')" showClose> <su-popup :show="show" type="bottom" round="20" @close="emits('close')" showClose>
<view class="model-box"> <view class="model-box">
<view class="title ss-m-t-16 ss-m-l-20 ss-flex">优惠</view> <view class="title ss-m-t-16 ss-m-l-20 ss-flex">优惠</view>
<view v-if="state.activityMap.length"> <view v-if="state.activityMap[state.activityInfo[0]?.id]?.reduc">
<view class="titleLi">促销</view> <view class="titleLi">促销</view>
<scroll-view class="model-content" scroll-y :scroll-with-animation="false" :enable-back-to-top="true"> <scroll-view class="model-content" scroll-y :scroll-with-animation="false" :enable-back-to-top="true">
<view class="actBox"> <view class="actBox">

View File

@ -124,6 +124,7 @@
// //
function onAddCart() { function onAddCart() {
console.log('购物车',state.selectedSku)
if (state.selectedSku.id <= 0) { if (state.selectedSku.id <= 0) {
sheep.$helper.toast('请选择规格'); sheep.$helper.toast('请选择规格');
return; return;

View File

@ -100,6 +100,7 @@ export const WxaSubscribeTemplate = {
export const getTimeStatusEnum = (startTime, endTime) => { export const getTimeStatusEnum = (startTime, endTime) => {
const now = dayjs(); const now = dayjs();
console.log('处理的数据',now,startTime,endTime)
if (now.isBefore(startTime)) { if (now.isBefore(startTime)) {
return TimeStatusEnum.WAIT_START; return TimeStatusEnum.WAIT_START;
} else if (now.isAfter(endTime)) { } else if (now.isAfter(endTime)) {