工作代码提交

This commit is contained in:
sx 2025-04-24 13:35:07 +08:00
parent 4ebbbd8b29
commit ad8fafcec0
6 changed files with 306 additions and 68 deletions

View File

@ -564,6 +564,45 @@ const shop = {
load: true, 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 export default shop

View File

@ -172,7 +172,12 @@
"setting" : { "setting" : {
"urlCheck" : false "urlCheck" : false
}, },
"usingComponents" : true "usingComponents" : true,
"permission" : {
"scope.userLocation" : {
"desc" : "为了使用服务,需要获取您当前的位置"
}
}
}, },
"mp-alipay" : { "mp-alipay" : {
"usingComponents" : true "usingComponents" : true

View File

@ -1,8 +1,25 @@
<script setup> <script setup>
// //
import { import {
reactive ref,
} from 'vue'; reactive,
computed,
getCurrentInstance,
} from 'vue'
import {
onLoad,
onReady,
onPageScroll,
} from '@dcloudio/uni-app';
//
import util from '@/common/js/util';
//
import api from '@/api/index.js'
// id
const orderId = ref('')
//
const detail = reactive({})
// //
const flow = reactive([{ const flow = reactive([{
@ -15,6 +32,30 @@
name: '到账成功', name: '到账成功',
} }
]) ])
onLoad((option) => {
if (option.orderId) orderId.value = option.orderId
//
getDetail()
})
//
function getDetail() {
api.shop.getRefundOrder({
query: {
orderId: orderId.value,
}
}).then(rs => {
if (rs.code == 200) {
Object.assign(detail, rs.data)
return
}
util.alert({
content: res.msg,
showCancel: false
})
})
}
</script> </script>
<template> <template>
@ -106,7 +147,7 @@
<!-- 订单信息 --> <!-- 订单信息 -->
<view class="order mt30 f26 c999"> <view class="order mt30 f26 c999">
<view class="line mtb20 rows"> <view class="line mtb20 rows">
<text>订单编号251547812138</text> <text>订单编号{{detail.orderNo}}</text>
<view class="btn ti closeHollow plr20">复制</view> <view class="btn ti closeHollow plr20">复制</view>
</view> </view>
<view class="line mtb20"> <view class="line mtb20">
@ -128,7 +169,7 @@
<view class="fill" style="height: 150rpx;"></view> <view class="fill" style="height: 150rpx;"></view>
<!-- --> <!-- -->
<view class="footer df jcr plr30 bfff shadow"> <view class="footer df jcr plr30 bfff shadow" v-if="0">
<view class="btn sm bar closeHollow plr20">联系商家</view> <view class="btn sm bar closeHollow plr20">联系商家</view>
</view> </view>
</view> </view>

View File

@ -153,7 +153,7 @@
'1': '商家拒绝', '1': '商家拒绝',
'2': '退款中', '2': '退款中',
'3': '已退款', '3': '已退款',
'4': '待用户退货', '4': '待买家退货',
'5': '商家待收货', '5': '商家待收货',
'6': '已撤销', '6': '已撤销',
} [item.afterSaleStatus] } [item.afterSaleStatus]
@ -240,13 +240,33 @@
function handleExpressConfirm(param) { function handleExpressConfirm(param) {
let data = { let data = {
...param, ...param,
id: orderDetail.id, id: orderDetail.refundOrder.id,
} }
console.log('orderupdateRefund', data)
order.orderupdateRefund(data).then(res => { api.shop.setShopOrderRefundGoods({
data,
}).then(res => {
if (res.code == 200) {
// //
refreshList() 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,
}),
}) })
} }
</script> </script>
@ -278,16 +298,24 @@
<orderItem :item="item" mode="mine" @item="handleItem"> <orderItem :item="item" mode="mine" @item="handleItem">
<!-- 操作按钮 --> <!-- 操作按钮 -->
<template #menu="scope"> <template #menu="scope">
<view class="menu ptb20 df jcr" v-if="[0,1,4,5,6].includes(scope.item.status) || scope.item.refundStatus == 1"> <!-- 售后 -->
<template v-if="[0,1,2,5,6].includes(scope.item.afterSaleStatus)">
</template>
<!-- 待买家发货 -->
<view class="menu ptb20 df jcr" v-else-if="scope.item.afterSaleStatus == 4">
<!-- 售后中 --> <!-- 售后中 -->
<template v-if="scope.item.refundStatus == 1">
<template v-if="scope.item.refundStatus == 4">
<view class="btn bar warmHollow plr30" @click.stop="handleExpress(scope.item)"> <view class="btn bar warmHollow plr30" @click.stop="handleExpress(scope.item)">
填写退货物流信息</view> 填写退货物流信息</view>
</template> </view>
</template> <!-- 售后 -->
<view class="menu ptb20 df jcr" v-else-if="scope.item.afterSaleStatus == 3">
<!-- 售后中 -->
<view class="btn bar closeHollow plr30"
@click.stop="handleAfterSalesDetail(scope.item)">
查看售后详情</view>
</view>
<!-- 非售后 --> <!-- 非售后 -->
<template v-else-if="scope.item.refundStatus == 0"> <view class="menu ptb20 df jcr" v-else-if="[0,1,4,5,6].includes(scope.item.status)">
<!-- 待支付 --> <!-- 待支付 -->
<template v-if="scope.item.status == 0"> <template v-if="scope.item.status == 0">
<view class="btn bar closeHollow plr30" @click.stop="handleCancel(scope.item)"> <view class="btn bar closeHollow plr30" @click.stop="handleCancel(scope.item)">
@ -307,8 +335,8 @@
@click.stop="order.orderAfterSales(scope.item)">申请退款</view> @click.stop="order.orderAfterSales(scope.item)">申请退款</view>
<!-- <view class="btn bar closeHollow plr30" v-if="scope.item.afterSaleStatus === 1"> <!-- <view class="btn bar closeHollow plr30" v-if="scope.item.afterSaleStatus === 1">
申请平台介入</view> --> 申请平台介入</view> -->
<view class="btn bar closeHollow plr30" <view class="btn bar closeHollow plr30" @click.stop="order.logistics(scope.item)">
@click.stop="order.logistics(scope.item)">查看物流</view> 查看物流</view>
<view class="btn bar warmHollow plr30" @click.stop="handleReceived(scope.item)"> <view class="btn bar warmHollow plr30" @click.stop="handleReceived(scope.item)">
确认收货 确认收货
</view> </view>
@ -319,9 +347,10 @@
v-if="scope.item.afterSaleStatus === 1 && scope.item.isGiftPack != 1 && 0"> v-if="scope.item.afterSaleStatus === 1 && scope.item.isGiftPack != 1 && 0">
申请平台介入</view> 申请平台介入</view>
<view class="btn bar closeHollow plr30" <view class="btn bar closeHollow plr30"
@click.stop="order.orderAfterSales(scope.item)" v-if="scope.item.isGiftPack != 1">申请退款</view> @click.stop="order.orderAfterSales(scope.item)"
<view class="btn bar warmHollow plr30" v-if="scope.item.isGiftPack != 1">申请退款</view>
@click.stop="order.orderComment(scope.item)">评价</view> <view class="btn bar warmHollow plr30" @click.stop="order.orderComment(scope.item)">
评价</view>
</template> </template>
<!-- 已完成 --> <!-- 已完成 -->
<template v-else-if="scope.item.status == 6"> <template v-else-if="scope.item.status == 6">
@ -329,7 +358,6 @@
<!-- <view class="btn bar closeHollow plr30">钱款去向</view> --> <!-- <view class="btn bar closeHollow plr30">钱款去向</view> -->
<!-- <view class="btn bar warmHollow plr30" v-if="scope.item.afterSaleStatus === 1">申请平台介入</view> --> <!-- <view class="btn bar warmHollow plr30" v-if="scope.item.afterSaleStatus === 1">申请平台介入</view> -->
</template> </template>
</template>
</view> </view>
</template> </template>
</orderItem> </orderItem>

