工作代码提交

This commit is contained in:
sx 2025-04-25 11:06:41 +08:00
parent ad8fafcec0
commit a6da6b7394
9 changed files with 265 additions and 105 deletions

View File

@ -603,6 +603,19 @@ const shop = {
load: true, load: true,
}) })
}, },
/**
* 获取退货地址
* @param {Object} param
*/
getReturnAddress(param) {
return util.request({
url: `/shopify/appRefundOrder/getReturnAddress`,
method: 'GET',
query: param.query,
load: true,
})
},
} }
export default shop export default shop

View File

@ -8,7 +8,7 @@ const config = {
// #ifndef H5 // #ifndef H5
// host: 'http://91f.xyz:8080', // host: 'http://91f.xyz:8080',
// host: 'http://liuyd.cpolar.top', // host: 'http://liuyd.cpolar.top',
host: 'http://heucy7.natappfree.cc', host: 'http://88bsux.natappfree.cc',
// #endif // #endif
// 是否vivo显示 // 是否vivo显示
showVivo: true, showVivo: true,

View File

@ -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 export default order

View File

@ -145,8 +145,8 @@
}).then(res => { }).then(res => {
if (res.code == 200) { if (res.code == 200) {
// //
uni.$off('updateOrderList') uni.$emit('updateOrderList')
uni.$off('updateOrderDetail') uni.$emit('updateOrderDetail')
uni.navigateBack() uni.navigateBack()
return return
} else if (res.code === 501) { } else if (res.code === 501) {

View File

@ -22,16 +22,20 @@
const detail = reactive({}) const detail = reactive({})
// //
const flow = reactive([{ const flow = computed(() => {
let result = []
if (detail.id) result.push({
time: detail.dealTime,
name: '同意退款', name: '同意退款',
}, }, {
{ time: detail.dealTime,
name: '平台处理中', name: '平台处理中',
}, }, {
{ time: detail.refundTime,
name: '到账成功', name: '到账成功',
} })
]) return result
})
onLoad((option) => { onLoad((option) => {
if (option.orderId) orderId.value = option.orderId if (option.orderId) orderId.value = option.orderId
@ -47,15 +51,22 @@
} }
}).then(rs => { }).then(rs => {
if (rs.code == 200) { 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 return
} }
util.alert({ util.alert({
content: res.msg, content: rs.msg,
showCancel: false showCancel: false
}) })
}) })
} }
//
function handleCopy() {
util.copyText(detail.orderNo)
}
</script> </script>
<template> <template>
@ -67,7 +78,7 @@
<view class="result mtb30"> <view class="result mtb30">
<view class="refundPrice "> <view class="refundPrice ">
<text class="f48"></text> <text class="f48"></text>
<text class="value">2</text> <text class="value">{{detail.refundPrice}}</text>
</view> </view>
<view class="c37B111">已退回至九亿钱包</view> <view class="c37B111">已退回至九亿钱包</view>
</view> </view>
@ -86,26 +97,26 @@
</view> </view>
<view class="main mt20 tac c999 f26"> <view class="main mt20 tac c999 f26">
<view class="name">{{item.name}}</view> <view class="name">{{item.name}}</view>
<view class="time mt10">10-10 15:27</view> <view class="time mt10">{{item.time}}</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 退款金额 --> <!-- 退款金额 -->
<view class="container info c999 f28"> <view class="container info c999 f28" v-if="detail.id">
<view class="title mtb20 c333 f32">钱款去向</view> <view class="title mtb20 c333 f32">钱款去向</view>
<view class="line rows mtb20"> <view class="line rows mtb20">
<view class="key">九亿账号</view> <view class="key">九亿账号</view>
<view class="">12345665</view> <view class="">{{detail.refundAccount}}</view>
</view> </view>
<view class="line rows mtb20"> <view class="line rows mtb20">
<view class="key">支付方式</view> <view class="key">支付方式</view>
<view class="">余额</view> <view class="">{{detail.payment.name}}</view>
</view> </view>
<view class="line rows mtb20"> <view class="line rows mtb20">
<view class="key">退款账户</view> <view class="key">退款账户</view>
<view class="">12345665</view> <view class="">{{detail.refundAccount}}</view>
</view> </view>
</view> </view>
@ -113,34 +124,30 @@
<view class="header line rows ptb20 f28"> <view class="header line rows ptb20 f28">
<!-- 店铺 --> <!-- 店铺 -->
<view class="store df aic thd f1"> <view class="store df aic thd f1">
<image class="wh50 br10" <image class="wh50 br10" :src="detail.merchantAvatar" mode="aspectFill" />
src="https://img13.360buyimg.com/n1/jfs/t1/117234/35/34799/82687/6449f2b4Fd6e2eef9/a754c5e178c9e9be.jpg.avif" <view class="name ml10 c333">{{detail.merchantName}}</view>
mode="aspectFill" />
<view class="name ml10 c333">家纺专营店</view>
</view> </view>
</view> </view>
<!-- 商品信息 --> <!-- 商品信息 -->
<view class="product line df ptb20"> <view class="product line df ptb20" v-if="detail.productInf">
<view class="poster wh160"> <view class="poster wh160">
<image class="wh160 br10" <image class="wh160 br10" :src="detail.productInfo.sliderImage.split(',')[0]" mode="aspectFill" />
src="https://img13.360buyimg.com/n1/jfs/t1/117234/35/34799/82687/6449f2b4Fd6e2eef9/a754c5e178c9e9be.jpg.avif"
mode="aspectFill" />
</view> </view>
<!-- 产品名称 购买的规格 --> <!-- 产品名称 购买的规格 -->
<view class="info mlr20 f1"> <view class="info mlr20 f1">
<view class="name c333 f28">靠枕 纯棉靠枕 车载居家 纯棉100% 卡通靠枕 人体工学</view> <view class="name c333 f28">{{detail.productInfo.name}}</view>
<view class="spec mt10 c999 f26">款式普通款 小熊</view> <view class="spec mt10 c999 f26">款式{{detail.style}}</view>
</view> </view>
<!-- 单价 数量 --> <!-- 单价 数量 -->
<view class="tar"> <view class="tar">
<view class="price c666"> <view class="price c666">
<text class="f20"></text> <text class="f20"></text>
<text class="f26">89</text> <text class="f26">{{detail.productInfo.price}}</text>
</view> </view>
<view class="number f24 c999">x 1</view> <view class="number f24 c999">x {{detail.totalNum}}</view>
</view> </view>
</view> </view>
@ -148,19 +155,19 @@
<view class="order mt30 f26 c999"> <view class="order mt30 f26 c999">
<view class="line mtb20 rows"> <view class="line mtb20 rows">
<text>订单编号{{detail.orderNo}}</text> <text>订单编号{{detail.orderNo}}</text>
<view class="btn ti closeHollow plr20">复制</view> <view class="btn ti closeHollow plr20" @click="handleCopy">复制</view>
</view> </view>
<view class="line mtb20"> <view class="line mtb20">
<text>申请金额2</text> <text>申请金额{{detail.refundPrice}}</text>
</view> </view>
<view class="line mtb20"> <view class="line mtb20">
<text>退款原因其他原因</text> <text>退款原因{{detail.refundReasonWap}}</text>
</view> </view>
<view class="line mtb20"> <!-- <view class="line mtb20">
<text>收货状态已收货</text> <text>收货状态已收货</text>
</view> </view> -->
<view class="line mtb20"> <view class="line mtb20">
<text>申请时间2024-12-15 17:00</text> <text>申请时间{{detail.createTime}}</text>
</view> </view>
</view> </view>
</view> </view>

