This commit is contained in:
lixuan
2022-12-06 18:14:56 +08:00
parent f8543b24e7
commit 5c968e561a
7 changed files with 453 additions and 76 deletions

View File

@@ -68,7 +68,25 @@
adUnitId: 'adunit-a7faf57adeed211f'
})
}
interstitialAd.onLoad((err) => {
console.log('onLoad event emit', err)
})
interstitialAd.onError((err) => {
setTimeout(() => {
if (key == '在线') {
uni.switchTab({
url: '/pages/tabbar/home/home',
fail: (err) => {
console.log(err)
}
// url:'/BagStation/orderDetail/orderDetail'
})
} else {
uni.redirectTo({
url: '/BagAuth/pages/login/login'
})
}
}, 2000)
console.log('onError event emit', err)
})
// 在适合的场景显示插屏广告

View File

@@ -1,5 +1,5 @@
<template>
<view class="my-bg">
<view class="my-bg" style="display: flex;flex-direction: column;height: 100vh;">
<cu-custom class="main-totextbar bg-main-oil" bgColor="bg-main-oil">
<block slot="content">附近油站</block>
</cu-custom>
@@ -17,7 +17,7 @@
</view>
</view>
</view>
<view class="placeholder-hidden">
<!-- <view class="placeholder-hidden">
<view class="cu-bar search bg-white">
<view class="search-form round">
<text class="cuIcon-search"></text>
@@ -29,14 +29,15 @@
src="https://www.51xingka.net/LSMOIL/static/img/gas-station.png" mode=""></image>
</view>
</view>
</view>
</view> -->
<!-- 筛选开始 -->
<scroll-view class="screentop bg-white">
<scroll-view class="screentop bg-white" style="flex: 1;">
<view class="">
<sl-filter reflexTitle ref="slFilter" @result="filterRes" :menuList="menuList"></sl-filter>
<sl-filter reflexTitle ref="slFilter" :productCodeList="productCodeList" :areaCodeList="areaCodeList" @result="filterRes" :menuList="menuList"></sl-filter>
<!-- <sl-filter reflexTitle ref="slFilter" @result="filterRes" :menuList="menuList"></sl-filter> -->
</view>
<view class="bg-white min-height-50 padding-top" v-if="siteList.length>0">
<site-item v-for="(item,index) in siteList" :key="item.id" :site-item="item" :first="index==0"
<site-item v-for="(item,index) in siteList" :key="item.id" :site-item="item" :first="index==0" :listHeight="listHeight"
class="cu-list menu-avatar cu-item" @tap="toDetail(item)">
</site-item>
<view class="placeholder-hidden">
@@ -45,7 +46,7 @@
</view>
<view class="" v-else>
<my-empty></my-empty>
<my-empty :contentTitle="contentTitle"></my-empty>
</view>
</scroll-view>
@@ -68,39 +69,166 @@
data() {
return {
filterData: {
oilProductCode: '0#'
// oilProductCode: '0#'
},
contentTitle:'您当前位置附近没有油站,可以点击左上角-距离-选择其他省市进行查看。',
loadStatus: 'load',
listHeight:160,
areaCodeList:[],
siteName: '',
menuList: uni.getStorageSync('filterData') ? uni.getStorageSync('filterData') : [{
title: '渠道',
isMutiple: false,
key: 'channelCode',
detailList: [{
title: "全部",
value: ""
}]
},
menuList:[
{
title: '0#轻柴油',
key: 'oilProductCode',
isMutiple: false,
detailList: [{
title: "全部",
value: ""
}]
},
{
title: '品牌',
key: 'siteBrand',
isSort: true,
isMutiple: false,
detailList: [{
title: "全部",
value: ""
}]
}
title: '距离',
isMutiple: false,
key: 'distance',
detailList: [
{
title: "全部",
value: ''
},
{
title: "20Km",
value: 20
},
{
title: "30Km",
value: 30
},
{
title: "50Km",
value: 50
},
{
title: "省市",
value: 10
}
]
},
{
title: '油品',
key: 'oilProductCode',
isMutiple: false,
detailList: [{
title: "全部",
value: ""
},
{
title: "0#",
value: "0#"
},
{
title: "-10#",
value: "-10#"
},
{
title: "-20#",
value: "-20#"
},
{
title: "-35#",
value: "-35#"
},
{
title: "LNG",
value: "LNG"
}]
},
// {
// title: '油品',
// key: 'oilProductCode',
// isMutiple: false,
// detailList: {全部:[{
// title: "全部",
// value: ""
// }],
// 柴油:[{
// title: "0#",
// value: "0#"
// },
// {
// title: "-10#",
// value: "-10#"
// },
// {
// title: "-20#",
// value: "-20#"
// },
// {
// title: "-35#",
// value: "-35#"
// }],
// 天然气:[{
// title: "LNG",
// value: "LNG"
// }]}
// },
{
title: '距离排序',
isMutiple: false,
key: 'comprehensiveSort',
detailList: [{
title: "距离排序",
value: 1
},
{
title: "价格排序",
value: 2
}
]
},
],
// menuList: uni.getStorageSync('filterData') ? uni.getStorageSync('filterData') : [
// {
// title: '渠道',
// isMutiple: false,
// key: 'channelCode',
// detailList: [{
// title: "全部",
// value: ""
// }]
// },
// {
// title: '距离',
// isMutiple: false,
// key: 'distance',
// detailList: [{
// title: "默认",
// value: 20
// },
// {
// title: "20Km",
// value: 20
// },
// {
// title: "30Km",
// value: 30
// },
// {
// title: "50Km",
// value: 50
// }
// ]
// },
// {
// title: '0#轻柴油',
// key: 'oilProductCode',
// isMutiple: false,
// detailList: [{
// title: "全部",
// value: ""
// }]
// },
// {
// title: '品牌',
// key: 'siteBrand',
// isSort: true,
// isMutiple: false,
// detailList: [{
// title: "全部",
// value: ""
// }]
// }
// ],
siteList: [],
InputBottom: 0,
show: false,
@@ -155,7 +283,6 @@
methods: {
filterRes(val) {
this.filterData = val
console.log(val)
this.currentPage = 1
this.siteList = []
this.getSiteList()
@@ -163,24 +290,33 @@
getFilterData() {
oilSiteApi.getCheckInfo().then(res => {
if (res.code == 20000) {
res.data.channelCodes.map(item => {
this.menuList[0].detailList.push({
title: item.name,
value: item.id
})
})
res.data.productCodes.map(item => {
this.menuList[1].detailList.push({
title: item.name,
value: item.id
})
})
res.data.siteBrands.map(item => {
this.menuList[2].detailList.push({
title: item.name,
value: item.id
})
})
uni.setStorageSync('productCodeList', res.data.productCodeList)
uni.setStorageSync('areaCodeList', res.data.areaCodeList)
this.areaCodeList = uni.getStorageSync('areaCodeList')
if(uni.getStorageSync('areaCodeList')){
this.areaCodeList = uni.getStorageSync('areaCodeList')
}else{
this.areaCodeList = res.data.areaCodeList
}
// this.productCodeList = uni.getStorageSync('productCodeList')
// res.data.channelCodes.map(item => {
// this.menuList[0].detailList.push({
// title: item.name,
// value: item.id
// })
// })
// res.data.productCodes.map(item => {
// this.menuList[1].detailList.push({
// title: item.name,
// value: item.id
// })
// })
// res.data.siteBrands.map(item => {
// this.menuList[2].detailList.push({
// title: item.name,
// value: item.id
// })
// })
// // console.log(channelCodes, productCodes, siteBrands)
// this.$refs.slFilter.resetMenuList(this.menuList)
@@ -215,7 +351,12 @@
channelCode: this.siteName ? '' : this.filterData
.channelCode, // 备注:// 渠道编码 ( OIL星油 WJY万金油 LV老吕找油网 TY团油 YDJY一点加油壳牌)
oilProductCode: this.siteName ? '' : this.filterData
.oilProductCode // 备注:// 油号选择 ( 0# 92# 92#)
.oilProductCode, // 备注:// 油号选择 ( 0# 92# 92#)
provinceCode:this.filterData.provinceCode,
cityCode:this.filterData.cityCode,
areaCode:this.filterData.areaCode,
distance:this.filterData.distance,
comprehensiveSort:this.filterData.comprehensiveSort?this.filterData.comprehensiveSort:1
}
}
@@ -232,7 +373,7 @@
}
})
} else {
oilSiteApi.getSiteList(data1).then(res => {
oilSiteApi.getSiteLists(data1).then(res => {
if (res.code == 20000) {
this.siteList = this.siteList.concat(res.data.list)
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
@@ -326,12 +467,13 @@
.placeholder-hidden {
/* min-height: 95upx; */
opacity: 0;
}
.fixed-top-site {
/* top: 120rpx; */
z-index: 4;
position: fixed;
/* position: fixed; */
width: 750upx;
}