Feat:待发货状态订单增加修改地址功能

This commit is contained in:
linxi
2026-04-02 20:06:23 +08:00
parent 14e2fd9104
commit 057a727c9e
2 changed files with 55 additions and 17 deletions
+25 -5
View File
@@ -361,6 +361,11 @@
class="bnt service"
@click="applyRefund(order)"
>{{ '申请退款' }}</view>
<view
v-if="canShowModifyAddress(order)"
class="bnt service"
@click="addressTap(order)"
>修改地址</view>
<view
class="bnt service"
:class="{'v12-primary-text v12-primary-border': order.isTravelGroup === 1}"
@@ -517,7 +522,7 @@ import {
getOrderData,
getOrderList,
orderDelay,
editAddress
applyEditAddress
} from "@/api/order"
import {
cancelOrderHandle,
@@ -609,24 +614,24 @@ export default {
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
const addressId = chooseAddress.id || ''
// 监听到选择收货地址
if (addressId) {
if (addressId && this._orderId) {
uni.setStorageSync('chooseAddress', {})
uni.showModal({
title:'确定修改地址吗?',
content: '',
content: '提交后将进入审核流程,请确认是否继续',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success:(success)=>{
if(success.confirm) {
uni.showLoading()
editAddress({
applyEditAddress({
addressId,
orderId: _this._orderId
}).then(res => {
uni.showToast({
icon: 'success',
title: '修改成功!'
title: '已提交审核'
})
uni.setStorageSync('sourceAddress', chooseAddress)
_this.changeType()
@@ -665,6 +670,21 @@ export default {
}
},
methods: {
canShowModifyAddress(order) {
if (!order || order.isTravelGroup === 1 || order.isTickets === 1) {
return false
}
const type = parseInt(order._status && order._status._type)
if (type !== 1) {
return false
}
const isAddressUpdate = Number(order.isAddressUpdate || 0)
const addressUpdateStatus = Number(order.addressUpdateStatus || 0)
if (isAddressUpdate === 0) {
return true
}
return addressUpdateStatus === 2
},
initUserLocation() {
uni.getLocation({
type: 'gcj02',