Compare commits

...

10 Commits

Author SHA1 Message Date
xiaozhiyong 5e004d99ac 更新 2 months ago
xiaozhiyong 687ebc8e11 更新 5 months ago
xiaozhiyong 2c07c1ec7b 更新 6 months ago
xiaozhiyong 7417788438 更新 8 months ago
xiaozhiyong d330091b19 更新 8 months ago
xiaozhiyong a38c60bdc4 更新 8 months ago
xiaozhiyong a4b95d8d6f 更新 8 months ago
xiaozhiyong 99fb078b91 更新 8 months ago
xiaozhiyong 96ed774959 更新 8 months ago
xiaozhiyong 90ebfec3e9 更新 9 months ago
  1. 73
      BagStation/pages/components/price-select-tab.vue
  2. 6
      BagStation/pages/makeOrder/makeOrder.vue
  3. 2
      BagStation/pages/routePlain/routePlain.vue
  4. 10
      BagStation/pages/routePlainMap/routePlainMap.vue
  5. 29
      BagStation/pages/stationDetail/stationDetail.vue
  6. 2
      BagStation/pages/stationDetail/stieQr.vue
  7. 408
      BagStation/pages/stationMap/stationMap.vue
  8. 25
      api/oil-site.js
  9. 10
      components/three-sites.vue
  10. 1
      pages/index/startPage/startPage.vue
  11. 151
      pages/tabbar/home/home.vue
  12. 2
      pages/tabbar/qrCenter/qrCenter.vue
  13. 102
      pages/tabbar/station/stationList.vue
  14. 34
      utils/request.js

