更新
This commit is contained in:
@@ -21,7 +21,10 @@
|
|||||||
<view v-for="(item,index) in menuList" :key='index' class="filter_item">
|
<view v-for="(item,index) in menuList" :key='index' class="filter_item">
|
||||||
<view @click="seleFilter(item,index)"> {{ item.value?item.value.split('/')[0]:item.title}} </view>
|
<view @click="seleFilter(item,index)"> {{ item.value?item.value.split('/')[0]:item.title}} </view>
|
||||||
<view :style="{maxHeight:item.SublistOpen?'200rpx':'0rpx'}" class="conditions">
|
<view :style="{maxHeight:item.SublistOpen?'200rpx':'0rpx'}" class="conditions">
|
||||||
<view :style="{color:item.value?item.value.split('/')[0] == items.lable?'#666666':'#bbbbbb':'#bbbbbb'}" @click="filterItemSele(index,indexs)" v-for="(items,indexs) in item.Sublist" :key='indexs' style="margin-bottom: 10rpx; font-size: 25rpx;">{{items.lable}}</view>
|
<view
|
||||||
|
:style="{color:item.value?item.value.split('/')[0] == items.lable?'#666666':'#bbbbbb':'#bbbbbb'}"
|
||||||
|
@click="filterItemSele(index,indexs)" v-for="(items,indexs) in item.Sublist" :key='indexs'
|
||||||
|
style="margin-bottom: 10rpx; font-size: 25rpx;">{{items.lable}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -59,7 +62,7 @@
|
|||||||
isShow: {
|
isShow: {
|
||||||
conditions: false
|
conditions: false
|
||||||
},
|
},
|
||||||
header:null,
|
header: null,
|
||||||
menuList: [{
|
menuList: [{
|
||||||
title: '距离',
|
title: '距离',
|
||||||
value: '5KM/5',
|
value: '5KM/5',
|
||||||
@@ -74,7 +77,7 @@
|
|||||||
}, {
|
}, {
|
||||||
lable: '30KM',
|
lable: '30KM',
|
||||||
value: '30'
|
value: '30'
|
||||||
},{
|
}, {
|
||||||
lable: '50KM',
|
lable: '50KM',
|
||||||
value: '50'
|
value: '50'
|
||||||
}]
|
}]
|
||||||
@@ -84,19 +87,18 @@
|
|||||||
value: '全部/2',
|
value: '全部/2',
|
||||||
field: 'highSpeed',
|
field: 'highSpeed',
|
||||||
SublistOpen: false,
|
SublistOpen: false,
|
||||||
Sublist: [
|
Sublist: [{
|
||||||
{
|
|
||||||
lable: '全部',
|
lable: '全部',
|
||||||
value: '2'
|
value: '2'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
lable: '高速',
|
lable: '高速',
|
||||||
value: '1'
|
value: '1'
|
||||||
}, {
|
}, {
|
||||||
lable: '非高速',
|
lable: '非高速',
|
||||||
value: '0'
|
value: '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -107,67 +109,70 @@
|
|||||||
console.log(this.styles);
|
console.log(this.styles);
|
||||||
const query = uni.createSelectorQuery().in(this);
|
const query = uni.createSelectorQuery().in(this);
|
||||||
query.select('.header').boundingClientRect(data => {
|
query.select('.header').boundingClientRect(data => {
|
||||||
console.log("得到布局位置信息" + JSON.stringify(data));
|
console.log("得到布局位置信息" + JSON.stringify(data));
|
||||||
this.header = data
|
this.header = data
|
||||||
console.log("节点离页面顶部的距离为" + data.top);
|
console.log("节点离页面顶部的距离为" + data.top);
|
||||||
}).exec();
|
}).exec();
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getConditionMenu();
|
this.getConditionMenu();
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getElement(){
|
getElement() {
|
||||||
return this.styles.top + this.styles.height + 10 + this.header.height
|
return this.styles.top + this.styles.height + 10 + this.header.height
|
||||||
},
|
},
|
||||||
filterItemSele(index,indexs){
|
filterItemSele(index, indexs) {
|
||||||
this.menuList[index].value = `${this.menuList[index].Sublist[indexs].lable}/${this.menuList[index].Sublist[indexs].value}`;
|
this.menuList[index].value =
|
||||||
this.menuList[index].SublistOpen=false;
|
`${this.menuList[index].Sublist[indexs].lable}/${this.menuList[index].Sublist[indexs].value}`;
|
||||||
console.log(this.datassFn(),'/-/-/');
|
this.menuList[index].SublistOpen = false;
|
||||||
if(index==2){
|
console.log(this.datassFn(), '/-/-/');
|
||||||
this.$emit('mapEventListeners','localScreen',this.datassFn())
|
if (index == 2) {
|
||||||
}else{
|
this.$emit('mapEventListeners', 'localScreen', this.datassFn())
|
||||||
this.$emit('mapEventListeners','apiScreen',this.datassFn())
|
} else {
|
||||||
|
this.$emit('mapEventListeners', 'apiScreen', this.datassFn())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getConditionMenu() {
|
getConditionMenu() {
|
||||||
oilSiteApi.getConditionMenu().then(res => {
|
oilSiteApi.getConditionMenu().then(res => {
|
||||||
if (res.code !== 20000) return
|
if (res.code !== 20000) return
|
||||||
Object.keys(res.data).forEach((item,index)=>{
|
Object.keys(res.data).forEach((item, index) => {
|
||||||
let data = {
|
let data = {
|
||||||
title: index==0?'全渠道':'油品',
|
title: index == 0 ? '全渠道' : '油品',
|
||||||
value: index==0?'全渠道/':'0#/0#',
|
value: index == 0 ? '全渠道/' : '0#/0#',
|
||||||
field: index==0?'siteChannel':'oilProductCode',
|
field: index == 0 ? 'siteChannel' : 'oilProductCode',
|
||||||
SublistOpen: false,
|
SublistOpen: false,
|
||||||
Sublist: []
|
Sublist: []
|
||||||
}
|
}
|
||||||
res.data[item].forEach(items=>{
|
res.data[item].forEach(items => {
|
||||||
data.Sublist.push({
|
data.Sublist.push({
|
||||||
lable:index==0?items.name:items.id,
|
lable: index == 0 ? items.name : items.id,
|
||||||
value:items.id
|
value: items.id
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.menuList.push(data)
|
this.menuList.push(data)
|
||||||
})
|
})
|
||||||
this.menuList[2].Sublist.unshift({
|
this.menuList[2].Sublist.unshift({
|
||||||
lable:'全渠道',
|
lable: '全渠道',
|
||||||
value:''
|
value: ''
|
||||||
});
|
});
|
||||||
// [this.menuList[1],this.menuList[3]]=[this.menuList[3],this.menuList[1]]
|
// [this.menuList[1],this.menuList[3]]=[this.menuList[3],this.menuList[1]]
|
||||||
[this.menuList[0],this.menuList[1],this.menuList[2],this.menuList[3]] = [this.menuList[0],this.menuList[3],this.menuList[1],this.menuList[2]];
|
[this.menuList[0], this.menuList[1], this.menuList[2], this.menuList[3]] = [this.menuList[0],
|
||||||
|
this.menuList[3], this.menuList[1], this.menuList[2]
|
||||||
|
];
|
||||||
console.log(this.menuList, '***')
|
console.log(this.menuList, '***')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
datassFn(){
|
datassFn() {
|
||||||
let data = {}
|
let data = {}
|
||||||
this.menuList.forEach((item,index)=>{
|
this.menuList.forEach((item, index) => {
|
||||||
data[item.field] = item.value?item.value.split('/')[1]:''
|
data[item.field] = item.value ? item.value.split('/')[1] : ''
|
||||||
})
|
})
|
||||||
return data
|
return data
|
||||||
},
|
},
|
||||||
seleFilter(e, w) {
|
seleFilter(e, w) {
|
||||||
this.menuList.forEach((item,index)=>{
|
this.menuList.forEach((item, index) => {
|
||||||
if(w==index) return
|
if (w == index) return
|
||||||
item.SublistOpen = false
|
item.SublistOpen = false
|
||||||
})
|
})
|
||||||
e.SublistOpen = !e.SublistOpen;
|
e.SublistOpen = !e.SublistOpen;
|
||||||
@@ -212,7 +217,7 @@
|
|||||||
padding: 24rpx 0;
|
padding: 24rpx 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
/* border-bottom-left-radius: 10px;
|
/* border-bottom-left-radius: 10px;
|
||||||
border-bottom-right-radius: 10px; */
|
border-bottom-right-radius: 10px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@
|
|||||||
} = item
|
} = item
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.newMapMoveToLocation(longitude, latitude, 'reset')
|
this.newMapMoveToLocation(longitude, latitude, 'reset')
|
||||||
},500)
|
}, 500)
|
||||||
},
|
},
|
||||||
bindregionchange(e) {
|
bindregionchange(e) {
|
||||||
console.log(e, '***********')
|
console.log(e, '***********')
|
||||||
@@ -211,6 +211,7 @@
|
|||||||
} = this.$refs.addressSelector.datassFn();
|
} = this.$refs.addressSelector.datassFn();
|
||||||
let markerList = await this.mapUpdateMarkers(this.polyline[0].points, oilProductCode, juLi,
|
let markerList = await this.mapUpdateMarkers(this.polyline[0].points, oilProductCode, juLi,
|
||||||
siteChannel);
|
siteChannel);
|
||||||
|
|
||||||
//处理油站站点数据并显示
|
//处理油站站点数据并显示
|
||||||
this.spareMarkers = this.locationProcessing(markerList);
|
this.spareMarkers = this.locationProcessing(markerList);
|
||||||
let markers = JSON.parse(JSON.stringify(this.spareMarkers));
|
let markers = JSON.parse(JSON.stringify(this.spareMarkers));
|
||||||
@@ -369,7 +370,6 @@
|
|||||||
latitude: this.coordinate.latitude,
|
latitude: this.coordinate.latitude,
|
||||||
longitude: this.coordinate.longitude
|
longitude: this.coordinate.longitude
|
||||||
}
|
}
|
||||||
console.log(JSON.stringify(data))
|
|
||||||
let taht = this;
|
let taht = this;
|
||||||
return new Promise(function(re, rj) {
|
return new Promise(function(re, rj) {
|
||||||
oilSiteApi.getSiteByGeoHashNew(data).then(markerList => {
|
oilSiteApi.getSiteByGeoHashNew(data).then(markerList => {
|
||||||
@@ -456,7 +456,6 @@
|
|||||||
},
|
},
|
||||||
//移动当前中心点 参数:经纬度
|
//移动当前中心点 参数:经纬度
|
||||||
newMapMoveToLocation(longitude, latitude, type) {
|
newMapMoveToLocation(longitude, latitude, type) {
|
||||||
console.log('newMapMoveToLocation')
|
|
||||||
let that = this
|
let that = this
|
||||||
this.mapContext.moveToLocation({
|
this.mapContext.moveToLocation({
|
||||||
longitude: longitude,
|
longitude: longitude,
|
||||||
@@ -477,9 +476,6 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
|
||||||
fail(ee) {
|
|
||||||
console.log('ee',ee)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -510,10 +506,11 @@
|
|||||||
index) => {
|
index) => {
|
||||||
return Number(w.highSpeed) == 2 ? item : item.highSpeedMark == Number(w.highSpeed)
|
return Number(w.highSpeed) == 2 ? item : item.highSpeedMark == Number(w.highSpeed)
|
||||||
}) : e;
|
}) : e;
|
||||||
|
|
||||||
let copy = JSON.parse(JSON.stringify(highSpeedMarkers))
|
let copy = JSON.parse(JSON.stringify(highSpeedMarkers))
|
||||||
|
|
||||||
let sort = that.priceSort(copy);
|
let sort = that.priceSort(copy);
|
||||||
|
|
||||||
that.selePrice = sort.length !== 0 ? {
|
that.selePrice = sort.length !== 0 ? {
|
||||||
middlePrice: sort[Number.isInteger((sort.length / 2)) ? (sort.length / 2) : ((sort
|
middlePrice: sort[Number.isInteger((sort.length / 2)) ? (sort.length / 2) : ((sort
|
||||||
.length + 1) / 2) - 1].enterprisePrice,
|
.length + 1) / 2) - 1].enterprisePrice,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view class="site-list">
|
<view class="site-list">
|
||||||
<view class="container" v-if="siteList.length">
|
<view class="container" v-if="siteList.length">
|
||||||
<list>
|
<list>
|
||||||
<view class="item" v-for="item,index in siteList" :key="index">
|
<view class="item" v-for="(item,index) in siteList" :key="index">
|
||||||
<image
|
<image
|
||||||
:src="item.siteImages || 'https://static.czb365.com/1647787216992.jpg?x-oss-process=image/resize,m_lfit,h_420,w_630/format,png'">
|
:src="item.siteImages || 'https://static.czb365.com/1647787216992.jpg?x-oss-process=image/resize,m_lfit,h_420,w_630/format,png'">
|
||||||
</image>
|
</image>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<view>{{item.address || ''}}</view> <text>{{item.juli | adjust}}km</text>
|
<view>{{item.address || ''}}</view> <text>{{item.juli | adjust}}km</text>
|
||||||
</view>
|
</view>
|
||||||
<view>0# ¥7.94</view>
|
<view>{{item.oilProductCode}} ¥{{item.enterprisePrice | adjust}}</view>
|
||||||
<view>
|
<view>
|
||||||
<view @click="lookPosition(item)">查看位置</view>
|
<view @click="lookPosition(item)">查看位置</view>
|
||||||
<view @click="jump(item)">查看详情</view>
|
<view @click="jump(item)">查看详情</view>
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
filters: {
|
filters: {
|
||||||
adjust(val) {
|
adjust(val) {
|
||||||
if (!val) return '--'
|
if (!val) return '--'
|
||||||
val = +val/1000
|
val = +val
|
||||||
return val.toFixed(2)
|
return val.toFixed(2)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -56,9 +56,7 @@
|
|||||||
},
|
},
|
||||||
jump(item) {
|
jump(item) {
|
||||||
let obj = {
|
let obj = {
|
||||||
siteId: item.id,
|
siteId: item.siteId,
|
||||||
longitude: item.longitude,
|
|
||||||
latitude: item.latitude,
|
|
||||||
}
|
}
|
||||||
let itemS = JSON.stringify(obj)
|
let itemS = JSON.stringify(obj)
|
||||||
// return
|
// return
|
||||||
|
|||||||
@@ -218,7 +218,6 @@
|
|||||||
this.innerAudioContext?.stop()
|
this.innerAudioContext?.stop()
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
// let siteId = uni.getStorageSync('siteId') ||
|
|
||||||
if(option.siteId && !option.customerJump) {
|
if(option.siteId && !option.customerJump) {
|
||||||
this.isShow = false
|
this.isShow = false
|
||||||
this.siteId = option.siteId
|
this.siteId = option.siteId
|
||||||
@@ -226,26 +225,13 @@
|
|||||||
uni.setStorageSync('siteId',option.siteId)
|
uni.setStorageSync('siteId',option.siteId)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// console.log(option)
|
|
||||||
// if(option.channerCode == 'TY'){
|
|
||||||
// var oilItem = uni.getStorageSync('OtherSiteInfo')
|
|
||||||
// // console.log(oilItem)
|
|
||||||
// }else{
|
|
||||||
// let obj = option.item,
|
|
||||||
// var oilItem = JSON.parse(option.item)
|
|
||||||
// }
|
|
||||||
let oilItem = option.channerCode == 'TY' ? uni.getStorageSync('OtherSiteInfo') : option.item ? JSON.parse(option.item) : {siteId:option.siteId}
|
let oilItem = option.channerCode == 'TY' ? uni.getStorageSync('OtherSiteInfo') : option.item ? JSON.parse(option.item) : {siteId:option.siteId}
|
||||||
// if(oilItem.secondChannelCode === 'SQ'){
|
|
||||||
// oilItem.listTag = oilItem.sqSiteBelong === 'JKJY' ? '集卡加油' :'上汽联名卡'
|
|
||||||
// }
|
|
||||||
uni.setStorageSync('oilItem',oilItem)
|
uni.setStorageSync('oilItem',oilItem)
|
||||||
this.getSiteInfo(oilItem.siteId)
|
this.getSiteInfo(oilItem.siteId)
|
||||||
this.siteId = oilItem.siteId
|
this.siteId = oilItem.siteId
|
||||||
// if(option.item.ureaNumber!='0'){
|
|
||||||
// this.ureaNum = true
|
|
||||||
// }else{
|
|
||||||
// this.ureaNum = false
|
|
||||||
// }
|
|
||||||
if(oilItem.listTag == '万金油'){
|
if(oilItem.listTag == '万金油'){
|
||||||
this.audioUrl = 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/wanjinyou.mp3'
|
this.audioUrl = 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/wanjinyou.mp3'
|
||||||
}else if(oilItem.listTag == '星油'){
|
}else if(oilItem.listTag == '星油'){
|
||||||
@@ -338,7 +324,6 @@
|
|||||||
areaPriceList.push(item.guidePrice)
|
areaPriceList.push(item.guidePrice)
|
||||||
})
|
})
|
||||||
this.areaPrice = Math.min(...areaPriceList)
|
this.areaPrice = Math.min(...areaPriceList)
|
||||||
console.log(Math.min(...areaPriceList),areaPriceList,'对对对对对对多多多多')
|
|
||||||
}
|
}
|
||||||
}else if(res.code == 40000){
|
}else if(res.code == 40000){
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
@@ -347,6 +332,10 @@
|
|||||||
showCancel:false,
|
showCancel:false,
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
|
if(getCurrentPages().length > 1) {
|
||||||
|
uni.navigateBack()
|
||||||
|
return
|
||||||
|
}
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url:'../../../pages/tabbar/home/home'
|
url:'../../../pages/tabbar/home/home'
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user