地址
This commit is contained in:
parent
39881425ed
commit
5ced2d0106
|
|
@ -94,7 +94,7 @@
|
|||
"quickapp" : {},
|
||||
/* 快应用特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx9ffab147a56e9424",
|
||||
"appid" : "wxa17265f5fe8374b1",
|
||||
"setting" : {
|
||||
"urlCheck" : true,
|
||||
"postcss" : true,
|
||||
|
|
|
|||
|
|
@ -1,87 +1,89 @@
|
|||
<template>
|
||||
<view>
|
||||
<u-toast ref="uToast" /><u-no-network></u-no-network>
|
||||
<u-navbar title="地址列表"></u-navbar>
|
||||
<view class="content">
|
||||
<view v-if="list.length">
|
||||
<view class="item" v-for="(item, key) in list" :key="key">
|
||||
<view class="top" @click="isSelect(item)">
|
||||
<view class="name">{{ item.name }}</view>
|
||||
<view class="phone">{{ item.mobile }}</view>
|
||||
<view class="tag">
|
||||
<text class="red" v-if="item.isDefault">默认</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom" @click="isSelect(item)">
|
||||
{{item.areaName + item.address}}
|
||||
<u-icon name="edit-pen" :size="40" color="#999999" v-show="type != 'order'" @click="toEdit(item.id)"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 无数据时默认显示 -->
|
||||
<view class="coreshop-emptybox" v-else>
|
||||
<u-empty :src="$globalConstVars.apiFilesUrl+'/static/images/empty/address.png'" icon-size="300" text="暂无地址信息" mode="list"></u-empty>
|
||||
</view>
|
||||
<view class="coreshop-bottomBox">
|
||||
<button class="coreshop-btn coreshop-btn-b coreshop-btn-square" @click="toAdd()">新增收货地址</button>
|
||||
</view>
|
||||
<view>
|
||||
<u-toast ref="uToast" /><u-no-network></u-no-network>
|
||||
<u-navbar title="地址列表"></u-navbar>
|
||||
<view class="content">
|
||||
<view v-if="list.length">
|
||||
<view class="item" v-for="(item, key) in list" :key="key">
|
||||
<view class="top" @click="isSelect(item)">
|
||||
<view class="name">{{ item.name }}</view>
|
||||
<view class="phone">{{ item.mobile }}</view>
|
||||
<view class="tag">
|
||||
<text class="red" v-if="item.isDefault">默认</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom" @click="isSelect(item)">
|
||||
{{item.areaName + item.address}}
|
||||
<u-icon name="edit-pen" :size="40" color="#999999"
|
||||
@click="toEdit(item.id)"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 无数据时默认显示 -->
|
||||
<view class="coreshop-emptybox" v-else>
|
||||
<u-empty :src="$globalConstVars.apiFilesUrl+'/static/images/empty/address.png'" icon-size="300"
|
||||
text="暂无地址信息" mode="list"></u-empty>
|
||||
</view>
|
||||
<view class="coreshop-bottomBox">
|
||||
<button class="coreshop-btn coreshop-btn-b coreshop-btn-square" @click="toAdd()">新增收货地址</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],// 用户收货地址列表
|
||||
type: ''
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
if (e.type) {
|
||||
this.type = e.type;
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.userShipList();
|
||||
},
|
||||
methods: {
|
||||
// 获取收货地址列表
|
||||
userShipList() {
|
||||
this.$u.api.userShip().then(res => {
|
||||
if (res.status) {
|
||||
this.list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
toEdit(id) {
|
||||
this.$u.route('/pages/member/address/index/index?shipId=' + id);
|
||||
},
|
||||
//添加
|
||||
toAdd() {
|
||||
this.$u.route('/pages/member/address/index/index');
|
||||
},
|
||||
//选择
|
||||
isSelect(data) {
|
||||
if (this.type == 'order') {
|
||||
let pages = getCurrentPages();//当前页
|
||||
let beforePage = pages[pages.length - 2];//上个页面
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [], // 用户收货地址列表
|
||||
type: ''
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
if (e.type) {
|
||||
this.type = e.type;
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.userShipList();
|
||||
},
|
||||
methods: {
|
||||
// 获取收货地址列表
|
||||
userShipList() {
|
||||
this.$u.api.userShip().then(res => {
|
||||
if (res.status) {
|
||||
this.list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
toEdit(id) {
|
||||
this.$u.route('/pages/member/address/index/index?shipId=' + id);
|
||||
},
|
||||
//添加
|
||||
toAdd() {
|
||||
this.$u.route('/pages/member/address/index/index');
|
||||
},
|
||||
//选择
|
||||
isSelect(data) {
|
||||
if (this.type == 'order') {
|
||||
let pages = getCurrentPages(); //当前页
|
||||
let beforePage = pages[pages.length - 2]; //上个页面
|
||||
|
||||
beforePage.$vm.userShip = data;
|
||||
beforePage.$vm.params.areaId = data.areaId;
|
||||
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
// this.$u.route("/pages/placeOrder/index/index")
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
beforePage.$vm.userShip = data;
|
||||
beforePage.$vm.params.areaId = data.areaId;
|
||||
uni.setStorageSync("adders_userShip", data);
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
// this.$u.route("/pages/placeOrder/index/index")
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "list.scss";
|
||||
@import "list.scss";
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user