Commit 476c26af authored by 陈宗胤(贵阳日报)'s avatar 陈宗胤(贵阳日报)
parents bb0b02a5 6c87f4a7
......@@ -123,6 +123,7 @@ const getDetail = async () => {
orderDetail.value.orderItems.forEach((item) => {
count += item.prodCount;
});
orderDetail.value.prodCount = count;
};
/**
......
......@@ -156,6 +156,19 @@
</view>
</view>
<!-- card-end -->
<view class="rich-text-card">
<text class="title">商品组合</text>
<view class="product-combination" v-for="(item, index) in productCombination" :key="index">
<text class="t-t">{{ item[0].categorizeName }}</text>
<view class="product-combination-box" v-for="(i, n) in item" :key="n">
<text class="p-t">{{ i.prodName }}</text>
<view class="price">
<text>{{ i.price }}</text>
<text style="margin-left: 30rpx">{{ i.count }}</text>
</view>
</view>
</view>
</view>
<view class="rich-text-card">
<text class="title">商品详情</text>
<rich-text class="desc" :nodes="prodInfo.content"></rich-text>
......@@ -265,6 +278,7 @@ const shopLocation = ref({});
const shopId = ref('');
const showpopup = ref(false);
const backIconColor = ref('');
const productCombination = ref([]);
const prodSkusInfo = ref({});
// 商品优惠券
const productCoupons = ref([]);
......@@ -345,10 +359,26 @@ function getProdDetailFn(prodId) {
prodRlue.value = res.data.data.groupPurchasePackageRule;
prodSkusInfo.value = res.data.data.skus[0];
shopId.value = res.data.data.prod.shopId;
productCombination.value = groupByCategorizeName(res.data.data.prodAdditionals);
resolve(res.data.data.prod.shopId);
}
});
});
} // 定义一个函数来根据 categorizeName 字段对数据进行分组
function groupByCategorizeName(prodAdditionals) {
if (!Array.isArray(prodAdditionals) || prodAdditionals.length === 0) {
return [];
}
const grouped = prodAdditionals.reduce((result, item) => {
if (!result[item.categorizeName]) {
result[item.categorizeName] = [];
}
result[item.categorizeName].push(item);
return result;
}, {});
return Object.values(grouped);
}
/**
* 获取商品优惠券列表
......@@ -894,6 +924,34 @@ page {
margin-top: 10rpx;
border-radius: 8 * 2rpx;
box-shadow: 0 -8rpx 22 * 2rpx 0 rgba(255, 255, 255, 0.6);
.product-combination {
display: flex;
flex-direction: column;
align-items: flex-start;
margin-top: 20rpx;
width: 100%;
.t-t {
font-size: 12 * 2rpx;
color: #151515;
font-weight: bold;
width: 100%;
}
.product-combination-box {
display: flex;
width: 100%;
align-items: center;
justify-content: space-between;
margin-top: 10rpx;
.p-t {
font-size: 11 * 2rpx;
color: #abaaaa;
}
.price {
font-size: 11 * 2rpx;
color: #abaaaa;
}
}
}
.desc {
white-space: pre-line;
}
......@@ -919,7 +977,7 @@ page {
.title {
font-size: 13 * 2rpx;
color: #151515;
font-weight: 500;
font-weight: bold;
}
img {
max-width: 100%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment