|
|
|
|
@ -9,7 +9,7 @@ |
|
|
|
|
<span class="phone_txt">{{item.phone}}</span> |
|
|
|
|
</view> |
|
|
|
|
<view class="bottom"> |
|
|
|
|
{{item.province}} {{item.city}} {{item.area}}{{item.address}} |
|
|
|
|
{{item.province}}{{item.city}}{{item.area}}{{item.address}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="edit_box" @click="handleEdit(item)"> |
|
|
|
|
@ -19,12 +19,17 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="bottom_item"> |
|
|
|
|
<view v-if="item.isDefault == 0" class="no_checked"></view> |
|
|
|
|
<view v-if="item.isDefault == 1" class="checked"> |
|
|
|
|
<p class="item"></p> |
|
|
|
|
<view class="no_checked_box" v-if="item.isDefault == 0" @click="handleDefault(item)"> |
|
|
|
|
<view class="no_checked"></view> |
|
|
|
|
<p class="no_default" >设为默认</p> |
|
|
|
|
</view> |
|
|
|
|
<p class="no_default" v-if="item.isDefault == 0" @click="handleDefault(item)">设为默认</p> |
|
|
|
|
<p v-if="item.isDefault == 1" class="default_txt">默认地址</p> |
|
|
|
|
<view class="check_box" v-if="item.isDefault == 1"> |
|
|
|
|
<view class="checked"> |
|
|
|
|
<p class="item"></p> |
|
|
|
|
</view> |
|
|
|
|
<p class="default_txt">默认地址</p> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<uni-load-more iconType="circle" :status="status" @clickLoadMore="loadMore" |
|
|
|
|
@ -41,7 +46,7 @@ |
|
|
|
|
<view class="tit_txt"> |
|
|
|
|
{{title}} |
|
|
|
|
</view> |
|
|
|
|
<view class="image_box"> |
|
|
|
|
<view class="image_box" @click="closePop"> |
|
|
|
|
<image class="img" src="../../../static/image/cancel.png" mode=""></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
@ -66,21 +71,22 @@ |
|
|
|
|
<view class="left_item"> |
|
|
|
|
位置: |
|
|
|
|
</view> |
|
|
|
|
<!-- <view class="right_item"> |
|
|
|
|
山东省青岛市市北区 |
|
|
|
|
</view> --> |
|
|
|
|
<view class="right_item"> |
|
|
|
|
<!-- 山东省青岛市市北区 --> |
|
|
|
|
|
|
|
|
|
<!-- <view class="right_icon" @click="changeAddress"> |
|
|
|
|
<image src="../../../static/image/icon-arrow-right.png"></image> |
|
|
|
|
</view> --> |
|
|
|
|
<picker class="picker_box" :range="locationArr" @change="cityChange" mode="multiSelector" |
|
|
|
|
@columnchange="columnchange" :value="multiIndex"> |
|
|
|
|
<view class="city_box" v-if="province !== '' && city !== ''"> |
|
|
|
|
{{province}} / {{city}} {{district ? '/' : ''}} {{district}} |
|
|
|
|
</view> |
|
|
|
|
<view class="city_box" v-if="province == '' && city == '' && district == ''"> |
|
|
|
|
<span style="color: #999;">请选择地区</span> |
|
|
|
|
</view> |
|
|
|
|
</picker> |
|
|
|
|
<picker class="picker_box" :range="locationArr" @change="cityChange" mode="multiSelector" |
|
|
|
|
@columnchange="columnchange" :value="multiIndex"> |
|
|
|
|
<view class="city_box" v-if="province !== '' && city !== ''"> |
|
|
|
|
{{province}} / {{city}} {{district ? '/' : ''}} {{district}} |
|
|
|
|
</view> |
|
|
|
|
<view class="city_box" v-if="province == '' && city == '' && district == ''"> |
|
|
|
|
<span style="color: #999;">请选择地区</span> |
|
|
|
|
</view> |
|
|
|
|
</picker> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="content_item"> |
|
|
|
|
<view class="left_item"> |
|
|
|
|
@ -89,9 +95,9 @@ |
|
|
|
|
<view class="right_item"> |
|
|
|
|
<uni-easyinput type="textarea" :inputBorder="false" autoHeight v-model="address" placeholder="请输入详细地址"></uni-easyinput> |
|
|
|
|
</view> |
|
|
|
|
<view class="right_icon" @click="handlePosition"> |
|
|
|
|
<!-- <view class="right_icon" @click="handlePosition"> |
|
|
|
|
<image src="../../../static/image/position.png"></image> |
|
|
|
|
</view> |
|
|
|
|
</view> --> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="button_box"> |
|
|
|
|
@ -175,7 +181,7 @@ |
|
|
|
|
phone:this.buyPhone, |
|
|
|
|
province:this.province, |
|
|
|
|
city:this.city, |
|
|
|
|
district:this.district ? this.district : '', |
|
|
|
|
area:this.district ? this.district : '', |
|
|
|
|
address:this.address, |
|
|
|
|
isDefault:0 |
|
|
|
|
} |
|
|
|
|
@ -193,6 +199,7 @@ |
|
|
|
|
title: '新增成功', |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
this.addressData = [] |
|
|
|
|
this.$refs.popup.close(); |
|
|
|
|
this.hasMore = true; |
|
|
|
|
this.current = 0; |
|
|
|
|
@ -215,7 +222,7 @@ |
|
|
|
|
phone:this.buyPhone, |
|
|
|
|
province:this.province, |
|
|
|
|
city:this.city, |
|
|
|
|
district:this.district ? this.district : '', |
|
|
|
|
area:this.district ? this.district : '', |
|
|
|
|
address:this.address, |
|
|
|
|
} |
|
|
|
|
uni.request({ |
|
|
|
|
@ -262,8 +269,47 @@ |
|
|
|
|
this.province = item.province; |
|
|
|
|
this.city = item.city; |
|
|
|
|
this.district = item.area; |
|
|
|
|
this.getCurrentArea(this.province) |
|
|
|
|
this.$refs.popup.open('bottom') |
|
|
|
|
}, |
|
|
|
|
// 编辑页面时获取省市区数据 |
|
|
|
|
getCurrentArea(value){ |
|
|
|
|
this.locationArr[1] = [] |
|
|
|
|
this.locationArr[2] = [] |
|
|
|
|
this.allCityData.map((item,index) =>{ |
|
|
|
|
if(item.province == this.province){ |
|
|
|
|
this.multiIndex[0] = index; |
|
|
|
|
item.citys.map((item1,index1) =>{ |
|
|
|
|
if(item1.city == this.province){ |
|
|
|
|
console.log(item1) |
|
|
|
|
item1.areas.map((item2,index2) =>{ |
|
|
|
|
if(item2.area == this.city){ |
|
|
|
|
this.multiIndex[1] = index2; |
|
|
|
|
} |
|
|
|
|
this.locationArr[1].push(item2.area); |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
if(item1.city == this.city){ |
|
|
|
|
this.multiIndex[1] = index1; |
|
|
|
|
item1.areas.map((item3,index3) =>{ |
|
|
|
|
this.locationArr[2].push(item3.area) |
|
|
|
|
if(item3.area == this.district){ |
|
|
|
|
console.log('item3 ==>',item3) |
|
|
|
|
console.log('index3 ==>',index3) |
|
|
|
|
this.multiIndex[2] = index3; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.locationArr[1].push(item1.city); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
console.log('multiIndex',this.multiIndex) |
|
|
|
|
console.log('locationArr',this.locationArr) |
|
|
|
|
}, |
|
|
|
|
// 删除地址 |
|
|
|
|
handleDelete(){ |
|
|
|
|
uni.showModal({ |
|
|
|
|
@ -348,7 +394,7 @@ |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 跳转到提交订单页面 |
|
|
|
|
turnToOrder(item){ |
|
|
|
|
if(this.pageFrom == 1){ |
|
|
|
|
var pages = getCurrentPages(); // 获取页面栈 |
|
|
|
|
@ -357,13 +403,8 @@ |
|
|
|
|
console.log(pages) |
|
|
|
|
console.log(prevPage) |
|
|
|
|
if(prevPage.__route__ == 'pages/pages_zhentou/order/confirmOrder'){ |
|
|
|
|
prevPage.__data__.changeAddress( |
|
|
|
|
{ |
|
|
|
|
name:item.consignee, |
|
|
|
|
phone:item.phone, |
|
|
|
|
address:item.province + item.city + (item.area ? item.area : '') + item.address, |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
prevPage.__data__.changeAddress(item); |
|
|
|
|
uni.navigateBack() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
@ -373,7 +414,7 @@ |
|
|
|
|
}, |
|
|
|
|
// 获取地区数据 |
|
|
|
|
getData() { |
|
|
|
|
console.log(this.allCityData) |
|
|
|
|
this.locationArr = [[],[],[]] |
|
|
|
|
this.allCityData.map(item => { |
|
|
|
|
this.locationArr[0].push(item.province); |
|
|
|
|
}) |
|
|
|
|
@ -383,15 +424,15 @@ |
|
|
|
|
|
|
|
|
|
console.log(this.locationArr) |
|
|
|
|
}, |
|
|
|
|
// 省市区确定地址 |
|
|
|
|
cityChange(e) { |
|
|
|
|
console.log('111') |
|
|
|
|
this.multiIndex = e.detail.value; |
|
|
|
|
console.log(this.locationArr) |
|
|
|
|
this.province = this.locationArr[0][this.multiIndex[0]] |
|
|
|
|
this.city = this.locationArr[1][this.multiIndex[1]] |
|
|
|
|
this.district = this.locationArr[2][this.multiIndex[2]]; |
|
|
|
|
this.address = '' |
|
|
|
|
}, |
|
|
|
|
// 列切换 |
|
|
|
|
columnchange(e) { |
|
|
|
|
let value = e.detail.value; |
|
|
|
|
console.log(e.detail) |
|
|
|
|
@ -442,6 +483,8 @@ |
|
|
|
|
this.province = ''; |
|
|
|
|
this.city = ''; |
|
|
|
|
this.district = ''; |
|
|
|
|
this.getData(); |
|
|
|
|
this.multiIndex = [0,0,0] |
|
|
|
|
this.$refs.popup.open('bottom') |
|
|
|
|
}, |
|
|
|
|
// 定位 |
|
|
|
|
@ -501,7 +544,7 @@ |
|
|
|
|
this.current = this.current + 1; |
|
|
|
|
this.staus = 'loading'; |
|
|
|
|
uni.request({ |
|
|
|
|
url: getApp().globalData.baseUrl + '/address/list?userId=' + this.userInfo.id + '¤t=' + this |
|
|
|
|
url: getApp().globalData.baseUrl + '/address/list?id=' + this.userInfo.id + '¤t=' + this |
|
|
|
|
.current + '&size=' + this.size, |
|
|
|
|
method: 'GET', |
|
|
|
|
header:{ |
|
|
|
|
@ -556,34 +599,45 @@ |
|
|
|
|
height: 25%; |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
.no_checked{ |
|
|
|
|
width: 28rpx; |
|
|
|
|
height: 28rpx; |
|
|
|
|
background: #FFFFFF; |
|
|
|
|
border: 1rpx solid #666666; |
|
|
|
|
border-radius: 50%; |
|
|
|
|
margin: 0 30rpx; |
|
|
|
|
.no_checked_box{ |
|
|
|
|
width: 100%; |
|
|
|
|
display: flex; |
|
|
|
|
.no_checked{ |
|
|
|
|
width: 28rpx; |
|
|
|
|
height: 28rpx; |
|
|
|
|
background: #FFFFFF; |
|
|
|
|
border: 1rpx solid #666666; |
|
|
|
|
border-radius: 50%; |
|
|
|
|
margin: 0 30rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.checked{ |
|
|
|
|
width: 28rpx; |
|
|
|
|
height: 28rpx; |
|
|
|
|
background: #FFFFFF; |
|
|
|
|
border: 1rpx solid #D73232; |
|
|
|
|
border-radius: 50%; |
|
|
|
|
margin: 0 30rpx; |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
justify-content: center; |
|
|
|
|
|
|
|
|
|
.item{ |
|
|
|
|
width: 16rpx; |
|
|
|
|
height: 16rpx; |
|
|
|
|
background: #D73232; |
|
|
|
|
.check_box{ |
|
|
|
|
width: 100%; |
|
|
|
|
display: flex; |
|
|
|
|
.checked{ |
|
|
|
|
width: 28rpx; |
|
|
|
|
height: 28rpx; |
|
|
|
|
background: #FFFFFF; |
|
|
|
|
border: 1rpx solid #D73232; |
|
|
|
|
border-radius: 50%; |
|
|
|
|
margin: 0 30rpx; |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
justify-content: center; |
|
|
|
|
|
|
|
|
|
.item{ |
|
|
|
|
width: 16rpx; |
|
|
|
|
height: 16rpx; |
|
|
|
|
background: #D73232; |
|
|
|
|
border-radius: 50%; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.default_txt{ |
|
|
|
|
font-size: 22rpx; |
|
|
|
|
color: #D73232; |
|
|
|
|
@ -726,6 +780,7 @@ |
|
|
|
|
margin-left: 30rpx; |
|
|
|
|
font-size: 26rpx; |
|
|
|
|
color: #333; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.right_item{ |
|
|
|
|
@ -736,6 +791,19 @@ |
|
|
|
|
margin-left: 30rpx; |
|
|
|
|
font-size: 26rpx; |
|
|
|
|
color: #333; |
|
|
|
|
|
|
|
|
|
.picker_box{ |
|
|
|
|
padding-left: 20rpx; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/deep/.uni-easyinput__content{ |
|
|
|
|
// padding-left: 30rpx; |
|
|
|
|
|
|
|
|
|
.uni-easyinput__content-textarea{ |
|
|
|
|
min-height: 40rpx !important; |
|
|
|
|
padding-left: 20rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.right_icon{ |
|
|
|
|
|