Feat:待发货状态订单增加修改地址功能
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user