feat: 新增拼团

This commit is contained in:
2026-09-23 10:29:41 +08:00
parent f7b9e66172
commit 67f8b3f352
33 changed files with 7491 additions and 858 deletions
+53 -5
View File
@@ -31,8 +31,9 @@
<view v-if="
item.status !== ORDER_TYPE.UNPAID &&
form.type !== MINE_ORDER_TYPE.AFTER_SALE
" class="order_item_header_right" :style="{ color: ORDER_STATUS_CSS[item.status] }">
{{ getValue(ORDER_STATUS, item.status) }}
" class="order_item_header_right"
:style="{ color: item.groupStatus === 0 ? '#999' : ORDER_STATUS_CSS[item.status] }">
{{ item.groupStatus === 0 ? '待成团' : getValue(ORDER_STATUS, item.status) }}
</view>
<!-- 售后显示订单状态 -->
<view v-if="
@@ -56,7 +57,11 @@
<view class="content_item" @click="jumpOrderInfo(item)">
<up-image :src="pItem.mainGraph" width="80" height="80" bgColor="#f1f6ff00"></up-image>
<view class="content_info">
<view class="content_info_title">{{ pItem.title }}</view>
<view class="content_info_title">
<image v-if="item.teamId" class="group_buy_tag"
src="https://static.tbmall.xin/static/mine/groupBuy.png" mode="heightFix"></image>
<text class="title_text">{{ pItem.title }}</text>
</view>
<view class="content_info_tag">{{ pItem.goodsSpece }}</view>
<!-- <view>
<text class="content_info_description" v-for="dItem in pItem.description">
@@ -103,8 +108,8 @@
+¥{{ item.sumAmount }}</view>
<view class="collect_msg" v-if="!item.buyDeductionValue">运费:¥{{ item.postage }},商品总价:¥{{ item.sumAmount }}
</view>
<view class="collect_msg" v-if="!item.buyDeductionValue">共{{ item.buyNum }}件,合计¥{{ item.sumAmount -
item.buyDeduction }}</view>
<view class="collect_msg" v-if="!item.buyDeductionValue">共{{ item.buyNum }}件,合计¥{{
calcOrderTotal(item.sumAmount, item.buyDeduction) }}</view>
<view class="collect_operate">
<!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.UNSHIPPED" @click="checkCancel(true)">取消订单</view> -->
<view class="operate_comm operate_but_2" v-if="
@@ -158,6 +163,13 @@
申请售后
</view>
<!-- 查看拼团按钮 (待发货 + 拼团商品 item.teamId) -->
<view class="operate_comm operate_but_2"
v-if="item.teamId && (item.status == 2 || item.status === ORDER_TYPE.UNSHIPPED)"
@click="jumpGroupDetail(item)">
查看拼团
</view>
<view class="operate_comm operate_but_1" v-if="form.type === MINE_ORDER_TYPE.AFTER_SALE"
@click="onAfterSaleDetail(item)">
售后详情
@@ -381,6 +393,7 @@ import { CUSTOMER_SERVICE_PHONE_NUMBER } from "@/utils/config.js";
import afterSales from "./after-sales/index";
import refundPopup from "@/pages/mine_package/mine_order/after-sales/refund-popup.vue";
import { RETURN_REASON_LIST } from "@/pages/mine_package/mine_order/emun/index.js";
import Decimal from "decimal.js";
export default {
components: { DownPopup, afterSales, refundPopup },
@@ -500,6 +513,19 @@ export default {
this.userinfo();
},
methods: {
calcOrderTotal(sumAmount, buyDeduction) {
try {
const sum = new Decimal(sumAmount || 0);
const deduction = new Decimal(buyDeduction || 0);
const total = sum.minus(deduction);
return (total.greaterThan(0) ? total : new Decimal(0)).toFixed(2);
} catch (e) {
const sum = Number(sumAmount) || 0;
const deduction = Number(buyDeduction) || 0;
const total = sum - deduction;
return (total > 0 ? total : 0).toFixed(2);
}
},
initMPHeader() {
// #ifdef MP-WEIXIN || MP
try {
@@ -788,6 +814,12 @@ export default {
"/pages/mine_package/mine_order_info/mine_order_info?id=" + item.id + '&type=' + this.form.type,
});
},
jumpGroupDetail(item) {
if (!item || !item.teamId) return;
uni.navigateTo({
url: `/pages/active/group-detail/group-detail?teamId=${item.teamId}`,
});
},
// 处理到期时间
handleExpressTime(expressTime) {
let resultM = 0;
@@ -1350,6 +1382,22 @@ export default {
.content_info_title {
width: 370rpx;
display: flex;
align-items: center;
.group_buy_tag {
height: 30rpx;
margin-right: 8rpx;
flex-shrink: 0;
}
.title_text {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.content_item_yd {