From ad8fafcec0408e0a7edc93f101dafbb1e01f8158 Mon Sep 17 00:00:00 2001
From: sx <2427911852@qq.com>
Date: Thu, 24 Apr 2025 13:35:07 +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 | 39 +++++++
jiuyi2/manifest.json | 7 +-
jiuyi2/pages/shop/order/afterSales.vue | 49 ++++++++-
jiuyi2/pages/shop/order/index.vue | 136 ++++++++++++++----------
jiuyi2/pages/shop/store/order.vue | 141 +++++++++++++++++++++++--
jiuyi2/vite.config.js | 2 +-
6 files changed, 306 insertions(+), 68 deletions(-)
diff --git a/jiuyi2/api/shop.js b/jiuyi2/api/shop.js
index a2880293..5a5df13a 100644
--- a/jiuyi2/api/shop.js
+++ b/jiuyi2/api/shop.js
@@ -564,6 +564,45 @@ const shop = {
load: true,
})
},
+
+ /**
+ * 退货退款买家发货
+ * @param {Object} param
+ */
+ setShopOrderRefundGoods(param) {
+ return util.request({
+ url: `/shopify/refundOrder/dealRefundOrderReturnGoods`,
+ method: 'POST',
+ data: param.data,
+ load: true,
+ })
+ },
+
+ /**
+ * 商家确认收货
+ * @param {Object} param
+ */
+ setShopRefundOrder(param) {
+ return util.request({
+ url: `/shopify/refundOrder`,
+ method: 'GET',
+ path: param.path,
+ load: true,
+ })
+ },
+
+ /**
+ * 查看退款详情
+ * @param {Object} param
+ */
+ getRefundOrder(param) {
+ return util.request({
+ url: `/shopify/refundOrder/getInfo`,
+ method: 'GET',
+ query: param.query,
+ load: true,
+ })
+ },
}
export default shop
\ No newline at end of file
diff --git a/jiuyi2/manifest.json b/jiuyi2/manifest.json
index 0acd3247..b57e3ce2 100644
--- a/jiuyi2/manifest.json
+++ b/jiuyi2/manifest.json
@@ -172,7 +172,12 @@
"setting" : {
"urlCheck" : false
},
- "usingComponents" : true
+ "usingComponents" : true,
+ "permission" : {
+ "scope.userLocation" : {
+ "desc" : "为了使用服务,需要获取您当前的位置"
+ }
+ }
},
"mp-alipay" : {
"usingComponents" : true
diff --git a/jiuyi2/pages/shop/order/afterSales.vue b/jiuyi2/pages/shop/order/afterSales.vue
index 4ac3f78b..0f72208f 100644
--- a/jiuyi2/pages/shop/order/afterSales.vue
+++ b/jiuyi2/pages/shop/order/afterSales.vue
@@ -1,8 +1,25 @@
@@ -106,7 +147,7 @@
- 订单编号:251547812138
+ 订单编号:{{detail.orderNo}}
复制
@@ -128,7 +169,7 @@
-
+
联系商家
diff --git a/jiuyi2/pages/shop/order/index.vue b/jiuyi2/pages/shop/order/index.vue
index a4f2309f..9720235b 100644
--- a/jiuyi2/pages/shop/order/index.vue
+++ b/jiuyi2/pages/shop/order/index.vue
@@ -153,7 +153,7 @@
'1': '商家拒绝',
'2': '退款中',
'3': '已退款',
- '4': '待用户退货',
+ '4': '待买家退货',
'5': '商家待收货',
'6': '已撤销',
} [item.afterSaleStatus]
@@ -240,13 +240,33 @@
function handleExpressConfirm(param) {
let data = {
...param,
- id: orderDetail.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) {
+ // 重载列表
+ refreshList()
+ return
+ }
+ util.alert({
+ content: res.msg,
+ showCancel: false
+ })
+ })
+ }
+
+ /**
+ * 查看售后详情
+ * @param {Object} item
+ */
+ function handleAfterSalesDetail(item) {
+ uni.navigateTo({
+ url: util.setUrl('/pages/shop/order/afterSales',{
+ orderId: item.id,
+ }),
})
}
@@ -278,57 +298,65 @@
-
diff --git a/jiuyi2/pages/shop/store/order.vue b/jiuyi2/pages/shop/store/order.vue
index d24a0f42..36e3882f 100644
--- a/jiuyi2/pages/shop/store/order.vue
+++ b/jiuyi2/pages/shop/store/order.vue
@@ -69,6 +69,12 @@
const apexBgColor = ref('#ffffff00')
// 当前操作的订单
const orderDetail = reactive({})
+ // 确认退货的收货地址
+ const address = reactive({
+ real_name: '',
+ user_phone: '',
+ user_address: '',
+ })
// 用户信息
const userinfo = computed(() => store.state.userinfo)
@@ -78,7 +84,7 @@
})
//
onReady(() => {
- // proxy.$refs.changePriceRef.open()
+ // proxy.$refs.addressRef.open()
})
onPageScroll((ev) => {
@@ -252,7 +258,7 @@
function handleUnrefund(item) {
api.shop.setShopOrderUnrefund({
data: {
- // 订单id
+ // 售后订单id
id: item.refundOrder.id,
// 订单编号
refundOrderNo: item.orderNo,
@@ -272,6 +278,69 @@
})
}
+ /**
+ * 商家同意售后
+ * @param {Object} item 订单项
+ */
+ function handleRefund(item) {
+ console.log('handleRefund', item)
+ Object.assign(orderDetail, {}, item)
+ // 售后类型:1-仅退款,2-退货退款
+ if (item.refundOrder.afterSalesType == 1) handleOrderRefund()
+ else if (item.refundOrder.afterSalesType == 2) proxy.$refs.addressRef.open()
+ }
+
+ // 填写收货地址确认
+ function handleAddressConfirm() {
+ console.log('address', address)
+ // 验证必填项
+ if (!address.real_name) {
+ util.alert('收货人姓名不能为空')
+ return
+ }
+ if (!address.user_phone) {
+ util.alert('收货人电话不能为空')
+ return
+ }
+ if (!address.user_address) {
+ util.alert('收货地址不能为空')
+ return
+ }
+ //
+ handleOrderRefund()
+ }
+
+ // 确认售后
+ function handleOrderRefund() {
+ //
+ api.shop.setShopOrderRefund({
+ data: {
+ // 售后订单id
+ id: orderDetail.refundOrder.id,
+ // 订单编号
+ refundOrderNo: orderDetail.orderNo,
+ // 订单金额
+ refundPrice: orderDetail.totalPrice,
+ ...address,
+ },
+ }).then(res => {
+ if (res.code === 200) {
+ proxy.$refs.addressRef.close()
+ address.real_name = ''
+ address.user_address = ''
+ address.user_phone = ''
+ // 重载列表
+ refreshList()
+ return
+ }
+ util.alert({
+ content: res.msg,
+ showCancel: false
+ })
+ })
+
+ }
+
/**
* 预览图片
* @param {Array} urls
@@ -283,6 +352,27 @@
current,
})
}
+
+ /**
+ * 商家确认收货
+ * @param {Object} item 订单项
+ */
+ function handleRefundOrder(item) {
+ api.shop.setShopRefundOrder({
+ // 售后订单id
+ path: [item.refundOrder.id],
+ }).then(res => {
+ if (res.code === 200) {
+ // 重载列表
+ refreshList()
+ return
+ }
+ util.alert({
+ content: res.msg,
+ showCancel: false
+ })
+ })
+ }
@@ -311,7 +401,7 @@
-
+
-
+
+
+
@@ -386,7 +484,7 @@
-
+
输入金额
确定金额
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 确认
+
+
diff --git a/jiuyi2/vite.config.js b/jiuyi2/vite.config.js
index 035c00ad..6d71f5c5 100644
--- a/jiuyi2/vite.config.js
+++ b/jiuyi2/vite.config.js
@@ -5,7 +5,7 @@ import uni from '@dcloudio/vite-plugin-uni';
// let target = 'http://91f.xyz:8080'
// let target = 'http://liuyd.cpolar.top'
-let target = 'http://yjggbt.natappfree.cc'
+let target = 'http://rcq3fm.natappfree.cc'
export default defineConfig({
plugins: [uni()],