From f1406d6c42dd2176117dcd6adf81ea2e0dc02cde Mon Sep 17 00:00:00 2001
From: air <30444667+sszdot@users.noreply.github.com>
Date: Mon, 20 Jan 2025 18:32:00 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?=
=?UTF-8?q?=EF=BC=9Afeat=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?=
=?UTF-8?q?=EF=BC=9A=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E9=87=8C=E9=9D=A2?=
=?UTF-8?q?=E7=9A=84=20=E6=97=B6=E9=97=B4=E7=BA=BF=E7=BB=84=E4=BB=B6=20?=
=?UTF-8?q?=E3=80=90=E8=BF=87=20=20=E7=A8=8B=E3=80=91=EF=BC=9A=20=E3=80=90?=
=?UTF-8?q?=E5=BD=B1=20=20=E5=93=8D=E3=80=91=EF=BC=9A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
---
App.vue | 4 +-
components/orderItem/orderItem.vue | 69 ++++++++++++++++--------------
components/process/process.vue | 50 ++++++++++++++++++++++
pages.json | 19 ++++----
pages/order/refProcess.vue | 35 ++++++++++++---
pages/order/refund.vue | 2 +-
6 files changed, 129 insertions(+), 50 deletions(-)
create mode 100644 components/process/process.vue
diff --git a/App.vue b/App.vue
index 82f3409..4aa4695 100644
--- a/App.vue
+++ b/App.vue
@@ -336,11 +336,11 @@
}
.fcb {
- color: $uni-text-color-disable
+ color: $uni-text-color-disable;
}
.fcm {
- color: $uni-color-error
+ color: $uni-color-error;
}
.z-top {
diff --git a/components/orderItem/orderItem.vue b/components/orderItem/orderItem.vue
index 3bc690d..ee24290 100644
--- a/components/orderItem/orderItem.vue
+++ b/components/orderItem/orderItem.vue
@@ -23,7 +23,8 @@
-
+
立即支付
@@ -31,14 +32,18 @@
{{ foodSn }}
-
+
申请售后
-
- 退款详情
-
+
+
+ 退款详情
+
+
@@ -67,8 +72,9 @@
},
computed: {
//订单总价格
- fullPrice(){
- return this.formatPrice(Number(this.order.transport_price) + Number(this.order.pack_price) + Number(this.order.total_price))
+ fullPrice() {
+ return this.formatPrice(Number(this.order.transport_price) + Number(this.order.pack_price) + Number(this
+ .order.total_price))
},
// 是否显示 "立即支付" 按钮
showPayButton() {
@@ -94,36 +100,37 @@
if (this.order.main_status === '已付款' && this.order.refund_status === '未申请') {
return this.order.shipment_status;
}
- switch (this.order.refund_status) {
- case '申请中':
- return '申请中';
- case '已同意':
- return '商家同意退款';
- case '主动退':
- return '商家退单';
- case '拒绝退':
- return '商家拒绝退款';
- default:
- return '';
+ // 如果订单的主状态是已退款,直接返回已退款
+ if (this.order.main_status === '已退款') {
+ return '已退款';
}
- },
- // 显示退款状态
- refundStatusDisplay() {
- switch (this.order.refund_status) {
- case '申请中':
- return '申请中';
- case '已同意':
+
+ // 如果订单的主状态是已付款,并且退款状态为已同意,返回商家同意退款
+ if (this.order.main_status === '已付款') {
+ if (this.order.refund_status === '已同意') {
return '商家同意退款';
- case '主动退':
+ }
+
+ // 如果退款状态为主动退,返回商家退单
+ if (this.order.refund_status === '主动退') {
return '商家退单';
- case '拒绝退':
- return '商家拒绝退款';
- default:
- return '';
+ }
}
+
+ // 根据退款状态显示其他状态
+ if (this.order.refund_status === '申请中') {
+ return '申请中';
+ }
+
+ if (this.order.refund_status === '拒绝退') {
+ return '商家拒绝退款';
+ }
+
+ // 默认返回空
+ return '';
},
},
- methods:{
+ methods: {
formatPrice //价格格式化
},
props: {
diff --git a/components/process/process.vue b/components/process/process.vue
new file mode 100644
index 0000000..13a4439
--- /dev/null
+++ b/components/process/process.vue
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages.json b/pages.json
index e1d1c83..8bf2301 100644
--- a/pages.json
+++ b/pages.json
@@ -2,8 +2,7 @@
"easycom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
},
- "pages": [
- {
+ "pages": [{
"path": "pages/index/index",
"style": {
"navigationStyle": "custom"
@@ -46,29 +45,27 @@
}
},
{
- "path" : "pages/main/login",
+ "path": "pages/main/login",
"style": {
"navigationStyle": "custom"
}
},
{
- "path" : "pages/order/index",
+ "path": "pages/order/index",
"style": {
"navigationStyle": "custom"
}
},
{
- "path" : "pages/order/refund",
- "style" :
- {
+ "path": "pages/order/refund",
+ "style": {
"navigationStyle": "custom"
}
},
{
- "path" : "pages/order/refProcess",
- "style" :
- {
- "navigationBarTitleText" : ""
+ "path": "pages/order/refProcess",
+ "style": {
+ "navigationStyle": "custom"
}
}
],
diff --git a/pages/order/refProcess.vue b/pages/order/refProcess.vue
index 8183fd0..d441c92 100644
--- a/pages/order/refProcess.vue
+++ b/pages/order/refProcess.vue
@@ -1,6 +1,18 @@
-
+
+
+
+
+
+
+
+
+
+ {{ order.refund_status !== "主动退"?"买家申请":"卖家取消订单" }}
+
+
+
@@ -8,15 +20,28 @@
export default {
data() {
return {
-
+ order_sn: '', //订单号
}
},
+ onLoad(options) {
+ this.order_sn = options.order_sn // 从提交订单页面传递过来的订单号
+ },
methods: {
-
+
+ },
+ computed: {
+ //订单
+ order() {
+ if (this.order_sn) {
+ return this.$store.state.orderList.find(item => item.order_sn === this.order_sn)
+ } else {
+ return null
+ }
+ },
}
}
-
+
\ No newline at end of file
diff --git a/pages/order/refund.vue b/pages/order/refund.vue
index 5c3d649..f006a3e 100644
--- a/pages/order/refund.vue
+++ b/pages/order/refund.vue
@@ -249,7 +249,7 @@
},
watch: {},
computed: {
- //未付款订单
+ //订单
order() {
if (this.order_sn) {
return this.$store.state.orderList.find(item => item.order_sn === this.order_sn)