优化
This commit is contained in:
@@ -4,8 +4,10 @@
|
||||
<view class='c-flex-row' style='align-items: flex-start'>
|
||||
<image class='goods-image' :src='goodsDetailBean?.images||defaultImage' />
|
||||
<view class='c-flex-column' style='flex: 1'>
|
||||
<text class='goods-name'>{{ goodsDetailBean?.name }}</text>
|
||||
<text class='goods-price'>{{ flashPrice > 0 ? `${flashPrice}` : `${goodsDetailBean?.price}` || 0 }}</text>
|
||||
<text class='goods-name'>{{ goodsDetailBean?.name || '未知' }}</text>
|
||||
<text class='goods-price'>{{ flashPrice > 0 ? `${flashPrice}` : `${goodsDetailBean?.consumePrice || 0}` || 0
|
||||
}}
|
||||
</text>
|
||||
</view>
|
||||
<image class='close-image' :src='assetsUrl("ic_close.png")' @click.stop='close' />
|
||||
</view>
|
||||
@@ -58,6 +60,10 @@ import { assetsUrl, defaultImage } from '@/utils/assets';
|
||||
import { showToast } from '@/utils';
|
||||
import { getGoodsDetail } from '@/api/goods';
|
||||
import { GoodsBean, StockBean } from '@/api/goods/types';
|
||||
import { useUserStore } from '@/store';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const { userInfo } = storeToRefs(userStore);
|
||||
|
||||
const props = defineProps({
|
||||
flashPrice: {
|
||||
@@ -78,7 +84,9 @@ const show = async (goodsId: string, fn: Function) => {
|
||||
callback = fn;
|
||||
|
||||
goodsDetailBean.value = await getGoodsDetail(goodsId);
|
||||
if(goodsDetailBean.value?.stocks?.length == 0) {
|
||||
goodsDetailBean.value.consumePrice = Number((goodsDetailBean.value?.price * ((userInfo?.value?.levelEntity?.discount || 100) / 100)).toFixed(2));
|
||||
|
||||
if((goodsDetailBean.value?.stocks?.length || 0) <= 0) {
|
||||
showToast('暂无库存');
|
||||
return;
|
||||
}
|
||||
@@ -103,7 +111,8 @@ const show = async (goodsId: string, fn: Function) => {
|
||||
}
|
||||
|
||||
if(skuSizeList) {
|
||||
// skuSizeList.value![2].existingNumber = 2;
|
||||
//skuSizeList.value![0].existingNumber = 2;
|
||||
//skuSizeList.value![2].existingNumber = 2;
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user