Feat:待发货状态订单增加修改地址功能
This commit is contained in:
@@ -361,6 +361,11 @@
|
|||||||
class="bnt service"
|
class="bnt service"
|
||||||
@click="applyRefund(order)"
|
@click="applyRefund(order)"
|
||||||
>{{ '申请退款' }}</view>
|
>{{ '申请退款' }}</view>
|
||||||
|
<view
|
||||||
|
v-if="canShowModifyAddress(order)"
|
||||||
|
class="bnt service"
|
||||||
|
@click="addressTap(order)"
|
||||||
|
>修改地址</view>
|
||||||
<view
|
<view
|
||||||
class="bnt service"
|
class="bnt service"
|
||||||
:class="{'v12-primary-text v12-primary-border': order.isTravelGroup === 1}"
|
:class="{'v12-primary-text v12-primary-border': order.isTravelGroup === 1}"
|
||||||
@@ -517,7 +522,7 @@ import {
|
|||||||
getOrderData,
|
getOrderData,
|
||||||
getOrderList,
|
getOrderList,
|
||||||
orderDelay,
|
orderDelay,
|
||||||
editAddress
|
applyEditAddress
|
||||||
} from "@/api/order"
|
} from "@/api/order"
|
||||||
import {
|
import {
|
||||||
cancelOrderHandle,
|
cancelOrderHandle,
|
||||||
@@ -609,24 +614,24 @@ export default {
|
|||||||
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
|
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
|
||||||
const addressId = chooseAddress.id || ''
|
const addressId = chooseAddress.id || ''
|
||||||
// 监听到选择收货地址
|
// 监听到选择收货地址
|
||||||
if (addressId) {
|
if (addressId && this._orderId) {
|
||||||
uni.setStorageSync('chooseAddress', {})
|
uni.setStorageSync('chooseAddress', {})
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title:'确定修改地址吗?',
|
title:'确定修改地址吗?',
|
||||||
content: '',
|
content: '提交后将进入审核流程,请确认是否继续',
|
||||||
showCancel: true,
|
showCancel: true,
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
confirmText: '确认',
|
confirmText: '确认',
|
||||||
success:(success)=>{
|
success:(success)=>{
|
||||||
if(success.confirm) {
|
if(success.confirm) {
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
editAddress({
|
applyEditAddress({
|
||||||
addressId,
|
addressId,
|
||||||
orderId: _this._orderId
|
orderId: _this._orderId
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
title: '修改成功!'
|
title: '已提交审核'
|
||||||
})
|
})
|
||||||
uni.setStorageSync('sourceAddress', chooseAddress)
|
uni.setStorageSync('sourceAddress', chooseAddress)
|
||||||
_this.changeType()
|
_this.changeType()
|
||||||
@@ -665,6 +670,21 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
initUserLocation() {
|
||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
type: 'gcj02',
|
type: 'gcj02',
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="v12-font-28 v12-secondary-dark-text v12-justify-between">
|
<div class="v12-font-28 v12-secondary-dark-text v12-justify-between">
|
||||||
<text class=" more-t" style="flex: 2;">{{ orderInfo.userAddress }}</text>
|
<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>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -437,6 +437,7 @@
|
|||||||
<view class="v12-justify-between ">
|
<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 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 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>
|
||||||
<view class="bnt v12-primary-text v12-primary-border cancel" @click="goGoodsReturn2(orderInfo)">申请退款</view>
|
<view class="bnt v12-primary-text v12-primary-border cancel" @click="goGoodsReturn2(orderInfo)">申请退款</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -531,7 +532,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard'
|
import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard'
|
||||||
import OrderGoods from "@/components/OrderGoods";
|
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 Payment from "@/components/Payment";
|
||||||
import DataFormat from "@/components/DataFormat";
|
import DataFormat from "@/components/DataFormat";
|
||||||
import {copyClipboard} from "@/utils";
|
import {copyClipboard} from "@/utils";
|
||||||
@@ -592,7 +593,8 @@ export default {
|
|||||||
isGift: false,
|
isGift: false,
|
||||||
isGroup: false,
|
isGroup: false,
|
||||||
key: "",
|
key: "",
|
||||||
loading: true
|
loading: true,
|
||||||
|
addressEditOrderId: ""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -609,37 +611,37 @@ export default {
|
|||||||
onShow() {
|
onShow() {
|
||||||
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
|
const chooseAddress = uni.getStorageSync('chooseAddress') || {}
|
||||||
const addressId = chooseAddress.id || ''
|
const addressId = chooseAddress.id || ''
|
||||||
console.log(addressId, 'addressId');
|
|
||||||
|
|
||||||
// 监听到选择收货地址
|
// 监听到选择收货地址
|
||||||
if (addressId) {
|
if (addressId && this.addressEditOrderId) {
|
||||||
uni.setStorageSync('chooseAddress', {})
|
uni.setStorageSync('chooseAddress', {})
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title:'确定修改地址吗?',
|
title:'确定修改地址吗?',
|
||||||
content: '',
|
content: '提交后将进入审核流程,请确认是否继续',
|
||||||
showCancel: true,
|
showCancel: true,
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
confirmText: '确认',
|
confirmText: '确认',
|
||||||
success:(success)=>{
|
success:(success)=>{
|
||||||
if(success.confirm) {
|
if(success.confirm) {
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
editAddress({
|
applyEditAddress({
|
||||||
addressId,
|
addressId,
|
||||||
orderId: this.orderInfo.orderId
|
orderId: this.addressEditOrderId
|
||||||
}).then(res => {
|
}).then(() => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
title: '修改成功!'
|
title: '已提交审核'
|
||||||
})
|
})
|
||||||
uni.setStorageSync('sourceAddress', chooseAddress)
|
uni.setStorageSync('sourceAddress', chooseAddress)
|
||||||
this.getDetail()
|
this.getDetail()
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
this.getDetail()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
complete:(complete)=>{
|
complete:(complete)=>{
|
||||||
uni.hideLoading()
|
this.addressEditOrderId = ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -655,6 +657,21 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
copyClipboard,
|
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() {
|
delayOrder() {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -740,6 +757,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
goAddress() {
|
goAddress() {
|
||||||
|
this.addressEditOrderId = this.orderInfo.orderId
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path:'/pages/user/address/AddressManagement/index',
|
path:'/pages/user/address/AddressManagement/index',
|
||||||
query: {
|
query: {
|
||||||
|
|||||||
Reference in New Issue
Block a user