|
|
|
|
@ -13,11 +13,13 @@ |
|
|
|
|
{{item.address}} |
|
|
|
|
</view> |
|
|
|
|
<view class="right_bot"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<uni-load-more iconType="circle" :status="status" @clickLoadMore="loadMore" |
|
|
|
|
:content-text="contentText"></uni-load-more> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
@ -25,42 +27,85 @@ |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
addressData:[ |
|
|
|
|
{name:'张晓明',phone:'132****1021',status:0,label:'家',address:'山东省青岛市市南区香港中路7号甲亚麦国际中心7层2097户东户'}, |
|
|
|
|
{name:'张三',phone:'131****0021',status:1,label:'家',address:'山东省青岛市市南区香港中路7号甲亚麦国际中心7层2017户西户'}, |
|
|
|
|
{name:'李四',phone:'132****3201',status:1,label:'家',address:'山东省青岛市市南区香港中路7号甲亚麦国际中心'}, |
|
|
|
|
{name:'王五',phone:'132****0015',status:1,label:'家',address:'山东省青岛市市南区香港中路7号甲亚麦国际中心7层'}, |
|
|
|
|
] |
|
|
|
|
addressData: [], |
|
|
|
|
current: 0, |
|
|
|
|
size: 10, |
|
|
|
|
hasMore: true, |
|
|
|
|
status: '', |
|
|
|
|
contentText: { |
|
|
|
|
contentdown: "点击查看更多", |
|
|
|
|
contentrefresh: "正在加载...", |
|
|
|
|
contentnomore: "没有更多数据了", |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
let userInfo = uni.getStorageSync('userInfo'); |
|
|
|
|
if (userInfo) { |
|
|
|
|
this.userInfo = JSON.parse(userInfo); |
|
|
|
|
if (this.userInfo.id != undefined) { |
|
|
|
|
this.loadMore(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
|
|
|
|
|
//加载更多 |
|
|
|
|
loadMore() { |
|
|
|
|
console.log('loadmore') |
|
|
|
|
if (this.hasMore) { |
|
|
|
|
this.current = this.current + 1; |
|
|
|
|
this.staus = 'loading'; |
|
|
|
|
uni.request({ |
|
|
|
|
url: getApp().globalData.baseUrl + '/address/list?userId=' + this.userInfo.id + '¤t=' + this |
|
|
|
|
.current + '&size=' + this.size, |
|
|
|
|
method: 'GET', |
|
|
|
|
success: (res) => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.addressData = this.addressData.concat(res.data.data.records); |
|
|
|
|
if (res.data.data.records.length == 0 || res.data.data.total < this.size) { |
|
|
|
|
this.hasMore = false; |
|
|
|
|
this.status = 'nomore'; |
|
|
|
|
} else { |
|
|
|
|
this.status = 'more'; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.data.msg, |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
.add_box{ |
|
|
|
|
.add_box { |
|
|
|
|
width: 100%; |
|
|
|
|
background: #fff; |
|
|
|
|
.address_box{ |
|
|
|
|
|
|
|
|
|
.address_box { |
|
|
|
|
width: 95%; |
|
|
|
|
margin: 0 auto; |
|
|
|
|
margin-top: 40rpx; |
|
|
|
|
|
|
|
|
|
.address_item{ |
|
|
|
|
|
|
|
|
|
.address_item { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 200rpx; |
|
|
|
|
border-bottom: 2rpx solid #ccc; |
|
|
|
|
|
|
|
|
|
.bottom{ |
|
|
|
|
|
|
|
|
|
.bottom { |
|
|
|
|
width: 100%; |
|
|
|
|
.left_bot{ |
|
|
|
|
|
|
|
|
|
.left_bot { |
|
|
|
|
width: 90%; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
</style> |
|
|
|
|
</style> |