76 lines
2.4 KiB
Vue
76 lines
2.4 KiB
Vue
<template>
|
|
<view class="content">
|
|
<oct-address :lists="addressList" :pattern="true" :isEdit="edit" editColor="#34CE98"
|
|
:btnStyle="{'backgroundColor': '#34CE98'}" @onAddress="onInfo"
|
|
@onAdd="$Router.push({name: 'AddressEdit'})" />
|
|
<!-- -->
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
list
|
|
} from '@/apis/interfaces/address'
|
|
export default {
|
|
data() {
|
|
return {
|
|
edit: true,
|
|
addressList: [],
|
|
task_id: '',
|
|
};
|
|
},
|
|
onShow() {
|
|
this.edit = this.$Route.query.type === 'edit'
|
|
this.task_id = this.$Route.query.task_id
|
|
list().then(res => {
|
|
this.addressList = res
|
|
})
|
|
},
|
|
methods: {
|
|
onInfo(val) {
|
|
if (this.edit) {
|
|
this.$Router.push({
|
|
name: 'AddressEdit',
|
|
params: {
|
|
id: val.address_id
|
|
}
|
|
})
|
|
} else {
|
|
console.log('back........', this.task_id)
|
|
if (this.task_id != '') {
|
|
uni.showModal({
|
|
title: '温馨提示',
|
|
content: '是否确认将该商品发货到这个位置',
|
|
confirmColor: '#34ce98',
|
|
confirmText: '我确定',
|
|
cancelColor: '#999',
|
|
cancelText: '再想想',
|
|
success: (res) => {
|
|
if (res.confirm) {
|
|
console.log('调用该接口。。。。');
|
|
uni.navigateBack();
|
|
}
|
|
if (res.cancel) {
|
|
uni.navigateBack();
|
|
}
|
|
}
|
|
})
|
|
return;
|
|
}
|
|
|
|
this.$store.commit('setAddress', val)
|
|
this.$Router.back()
|
|
}
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.content {
|
|
background: #F3F6FB;
|
|
overflow: hidden;
|
|
min-height: 100vh;
|
|
}
|
|
</style>
|