@ -73,7 +73,7 @@
</view>
</view>
<view class="">
{{plateNumber?plateNumber:(plateNumberSel?plateNumberSel:'非必填')}}
{{plateNumber?plateNumber:(plateNumberSel?plateNumberSel:'输入车牌号')}}
</view>
</view>
</view>
@ -294,7 +294,7 @@
<view class="cu-modal bottom-modal " :class="showPlate">
<view class="cu-dialog bg-white">
<view class="cu-bar bg-white justify-end">
<view class="content">车牌号非必填</view>
<!-- <view class="content">车牌号非必填</view> -->
<view class="action" @tap="showPlate=''">
<text class="cuIcon-close text-blues"></text>
</view>
@ -305,7 +305,7 @@
<view class="flex-sub">
输入车牌号
</view>
<input type="text" value="" placeholder="请选择或输入车牌号" v-model="plateNumber" />
<input type="text" value="" placeholder="请选择或输入车牌号" v-model.trim="plateNumber" />
</view>
<picker-view :indicator-style="indicatorStyle" v-if="plateNumbers.length" :value="plateIndex"
@change="pickPlate" class="picker-view">
@ -365,6 +365,10 @@
activeCur: {
type: Number,
default: 0
},
siteId: {
type: String,
default: ""
}
},
data() {
@ -499,12 +503,13 @@
checkBar: [],
realMoney: '',
xoilAmountGun: '',
vlom: ''
vlom: '',
oilItem: {}
}
},
created() {
let oilItem = uni.getStorageSync('oilItem')
this.showtitles = oilItem.listTag
this.oilItem = uni.getStorageSync('oilItem')
this.showtitles = this.oilItem.listTag
},
watch: {
activeChannelCode: {
@ -671,16 +676,17 @@
})
},
checkInfo() {
// console.log(this.radio)
this.tsetPlate(this.plateNumber ? this.plateNumber : this.plateNumberSel)
// if (!this.testPlateResult) {
// this.plateNumber=''
// uni.showToast({
// title: '',
// icon: 'none'
// })
// // return false
// }
this.tsetPlate(this.plateNumber || this.plateNumberSel)
if (!this.testPlateResult && !['1689182438357262336', '1689183144276463616', '1689185023261741056','1762304610449412096','1689183774927818752','1689184331812888576']
.includes(this.siteId || this.oilItem.siteId)) {
// this.plateNumber=''
uni.showToast({
title: '车牌号不可为空或格式错误,请重新输入',
icon: 'none',
duration: 2000
})
return false
}
if (this.radio == null || !this.oilSitePriceDetailsVo[this.radio].priceId) {
uni.showToast({
icon: 'none',
@ -832,15 +838,17 @@
},
beforeMake() {
// console.log(this.radio, 'beforeMake')
this.tsetPlate(this.plateNumber ? this.plateNumber : this.plateNumberSel)
// if (!this.testPlateResult) {
// this.plateNumber=''
// uni.showToast({
// title: '',
// icon: 'none'
// })
// // return false
// }
this.tsetPlate( this.plateNumber || this.plateNumberSel)
if (!this.testPlateResult && !['1689182438357262336', '1689183144276463616', '1689185023261741056','1762304610449412096','1689183774927818752','1689184331812888576']
.includes(this.siteId || this.oilItem.siteId)) {
// this.plateNumber=''
uni.showToast({
title: '车牌号不可为空或格式错误,请重新输入',
icon: 'none',
duration: 2000
})
return false
}
if (this.radio == null || !this.oilSitePriceDetailsVo[this.radio].priceId) {
uni.showToast({
icon: 'none',
@ -939,6 +947,9 @@
}
}).finally(msg => {
clearTimeout(this.timer)
if (!this.plateNumbers.length) {
uni.setStorageSync('localPlateNumber', this.plateNumber)
}
})
}, 500)
}
@ -946,18 +957,20 @@
},
tsetPlate(plateNumber) {
this.testPlateResult =
/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/
/(^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4,5}[A-Z0-9挂学警港澳]{1}$)/
.test(plateNumber)
},
//
getNewSitePrice(channelId) {
this.oilSitePriceDetailsVo = []
oilSiteApi.getNewSitePriceZp({
oilSiteApi.getSitePriceKAByBelong({
channelId: channelId,
clientBelong: "ZHONGPIN"
}).then(res => {
if (res.code == 20000) {
this.plateNumbers = res.data.plateNumbers
if (!res.data.plateNumbers.length) {
this.plateNumber = uni.getStorageSync('localPlateNumber') || ''
} else this.plateNumbers = res.data.plateNumbers
this.oilSitePriceDetailsVo = res.data.oilSitePriceDetailsVo;
this.siteUserNames = res.data.siteUserNames;
if (this.oilSitePriceDetailsVo.length == 1) {
@ -1018,7 +1031,7 @@
})
this.vlom = ''
// // console.log(this.radio)
console.log(this.oilSitePriceDetailsVo[this.radio])
// console.log(this.oilSitePriceDetailsVo[this.radio])
},
tabSelect(e) {
this.activeChannelCode = e.currentTarget.dataset.channelCode;
@ -1195,4 +1208,4 @@
.box-panding {
padding: 10 0;
}
</style>
</style>

@ -63,7 +63,7 @@
<!-- 价格 -->
<price-select-tab @onChangePayQr="onChangePayQr" @onChangePay="onChangePay" :active-cur="activeCur"
:site-name="siteInfo.siteName" :channel-list="siteInfo.oilSiteChannelDetailsVos"
:channelJuli="siteInfo.juli"></price-select-tab>
:channelJuli="siteInfo.juli" :siteId="siteId"></price-select-tab>
</view>
@ -79,6 +79,7 @@
data() {
return {
isBackPrev: true,
siteId:'',
otherImgURL: this.global.otherImgURL,
radio: 'B',
mainURL: this.global.mainURL,
@ -109,6 +110,7 @@
if (authorization && target.siteId) {
//
this.isBackPrev = false
this.siteId = target.siteId
this.getSiteInfo(target.siteId)
}
} catch (e) {}
@ -148,7 +150,7 @@
clientBelong: "ZHONGPIN"
}
oilSiteApi.getSiteDetails(data2).then(res => {
oilSiteApi.getSiteDetailsByKA(data2).then(res => {
if (res.code == 20000) {
this.siteInfo = res.data
}

@ -170,7 +170,7 @@
latitude :that.origin.latitude
}
}
oilSiteApi.getSiteList(data1).then(res => {
oilSiteApi.findKASiteInfoByPage(data1).then(res => {
//console.log(res)
if (res.code == 20000) {
that.nearSite = res.data.list

@ -497,10 +497,10 @@
})
},
markerTap(res){
console.log('这类似点击marker点',res)
console.log('这类似点击marker点匹配',this.coverDatas)
// console.log('marker',res)
// console.log('marker',this.coverDatas)
let site = this.coverDatas.filter(item=>Number(item.id.substr(0,8)) == res.detail.markerId );
console.log('*++++++++++++++++++++++++++++++*',site)
// console.log('*++++++++++++++++++++++++++++++*',site)
this.siteInfo = site[0]
if(this.siteInfo){
let userLocation = uni.getStorageSync('userLocation')
@ -512,8 +512,8 @@
latitude:latitude ,
longitude: longitude ,
}
console.log('点击获取obj',obj)
oilSiteApi.getSiteDetails(obj).then(res=>{
// console.log('obj',obj)
oilSiteApi.getSiteDetailsByKA(obj).then(res=>{
if(res.code == 20000){
console.log(res)
this.oliSiteInfo = res.data

@ -211,6 +211,8 @@
}
this.location = uni.getStorageSync('location')
// console.log('option',option)
if (!option.item) {
let siteInfos = uni.getStorageSync('siteInfo')
@ -291,16 +293,23 @@
siteId: item.siteId,
clientBelong: "ZHONGPIN"
}
let user = uni.getStorageSync('user');
if (user) {
oilSiteApi.getSiteDetails(data2).then(res => {
if (res.code == 20000) {
this.siteInfo = Object.assign(item, res.data);
}
})
} else {
this.siteInfo = item;
}
oilSiteApi.getSiteDetailsByKA(data2).then(res => {
if (res.code == 20000) {
this.siteInfo = Object.assign(item, res.data);
}else {
this.siteInfo = item
}
})
// let user = uni.getStorageSync('user');
// if (user) {
// oilSiteApi.getSiteDetailsByKA(data2).then(res => {
// if (res.code == 20000) {
// this.siteInfo = Object.assign(item, res.data);
// }
// })
// } else {
// this.siteInfo = item;
// }
},
makePay() {

@ -283,7 +283,7 @@
...uni.getStorageSync('location'),
siteId: this.siteId
}
oilSiteApi.getSiteDetails(data2).then(res => {
oilSiteApi.getSiteDetailsByKA(data2).then(res => {
if (res.code == 20000) {
this.siteInfo = res.data
}

@ -1,79 +1,109 @@
<template>
<view>
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
<block slot="backText">返回</block>
<block slot="content">油站地图</block>
</cu-custom>
<view>
<view class="cu-bar search bg-white">
<view class="search-form round">
<text class="cuIcon-search"></text>
<input confirm-type="search" @input="onInput" @confirm="onSearch" v-model="siteName" :adjust-position="false" type="text" placeholder="加油站名称" />
</view>
<view class="action" @tap="loadMore">
更多
<cu-custom
class="main-totextbar bg-main-oil"
:isBack="true"
bgColor="bg-main-oil"
>
<block slot="backText">返回</block>
<block slot="content">油站地图</block>
</cu-custom>
<view>
<view class="cu-bar search bg-white">
<view class="search-form round">
<text class="cuIcon-search"></text>
<input
confirm-type="search"
@input="onInput"
@confirm="onSearch"
v-model="siteName"
:adjust-position="false"
type="text"
placeholder="加油站名称"
/>
</view>
<view class="action" @tap="loadMore"> 更多 </view>
</view>
</view>
<view class="page-body">
<view class="page-section page-section-gap">
<map style="width: 100%; height:100vh;" :controls="controls" :polyline='polyline' :scale="scale" :latitude="latitude" @labeltap='makerTap' @markertap="makerTap" :longitude="longitude" :markers="covers">
</map>
<view class="page-body">
<view class="page-section page-section-gap">
<map
style="width: 100%; height: 100vh"
:controls="controls"
:polyline="polyline"
:scale="scale"
:latitude="latitude"
@labeltap="makerTap"
@markertap="makerTap"
:longitude="longitude"
:markers="covers"
>
</map>
</view>
</view>
</view>
</view>
<view class="cu-modal bottom-modal" :class="showSite">
<view class="cu-dialog" @tap.stop="">
<view class="cu-bar bg-white justify-end">
<view class="content"> {{siteInfo.siteName?siteInfo.siteName:'油站名称'}}</view>
<view class="action" @tap="showSite=''">
<text class="cuIcon-close text-red"></text>
<view class="cu-modal bottom-modal" :class="showSite">
<view class="cu-dialog" @tap.stop="">
<view class="cu-bar bg-white justify-end">
<view class="content">
{{ siteInfo.siteName ? siteInfo.siteName : "油站名称" }}</view
>
<view class="action" @tap="showSite = ''">
<text class="cuIcon-close text-red"></text>
</view>
</view>
</view>
<view class="flex-sub">
<view class="cu-list menu padding-sm radius my-shadow bg-white yu-card-xuan">
<view class="cu-item ">
<view class="content" @tap="toDetail(siteInfo)">
<view class="strong padding-bottom-xs">
{{siteInfo.siteName?siteInfo.siteName:'油站名称'}}
</view>
<view class="text-gray flex">
<view class="text-bold yellow-oil; text-xl padding-right-xs">
{{siteInfo.oilProductCode}}
<view class="flex-sub">
<view
class="cu-list menu padding-sm radius my-shadow bg-white yu-card-xuan"
>
<view class="cu-item">
<view class="content" @tap="toDetail(siteInfo)">
<view class="strong padding-bottom-xs">
{{ siteInfo.siteName ? siteInfo.siteName : "油站名称" }}
</view>
<view class="oil-main-color text-xl text-bold padding-right-xs">
<view class="text-gray flex">
<view class="text-bold yellow-oil; text-xl padding-right-xs">
{{ siteInfo.oilProductCode }}
</view>
<view
class="oil-main-color text-xl text-bold padding-right-xs"
>
{{ siteInfo.sitePrice | moneyFormat }}
</view>
<view class="">
<text
class="cu-tag oil-tag radius text-xs"
v-if="siteInfo.oilSitePrice - siteInfo.sitePrice > 0"
>{{
(siteInfo.oilSitePrice - siteInfo.sitePrice)
| moneyFormat
}}</text
>
</view>
{{siteInfo.sitePrice|moneyFormat}}
<view class="text-cut padding-left-sm text-lg">
<text
class="text-delete color-333 text-sm padding-right-xs"
>
{{ siteInfo.oilSitePrice | moneyFormat }}/L
</text>
</view>
<view class="">
<text class="cu-tag oil-tag radius text-xs" v-if="siteInfo.oilSitePrice - siteInfo.sitePrice>0">{{(siteInfo.oilSitePrice - siteInfo.sitePrice)|moneyFormat}}</text>
</view>
<view class="text-cut padding-left-sm text-lg">
<text class="text-delete color-333 text-sm padding-right-xs">
{{siteInfo.oilSitePrice|moneyFormat}}/L
</text>
<!-- <my-icon iconName="¥.png" class="padding-right-xs icon-rectangle"></my-icon>
<!-- <my-icon iconName="¥.png" class="padding-right-xs icon-rectangle"></my-icon>
<my-icon iconName="f.png" class="padding-right-xs "></my-icon> -->
</view>
</view>
<view class="font-12 text-left color-999 site-label text-cut">
{{ siteInfo.address ? siteInfo.siteName : "油站地址" }}
</view>
</view>
<view class="font-12 text-left color-999 site-label text-cut">
{{siteInfo.address?siteInfo.siteName:'油站地址'}}
</view>
</view>
<view class="action " @tap="openMap">
<view class="oil-main-color">
<my-icon iconName="sy-der-icon.png" class="padding-right-xs text-sm"></my-icon>
{{siteInfo.juli|distanceFilter}}
<view class="action" @tap="openMap">
<view class="oil-main-color">
<my-icon
iconName="sy-der-icon.png"
class="padding-right-xs text-sm"
></my-icon>
{{ siteInfo.juli | distanceFilter }}
</view>
</view>
</view>
</view>
@ -81,17 +111,16 @@
</view>
</view>
</view>
</view>
</template>
<script>
import oilSiteApi from '@/api/oil-site.js'
import oilSiteApi from "@/api/oil-site.js";
export default {
data() {
return {
siteInfo: {},
showSite: '',
showSite: "",
imgUrl: this.global.imgURL,
siteList: [],
InputBottom: 0,
@ -99,67 +128,73 @@ export default {
siteCount: 1,
currentPage: 1,
isLoadMore: false, //
baseDriver: uni.getStorageSync('baseDriver'),
baseDriver: uni.getStorageSync("baseDriver"),
selLocation: {},
title: 'map',
location: uni.getStorageSync('location'),
title: "map",
location: uni.getStorageSync("location"),
latitude: 39.909,
longitude: 116.39742,
covers: [],
fillColor: '#ffd75e',
borderColor: '#12A1DD',
fillColor: "#ffd75e",
borderColor: "#12A1DD",
scale: 12, //
controls: [{ //
id: 1, //id
position: { //
left: 0,
top: 15,
width: 50,
height: 50
controls: [
{
//
id: 1, //id
position: {
//
left: 0,
top: 15,
width: 50,
height: 50,
},
},
}],
polyline: [{ //线
points: [],
color: "#0000AA", //线
width: 2, //线
dottedLine: true, //线
arrowLine: true, //线
}],
],
polyline: [
{
//线
points: [],
color: "#0000AA", //线
width: 2, //线
dottedLine: true, //线
arrowLine: true, //线
},
],
};
},
onLoad() {
let that = this
this.getSiteList()
let that = this;
this.getSiteList();
},
filters: {
distanceFilter(value) {
if (value) {
return value > 1000 ? ((value / 1000).toFixed(2) + 'km') : (value + 'm')
return value > 1000 ? (value / 1000).toFixed(2) + "km" : value + "m";
}
},
moneyFormat(value) {
if (value) {
return value.toFixed(2)
return value.toFixed(2);
} else {
return '0.00'
return "0.00";
}
}
},
},
methods: {
getSiteInfo(id) {
let data2 = {
...uni.getStorageSync('location'),
siteId: id
}
oilSiteApi.getSiteDetails(data2).then(res => {
...uni.getStorageSync("location"),
siteId: id,
};
oilSiteApi.getSiteDetailsByKA(data2).then((res) => {
if (res.code == 20000) {
this.siteInfo = res.data
this.siteInfo = res.data;
}
})
});
},
openMap() {
let that = this
let that = this;
uni.openLocation({
latitude: this.siteInfo.latitude,
longitude: this.siteInfo.longitude,
@ -176,21 +211,22 @@ export default {
complete: () => {
// // console.log('made')
},
});
})
var map = uni.createMapContext('map')
map.moveToLocation()
var map = uni.createMapContext("map");
map.moveToLocation();
},
makerTap(e) {
// // console.log(e)
// // console.log(e.detail)
this.showSite = ''
this.showSite = "";
if (e.detail.markerId !== 0) {
const index = this.siteList.findIndex(s => s.markerId === e.detail.markerId)
const index = this.siteList.findIndex(
(s) => s.markerId === e.detail.markerId
);
// // console.log(index)
this.showSite = 'show'
this.siteInfo = this.siteList[index]
this.showSite = "show";
this.siteInfo = this.siteList[index];
}
},
refreshLocation() {
@ -200,7 +236,6 @@ export default {
// uni.setStorageSync('location', res)
// this.location = res
// this.addLocationCurrent()
// }
// });
},
@ -209,104 +244,105 @@ export default {
id: 0,
latitude: this.location.latitude, //
longitude: this.location.longitude, //
label: { //
label: {
//
content: "我的位置", //
color: '#12A1DD', //
color: "#12A1DD", //
anchorX: 5, //label marker
anchorY: -10, //label marker
bgColor: '#fff', //
anchorY: -10, //label marker
bgColor: "#fff", //
padding: 5, //
borderWidth: 1, //
borderRadius: 10,
borderColor: '#12A1DD', // textAlign: 'right' //
}
})
borderColor: "#12A1DD", // textAlign: 'right' //
},
});
},
loadMore() {
this.getSiteList()
this.getSiteList();
},
getSiteList() {
this.refreshLocation()
this.refreshLocation();
let data1 = {
currentPage: this.currentPage,
pageSize: 20,
params: { //Object //
params: {
//Object //
sort: "juli", //String // ( price juli )
siteName: this.siteName,
...uni.getStorageSync('location'),
...this.filterData
...uni.getStorageSync("location"),
...this.filterData,
// siteBrand: "", // // ( 1- 2- 3- 4- 5- 6- 7- 8- )
// channelCode: "", // // ( OIL WJY LV TY YDJY)
// oilProductCode: "" // // ( 0# 92# 92#)
}
}
oilSiteApi.getSiteList(data1).then(res => {
},
};
oilSiteApi.findKASiteInfoByPage(data1).then((res) => {
if (res.code == 20000) {
const tmp = res.data.list
tmp.forEach(e => {
e.markerId = this.siteCount++
})
this.siteList = this.siteList.concat(tmp)
const tmp = res.data.list;
tmp.forEach((e) => {
e.markerId = this.siteCount++;
});
this.siteList = this.siteList.concat(tmp);
if (this.siteList.length != 0) {
this.latitude = this.siteList[0].latitude
this.longitude = this.siteList[0].longitude
this.latitude = this.siteList[0].latitude;
this.longitude = this.siteList[0].longitude;
} else {
uni.showToast({
title: '没有查到相关油站',
icon: 'none'
})
this.latitude = this.location.latitude
this.longitude = this.location.longitude
title: "没有查到相关油站",
icon: "none",
});
this.latitude = this.location.latitude;
this.longitude = this.location.longitude;
}
tmp.forEach(item => {
this.addCover(item)
})
if (tmp.length == 0) { //
tmp.forEach((item) => {
this.addCover(item);
});
if (tmp.length == 0) {
//
// this.$emit('changeLoad', 'nomore', true)
uni.showToast({
title: '没有更多油站了',
icon: 'none'
})
title: "没有更多油站了",
icon: "none",
});
} else {
this.currentPage++
this.currentPage++;
// this.$emit('changeLoad', 'load', false)
}
}
})
});
},
onInput() {
setTimeout(() => {
this.currentPage = 1
this.siteList = []
this.covers = []
this.getSiteList()
}, 100)
this.currentPage = 1;
this.siteList = [];
this.covers = [];
this.getSiteList();
}, 100);
},
onSearch() {
this.currentPage = 1
this.siteList = []
this.covers = []
this.getSiteList()
this.currentPage = 1;
this.siteList = [];
this.covers = [];
this.getSiteList();
},
toDetail(item) {
let itemS = JSON.stringify(item)
console.log('++++++')
console.log(itemS)
if (uni.getStorageSync('user')) {
uni.navigateTo({
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
fail: (err) => {
// console.log(err)
},
success: () => {
// console.log('err')
}
})
}
toDetail(item) {
let itemS = JSON.stringify(item);
console.log("++++++");
console.log(itemS);
if (uni.getStorageSync("user")) {
uni.navigateTo({
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
fail: (err) => {
// console.log(err)
},
success: () => {
// console.log('err')
},
});
}
},
addCover(site) {
// ( XOIL WJY LV TY YDJY)
@ -315,28 +351,30 @@ export default {
latitude: site.latitude, //
longitude: site.longitude, //
// iconPath: this.imgUrl + 'map-' + site.channelCode + '.png',
iconPath: this.imgUrl + 'map-' +'XOIL' + '.png',
iconPath: this.imgUrl + "map-" + "XOIL" + ".png",
width: 100,
height: 50,
title: site.siteName, //
label: { //
content: '¥' + site.sitePrice, //
label: {
//
content: "¥" + site.sitePrice, //
// color: '#F76350', //
color: '#fff', //
fontSize: '16',
textAlign:'center',
color: "#fff", //
fontSize: "16",
textAlign: "center",
anchorX: -5, //label marker
anchorY: -45, //label marker
anchorY: -45, //label marker
// x:39.909,//1.2.0
// y:116.39742,
bgColor: '#FF0000', //
bgColor: "#FF0000", //
borderRadius: 10,
// borderWidth: 1, //
// borderColor: '#D84C29', // textAlign: 'center' //
},
callout: { //
callout: {
//
content: site.siteName,
color: '#F76350',
color: "#F76350",
fontSize: 12,
borderRadius: 5,
},
@ -344,10 +382,10 @@ export default {
// x:5,
// y:1,
// }
})
}
}
}
});
},
},
};
</script>
<style scoped>

@ -45,6 +45,14 @@ export default {
data: data
})
},
// 中小客户调度管理系统
findKASiteInfoByPage(data) {
return request({
url: `/oil-site/oilSiteAppInfo/findKASiteInfoByPage`,
method: 'post',
data: data
})
},
getSiteDetails(data) {
return request({
url: `/${service_name}/${group_name}/getSiteDetails`,
@ -52,6 +60,14 @@ export default {
data: data
})
},
// 中小企业油站详情
getSiteDetailsByKA(data) {
return request({
url: `/${service_name}/${group_name}/getSiteDetailsByKA`,
method: 'post',
data: data
})
},
// 未登录查询油站
readOnlySites(data) {
return request({
@ -89,6 +105,7 @@ export default {
method: 'get'
})
},
// 中品 下单 -- 获取最新油站价格、司机、加油员相关信息
getNewSitePriceZp(data) {
return request({
@ -97,6 +114,14 @@ export default {
data:data
})
},
// 中小企业
getSitePriceKAByBelong(data) {
return request({
url: `/${service_name}/${group_name}/getSitePriceKAByBelong`,
method: 'post',
data:data
})
},
//根据地址获取详细地址信息
getGeoByAddress(address) {
return request({

@ -50,7 +50,7 @@
}
},
created() {
this.getSiteList()
this.refreshLocation()
},
methods: {
toSitePage(){
@ -62,13 +62,14 @@
refreshLocation(){
uni.getLocation({
type: 'wgs84',
success: function (res) {
success: (res) => {
uni.setStorageSync('location',res)
this.getSiteList()
}
});
},
getSiteList() {
this.refreshLocation()
// this.refreshLocation()
let data1 = {
currentPage: 1,
pageSize: 3,
@ -79,13 +80,14 @@
...this.filterData,
comprehensiveSort:1,
zpDisable:'ENABLE',
// parentCompanyId
// siteBrand: "", // // ( 1- 2- 3- 4- 5- 6- 7- 8- )
// channelCode: "", // // ( OIL WJY LV TY YDJY)
// oilProductCode: "" // // ( 0# 92# 92#)
}
}
oilSiteApi.getSiteLists(data1).then(res => {
oilSiteApi.findKASiteInfoByPage(data1).then(res => {
if (res.code == 20000) {
this.siteList = res.data.list;
(this.siteList.length>3)&&(this.siteList.length = 3)

@ -96,6 +96,7 @@
})
}
}
// handle()
interstitialAd.onClose(handle)
interstitialAd.onError((err) => {
console.log('onError', err)

@ -72,7 +72,7 @@
</view> -->
<view>
<view v-if="siteList.length>0">
<site-item :location='location' v-for="(item,index) in siteList" :key="item.id" :site-item="item"
<site-item :location='location' v-for="(item,index) in siteList" :key="index" :site-item="item"
:first="index==0" :listHeight="listHeight" class="cu-list menu-avatar cu-item"
@tap="toDetail(item)">
</site-item>
@ -83,7 +83,8 @@
</view>
</view>
<msg-models :showAuthFrror="showAuthFrror" @hideOneModal="hideModel"></msg-models>
<three-sites @hideOneModal="showThreeSites=false" :showThreeSites="showThreeSites"></three-sites>
<three-sites v-if="showThreeSites" @hideOneModal="showThreeSites=false"
:showThreeSites="showThreeSites"></three-sites>
</view>
</template>
@ -237,7 +238,8 @@
},
onPullDownRefresh() {
// this.refreshLocation()
this.refreshLocation()
setTimeout(function() {
uni.stopPullDownRefresh()
}, 800);
@ -306,6 +308,7 @@
type: 'wgs84',
success: (res) => {
uni.setStorageSync('location', res)
this.getSiteList()
},
fail: () => {
uni.getSetting({
@ -318,25 +321,23 @@
success: (resSec) => {
if (resSec.confirm) {
uni.openSetting({
success: (resThird) => {
if (resThird
.authSetting[
'scope.userLocation'
]) {
this.refreshLocation()
}
}
})
}
}
})
} else {
uni.showToast({
title: '获取定位失败,请稍后再试!',
icon: 'none'
})
}
}
})
},
complete: () => {
this.getSiteList()
},
// complete: () => {
// this.getSiteList()
// },
});
},
@ -375,18 +376,10 @@
showQr() {
let user = uni.getStorageSync("user");
if (!user) {
uni.showModal({
content: "登录后才能出示付款码哦",
confirmText: "去登录",
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: "/BagAuth/pages/login/login",
});
}
},
});
return;
uni.showToast({
title:'登录后才能出示付款码哦',
icon:'none'
})
}
this.showThreeSites = true
},
@ -394,18 +387,11 @@
toCards() {
let user = uni.getStorageSync("user");
if (!user) {
uni.showModal({
content: "登录后才能查看哦",
confirmText: "去登录",
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: "/BagAuth/pages/login/login",
});
}
},
});
return;
uni.showToast({
title:'登录后才能获取加油卡哦',
icon:'none'
})
return
}
uni.navigateTo({
url: '/BagMoney/pages/oilCards/oilCards'
@ -413,21 +399,21 @@
},
toOrders() {
let user = uni.getStorageSync("user");
if (!user) {
uni.showModal({
content: "登录后才能查看哦",
confirmText: "去登录",
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: "/BagAuth/pages/login/login",
});
}
},
});
return;
}
// let user = uni.getStorageSync("user");
// if (!user) {
// uni.showModal({
// content: "",
// confirmText: "",
// success: function(res) {
// if (res.confirm) {
// uni.navigateTo({
// url: "/BagAuth/pages/login/login",
// });
// }
// },
// });
// return;
// }
uni.switchTab({
url: '/pages/tabbar/order/orderList/orderList'
})
@ -443,18 +429,20 @@
currentPage: 1,
pageSize: 10,
params: {
longitude: 117.157817,
latitude: 31.802472,
// longitude: 117.157817,
// latitude: 31.802472,
clientBelong: 'ZHONGPIN',
comprehensiveSort: 1,
zpDisable: 'ENABLE',
sort: "juli",
...uni.getStorageSync('location'),
...this.filterData,
// latitude: '37.38808',
// longitude: '112.40546'
}
};
oilSiteApi.getSiteLists(params).then(res => {
oilSiteApi.findKASiteInfoByPage(params).then(res => {
if (res.code == 20000) {
this.siteList = res.data.list
}
@ -462,21 +450,23 @@
},
toDetail(item) {
let user = uni.getStorageSync("user");
if (!user) {
uni.showModal({
content: "登录后才能查看哦",
confirmText: "去登录",
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: "/BagAuth/pages/login/login",
});
}
},
});
return;
}
// console.log('siteList',this.siteList)
// let user = uni.getStorageSync("user");
// if (!user) {
// uni.showModal({
// content: "",
// confirmText: "",
// success: function(res) {
// if (res.confirm) {
// uni.navigateTo({
// url: "/BagAuth/pages/login/login",
// });
// }
// },
// });
// return;
// }
// console.log('item',item)
let itemS = encodeURIComponent(JSON.stringify(item));
uni.navigateTo({
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`
@ -495,7 +485,7 @@
...uni.getStorageSync('location'),
siteId: id
}
oilSiteApi.getSiteDetails(data2).then(res => {
oilSiteApi.getSiteDetailsByKA(data2).then(res => {
if (res.code == 20000) {
this.siteInfo = res.data
if (res.data.oilSiteChannelDetailsVos.length == 1 && res.data.oilSiteChannelDetailsVos[0]
@ -530,18 +520,11 @@
openScan() {
let user = uni.getStorageSync("user");
if (!user) {
uni.showModal({
content: "登录后才能使用扫一扫哦",
confirmText: "去登录",
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: "/BagAuth/pages/login/login",
});
}
},
});
return;
uni.showToast({
title:'登录后才能使用扫一扫哦',
icon:'none'
})
return
}
uni.scanCode({
scanType: 'qrCode',

@ -89,7 +89,7 @@
...uni.getStorageSync('location'),
siteId: id
}
oilSiteApi.getSiteDetails(data2).then(res => {
oilSiteApi.getSiteDetailsByKA(data2).then(res => {
if (res.code == 20000) {
this.siteInfo = res.data
if (res.data.oilSiteChannelDetailsVos.length == 1 && res.data.oilSiteChannelDetailsVos[0]

@ -38,7 +38,7 @@
<!-- <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="index" :site-item="item" :first="index==0"
:listHeight="listHeight" class="cu-list menu-avatar cu-item" @tap="toDetail(item)">
</site-item>
<view class="placeholder-hidden">
@ -256,14 +256,14 @@
}
},
},
onShow() {
this.tools.userLocationChenk().then(res => {
this.refreshLocation();
}).catch(err => {});
this.getSiteList()
},
// onShow() {
// this.tools.userLocationChenk().then(res => {
// this.refreshLocation();
// }).catch(err => {});
// this.getSiteList()
// },
onLoad() {
// this.refreshLocation()
this.refreshLocation()
if (!uni.getStorageSync('filterData')) {
this.getFilterData()
} else {
@ -369,15 +369,55 @@
onSelected(e) {
// console.log(e)
},
// refreshLocation() {
// uni.getLocation({
// type: 'wgs84',
// success: function(res) {
// uni.setStorageSync('location', res)
// }
// });
// },
refreshLocation() {
uni.getLocation({
type: 'wgs84',
success: function(res) {
success: (res) => {
uni.setStorageSync('location', res)
}
this.getSiteList()
},
fail: () => {
uni.getSetting({
success: (res) => {
if (!res.authSetting['scope.userLocation']) {
uni.showModal({
title: '请您打开定位权限',
content: '用于获取您当前位置附近的油站',
confirmText: '去设置',
success: (resSec) => {
if (resSec.confirm) {
uni.openSetting({
complete:() => {
// this.getSiteList()
// this.realPosition()
this.refreshLocation()
}
})
}
}
})
}else {
uni.showToast({
title:'获取定位失败,请稍后再试!',
icon:'none'
})
}
}
})
},
// complete: () => {
// this.getSiteList()
// },
});
},
getSiteList() {
let parameter = {
currentPage: this.currentPage,
@ -405,35 +445,37 @@
}
}
oilSiteApi.getSiteLists(parameter).then(res => {
oilSiteApi.findKASiteInfoByPage(parameter).then(res => {
if (res.code == 20000) {
this.siteList = this.siteList.concat(res.data.list)
if(this.currentPage == 1) {
this.siteList = res.data.list
}else this.siteList = this.siteList.concat(res.data.list)
if (res.data.list.length < 10) { //
this.loadStatus = 'nomore'
} else {
this.currentPage++
this.loadStatus = 'load'
}
}
}K
})
},
toDetail(item) {
let user = uni.getStorageSync("user");
if (!user) {
uni.showModal({
content: "登录后才能查看哦",
confirmText: "去登录",
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: "/BagAuth/pages/login/login",
});
}
},
});
return;
}
// let user = uni.getStorageSync("user");
// if (!user) {
// uni.showModal({
// content: "",
// confirmText: "",
// success: function(res) {
// if (res.confirm) {
// uni.navigateTo({
// url: "/BagAuth/pages/login/login",
// });
// }
// },
// });
// return;
// }
let itemS = encodeURIComponent(JSON.stringify(item));
uni.navigateTo({
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,

@ -18,43 +18,37 @@ var url = ''
service.interceptors.request.use(
config => {
// 拦截请求
uni.showLoading({
title: '加载中...'
})
const token = uni.getStorageSync('Authorization') || " "
const unionId = uni.getStorageSync('unionid')
const openId = uni.getStorageSync('openid')
// const accountSources = 'WE_CHAT_PROGRAM'
const accountSources = 'LOGIN_MP_WECHAT'
// console.log('取出来缓存', token, openid)
config.headers['openId'] = openId
config.headers['Authorization'] = token
config.headers['accountSources'] = accountSources
config.headers['imei'] = unionId
config.headers['dataSources'] = 'MP'
if(['/oil-site/oilSiteAppInfo/findKASiteInfoByPage','/oil-site/oilSiteAppInfo/getSiteDetailsByKA','/oil-site/oilSiteAppInfo/getSitePriceKAByBelong'].includes(config.url)) {
let parentCompanyId = config.baseURL === 'https://www.xingoil.com/adminapi' ? '1812649739013771264' : '1810568376122056704'
if(config.data.params) {
config.data.params['parentCompanyId'] = parentCompanyId
}else config.data['parentCompanyId'] = parentCompanyId
}
if (env === 'production') {
// 生产环境,加密,不输出任何东西
// 设置jsessionid和token
const JSESSIONID = utils.uuid()
config.headers['JSESSIONID'] = JSESSIONID
config.headers['token'] = utils.md5Salt(JSESSIONID)
// if ( encryptWhite.indexOf(config.url) < 0) {
// if (!notEncrypt && encryptWhite.indexOf(config.url) < 0) {
// 这是定义在哪的
const data = { // 用于存储加密
params: '' // 加密后的密文
const data = {
params: ''
}
// 要加密
data.params = utils.encrypt(JSON.stringify(config.data))
// console.log('参数', config.url, '参数加密前',config.data)
config.data = data
// }
} else {
// console.log('\n\n-----------------------')
// console.log('参数', config.url, '参数加密前', config.data)
url = config.url
}
@ -75,20 +69,14 @@ service.interceptors.response.use(
const res = response.data
if (env === 'production') {
// 生产环境,进行加密解密,不输出日志
if (res.encrypt == 1) {
// 加密的数据,需要解密
const dataParam = JSON.parse(utils.decrypt(res.data))
res.data = JSON.stringify(dataParam) === '{}' ? null : dataParam
// console.log('返回', response.config.url, '返回结果',res)
}
} else {
// console.log('返回', response.config.url, '返回结果未加密', res)
// console.log('-------------------------------------------\n\n')
}
uni.hideLoading()
if(response.config.url.indexOf('/oil-site/oilSiteOrderInfo/getOrderQrCode') === -1){
if(response.config.url.indexOf('/oil-site/oilSiteOrderInfo/getOrderQrCode') == -1){
if (res.code != 20000 && res.msg != '令牌为空,不允许操作' && res.msg != '您的ip已经更改,请重新登录' && res.msg != '登录与操作设备不同') {
uni.showToast({
title: res.msg,

Loading…
Cancel
Save