View File

@ -42,6 +42,8 @@
const showOrderDetail = ref(false) const showOrderDetail = ref(false)
// //
const logistics = computed(() => detail.logistics.info ? detail.logistics.info[0] : {}) const logistics = computed(() => detail.logistics.info ? detail.logistics.info[0] : {})
// 退
const returnAddress = reactive({})
onLoad((option) => { onLoad((option) => {
if (option.orderId) orderId.value = option.orderId if (option.orderId) orderId.value = option.orderId
@ -116,11 +118,18 @@
order.orderReceived({ order.orderReceived({
orderId: detail.id, orderId: detail.id,
}).then(res => { }).then(res => {
// uni.$emit('updateOrderList')
refreshList() //
getDetail()
}) })
} }
// 退
function handleExpress(item) {
Object.assign(orderDetail, {}, item)
proxy.$refs.expressRef.open()
}
/** /**
* 填写退货物流信息 * 填写退货物流信息
* @param {Object} param * @param {Object} param
@ -128,15 +137,42 @@
function handleExpressConfirm(param) { function handleExpressConfirm(param) {
let data = { let data = {
...param, ...param,
id: detail.id, id: orderDetail.refundOrder.id,
} }
console.log('orderupdateRefund', data)
order.orderupdateRefund(data).then(res => { api.shop.setShopOrderRefundGoods({
// data,
refreshList() }).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}`)
}
</script> </script>
<template> <template>
@ -234,55 +270,89 @@
</view> --> </view> -->
<view class="fill"></view> <view class="fill"></view>
<view class="footer df jcr plr30 bfff shadow" v-if="[0,1,4,5,6].includes(detail.status)"> <!-- 售后 -->
<template v-if="[0,1,2,5,6].includes(detail.afterSaleStatus)">
</template>
<!-- 待买家发货 -->
<view class="footer df jcr plr30 bfff shadow" v-else-if="detail.afterSaleStatus == 4">
<!-- 查看退货地址 -->
<view class="btn bar closeHollow plr30" @click.stop="handleReturnAddress(detail)">
查看退货地址</view>
<!-- 售后中 --> <!-- 售后中 -->
<template v-if="detail.refundStatus == 1"> <view class="btn bar warmHollow plr30" @click.stop="handleExpress(detail)">
<template v-if="detail.refundStatus == 4"> 填写退货物流信息</view>
<view class="btn bar warmHollow plr30" @click.stop="$refs.expressRef.open()"> </view>
填写退货物流信息</view> <!-- 售后 -->
</template> <view class="footer df jcr plr30 bfff shadow" v-else-if="detail.afterSaleStatus == 3">
<!-- 售后中 -->
<view class="btn bar closeHollow plr30" @click.stop="handleAfterSalesDetail(detail)">
查看售后详情</view>
</view>
<!-- 非售后 -->
<view class="footer df jcr plr30 bfff shadow" v-else-if="[0,1,4,5,6].includes(detail.status)">
<!-- 待支付 -->
<template v-if="detail.status == 0">
<view class="btn bar closeHollow plr30" @click="handleCancel">取消订单</view>
<view class="btn bar warmHollow plr30" @click="order.orderPay(detail)">继续付款</view>
</template> </template>
<!-- 非售后 --> <!-- 待发货 -->
<template v-else-if="detail.refundStatus == 0"> <template v-else-if="detail.status == 1">
<!-- 待支付 --> <view class="btn bar closeHollow plr30" @click.stop="handleCancel">取消订单</view>
<template v-if="detail.status == 0"> </template>
<view class="btn bar closeHollow plr30" @click="handleCancel">取消订单</view> <!-- 待收货 -->
<view class="btn bar warmHollow plr30" @click="order.orderPay(detail)">继续付款</view> <template v-else-if="detail.status == 4">
</template> <view class="btn bar closeHollow plr30" @click.stop="order.orderAfterSales(detail)">申请退款</view>
<!-- 待发货 --> <view class="btn bar closeHollow plr30" v-if="detail.afterSaleStatus === 1">
<template v-else-if="detail.status == 1"> 申请平台介入</view>
<view class="btn bar closeHollow plr30" @click.stop="handleCancel">取消订单</view> <view class="btn bar closeHollow plr30" @click.stop="order.logistics(detail)">查看物流
</template> </view>
<!-- 待收货 --> <view class="btn bar warmHollow plr30" @click.stop="handleReceived">确认收货
<template v-else-if="detail.status == 4"> </view>
<view class="btn bar closeHollow plr30" @click.stop="order.orderAfterSales(detail)">申请退款</view> </template>
<view class="btn bar closeHollow plr30" v-if="detail.afterSaleStatus === 1"> <!-- 已收货 -->
申请平台介入</view> <template v-else-if="detail.status == 5">
<view class="btn bar closeHollow plr30" @click.stop="order.logistics(detail)">查看物流 <view class="btn bar closeHollow plr30"
</view> v-if="detail.afterSaleStatus === 1 && detail.isGiftPack != 1 && 0">申请平台介入</view>
<view class="btn bar warmHollow plr30" @click.stop="handleReceived">确认收货 <view class="btn bar closeHollow plr30" @click.stop="order.orderAfterSales(detail)"
</view> v-if="detail.isGiftPack != 1">申请退款</view>
</template> <view class="btn bar warmHollow plr30" @click.stop="order.orderComment(detail)">评价</view>
<!-- 已收货 --> </template>
<template v-else-if="detail.status == 5"> <!-- 已完成 -->
<view class="btn bar closeHollow plr30" v-if="detail.afterSaleStatus === 1"> <template v-else-if="detail.status == 6">
申请平台介入</view> <view class="btn bar closeHollow plr30">取消售后</view>
<view class="btn bar closeHollow plr30" @click.stop="order.orderAfterSales(detail)">申请退款</view> <!-- <view class="btn bar closeHollow plr30">钱款去向</view> -->
<view class="btn bar warmHollow plr30" @click.stop="order.orderComment(detail)">评价</view> <view class="btn bar warmHollow plr30" v-if="detail.afterSaleStatus === 1">
</template> 申请平台介入</view>
<!-- 已完成 -->
<template v-else-if="detail.status == 6">
<view class="btn bar closeHollow plr30">取消售后</view>
<!-- <view class="btn bar closeHollow plr30">钱款去向</view> -->
<view class="btn bar warmHollow plr30" v-if="detail.afterSaleStatus === 1">
申请平台介入</view>
</template>
</template> </template>
</view> </view>
</view> </view>
<!-- 物流弹窗 --> <!-- 物流弹窗 -->
<expressVue ref="expressRef" @confirm="handleExpressConfirm" /> <expressVue ref="expressRef" @confirm="handleExpressConfirm" />
<!-- 同意退款 -->
<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">
<view class="value mt10">{{returnAddress.realName}}</view>
</view>
<view class="line mtb20">
<view class="value mt10">{{returnAddress.userPhone}}</view>
</view>
<view class="line mtb20">
<view class="value mt10">{{returnAddress.userAddress}}</view>
</view>
</view>
<view class="btn warm mtb30 mlr30" @click="handleAddressCopy">复制</view>
</view>
</uni-popup>
</template> </template>
<style lang="scss"> <style lang="scss">

View File

@ -76,6 +76,8 @@
const apexBgColor = ref('#ffffff00') const apexBgColor = ref('#ffffff00')
// //
const orderDetail = reactive({}) const orderDetail = reactive({})
// 退
const returnAddress = reactive({})
onLoad((option) => { onLoad((option) => {
if (option.tabIndex) tabIndex.value = Number(option.tabIndex) if (option.tabIndex) tabIndex.value = Number(option.tabIndex)
@ -259,16 +261,22 @@
} }
/** /**
* 查看售后详情 * 查看收货地址
* @param {Object} item * @param {Object} item
*/ */
function handleAfterSalesDetail(item) { function handleReturnAddress(item) {
uni.navigateTo({ order.getReturnAddress({
url: util.setUrl('/pages/shop/order/afterSales',{ orderId: item.id,
orderId: item.id, }).then(res => {
}), Object.assign(returnAddress, res)
proxy.$refs.addressRef.open()
}) })
} }
//
function handleAddressCopy() {
util.copyText(`${returnAddress.realName} ${returnAddress.userPhone} ${returnAddress.userAddress}`)
}
</script> </script>
<template> <template>
@ -303,6 +311,9 @@
</template> </template>
<!-- 待买家发货 --> <!-- 待买家发货 -->
<view class="menu ptb20 df jcr" v-else-if="scope.item.afterSaleStatus == 4"> <view class="menu ptb20 df jcr" v-else-if="scope.item.afterSaleStatus == 4">
<!-- 查看退货地址 -->
<view class="btn bar closeHollow plr30" @click.stop="handleReturnAddress(scope.item)">
查看退货地址</view>
<!-- 售后中 --> <!-- 售后中 -->
<view class="btn bar warmHollow plr30" @click.stop="handleExpress(scope.item)"> <view class="btn bar warmHollow plr30" @click.stop="handleExpress(scope.item)">
填写退货物流信息</view> 填写退货物流信息</view>
@ -311,7 +322,7 @@
<view class="menu ptb20 df jcr" v-else-if="scope.item.afterSaleStatus == 3"> <view class="menu ptb20 df jcr" v-else-if="scope.item.afterSaleStatus == 3">
<!-- 售后中 --> <!-- 售后中 -->
<view class="btn bar closeHollow plr30" <view class="btn bar closeHollow plr30"
@click.stop="handleAfterSalesDetail(scope.item)"> @click.stop="order.handleAfterSalesDetail(scope.item)">
查看售后详情</view> 查看售后详情</view>
</view> </view>
<!-- 非售后 --> <!-- 非售后 -->
@ -371,6 +382,30 @@
<!-- 物流弹窗 --> <!-- 物流弹窗 -->
<expressVue ref="expressRef" @confirm="handleExpressConfirm" /> <expressVue ref="expressRef" @confirm="handleExpressConfirm" />
<!-- 同意退款 -->
<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">
<view class="value mt10">{{returnAddress.realName}}</view>
</view>
<view class="line mtb20">
<view class="value mt10">{{returnAddress.userPhone}}</view>
</view>
<view class="line mtb20">
<view class="value mt10">{{returnAddress.userAddress}}</view>
</view>
</view>
<view class="btn warm mtb30 mlr30" @click="handleAddressCopy">复制</view>
</view>
</uni-popup>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -71,9 +71,9 @@
const orderDetail = reactive({}) const orderDetail = reactive({})
// 退 // 退
const address = reactive({ const address = reactive({
real_name: '', realName: '',
user_phone: '', userPhone: '',
user_address: '', userAddress: '',
}) })
// //
const userinfo = computed(() => store.state.userinfo) const userinfo = computed(() => store.state.userinfo)
@ -294,15 +294,15 @@
function handleAddressConfirm() { function handleAddressConfirm() {
console.log('address', address) console.log('address', address)
// //
if (!address.real_name) { if (!address.realName) {
util.alert('收货人姓名不能为空') util.alert('收货人姓名不能为空')
return return
} }
if (!address.user_phone) { if (!address.userPhone) {
util.alert('收货人电话不能为空') util.alert('收货人电话不能为空')
return return
} }
if (!address.user_address) { if (!address.userAddress) {
util.alert('收货地址不能为空') util.alert('收货地址不能为空')
return return
} }
@ -326,9 +326,9 @@
}).then(res => { }).then(res => {
if (res.code === 200) { if (res.code === 200) {
proxy.$refs.addressRef.close() proxy.$refs.addressRef.close()
address.real_name = '' address.realName = ''
address.user_address = '' address.userAddress = ''
address.user_phone = '' address.userPhone = ''
// //
refreshList() refreshList()
return return
@ -437,7 +437,7 @@
</template> </template>
<template v-else> <template v-else>
<!-- 收货地址 --> <!-- 收货地址 -->
<view class="menu rows ptb20" v-if="[2,3,4,5,6].includes(scope.item.status)"> <view class="menu rows ptb20" v-if="[1,2,3,4,5,6].includes(scope.item.status)">
<view class="key fs0 c333">收货地址</view> <view class="key fs0 c333">收货地址</view>
<view class="value f1 ml20"> <view class="value f1 ml20">
<view class="c333 f28"> <view class="c333 f28">
@ -506,15 +506,15 @@
<view class="form oh plr30 c333 f30"> <view class="form oh plr30 c333 f30">
<view class="line mtb20"> <view class="line mtb20">
<input type="text" v-model="address.real_name" placeholder="收货人姓名" <input type="text" v-model="address.realName" placeholder="收货人姓名"
placeholder-class="placeholderStyle" /> placeholder-class="placeholderStyle" />
</view> </view>
<view class="line mtb20"> <view class="line mtb20">
<input type="text" v-model="address.user_phone" placeholder="收货人电话" <input type="text" v-model="address.userPhone" placeholder="收货人电话"
placeholder-class="placeholderStyle" /> placeholder-class="placeholderStyle" />
</view> </view>
<view class="line mtb20"> <view class="line mtb20">
<input type="text" v-model="address.user_address" placeholder="收货人详细地址" <input type="text" v-model="address.userAddress" placeholder="收货人详细地址"
placeholder-class="placeholderStyle" /> placeholder-class="placeholderStyle" />
</view> </view>
</view> </view>

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://rcq3fm.natappfree.cc' let target = 'http://88bsux.natappfree.cc'
export default defineConfig({ export default defineConfig({
plugins: [uni()], plugins: [uni()],