订单详情页修改

parent 8010e319
...@@ -57,12 +57,7 @@ ...@@ -57,12 +57,7 @@
</view> </view>
</view> </view>
</view> </view>
<wd-icon <wd-icon name="chevron-right" size="22px" color="#333"></wd-icon>
name="chevron-right"
size="22px"
color="#333"
v-if="orderDetail.baseOrder.prodType === 9"
></wd-icon>
</view> </view>
<view class="rectangle-with-semicircles"></view> <view class="rectangle-with-semicircles"></view>
...@@ -138,18 +133,18 @@ ...@@ -138,18 +133,18 @@
<view class="info" v-if="prodDetail && orderDetail.baseOrder.prodType === 5"> <view class="info" v-if="prodDetail && orderDetail.baseOrder.prodType === 5">
<view class="menu padding"> <view class="menu padding">
<text class="title">到店吃套餐</text> <text class="title">到店吃套餐</text>
<view class="menu-box" v-for="(item, index) in prodDetail.prodAdditionals" :key="index"> <view class="menu-box" v-for="(item, index) in productCombination" :key="index">
<view class="header"> <view class="header">
<view class="circle"></view> <view class="circle"></view>
<text class="h-name">{{ item.categorizeName }}</text> <text class="h-name">{{ item[0].categorizeName }}</text>
</view> </view>
<view class="list-box"> <view class="list-box" v-for="(i, n) in item" :key="n">
<text class="name">{{ item.prodName }}</text> <text class="name">{{ i.prodName }}</text>
<view class="right-box"> <view class="right-box">
<text class="num">({{ item.count }}份)</text> <text class="num">({{ i.count }}份)</text>
<view class="price-box"> <view class="price-box">
<text class="icon"></text> <text class="icon"></text>
<text class="num">{{ item.price }}</text> <text class="num">{{ i.price }}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -171,7 +166,7 @@ ...@@ -171,7 +166,7 @@
}} }}
</text> </text>
</view> </view>
<view class="row"> <view class="row" v-if="prodDetail.groupPurchasePackageRule.rule">
<text class="name">使用规则</text> <text class="name">使用规则</text>
<text class="colon"></text> <text class="colon"></text>
<text class="textarea">{{ prodDetail.groupPurchasePackageRule.rule }}</text> <text class="textarea">{{ prodDetail.groupPurchasePackageRule.rule }}</text>
...@@ -319,11 +314,29 @@ const codeDetail = (item) => { ...@@ -319,11 +314,29 @@ const codeDetail = (item) => {
* 获取商品详情 * 获取商品详情
*/ */
const prodDetail = ref(); const prodDetail = ref();
const productCombination = ref([]);
const getProductDetail = async (id) => { const getProductDetail = async (id) => {
const res = await getProdDetail({ prodId: id }); const res = await getProdDetail({ prodId: id });
prodDetail.value = res.data.data; prodDetail.value = res.data.data;
productCombination.value = groupByCategorizeName(res.data.data.prodAdditionals);
}; };
// 定义一个函数来根据 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);
}
/** /**
* 获取商铺信息 * 获取商铺信息
*/ */
...@@ -432,6 +445,11 @@ const anotherOrder = () => { ...@@ -432,6 +445,11 @@ const anotherOrder = () => {
}; };
const toProdDetail = () => { const toProdDetail = () => {
if (orderDetail.value.baseOrder.prodType === 5) {
xma.navigateTo({
url: `/pages/packageDetails/packageDetails?prodId=${orderDetail.value.orderItems[0].prodId}`,
});
}
if (orderDetail.value.baseOrder.prodType === 9) { if (orderDetail.value.baseOrder.prodType === 9) {
xma.navigateTo({ xma.navigateTo({
url: `/pages/assistingAgriculture/RouteDetails/RouteDetails?shopId=${orderDetail.value.baseOrder.shopId}&prodId=${orderDetail.value.orderItems[0].prodId}`, url: `/pages/assistingAgriculture/RouteDetails/RouteDetails?shopId=${orderDetail.value.baseOrder.shopId}&prodId=${orderDetail.value.orderItems[0].prodId}`,
...@@ -520,7 +538,7 @@ page { ...@@ -520,7 +538,7 @@ page {
.price-box { .price-box {
display: flex; display: flex;
align-items: last baseline; align-items: baseline;
.icon { .icon {
font-weight: bold; font-weight: bold;
...@@ -602,6 +620,7 @@ page { ...@@ -602,6 +620,7 @@ page {
.between { .between {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: baseline;
margin-bottom: 28rpx; margin-bottom: 28rpx;
} }
...@@ -650,6 +669,7 @@ page { ...@@ -650,6 +669,7 @@ page {
font-size: 32rpx; font-size: 32rpx;
line-height: 56rpx; line-height: 56rpx;
font-weight: bold; font-weight: bold;
max-width: 520rpx;
} }
.btn { .btn {
...@@ -769,7 +789,7 @@ page { ...@@ -769,7 +789,7 @@ page {
.price-box { .price-box {
display: flex; display: flex;
align-items: last baseline; align-items: baseline;
text { text {
font-family: PingFang SC Bold; font-family: PingFang SC Bold;
...@@ -781,6 +801,7 @@ page { ...@@ -781,6 +801,7 @@ page {
.icon { .icon {
font-size: 26rpx; font-size: 26rpx;
// line-height: 28rpx;
} }
} }
} }
......
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