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',
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
<div class="v12-font-28 v12-secondary-dark-text v12-justify-between">
|
||||
<text class=" more-t" style="flex: 2;">{{ orderInfo.userAddress }}</text>
|
||||
<view v-if="getStatus(orderInfo) === '待付款'" @click="goAddress" class="v12-btn cancel v12-dark-text v12-dark-border v12-radius-40" >修改地址</view>
|
||||
<view v-if="canShowModifyAddress(orderInfo)" @click="goAddress" class="v12-btn cancel v12-dark-text v12-dark-border v12-radius-40" >修改地址</view>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
@@ -437,6 +437,7 @@
|
||||
<view class="v12-justify-between ">
|
||||
<view v-if="orderInfo.isGiftCardReceiveBlind === 0" class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
|
||||
<view class="bnt v12-dark-text v12-dark-border cancel" @click="delayOrder">催发货</view>
|
||||
<view v-if="canShowModifyAddress(orderInfo)" class="bnt v12-dark-text v12-dark-border cancel" @click="goAddress">修改地址</view>
|
||||
</view>
|
||||
<view class="bnt v12-primary-text v12-primary-border cancel" @click="goGoodsReturn2(orderInfo)">申请退款</view>
|
||||
</view>
|
||||
@@ -531,7 +532,7 @@
|
||||
<script>
|
||||
import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard'
|
||||
import OrderGoods from "@/components/OrderGoods";
|
||||
import {orderDetail, orderDelay, aginConfirm, express, editAddress, orderExpectedArrivalTime, groupOrderDetail} from "@/api/order";
|
||||
import {orderDetail, orderDelay, aginConfirm, express, applyEditAddress, orderExpectedArrivalTime, groupOrderDetail} from "@/api/order";
|
||||
import Payment from "@/components/Payment";
|
||||
import DataFormat from "@/components/DataFormat";
|
||||
import {copyClipboard} from "@/utils";
|
||||
@@ -592,7 +593,8 @@ export default {
|
||||
isGift: false,
|
||||
isGroup: false,
|
||||
key: "",
|
||||
loading: true
|
||||
loading: true,
|
||||
addressEditOrderId: ""
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -609,37 +611,37 @@ export default {
|
||||
onShow() {
|
||||
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
|
||||
const addressId = chooseAddress.id || ''
|
||||
console.log(addressId, 'addressId');
|
||||
|
||||
// 监听到选择收货地址
|
||||
if (addressId) {
|
||||
if (addressId && this.addressEditOrderId) {
|
||||
uni.setStorageSync('chooseAddress', {})
|
||||
uni.showModal({
|
||||
title:'确定修改地址吗?',
|
||||
content: '',
|
||||
content: '提交后将进入审核流程,请确认是否继续',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '确认',
|
||||
success:(success)=>{
|
||||
if(success.confirm) {
|
||||
uni.showLoading()
|
||||
editAddress({
|
||||
applyEditAddress({
|
||||
addressId,
|
||||
orderId: this.orderInfo.orderId
|
||||
}).then(res => {
|
||||
orderId: this.addressEditOrderId
|
||||
}).then(() => {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
title: '修改成功!'
|
||||
title: '已提交审核'
|
||||
})
|
||||
uni.setStorageSync('sourceAddress', chooseAddress)
|
||||
this.getDetail()
|
||||
}).finally(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
} else {
|
||||
this.getDetail()
|
||||
}
|
||||
},
|
||||
complete:(complete)=>{
|
||||
uni.hideLoading()
|
||||
this.addressEditOrderId = ''
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@@ -655,6 +657,21 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
copyClipboard,
|
||||
canShowModifyAddress(order) {
|
||||
if (!order || this.isGroup || Number(order.isTickets || 0) === 1) {
|
||||
return false
|
||||
}
|
||||
const type = Number(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
|
||||
},
|
||||
//催发货
|
||||
delayOrder() {
|
||||
uni.showToast({
|
||||
@@ -740,6 +757,7 @@ export default {
|
||||
})
|
||||
},
|
||||
goAddress() {
|
||||
this.addressEditOrderId = this.orderInfo.orderId
|
||||
this.$yrouter.push({
|
||||
path:'/pages/user/address/AddressManagement/index',
|
||||
query: {
|
||||
|
||||
Reference in New Issue
Block a user