feat: 添加退款相关功能和状态显示

- 新增退款状态显示,包括“已退款”和“退款中”
- 添加退款目的地页面,支持查看订单退款信息
- 更新订单列表和订单详情页,支持退款操作
- 更新依赖edu-core至v1.0.13以支持新功能
This commit is contained in:
2026-05-09 11:09:14 +08:00
parent 708804cbbf
commit 5f4a4d4ae4
12 changed files with 221 additions and 35 deletions

View File

@@ -88,6 +88,16 @@
v-if="orderContet.orderStatus == 5"
>已超时</text
>
<text
class="orderState orderState6"
v-if="orderContet.orderStatus == 6"
>已退款</text
>
<text
class="orderState orderState7"
v-if="orderContet.orderStatus == 7"
>退款中</text
>
</view>
<view
class="orderContent"
@@ -1105,14 +1115,15 @@ export default {
text: "继续付款",
});
}
if (this.orderContet.orderStatus == 0) {
this.customButton.push({
width: "160rpx",
text: "取消订单",
color: "#333",
backgroundColor: "#f0f0f0",
});
}
// sociology注释取消订单按钮
// if (this.orderContet.orderStatus == 0) {
// this.customButton.push({
// width: "160rpx",
// text: "取消订单",
// color: "#333",
// backgroundColor: "#f0f0f0",
// });
// }
// var seconds = res.result.timestamp + 30 * 60 + 2 // 过期时间
// var nowSeconds = Math.floor(new Date().getTime() / 1000);
@@ -1131,6 +1142,10 @@ export default {
this.titleStat = "待收到";
} else if (this.orderContet.orderStatus == 3) {
this.titleStat = "已完成";
} else if (this.orderContet.orderStatus == 6) {
this.titleStat = "已退款";
} else if (this.orderContet.orderStatus == 7) {
this.titleStat = "退款中";
}
if (
this.orderContet.orderStatus >= 2 &&
@@ -1173,10 +1188,28 @@ export default {
},
});
},
checkPayTimeout(payItem) {
const createTime = payItem && payItem.createTime;
if (!createTime) return true;
const createdAt = new Date(String(createTime).replace(/-/g, "/")).getTime();
if (!createdAt) return true;
const expired = Date.now() - createdAt > 10 * 60 * 1000;
if (expired) {
uni.showModal({
title: "提示",
content: "订单已超时,不能继续支付,请重新下单",
confirmText: "知道了",
showCancel: false,
});
return false;
}
return true;
},
// 支付
goPay(payItem) {
console.log(payItem, "订单数据");
if (!this.checkPayTimeout(payItem)) return;
if (payItem.paymentMethod == 2) {
console.log("阿里支付");
setPay(
@@ -1320,6 +1353,12 @@ uni-view {
.orderState5 {
background-color: #787878;
}
.orderState6 {
background-color: #f56c6c;
}
.orderState7 {
background-color: #f56c6c;
}
.guoqi {
font-size: 28rpx;
align-items: center;