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