Fix:【商城小程序】待付款订单详情页补上修改地址的按钮
This commit is contained in:
@@ -21,7 +21,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 @click="goAddress" class="v12-btn cancel v12-dark-text v12-dark-border v12-radius-40" v-if="status.type == -2 || status.type == -3">修改地址</view> -->
|
<view v-if="getStatus(orderInfo) === '待付款'" @click="goAddress" class="v12-btn cancel v12-dark-text v12-dark-border v12-radius-40" >修改地址</view>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -421,7 +421,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} from "@/api/order";
|
import {orderDetail, orderDelay, aginConfirm, express, editAddress} 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";
|
||||||
@@ -455,6 +455,7 @@ export default {
|
|||||||
mixins: [pageListenMixins],
|
mixins: [pageListenMixins],
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
|
addressId: null,
|
||||||
showExtend: false,
|
showExtend: false,
|
||||||
delayId: '',
|
delayId: '',
|
||||||
showMore: false,
|
showMore: false,
|
||||||
@@ -489,6 +490,46 @@ export default {
|
|||||||
onShow() {
|
onShow() {
|
||||||
this.id = this.$yroute.query.id;
|
this.id = this.$yroute.query.id;
|
||||||
this.getDetail();
|
this.getDetail();
|
||||||
|
uni.$on('chooseAddress', (res) => {
|
||||||
|
this.addressId = res.id
|
||||||
|
})
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
addressId(val) {
|
||||||
|
if(val) {
|
||||||
|
const params = {
|
||||||
|
addressId: this.addressId,
|
||||||
|
orderId: this.orderInfo.orderId
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.showModal({
|
||||||
|
title:'确定修改地址吗?',
|
||||||
|
content: '',
|
||||||
|
showCancel: true,
|
||||||
|
cancelText: '取消',
|
||||||
|
confirmText: '确认',
|
||||||
|
success:(success)=>{
|
||||||
|
if(success.confirm) {
|
||||||
|
uni.showLoading()
|
||||||
|
editAddress(params).then(res => {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'success',
|
||||||
|
title: '修改成功!'
|
||||||
|
})
|
||||||
|
this.getDetail();
|
||||||
|
}).finally(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
complete:(complete)=>{
|
||||||
|
uni.hideLoading()
|
||||||
|
this.addressId = ''
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// inject: ["app"],
|
// inject: ["app"],
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
@@ -541,8 +582,11 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
goAddress() {
|
goAddress() {
|
||||||
uni.navigateTo({
|
this.$yrouter.push({
|
||||||
url:'/pages/user/address/AddressManagement/index'
|
path:'/pages/user/address/AddressManagement/index',
|
||||||
|
query: {
|
||||||
|
choosMode: 1
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toDelay(id) {
|
toDelay(id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user