feat: 店铺订单多规格展示

This commit is contained in:
2026-08-05 17:59:44 +08:00
parent e8a4108b42
commit 0964dae037
3 changed files with 84 additions and 21 deletions
+45 -1
View File
@@ -20,7 +20,7 @@
<view class="size28 spuName lineTwo" :class="{ 'p-r-10': props.type == 3, c0: props.theme == 2 }">
{{ v.spuName }}
</view>
<view class="shrink price" v-if="props.type != 4"><span class="size24">¥</span><span class="size36"
<view class="shrink price" v-if="props.type != 4 && !showMultiSku(v)"><span class="size24">¥</span><span class="size36"
style="font-weight: 600">{{ fen2yuan(v.price) }}</span></view>
</view>
<view v-if="props.type == 4">
@@ -40,6 +40,19 @@
</view>
</view>
</view>
<view v-else-if="showMultiSku(v)" class="multi-sku-list">
<view class="multi-sku-item flex-center m-b-12" v-for="(item, itemIndex) in v.items" :key="item.id || itemIndex">
<view class="multi-sku-row flex1 flex-center ju-between bg18 radius8 p-l-8 p-r-16">
<view class="multi-sku-text lineOne c19">
{{ formatSkuProperties(item?.properties) }}
</view>
<view class="flex-center">
<view class="c19">x{{ item.count }}</view>
<view class="size28 m-l-12 weight900">¥<span>{{ fen2yuan(item.payPrice || item.price) }}</span></view>
</view>
</view>
</view>
</view>
<view class="flex-row ju-between" :class="{ 'm-t-8': props.type == 3 }" v-else>
<view class="valueName size28" :class="{ c19: props.theme == 2 }">{{ formatSkuProperties(v.properties) }}</view>
<view class="shrink size28 c_333" :class="{ c0: props.theme == 2 }">{{
@@ -80,6 +93,14 @@
.filter(Boolean)
.join(' ');
};
const showMultiSku = (item: any) => {
return (
['2', '3'].includes(props.type) &&
[String(props.source), String(props.data?.__source)].includes('aishop') &&
Array.isArray(item?.items) &&
item.items.length > 1
);
};
const props = defineProps({
data: {
type: Object,
@@ -91,6 +112,10 @@
type: String,
default: '0', //0列表2订单详情 3订单列表 4ai订单详情
},
source: {
type: String,
default: '',
},
theme: {
type: String,
default: '2', //1浅色 2深色
@@ -152,6 +177,25 @@
font-size: 24rpx;
}
.multi-sku-list {
width: 100%;
}
.multi-sku-item:last-child {
margin-bottom: 0;
}
.multi-sku-row {
height: 52rpx;
}
.multi-sku-text {
flex: 1;
min-width: 0;
color: #777777;
font-size: 24rpx;
}
.btnItem {
line-height: 50rpx;
padding: 0 20rpx;