You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
246 lines
4.9 KiB
246 lines
4.9 KiB
1 year ago
|
<template>
|
||
|
<view class="bg">
|
||
|
<view :class="['item',selectItem.id==item.id?'active':'']" v-for="(item,index) in list" :key="index" @click="selectPoint(item)">
|
||
|
<view class="item-point-title">
|
||
|
<view class="name">{{item.extract_name}}</view>
|
||
|
<view class="addressStr">
|
||
|
<view class="flex-shrink-0">地址:</view>
|
||
|
<view class="text-overflow">{{item.detail_addr}}</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
<view class="item-point-guide" @click.stop="goMap(item)">
|
||
|
<view>
|
||
|
<image :src="showImg('/uploads/20240712/aae304f56ee7fd00b71c4524f56c7033.png')" mode="aspectFill" class="mapPoint"></image>
|
||
|
</view>
|
||
|
<view>去这里</view>
|
||
|
</view>
|
||
|
</view>
|
||
|
<view class="no-data" v-if="list.length==0">
|
||
|
<image src="https://static.ticket.sz-trip.com/dongtai/images/user/noAddress.png" mode="aspectFill" class="no-address"></image>
|
||
|
<view class="">
|
||
|
暂无自提点地址
|
||
|
</view>
|
||
|
</view>
|
||
|
<view class="btn-bottom">
|
||
|
<view class="addBox" @click.stop="confirmPoint">
|
||
|
确定
|
||
|
</view>
|
||
|
</view>
|
||
|
|
||
|
|
||
|
</view>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
data() {
|
||
|
return {
|
||
|
load: false,
|
||
|
pending: false,
|
||
|
list: [],
|
||
|
pickupId: null,
|
||
|
goodsId: null,
|
||
|
selectItem: {},
|
||
|
};
|
||
|
},
|
||
|
onLoad(options) {
|
||
|
this.pickupId = options.pickupId || null
|
||
|
this.goodsId = options.goodsId
|
||
|
},
|
||
|
onShow(options) {
|
||
|
this.getList()
|
||
|
},
|
||
|
|
||
|
methods: {
|
||
|
getList() {
|
||
|
if (this.pending) {
|
||
|
return
|
||
|
}
|
||
|
this.pending = true
|
||
|
// this.getLocation()
|
||
|
let param = {
|
||
|
goods_id: this.goodsId,
|
||
|
offset: this.list.length,
|
||
|
limit: 10,
|
||
|
// lon: this.$store.state.user.location.lon || '120.63132',
|
||
|
// lat: this.$store.state.user.location.lat || '31.30227',
|
||
|
}
|
||
|
this.Post(param, "/api/extract/getMerchantExtractListByGoodsIdNew").then(res => {
|
||
|
if (res) {
|
||
|
this.list = [...this.list, ...res.data];
|
||
|
if (res.data.length < 10) {
|
||
|
this.load = true;
|
||
|
}
|
||
|
if (this.pickupId && Array.isArray(this.list)) {
|
||
|
let selectItem = this.list.find(v=>v.id==this.pickupId)
|
||
|
if (selectItem) {
|
||
|
this.selectItem = selectItem
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
this.pending = false
|
||
|
})
|
||
|
|
||
|
|
||
|
},
|
||
|
|
||
|
selectPoint (item) {
|
||
|
this.selectItem = item
|
||
|
},
|
||
|
|
||
|
goMap (item) {
|
||
|
uni.openLocation({
|
||
|
latitude: Number(item.lat),
|
||
|
longitude: Number(item.lon),
|
||
|
name: item.extract_name,
|
||
|
address: item.detail_addr,
|
||
|
success: function () {
|
||
|
console.log('success');
|
||
|
}
|
||
|
});
|
||
|
},
|
||
|
|
||
|
confirmPoint () {
|
||
|
if(!this.selectItem.id) {
|
||
|
uni.showToast({icon: "none",title: "请先选择自提点"})
|
||
|
return;
|
||
|
}
|
||
|
// 返回上一个页面并带回selectItem
|
||
|
uni.$emit("updateDataByConnect", {msgType:'updatePickUpPoint',data:this.selectItem})
|
||
|
uni.navigateBack()
|
||
|
}
|
||
|
},
|
||
|
|
||
|
onReachBottom() {
|
||
|
setTimeout(() => {
|
||
|
if (!this.load) {
|
||
|
this.getList()
|
||
|
}
|
||
|
}, 1000);
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style lang="scss" scoped>
|
||
|
view {
|
||
|
box-sizing: border-box;
|
||
|
font-family: PingFang SC;
|
||
|
}
|
||
|
|
||
|
.bg {
|
||
|
position: relative;
|
||
|
background: #F7F7F7;
|
||
|
min-height: 100vh;
|
||
|
padding-bottom: 170rpx;
|
||
|
}
|
||
|
.flex-shrink-0{
|
||
|
flex-shrink: 0;
|
||
|
}
|
||
|
|
||
|
.item {
|
||
|
width: 697rpx;
|
||
|
height: 180rpx;
|
||
|
background: #FFFFFF;
|
||
|
border-radius: 13rpx;
|
||
|
margin: 0 auto;
|
||
|
margin-bottom: 28rpx;
|
||
|
padding: 26rpx;
|
||
|
padding-right: 0;
|
||
|
display: flex;
|
||
|
|
||
|
.item-point-title{
|
||
|
flex: 1;
|
||
|
width: 10rpx;
|
||
|
}
|
||
|
.item-point-guide{
|
||
|
width:140rpx;
|
||
|
flex-shrink: 0;
|
||
|
border-left: 1px solid #D8D8D8;
|
||
|
color: #FEB419;
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
align-items: center;
|
||
|
justify-content: center;
|
||
|
font-size: 24rpx;
|
||
|
}
|
||
|
.mapPoint{
|
||
|
width: 45rpx;
|
||
|
height: 49rpx;
|
||
|
}
|
||
|
}
|
||
|
.item.active{
|
||
|
border: 1px solid #FEB419;
|
||
|
}
|
||
|
.name {
|
||
|
display: flex;
|
||
|
font-size: 31rpx;
|
||
|
font-weight: bold;
|
||
|
color: #333333;
|
||
|
height: 85rpx;
|
||
|
|
||
|
overflow: hidden;
|
||
|
display: -webkit-box;
|
||
|
-webkit-line-clamp: 2;
|
||
|
-webkit-box-orient: vertical;
|
||
|
text-overflow: ellipsis;
|
||
|
white-space: normal;
|
||
|
}
|
||
|
.addressStr{
|
||
|
display: flex;
|
||
|
font-size: 27rpx;
|
||
|
color: #999999;
|
||
|
padding-top: 10rpx;
|
||
|
}
|
||
|
|
||
|
.no-data {
|
||
|
width: 100%;
|
||
|
height: 100vh;
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
justify-content: center;
|
||
|
flex-direction: column;
|
||
|
|
||
|
view:nth-child(2) {
|
||
|
font-size: 30rpx;
|
||
|
font-family: PingFang SC;
|
||
|
font-weight: 500;
|
||
|
color: #333333;
|
||
|
margin-top: 25rpx;
|
||
|
}
|
||
|
|
||
|
image {
|
||
|
width: 160rpx;
|
||
|
height: 160rpx;
|
||
|
}
|
||
|
|
||
|
padding-bottom: 400rpx;
|
||
|
}
|
||
|
|
||
|
.btn-bottom{
|
||
|
position: fixed;
|
||
|
bottom: 0;
|
||
|
width: 750rpx;
|
||
|
height: 150rpx;
|
||
|
background: #FFFFFF;
|
||
|
box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(6, 0, 1, 0.1);
|
||
|
display: flex;
|
||
|
justify-content: space-between;
|
||
|
padding: 30rpx 50rpx 30rpx 50rpx;
|
||
|
|
||
|
.addBox{
|
||
|
margin: 0 auto;
|
||
|
width: 697rpx;
|
||
|
height: 80rpx;
|
||
|
background: linear-gradient(90deg, #F84A56, #FF9834);
|
||
|
border-radius: 40rpx;
|
||
|
font-size: 36rpx;
|
||
|
font-family: PingFang SC;
|
||
|
font-weight: 500;
|
||
|
color: #FFFFFF;
|
||
|
line-height: 80rpx;
|
||
|
text-align: center;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
</style>
|