diff --git a/api/oil-site.js b/api/oil-site.js
index fd12efe..a04a5e3 100644
--- a/api/oil-site.js
+++ b/api/oil-site.js
@@ -31,6 +31,13 @@ export default {
data: data
})
},
+ getSiteLists(data) {
+ return request({
+ url: `/${service_name}/${group_name}/findBCSiteInfoByPage`,
+ method: 'post',
+ data: data
+ })
+ },
getSiteDetails(data) {
return request({
url: `/${service_name}/${group_name}/getSiteDetails`,
diff --git a/components/Empty.vue b/components/Empty.vue
index bd26f3c..a91bd55 100644
--- a/components/Empty.vue
+++ b/components/Empty.vue
@@ -4,7 +4,7 @@
- 这里没有相关记录哦~
+ {{contentTitle?contentTitle:'这里没有相关记录哦~'}}
diff --git a/components/sl-filter/sl-filter.vue b/components/sl-filter/sl-filter.vue
index 6c1b29f..776c55c 100644
--- a/components/sl-filter/sl-filter.vue
+++ b/components/sl-filter/sl-filter.vue
@@ -226,6 +226,10 @@
}
}
} else {
+ // if(this.titleList[this.selectedIndex].key.indexOf('oilProductCode') !=-1 && this.titleList[this.selectedIndex].title.indexOf('全部') != -1){
+ // this.titleList[this.selectedIndex+1].title = '距离排序'
+ // console.log(this.titleList[this.selectedIndex].key,this.titleList[this.selectedIndex].title,'spppppppppppp')
+ // }
for (let key in titlesObj) {
if (!Array.isArray(titlesObj[key])) {
this.tempTitleObj[key] = titlesObj[key];
@@ -240,7 +244,6 @@
}
}
}
-
this.$refs.popupRef.close()
if (obj.isReset) {
diff --git a/pages/index/startPage/startPage.vue b/pages/index/startPage/startPage.vue
index 6a7540f..6bd4b7b 100644
--- a/pages/index/startPage/startPage.vue
+++ b/pages/index/startPage/startPage.vue
@@ -59,21 +59,59 @@
this.getFilterData()
}
}
- 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)
+ // 在页面中定义插屏广告
+ let interstitialAd = null
+
+ // 在页面onLoad回调事件中创建插屏广告实例
+ if (wx.createInterstitialAd) {
+ interstitialAd = wx.createInterstitialAd({
+ 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)
+ })
+ // 在适合的场景显示插屏广告
+ if (interstitialAd) {
+ interstitialAd.show().catch((err) => {
+ console.error(err)
+ })
+ }
+ interstitialAd.onClose(res => {
+ 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)
+ })
},
onReady(option) {
const updateManager = uni.getUpdateManager();
diff --git a/pages/tabbar/home/home.vue b/pages/tabbar/home/home.vue
index 6bc660c..8fa1dd6 100644
--- a/pages/tabbar/home/home.vue
+++ b/pages/tabbar/home/home.vue
@@ -137,6 +137,9 @@
+
+
+
@@ -310,6 +313,7 @@
onLoad() {
this.reverseGeocoder(this.location)
this.refreshLocation()
+
// if (!uni.getStorageSync('filterData')) {
// this.getFilterData()
// }
diff --git a/pages/tabbar/station/stationList.vue b/pages/tabbar/station/stationList.vue
index c747dff..ae05760 100644
--- a/pages/tabbar/station/stationList.vue
+++ b/pages/tabbar/station/stationList.vue
@@ -1,5 +1,5 @@
-
+
附近油站
@@ -17,7 +17,7 @@
-
+
-
+
-
+
+
-
@@ -45,7 +46,7 @@
-
+
@@ -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: ""
- }]
- },
- {
- title: '0#轻柴油',
- key: 'oilProductCode',
- isMutiple: false,
- detailList: [{
- title: "全部",
- value: ""
- }]
- },
+ menuList:[
{
- 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;
}