View File

@ -69,6 +69,12 @@
const apexBgColor = ref('#ffffff00') const apexBgColor = ref('#ffffff00')
// //
const orderDetail = reactive({}) const orderDetail = reactive({})
// 退
const address = reactive({
real_name: '',
user_phone: '',
user_address: '',
})
// //
const userinfo = computed(() => store.state.userinfo) const userinfo = computed(() => store.state.userinfo)
@ -78,7 +84,7 @@
}) })
// //
onReady(() => { onReady(() => {
// proxy.$refs.changePriceRef.open() // proxy.$refs.addressRef.open()
}) })
onPageScroll((ev) => { onPageScroll((ev) => {
@ -252,7 +258,7 @@
function handleUnrefund(item) { function handleUnrefund(item) {
api.shop.setShopOrderUnrefund({ api.shop.setShopOrderUnrefund({
data: { data: {
// id // id
id: item.refundOrder.id, id: item.refundOrder.id,
// //
refundOrderNo: item.orderNo, 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 * @param {Array} urls
@ -283,6 +352,27 @@
current, 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
})
})
}
</script> </script>
<template> <template>
@ -311,7 +401,7 @@
<orderItem :item="item" mode="shop" @item="handleItem"> <orderItem :item="item" mode="shop" @item="handleItem">
<template #menu="scope"> <template #menu="scope">
<!-- 售后流程 --> <!-- 售后流程 -->
<template v-if="scope.item.refundStatus == 1"> <template v-if="scope.item.refundStatus == 1 ">
<!-- 退款原因 --> <!-- 退款原因 -->
<view class="menu rows ptb20"> <view class="menu rows ptb20">
<view class="key fs0 c333">退款原因</view> <view class="key fs0 c333">退款原因</view>
@ -329,13 +419,21 @@
</view> </view>
</view> </view>
<view class="menu ptb20 df jcr"> <!-- 待商家审核 -->
<view class="menu ptb20 df jcr" v-if="scope.item.afterSaleStatus == 0">
<view class="btn bar closeHollow plr30" <view class="btn bar closeHollow plr30"
@click.stop="handleUnrefund(scope.item)"> @click.stop="handleUnrefund(scope.item)">拒绝退款</view>
拒绝退款</view> <view class="btn bar closeHollow plr30" @click.stop="handleRefund(scope.item)">
<view class="btn bar closeHollow plr30">同意退款</view> 同意退款</view>
<!-- <view class="btn bar warmHollow plr30">联系用户</view> --> <!-- <view class="btn bar warmHollow plr30">联系用户</view> -->
</view> </view>
<!-- 待商家确认收货 -->
<view class="menu ptb20 df jcr" v-if="scope.item.afterSaleStatus == 5">
<view class="btn bar warmHollow plr30"
@click.stop="handleRefundOrder(scope.item)">
确认收货</view>
</view>
</template> </template>
<template v-else> <template v-else>
<!-- 收货地址 --> <!-- 收货地址 -->
@ -386,7 +484,7 @@
<uni-icons type="closeempty" @click="$refs.changePriceRef.close()" /> <uni-icons type="closeempty" @click="$refs.changePriceRef.close()" />
</view> </view>
<view class="form ooh mtb30 plr30 c333 f30"> <view class="form oh mtb30 plr30 c333 f30">
<view class="line df aic"> <view class="line df aic">
<view class="mr20">输入金额</view> <view class="mr20">输入金额</view>
<input type="text" v-model="orderDetail.price" placeholder="输入修改价格" <input type="text" v-model="orderDetail.price" placeholder="输入修改价格"
@ -397,6 +495,33 @@
<view class="btn warm mtb30 mlr30" @click="handlePriceChangeConfirm">确定金额</view> <view class="btn warm mtb30 mlr30" @click="handlePriceChangeConfirm">确定金额</view>
</view> </view>
</uni-popup> </uni-popup>
<!-- 同意退款 -->
<uni-popup ref="addressRef" type="center">
<view class="addressAlt popMid bfff">
<view class="header rows ptb20 plr20">
<view>填写退货地址信息</view>
<uni-icons type="closeempty" @click="$refs.addressRef.close()" />
</view>
<view class="form oh plr30 c333 f30">
<view class="line mtb20">
<input type="text" v-model="address.real_name" placeholder="收货人姓名"
placeholder-class="placeholderStyle" />
</view>
<view class="line mtb20">
<input type="text" v-model="address.user_phone" placeholder="收货人电话"
placeholder-class="placeholderStyle" />
</view>
<view class="line mtb20">
<input type="text" v-model="address.user_address" placeholder="收货人详细地址"
placeholder-class="placeholderStyle" />
</view>
</view>
<view class="btn warm mtb30 mlr30" @click="handleAddressConfirm">确认</view>
</view>
</uni-popup>
</view> </view>
</template> </template>

View File

@ -5,7 +5,7 @@ import uni from '@dcloudio/vite-plugin-uni';
// let target = 'http://91f.xyz:8080' // let target = 'http://91f.xyz:8080'
// let target = 'http://liuyd.cpolar.top' // let target = 'http://liuyd.cpolar.top'
let target = 'http://yjggbt.natappfree.cc' let target = 'http://rcq3fm.natappfree.cc'
export default defineConfig({ export default defineConfig({
plugins: [uni()], plugins: [uni()],