111
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.
 
 
 
 

269 lines
5.8 KiB

<template>
<view class="mapIcon">
<view class="Position">
<image @click="$emit('reset')" v-if="polyline.length==0" src="https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油运营小程序/myPosition.png" ></image>
<image @click="$emit('swich',true);isShow.strategy=!isShow.strategy" v-else src="../../../static/img/trajectory.png" ></image>
</view>
<!-- <uni-icons v-if="polyline.length!==0" @click=" isShow.strategy=!isShow.strategy" type="map-pin-ellipse" size='25'></uni-icons> -->
<view @click="strategy('LEAST_TIME')"
:style="{top:!isShow.strategy?'0px':'-180rpx',right:!isShow.strategy?'120rpx':'40rpx',width:!isShow.strategy?'0px':''}"
:class="seleIndex=='LEAST_TIME'? 'Strategy' :'seleStrategy' ">
推荐路线
</view>
<view @click="strategy('LEAST_FEE')"
:style="{top:!isShow.strategy?'0px':'-90rpx',right:!isShow.strategy?'120rpx':'80rpx',width:!isShow.strategy?'0px':''}"
:class="seleIndex=='LEAST_FEE'? 'Strategy' :'seleStrategy' ">费用最少</view>
<view @click="strategy('AVOID_HIGHWAY')" :style="{width:!isShow.strategy?'0px':''}"
style="top: 0;right: 120rpx;" :class="seleIndex=='AVOID_HIGHWAY'? 'Strategy' :'seleStrategy' ">不走高速</view>
</view>
</template>
<script>
export default {
props: {
polyline: {
type: Array,
default: () => {
return []
}
}
},
data() {
return {
seleIndex: 'LEAST_TIME',
filterData: [{
lable: '所有价格',
value: 0
},
{
lable: '低于7.72',
value: 1
},
{
lable: '最低价格',
value: 2
}
],
list: [],
isShow: {
screen: false, //路线规划价格筛选条件
filterBox: false, //价格显示控制,已迁移组件内部
strategy: false, //路线规划策略选着
serviceStation: false, //油站详情控件
}
}
},
created() {
//获取最近地址列表
this.list = uni.getStorageSync('recentSearch') || [];
console.log(this.list)
},
watch: {
//是否开始路线规划控制最近搜索显示隐藏
polyline: function(n, o) {
n.length !== 0 ? this.isShow.screen = true : this.isShow.screen = false
}
},
methods: {
strategy(e) {
this.seleIndex = e;
setTimeout(() => {
this.isShow.strategy = false
this.$emit('strategy', this.seleIndex)
}, 500)
},
//点击最近开始路线规划
mapRoutePlanning(e, i) {
this.$emit('mapEventListeners', 'cardPlanning', e)
},
//修改缓存最近搜索逻辑
collection(e, i) {
let recentSearch = uni.getStorageSync('recentSearch');
if (e.type == 'lately') {
e.type = 'collection';
if (i == 0 && e.id != recentSearch[0].id) {
recentSearch.splice(i + 1, 0, e);
} else {
recentSearch.splice(i, 1, e);
}
} else if (e.type == 'collection') {
this.list.splice(i, 1);
recentSearch.splice(i, 1);
}
uni.setStorageSync('recentSearch', recentSearch);
},
checkFn(e, list) {
let check = true
for (let i = 0; i < list.length; i++) {
if (list[i].id == e.id) {
check = false
return
}
}
return check
},
lower(e) {
console.log(e)
}
}
}
</script>
<style lang="scss">
.Position image{
width: 45rpx;height: 45rpx;
}
.Position{
border-radius: 10px;
border-radius: 10px;
background-color: #FFFFFF;
padding: 10rpx;
width: min-content;
float: right;
}
.seleStrategy {
height: 80rpx;
width: 180rpx;
background-color: #FFFFFF;
border-radius: 10px;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
transition: top .3s, right 0.3s, opacity 0s,display 0s;
overflow: hidden;
}
.Strategy {
height: 80rpx;
width: 180rpx;
background-color: #FF6700;
border-radius: 10px;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
transition: top .3s, right 0.3s, opacity 0s;
overflow: hidden;
color: #FFFFFF;
}
.mapIcon {
// padding-bottom: 15rpx;
position: relative;
// height: 80rpx;
// margin-bottom: 10rpx;
position: absolute;
width: min-content;
top: -90rpx;
right: 30rpx;
}
.filterBox {
position: absolute;
width: max-content;
height: 244rpx;
background-color: #FFFFFF;
top: -280rpx;
border-radius: 10px;
font-size: 28rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
padding: 10rpx 25rpx;
color: #BBBBBB;
}
.screen_left {
position: relative;
display: flex;
align-items: center;
}
.screen_text {
margin: 0 30rpx;
font-size: 36rpx;
color: #666666;
font-weight: 600;
position: relative;
}
.screen_bottom {
width: 240rpx;
height: 80rpx;
background: #FF6700;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
color: #FFFFFF;
font-size: 36rpx;
font-weight: 600;
}
.screen {
margin: 0 30rpx;
height: 120rpx;
background: #FFFFFF;
border-radius: 15px;
margin-bottom: 90rpx;
display: flex;
align-items: center;
padding: 15rpx;
justify-content: space-between;
}
.lately {
position: absolute;
right: 0;
top: -22rpx;
width: 90rpx;
height: 50rpx;
background-color: #FF9C58;
color: #FFFFFF;
font-size: 16rpx;
display: flex;
align-items: center;
justify-content: center;
}
.swiper-item_text {
font-size: 28rpx;
color: #666666;
width: 100%;
margin-top: 5rpx;
}
.swiper-item_title {
font-size: 24rpx;
color: #BBBBBB;
}
.swiper-item {
width: 300rpx;
height: 300rpx;
background-color: #FFFFFF;
border-radius: 10px;
padding: 22rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: space-around;
}
.footerScroll_body {
position: absolute;
z-index: 999999;
width: 100vw;
bottom: 20px;
}
.swiper {
width: 100%;
height: 300rpx;
display: flex;
}
</style>