feat: 新增拼团
This commit is contained in:
@@ -143,7 +143,7 @@
|
||||
|
||||
<script>
|
||||
import { RETURN_REASON_LIST } from "@/pages/mine_package/mine_order/emun/index.js";
|
||||
import { getDetail, afterSaleApply } from "@/api/order.js";
|
||||
import { getDetail, afterSaleApply, cancelTeam } from "@/api/order.js";
|
||||
import { BASE_URL, Authorization } from '@/utils/config.js';
|
||||
import { getStorageFun, TOKEN_NAME } from '@/utils/auth.js';
|
||||
import { uploadImg } from '@/api/common.js';
|
||||
@@ -279,6 +279,7 @@ export default {
|
||||
this.tempSelectedReason = item;
|
||||
},
|
||||
confirmReason() {
|
||||
console.log("---1122", this.orderInfo)
|
||||
if (!this.tempSelectedReason) {
|
||||
uni.showToast({ title: '请选择退款原因', icon: 'none' });
|
||||
return;
|
||||
@@ -377,8 +378,13 @@ export default {
|
||||
imgUrls: this.fileList.join(','),
|
||||
type: this.orderInfo?.status === 2 ? 1 : (this.orderInfo?.status === 3 || this.orderInfo?.status === 4) ? 2 : 1
|
||||
};
|
||||
if (this.orderInfo.teamId) {
|
||||
await cancelTeam({ teamId: this.orderInfo.teamId })
|
||||
}
|
||||
|
||||
try {
|
||||
uni.showLoading({ title: '提交中...' });
|
||||
|
||||
const res = await afterSaleApply(params);
|
||||
uni.hideLoading();
|
||||
if (res && res.bizcode === 100) {
|
||||
|
||||
@@ -27,21 +27,23 @@
|
||||
<up-image :src="item.shopLogo" width="22" height="22" bgColor="#f1f6ff00" shape="circle"></up-image>
|
||||
<view class="order_product_title">{{ item.shopName }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 除开待付款 -->
|
||||
<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) }}
|
||||
item.teamId && form.type === MINE_ORDER_TYPE.UNSHIPPED
|
||||
" 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="
|
||||
form.type == MINE_ORDER_TYPE.AFTER_SALE
|
||||
" class="order_item_header_right" :style="{ color: ORDER_STATUS_CSS[item.status] }">
|
||||
{{ getValue(AFTER_ORDER_STATUS, item.status) }}
|
||||
</view>
|
||||
<!-- 待付款 -->
|
||||
|
||||
<!-- 待付款 -->
|
||||
<view v-if="
|
||||
form.type !== MINE_ORDER_TYPE.AFTER_SALE &&
|
||||
item.status === ORDER_TYPE.UNPAID
|
||||
@@ -50,13 +52,18 @@
|
||||
<view class="order_right_due_time">{{ formatDate1(item.expireTime) }}前</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 产品详情 -->
|
||||
<view class="order_item_content">
|
||||
<view v-for="pItem in item.items" :key="pItem.id">
|
||||
<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">
|
||||
@@ -99,12 +106,12 @@
|
||||
<view>共{{ item.buyNum }}件,合计¥{{ item.sumAmount }}</view>
|
||||
</view> -->
|
||||
<view class="collect_msg" v-if="item.buyDeductionValue">共{{ item.buyNum }}件,合计数字积分{{ item.buyDeductionValue
|
||||
}}
|
||||
}}
|
||||
+¥{{ 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="
|
||||
@@ -149,6 +156,7 @@
|
||||
取消支付
|
||||
</view>
|
||||
|
||||
|
||||
<view :class="[
|
||||
'operate_comm',
|
||||
'operate_but_1'
|
||||
@@ -158,6 +166,12 @@
|
||||
申请售后
|
||||
</view>
|
||||
|
||||
<!-- 查看拼团按钮 (待发货 + 拼团商品 item.teamId) -->
|
||||
<view class="operate_comm operate_but_2" v-if="item.teamId && form.type === MINE_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 +395,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 +515,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 {
|
||||
@@ -620,9 +648,11 @@ export default {
|
||||
this.cancelForm.afterReason = "";
|
||||
this.salesServer = 1;
|
||||
this.activeIndex = 0;
|
||||
this.aftterSalesProduct = item;
|
||||
this.aftterSalesProduct = { ...item };
|
||||
this.afterShow = true;
|
||||
this.aftterSalesProduct.status = 9;
|
||||
if (item.teamId)
|
||||
this.aftterSalesProduct.teamId = item.teamId;
|
||||
this.aftterSalesProduct.afterType =
|
||||
this.form.type == MINE_ORDER_TYPE.UNSHIPPED ? 1 : 2;
|
||||
}
|
||||
@@ -631,6 +661,7 @@ export default {
|
||||
this.activeIndex = 1;
|
||||
this.afterShow = false;
|
||||
const orderId = this.aftterSalesProduct ? this.aftterSalesProduct.id : '';
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/mine_package/apply_refund/apply_refund?id=${orderId}&orderData=${encodeURIComponent(JSON.stringify(this.aftterSalesProduct || {}))}`
|
||||
});
|
||||
@@ -788,6 +819,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 +1387,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 {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<up-image src="/pages/mine_package/static/order_status_1.png" width="20" height="19"
|
||||
bgColor="#f1f6ff00"></up-image>
|
||||
</view>
|
||||
<text class="msg">{{ getValue(ORDER_STATUS, orderInfo.status) }}</text>
|
||||
<text class="msg">{{ orderStatusText }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order_info_content">
|
||||
@@ -33,7 +33,7 @@
|
||||
<!-- 物流单号 -->
|
||||
<view class="address_info">
|
||||
<view class="address_data_warp">
|
||||
<up-image src="/pages/rwa_package/static/waybill.png" width="20" height="20"
|
||||
<up-image src="/static/common/waybill.png" width="20" height="20"
|
||||
bgColor="#f1f6ff00"></up-image>
|
||||
<view class="address_info_name">订单编号:</view>
|
||||
<view class="address_info_mobile" style="margin-right: 20rpx">{{
|
||||
@@ -78,7 +78,12 @@
|
||||
<view class="content_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="orderInfo.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"
|
||||
@@ -362,6 +367,20 @@ export default {
|
||||
},
|
||||
LOGISTICS_STATUS_UPDATE() {
|
||||
return LOGISTICS_STATUS_UPDATE
|
||||
},
|
||||
orderStatusText() {
|
||||
if (this.orderInfo?.teamId) {
|
||||
if (this.orderInfo.groupStatus == 0) {
|
||||
return "待成团";
|
||||
}
|
||||
if (this.orderInfo.groupStatus == 2) {
|
||||
return "拼团失败";
|
||||
}
|
||||
if (this.orderInfo.groupStatus == 1) {
|
||||
return getValue(ORDER_STATUS, this.orderInfo.status);
|
||||
}
|
||||
}
|
||||
return getValue(ORDER_STATUS, this.orderInfo?.status);
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -892,6 +911,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;
|
||||
}
|
||||
}
|
||||
|
||||
.data_item_yd {
|
||||
|
||||
Reference in New Issue
Block a user