Feat(订单列表):未支付订单修改地址
This commit is contained in:
@@ -169,4 +169,13 @@ export function orderDelay(uni) {
|
|||||||
*/
|
*/
|
||||||
export function aginConfirm(params) {
|
export function aginConfirm(params) {
|
||||||
return request.post('/order/buyAgainConfirm', params)
|
return request.post('/order/buyAgainConfirm', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改地址
|
||||||
|
* @param {*} params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function editAddress(params) {
|
||||||
|
return request.post('/order/editAddress', params)
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
<view class="flex">
|
<view class="flex">
|
||||||
<template v-if="order._status._type == 0">
|
<template v-if="order._status._type == 0">
|
||||||
<view class="bnt cancelBnt v12-dark-text v12-dark-border" @click="cancelOrder(order)">取消订单</view>
|
<view class="bnt cancelBnt v12-dark-text v12-dark-border" @click="cancelOrder(order)">取消订单</view>
|
||||||
<!-- <view class="bnt cancelBnt v12-dark-text v12-dark-border" @click="addressTap()">修改地址</view> -->
|
<view class="bnt cancelBnt v12-dark-text v12-dark-border" @click="addressTap(order)">修改地址</view>
|
||||||
<view class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" @click="goOrderDetails(order)">立即付款</view>
|
<view class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" @click="goOrderDetails(order)">立即付款</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="(order._status._type == 1 || order._status._type == 9) && order.isTickets==0">
|
<template v-if="(order._status._type == 1 || order._status._type == 9) && order.isTickets==0">
|
||||||
@@ -172,7 +172,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {getOrderData, getOrderList, orderDelay} from "@/api/order";
|
import {getOrderData, getOrderList, orderDelay, editAddress} from "@/api/order";
|
||||||
import {cancelOrderHandle, payOrderHandle, takeOrderHandle} from "@/libs/order";
|
import {cancelOrderHandle, payOrderHandle, takeOrderHandle} from "@/libs/order";
|
||||||
import Loading from "@/components/Loading";
|
import Loading from "@/components/Loading";
|
||||||
import Payment from "@/components/Payment";
|
import Payment from "@/components/Payment";
|
||||||
@@ -227,7 +227,9 @@ export default {
|
|||||||
showExtend: false,
|
showExtend: false,
|
||||||
delayId: null,
|
delayId: null,
|
||||||
pageKeyId: Object.freeze('userOrderIndex'),
|
pageKeyId: Object.freeze('userOrderIndex'),
|
||||||
keyword: ''
|
keyword: '',
|
||||||
|
_orderId: '',
|
||||||
|
addressId: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -240,6 +242,9 @@ export default {
|
|||||||
this.changeType(this.type);
|
this.changeType(this.type);
|
||||||
this.getOrderData();
|
this.getOrderData();
|
||||||
this.getOrderListReq();
|
this.getOrderListReq();
|
||||||
|
uni.$on('chooseAddress', (res) => {
|
||||||
|
this.addressId = res.id
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onHide: function () {
|
onHide: function () {
|
||||||
this.orderList = [];
|
this.orderList = [];
|
||||||
@@ -248,8 +253,43 @@ export default {
|
|||||||
this.loaded = false;
|
this.loaded = false;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
addressId(val) {
|
||||||
|
if(val) {
|
||||||
|
const params = {
|
||||||
|
addressId: this.addressId,
|
||||||
|
orderId: this._orderId
|
||||||
|
}
|
||||||
|
uni.showModal({
|
||||||
|
title:'确定修改地址吗?',
|
||||||
|
content: '',
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '取消',
|
||||||
|
confirmText: '确认',
|
||||||
|
success:(success)=>{
|
||||||
|
if(success.confirm) {
|
||||||
|
uni.showLoading()
|
||||||
|
editAddress(params).then(res => {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'success',
|
||||||
|
title: '修改成功!'
|
||||||
|
})
|
||||||
|
}).finally(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
complete:(complete)=>{
|
||||||
|
this.addressId = ''
|
||||||
|
this._orderId = ''
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addressTap() {
|
addressTap(order) {
|
||||||
|
this._orderId = order.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