feat: 订单的处理,ordertype 等于0的处理

This commit is contained in:
2026-03-31 00:05:42 +08:00
parent c9683398de
commit b8b1a3885a
9 changed files with 60 additions and 28 deletions

View File

@@ -90,7 +90,7 @@ const handleButtonClick = DebounceUtils.createDebounce(async (orderData) => {
// 检查接口返回数据
if (!res || !res.data) {
uni.hideLoading();
uni.showToast({ title: "订单创建失败,请重试", icon: "none" });
uni.showToast({ title: res.msg || "订单创建失败,请重试", icon: "none" });
return;
}
@@ -119,7 +119,10 @@ const handleButtonClick = DebounceUtils.createDebounce(async (orderData) => {
uni.showToast({
title: "支付成功",
icon: "success",
success: () => emit("refresh"),
success: () => {
console.log("支付成功,刷新订单详情");
emit("refresh", { orderId: orderId });
},
});
},
fail: () => {

View File

@@ -1,11 +1,11 @@
<template>
<view
v-if="orderType === '0'"
v-if="orderType == 0"
class="border-box bg-white p-12 rounded-12 mb-12"
>
<!-- 酒店类型入住离店日期部分 -->
<DateRangeSection
v-if="orderData.orderType === 0"
v-if="orderData.orderType == 0"
:selectedDate="selectedDate"
/>
@@ -32,7 +32,7 @@
</view>
<view
v-if="orderType !== '0'"
v-if="orderType != 0"
class="border-box bg-white p-12 rounded-12 mb-12"
>
<view
@@ -85,7 +85,7 @@ const orderType = computed(() => props.orderData.orderType);
const commodityAmount = computed(() => {
// 门票单位:张、餐饮单位:份
const { commodityAmount } = props.orderData;
return orderType.value === "2"
return orderType.value == 2
? `${parseInt(commodityAmount)}`
: `${parseInt(commodityAmount)}`;
});

View File

@@ -13,8 +13,8 @@
<text
:class="[
{
'color-FF3D60': statusCode === '0',
'color-21B466': ['1', '2', '3', '4', '5', '6'].includes(statusCode),
'color-FF3D60': statusCode === '0' || statusCode === '3',
'color-21B466': ['1', '2', '4', '5', '6'].includes(statusCode),
},
]"
>
@@ -45,7 +45,7 @@ const statusCode = computed(() => props.orderData.orderStatus);
// 使用计算属性缓存支付方式文本
const statusText = computed(() =>
statusCode.value === "0" ? "未支付" : "已支付"
statusCode.value === "0" || statusCode.value === "3" ? "未支付" : "已支付"
);
</script>