团购已结束,未开始显示处理
订单待支付数量显示
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
<text>{{ groupBuyBean?.payPrice || 0 }}</text>
|
<text>{{ groupBuyBean?.payPrice || 0 }}</text>
|
||||||
<text>¥{{ groupBuyBean?.price || 0 }}</text>
|
<text>¥{{ groupBuyBean?.price || 0 }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class='countdown-time c-flex-column'>
|
<view v-if='isPending()' class='countdown-time c-flex-column'>
|
||||||
<view class='c-flex-row'>{{ countdownTime?.days || 0 }}天
|
<view class='c-flex-row'>{{ countdownTime?.days || 0 }}天
|
||||||
<text class='time'>{{ countdownTime?.hours || '00' }}</text>
|
<text class='time'>{{ countdownTime?.hours || '00' }}</text>
|
||||||
:
|
:
|
||||||
@@ -29,6 +29,11 @@
|
|||||||
</view>
|
</view>
|
||||||
<text>距离活动结束仅剩</text>
|
<text>距离活动结束仅剩</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else>
|
||||||
|
<text style='font-size: 35rpx;color: #FFFFFF'>
|
||||||
|
{{ isNotStated() ? '未开始' : '已结束' }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class='goods-info-view c-flex-column'>
|
<view class='goods-info-view c-flex-column'>
|
||||||
@@ -38,7 +43,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class='c-flex-row'>
|
<view class='c-flex-row'>
|
||||||
<text style='flex: 1'>{{ groupBuyBean?.name }}</text>
|
<text style='flex: 1'>{{ groupBuyBean?.name || '未知' }}</text>
|
||||||
<view class='share-button c-flex-column'>
|
<view class='share-button c-flex-column'>
|
||||||
<image :src='assetsUrl("ic_share.png")'></image>
|
<image :src='assetsUrl("ic_share.png")'></image>
|
||||||
<button class='btn' plain open-type='share'>分享</button>
|
<button class='btn' plain open-type='share'>分享</button>
|
||||||
@@ -55,14 +60,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class='recommend-view c-flex-column' v-if='recommendList?.length>0'>
|
<view class='recommend-view c-flex-column' v-if='(recommendList?.length||0)>0'>
|
||||||
<text>浏览此商品的客户还浏览了</text>
|
<text>浏览此商品的客户还浏览了</text>
|
||||||
<scroll-view scroll-x>
|
<scroll-view scroll-x>
|
||||||
<view style='display: inline-block' v-for='(item, index) in recommendList'
|
<view style='display: inline-block' v-for='(item, index) in recommendList'
|
||||||
:key='index'>
|
:key='index'>
|
||||||
<view class='recommend-item c-flex-column'>
|
<view class='recommend-item c-flex-column'>
|
||||||
<image :src='item.images' />
|
<image :src='item.images||defaultImage' />
|
||||||
<text>{{ item.goodsName }}</text>
|
<text>{{ item.goodsName || '未知' }}</text>
|
||||||
<text class='goods-price'>{{ item.price }}</text>
|
<text class='goods-price'>{{ item.price }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -122,7 +127,10 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class='bottom-view c-flex-row'>
|
<view class='bottom-view c-flex-row'>
|
||||||
<view class='place-order-button' @click.stop='placeOrder'>跟团购买</view>
|
<button v-if='isPending()' class='place-order-button' @click.stop='placeOrder'>跟团购买</button>
|
||||||
|
<button v-else class='place-order-button-disable' :plain='true' :disabled='true'>
|
||||||
|
{{ isNotStated() ? '即将开始' : '已结束' }}
|
||||||
|
</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<sku-dialog ref='skuDialogRef' :flash-price='Number(groupBuyBean?.payPrice) || 0' />
|
<sku-dialog ref='skuDialogRef' :flash-price='Number(groupBuyBean?.payPrice) || 0' />
|
||||||
@@ -181,6 +189,19 @@ onUnload(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isNotStated = () => {
|
||||||
|
return dayjs(groupBuyBean.value?.startDate).isAfter(Date.now());
|
||||||
|
};
|
||||||
|
|
||||||
|
const isPending = () => {
|
||||||
|
return dayjs(groupBuyBean.value?.startDate).isBefore(Date.now()) && dayjs(groupBuyBean.value?.endDate).isAfter(Date.now());
|
||||||
|
;
|
||||||
|
};
|
||||||
|
|
||||||
|
const isEnded = () => {
|
||||||
|
return dayjs(groupBuyBean.value?.endDate).isBefore(Date.now());
|
||||||
|
};
|
||||||
|
|
||||||
const getStockColorCount = computed(() => {
|
const getStockColorCount = computed(() => {
|
||||||
const list = Array.from(new Set(groupBuyBean.value?.goods?.stocks?.map(item => item.colorName)))
|
const list = Array.from(new Set(groupBuyBean.value?.goods?.stocks?.map(item => item.colorName)))
|
||||||
.map(colorName => groupBuyBean.value?.goods?.stocks?.find(item => item.colorName === colorName)!);
|
.map(colorName => groupBuyBean.value?.goods?.stocks?.find(item => item.colorName === colorName)!);
|
||||||
@@ -194,7 +215,7 @@ const fetchRecommendList = async () => {
|
|||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
bean: {
|
bean: {
|
||||||
keyword: '',
|
keyword: '',
|
||||||
typeIds: ['1724629185362591745']
|
typeIds: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -550,6 +571,13 @@ const placeOrder = async () => {
|
|||||||
background: #F32B2B;
|
background: #F32B2B;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
border-radius: 40rpx;
|
border-radius: 40rpx;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.place-order-button-disable {
|
||||||
|
@extend .place-order-button;
|
||||||
|
background: #b9b5b5;
|
||||||
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
<image :src='assetsUrl("ic_decline.png")' />
|
<image :src='assetsUrl("ic_decline.png")' />
|
||||||
<text>直降¥{{ (item.price - item.payPrice).toFixed(2) }}</text>
|
<text>直降¥{{ (item.price - item.payPrice).toFixed(2) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<text>即将恢复</text>
|
<text>{{ tabIndex == 0 ? '即将恢复' : '即将开始'}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class='bottom-price c-flex-row' :class='{"bottom-price-disabled":tabIndex==1}'>
|
<view class='bottom-price c-flex-row' :class='{"bottom-price-disabled":tabIndex==1}'>
|
||||||
<text>{{ item.payPrice }}</text>
|
<text>{{ item.payPrice }}</text>
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
1.长按识别下方二维码,添加【店铺福利群】
|
1.长按识别下方二维码,添加【店铺福利群】
|
||||||
</text>
|
</text>
|
||||||
<view class='divider' style='margin-top: 28rpx' />
|
<view class='divider' style='margin-top: 28rpx' />
|
||||||
<image :src=' companyConfigInfo.regqrcode' show-menu-by-longpress />
|
<image :src=' companyConfigInfo.groupqrcode' show-menu-by-longpress />
|
||||||
<text class='step-title'>
|
<text class='step-title'>
|
||||||
2.识别【店铺福利群】发您的二维码,即可入群
|
2.识别【店铺福利群】发您的二维码,即可入群
|
||||||
</text>
|
</text>
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
<view class='c-flex-row'>
|
<view class='c-flex-row'>
|
||||||
<text style='flex: 1'>{{ goodsBean?.name }}</text>
|
<text style='flex: 1'>{{ goodsBean?.name }}</text>
|
||||||
<view class='share-button c-flex-column'>
|
<view class='share-button'>
|
||||||
<image :src='assetsUrl("ic_share.png")'></image>
|
<image :src='assetsUrl("ic_share.png")'></image>
|
||||||
<button class='btn' plain open-type='share'>分享</button>
|
<button class='btn' plain open-type='share'>分享</button>
|
||||||
</view>
|
</view>
|
||||||
@@ -56,8 +56,8 @@
|
|||||||
<view class='recommend-item c-flex-column'>
|
<view class='recommend-item c-flex-column'>
|
||||||
<image :src='item.images||defaultImage' />
|
<image :src='item.images||defaultImage' />
|
||||||
<text>{{ item.goodsName || '未知' }}</text>
|
<text>{{ item.goodsName || '未知' }}</text>
|
||||||
<text class='goods-price'>{{ (item.price * ((userInfo.levelEntity.discount || 100) / 100)).toFixed(2) }}
|
<text class='goods-price'>{{ (item.price * ((userInfo.levelEntity?.discount || 100) / 100)).toFixed(2) }}
|
||||||
<text v-if='userInfo.levelEntity.discount>0'
|
<text v-if='userInfo.levelEntity?.discount>0'
|
||||||
style='text-decoration: line-through;font-size: 25rpx;color: #999999'>{{ item.price }}
|
style='text-decoration: line-through;font-size: 25rpx;color: #999999'>{{ item.price }}
|
||||||
</text>
|
</text>
|
||||||
</text>
|
</text>
|
||||||
@@ -175,7 +175,6 @@ const addShoppingCart = () => {
|
|||||||
|
|
||||||
const placeOrder = () => {
|
const placeOrder = () => {
|
||||||
showSkuDialog((e: GoodsBean) => {
|
showSkuDialog((e: GoodsBean) => {
|
||||||
console.log(e);
|
|
||||||
const orderBean = {
|
const orderBean = {
|
||||||
totalPrice: (e.consumePrice * e.checkedStock.count).toFixed(2),
|
totalPrice: (e.consumePrice * e.checkedStock.count).toFixed(2),
|
||||||
orderGoods: [e]
|
orderGoods: [e]
|
||||||
@@ -264,6 +263,8 @@ const placeOrder = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.share-button {
|
.share-button {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
<view v-for='(item,index) in orderActionList' :key='index' @click.stop='gotoPath(item.path)'>
|
<view v-for='(item,index) in orderActionList' :key='index' @click.stop='gotoPath(item.path)'>
|
||||||
<image :src='item.icon' />
|
<image :src='item.icon' />
|
||||||
<text>{{ item.title }}</text>
|
<text>{{ item.title }}</text>
|
||||||
<text v-if='index==0&&userInfo?.orderNum>0'>{{ userInfo?.orderNum }}</text>
|
<text v-if='index==0&&unPaidOrderCount>0'>{{ unPaidOrderCount }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -67,6 +67,8 @@
|
|||||||
<script setup lang='ts'>
|
<script setup lang='ts'>
|
||||||
import { assetsUrl, defaultAvatar } from '@/utils/assets';
|
import { assetsUrl, defaultAvatar } from '@/utils/assets';
|
||||||
import { goLogin, goPath, isLogin } from '@/utils';
|
import { goLogin, goPath, isLogin } from '@/utils';
|
||||||
|
import { isPending } from '@/utils/order';
|
||||||
|
import { getOrderList } from '@/api/order';
|
||||||
import OfficialAccountDialog from '@/components/official-account-dialog.vue';
|
import OfficialAccountDialog from '@/components/official-account-dialog.vue';
|
||||||
import { useUserStore } from '@/store';
|
import { useUserStore } from '@/store';
|
||||||
|
|
||||||
@@ -124,6 +126,8 @@ title.value = import.meta.env.VITE_APP_TITLE;
|
|||||||
const store = useUserStore();
|
const store = useUserStore();
|
||||||
const { userInfo, companyConfigInfo } = storeToRefs(store);
|
const { userInfo, companyConfigInfo } = storeToRefs(store);
|
||||||
|
|
||||||
|
const unPaidOrderCount = ref(0);
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
if(!isLogin()) {
|
if(!isLogin()) {
|
||||||
goLogin();
|
goLogin();
|
||||||
@@ -131,6 +135,15 @@ onLoad(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onShow(async () => {
|
||||||
|
const { list } = await getOrderList({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 9999,
|
||||||
|
obj: { payStatus: 1 }
|
||||||
|
});
|
||||||
|
unPaidOrderCount.value = list.filter((item: any) => isPending(item))?.length || 0;
|
||||||
|
});
|
||||||
|
|
||||||
const gotoPath = (path: string) => {
|
const gotoPath = (path: string) => {
|
||||||
if(path === 'follow_official_account') {
|
if(path === 'follow_official_account') {
|
||||||
showOfficialAccountDialog();
|
showOfficialAccountDialog();
|
||||||
|
@@ -16,7 +16,8 @@ const useUserStore = defineStore('user', {
|
|||||||
goodsstockzero: 0,
|
goodsstockzero: 0,
|
||||||
mallopen: 0,
|
mallopen: 0,
|
||||||
regqrcode: undefined,
|
regqrcode: undefined,
|
||||||
userbgcover: undefined
|
userbgcover: undefined,
|
||||||
|
groupqrcode: undefined
|
||||||
},
|
},
|
||||||
deliveryAddress: {
|
deliveryAddress: {
|
||||||
addrid: '',
|
addrid: '',
|
||||||
|
Reference in New Issue
Block a user