This commit is contained in:
xiaozhiyong
2023-08-30 11:32:32 +08:00
parent 90e2d26117
commit 6df26c7fe5
12 changed files with 590 additions and 230 deletions

View File

@@ -1,25 +1,26 @@
<template>
<view class="screen">
<view class="screen_left">
<!-- <uni-icons type="smallcircle-filled" size='25'></uni-icons> -->
<image style="width: 50rpx;height: 50rpx;" src="../../../static/img/price.png"></image>
<view class="screen_text">
<text @click="showFn" >{{filterData[seleIndex].lable}}</text>
<view v-if="isShow.filterBox" class="filterBox">
<view @click="priceSele(item,index)" :style="{color:index==seleIndex?'#666666':''}" v-for="(item,index) in filterData">{{item.lable}}</view>
</view>
<view class="screen">
<view class="screen_left">
<!-- <uni-icons type="smallcircle-filled" size='25'></uni-icons> -->
<image style="width: 50rpx;height: 50rpx;" src="../../../static/img/price.png"></image>
<view class="screen_text">
<text @click="showFn">{{filterData[seleIndex].lable}}</text>
<view v-if="isShow.filterBox" class="filterBox">
<view @click="priceSele(item,index)" :style="{color:index==seleIndex?'#666666':''}"
v-for="(item,index) in filterData">{{item.lable}}</view>
</view>
<image style="width: 40rpx;height: 25rpx;" src="../../../static/img/chevron-up.png"></image>
</view>
<view @click="move" class="screen_bottom">{{site?'沿途站点':'全路径'}}</view>
<image style="width: 40rpx;height: 25rpx;" src="../../../static/img/chevron-up.png"></image>
</view>
<view @click="move" class="screen_bottom">{{site?'沿途站点':'全路径'}}</view>
</view>
</template>
<script>
export default {
props: {
selePrice:{
type:Object,
default:()=>{
selePrice: {
type: Object,
default: () => {
return null
}
},
@@ -32,82 +33,84 @@
},
data() {
return {
site:true,
seleIndex:1,
filterData:[],
site: true,
seleIndex: 1,
filterData: [],
list: [],
isShow: {
screen: false,
filterBox:false,
strategy:false
filterBox: false,
strategy: 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;
},
selePrice: function(n, o) {
console.log(this.selePrice,'jiage');
console.log(this.selePrice, 'jiage');
// this.filterData[1].lable = '低于' + this.selePrice.middlePrice;
// this.filterData[1].value = this.selePrice.middlePrice;
// this.filterData[2].lable = '最低价格';
// this.filterData[2].value = this.selePrice.minPrice;
// this.filterData
this.filterData = []
if(n){
Object.keys(this.selePrice).forEach((item,index)=>{
if(this.selePrice[item]!==null){
if (n) {
Object.keys(this.selePrice).forEach((item, index) => {
if (this.selePrice[item] !== null) {
this.filterData.push({
lable:item=='middlePrice'?'低于' + this.moneyIntercept(this.selePrice.middlePrice) :'最低价格',
value:item=='middlePrice'? this.moneyIntercept(this.selePrice.middlePrice) : this.moneyIntercept(this.selePrice.minPrice)
lable: item == 'middlePrice' ? '低于' + this.moneyIntercept(this
.selePrice.middlePrice) : '最低价格',
value: item == 'middlePrice' ? this.moneyIntercept(this.selePrice
.middlePrice) : this.moneyIntercept(this.selePrice.minPrice)
})
}
})
this.filterData.unshift({
lable:'所有价格',
value:99999
lable: '所有价格',
value: 99999
});
if( this.filterData.length==1){
this.seleIndex = 0;
}else{
if (this.filterData.length == 1) {
this.seleIndex = 0;
} else {
this.seleIndex = 1;
}
}
}
},
methods: {
closeFn(){
this.isShow.filterBox=false
closeFn() {
this.isShow.filterBox = false
},
showFn(e){
this.isShow.filterBox=!this.isShow.filterBox;
this.$emit('swich',false);
showFn(e) {
this.isShow.filterBox = !this.isShow.filterBox;
this.$emit('swich', false);
},
move(){
this.$emit('mapEventListeners','mapEventListeners','MoveToLocation',this.site);
move() {
this.$emit('mapEventListeners', 'mapEventListeners', 'MoveToLocation', this.site);
this.site = !this.site;
},
getprice(){
if( this.filterData.length==1) this.seleIndex = 0;
return this.filterData[this.seleIndex].value||0.00
getprice() {
if (this.filterData.length == 1) this.seleIndex = 0;
return this.filterData[this.seleIndex].value || 0.00
},
priceSele(e,w){
priceSele(e, w) {
this.seleIndex = w;
this.isShow.filterBox = false;
this.$emit('mapEventListeners','mapEventListeners','localScreen','footer')
this.$emit('mapEventListeners', 'mapEventListeners', 'localScreen', 'footer')
console.log(e)
},
mapRoutePlanning(e,i) {
this.$emit('mapEventListeners','cardPlanning', e)
mapRoutePlanning(e, i) {
this.$emit('mapEventListeners', 'cardPlanning', e)
},
collection(e, i) {
let recentSearch = uni.getStorageSync('recentSearch');
@@ -142,7 +145,7 @@
</script>
<style lang="scss">
.seleStrategy{
.seleStrategy {
height: 80rpx;
width: 180rpx;
background-color: #FFFFFF;
@@ -151,16 +154,18 @@
display: flex;
align-items: center;
justify-content: center;
transition: top .3s,right 0.3s,opacity 0s;
transition: top .3s, right 0.3s, opacity 0s;
overflow: hidden;
}
.mapIcon{
.mapIcon {
text-align: end;
padding-right: 30rpx;
padding-bottom: 15rpx;
position: relative;
height: 80rpx;
}
.filterBox {
position: absolute;
width: max-content;