From a6da6b739430897f4f94e8d0f164982227f5c108 Mon Sep 17 00:00:00 2001
From: sx <2427911852@qq.com>
Date: Fri, 25 Apr 2025 11:06:41 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E4=BB=A3=E7=A0=81=E6=8F=90?=
=?UTF-8?q?=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jiuyi2/api/shop.js | 13 ++
jiuyi2/common/js/config.js | 2 +-
jiuyi2/common/js/order.js | 35 +++++
jiuyi2/pages/shop/commodity/payment.vue | 4 +-
jiuyi2/pages/shop/order/afterSales.vue | 73 ++++++-----
jiuyi2/pages/shop/order/detail.vue | 166 +++++++++++++++++-------
jiuyi2/pages/shop/order/index.vue | 49 ++++++-
jiuyi2/pages/shop/store/order.vue | 26 ++--
jiuyi2/vite.config.js | 2 +-
9 files changed, 265 insertions(+), 105 deletions(-)
diff --git a/jiuyi2/api/shop.js b/jiuyi2/api/shop.js
index 5a5df13a..04648981 100644
--- a/jiuyi2/api/shop.js
+++ b/jiuyi2/api/shop.js
@@ -603,6 +603,19 @@ const shop = {
load: true,
})
},
+
+ /**
+ * 获取退货地址
+ * @param {Object} param
+ */
+ getReturnAddress(param) {
+ return util.request({
+ url: `/shopify/appRefundOrder/getReturnAddress`,
+ method: 'GET',
+ query: param.query,
+ load: true,
+ })
+ },
}
export default shop
\ No newline at end of file
diff --git a/jiuyi2/common/js/config.js b/jiuyi2/common/js/config.js
index 1082619b..35fdff50 100644
--- a/jiuyi2/common/js/config.js
+++ b/jiuyi2/common/js/config.js
@@ -8,7 +8,7 @@ const config = {
// #ifndef H5
// host: 'http://91f.xyz:8080',
// host: 'http://liuyd.cpolar.top',
- host: 'http://heucy7.natappfree.cc',
+ host: 'http://88bsux.natappfree.cc',
// #endif
// 是否vivo显示
showVivo: true,
diff --git a/jiuyi2/common/js/order.js b/jiuyi2/common/js/order.js
index 797d4584..ad87505c 100644
--- a/jiuyi2/common/js/order.js
+++ b/jiuyi2/common/js/order.js
@@ -128,6 +128,41 @@ const order = {
})
})
},
+
+ /**
+ * 获取退货地址
+ * @param {Object} event 事件对象
+ */
+ getReturnAddress: (event) => {
+ return new Promise((resolve, reject) => {
+ api.shop.getReturnAddress({
+ query: {
+ orderId: event.orderId,
+ },
+ }).then(res => {
+ if (res.code == 200) {
+ resolve(res.data)
+ return
+ }
+ util.alert({
+ content: res.msg,
+ showCancel: false,
+ })
+ })
+ })
+ },
+
+ /*
+ * 查看售后详情
+ * @param {Object} item
+ */
+ handleAfterSalesDetail: (event) => {
+ uni.navigateTo({
+ url: util.setUrl('/pages/shop/order/afterSales', {
+ orderId: event.id,
+ }),
+ })
+ },
}
export default order
\ No newline at end of file
diff --git a/jiuyi2/pages/shop/commodity/payment.vue b/jiuyi2/pages/shop/commodity/payment.vue
index 4c73aef3..78cd4823 100644
--- a/jiuyi2/pages/shop/commodity/payment.vue
+++ b/jiuyi2/pages/shop/commodity/payment.vue
@@ -145,8 +145,8 @@
}).then(res => {
if (res.code == 200) {
// 触发自定义事件
- uni.$off('updateOrderList')
- uni.$off('updateOrderDetail')
+ uni.$emit('updateOrderList')
+ uni.$emit('updateOrderDetail')
uni.navigateBack()
return
} else if (res.code === 501) {
diff --git a/jiuyi2/pages/shop/order/afterSales.vue b/jiuyi2/pages/shop/order/afterSales.vue
index 0f72208f..2654664a 100644
--- a/jiuyi2/pages/shop/order/afterSales.vue
+++ b/jiuyi2/pages/shop/order/afterSales.vue
@@ -22,16 +22,20 @@
const detail = reactive({})
// 流程
- const flow = reactive([{
+ const flow = computed(() => {
+ let result = []
+ if (detail.id) result.push({
+ time: detail.dealTime,
name: '同意退款',
- },
- {
+ }, {
+ time: detail.dealTime,
name: '平台处理中',
- },
- {
+ }, {
+ time: detail.refundTime,
name: '到账成功',
- }
- ])
+ })
+ return result
+ })
onLoad((option) => {
if (option.orderId) orderId.value = option.orderId
@@ -47,15 +51,22 @@
}
}).then(rs => {
if (rs.code == 200) {
- Object.assign(detail, rs.data)
+ const result = rs.data
+ result.payment = util.config.payType[result.refundType]
+ Object.assign(detail, result)
return
}
util.alert({
- content: res.msg,
+ content: rs.msg,
showCancel: false
})
})
}
+
+ // 复制文本
+ function handleCopy() {
+ util.copyText(detail.orderNo)
+ }
@@ -67,7 +78,7 @@
¥
- 2
+ {{detail.refundPrice}}
已退回至九亿钱包
@@ -86,26 +97,26 @@
{{item.name}}
- 10-10 15:27
+ {{item.time}}
-
+
钱款去向
九亿账号
- 12345665
+ {{detail.refundAccount}}
支付方式
- 余额
+ {{detail.payment.name}}
退款账户
- 12345665
+ {{detail.refundAccount}}
@@ -113,34 +124,30 @@
-
+
-
+
- 靠枕 纯棉靠枕 车载居家 纯棉100% 卡通靠枕 人体工学
- 款式:普通款 小熊
+ {{detail.productInfo.name}}
+ 款式:{{detail.style}}
¥
- 89
+ {{detail.productInfo.price}}
- x 1
+ x {{detail.totalNum}}
@@ -148,19 +155,19 @@
订单编号:{{detail.orderNo}}
- 复制
+ 复制
- 申请金额:¥2
+ 申请金额:¥{{detail.refundPrice}}
- 退款原因:其他原因
+ 退款原因:{{detail.refundReasonWap}}
-
+
- 申请时间:2024-12-15 17:00
+ 申请时间:{{detail.createTime}}
diff --git a/jiuyi2/pages/shop/order/detail.vue b/jiuyi2/pages/shop/order/detail.vue
index 9e0f8aee..8e90eeba 100644
--- a/jiuyi2/pages/shop/order/detail.vue
+++ b/jiuyi2/pages/shop/order/detail.vue
@@ -42,6 +42,8 @@
const showOrderDetail = ref(false)
// 物流信息
const logistics = computed(() => detail.logistics.info ? detail.logistics.info[0] : {})
+ // 退货收货地址
+ const returnAddress = reactive({})
onLoad((option) => {
if (option.orderId) orderId.value = option.orderId
@@ -116,11 +118,18 @@
order.orderReceived({
orderId: detail.id,
}).then(res => {
- // 重载列表
- refreshList()
+ uni.$emit('updateOrderList')
+ // 获取订单详情
+ getDetail()
})
}
+ // 填写退货物流信息
+ function handleExpress(item) {
+ Object.assign(orderDetail, {}, item)
+ proxy.$refs.expressRef.open()
+ }
+
/**
* 填写退货物流信息
* @param {Object} param
@@ -128,15 +137,42 @@
function handleExpressConfirm(param) {
let data = {
...param,
- id: detail.id,
+ id: orderDetail.refundOrder.id,
}
- console.log('orderupdateRefund', data)
- order.orderupdateRefund(data).then(res => {
- // 重载列表
- refreshList()
+ api.shop.setShopOrderRefundGoods({
+ data,
+ }).then(res => {
+ if (res.code == 200) {
+ uni.$emit('updateOrderList')
+ // 获取订单详情
+ getDetail()
+ return
+ }
+ util.alert({
+ content: res.msg,
+ showCancel: false
+ })
})
}
+
+ /**
+ * 查看收货地址
+ * @param {Object} item
+ */
+ function handleReturnAddress(item) {
+ order.getReturnAddress({
+ orderId: item.id,
+ }).then(res => {
+ Object.assign(returnAddress, res)
+ proxy.$refs.addressRef.open()
+ })
+ }
+
+ // 复制收货地址
+ function handleAddressCopy() {
+ util.copyText(`${returnAddress.realName} ${returnAddress.userPhone} ${returnAddress.userAddress}`)
+ }
@@ -234,55 +270,89 @@
-->
-
+
+
+
+
+
+
+
+ 查看退货地址
-
-
-
- 填写退货物流信息
-
+
+ 填写退货物流信息
+
+
+
+
+
+ 查看售后详情
+
+
+
+
+
+ 取消订单
+ 继续付款
-
-
-
-
- 取消订单
- 继续付款
-
-
-
- 取消订单
-
-
-
- 申请退款
-
- 申请平台介入
- 查看物流
-
- 确认收货
-
-
-
-
-
- 申请平台介入
- 申请退款
- 评价
-
-
-
- 取消售后
-
-
- 申请平台介入
-
+
+
+ 取消订单
+
+
+
+ 申请退款
+
+ 申请平台介入
+ 查看物流
+
+ 确认收货
+
+
+
+
+ 申请平台介入
+ 申请退款
+ 评价
+
+
+
+ 取消售后
+
+
+ 申请平台介入
+
+
+
+
+
+
+
+
+ {{returnAddress.realName}}
+
+
+ {{returnAddress.userPhone}}
+
+
+ {{returnAddress.userAddress}}
+
+
+
+ 复制
+
+