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) + }