10 Commits

Author SHA1 Message Date
xiaozhiyong
5e004d99ac 更新 2025-01-21 14:51:04 +08:00
xiaozhiyong
687ebc8e11 更新 2024-11-13 13:21:02 +08:00
xiaozhiyong
2c07c1ec7b 更新 2024-10-15 08:58:57 +08:00
xiaozhiyong
7417788438 更新 2024-08-19 09:59:58 +08:00
xiaozhiyong
d330091b19 更新 2024-08-13 09:44:50 +08:00
xiaozhiyong
a38c60bdc4 更新 2024-08-09 14:02:37 +08:00
xiaozhiyong
a4b95d8d6f 更新 2024-08-09 09:47:55 +08:00
xiaozhiyong
99fb078b91 更新 2024-07-31 14:09:10 +08:00
xiaozhiyong
96ed774959 更新 2024-07-22 08:59:59 +08:00
xiaozhiyong
90ebfec3e9 更新 2024-07-17 16:20:13 +08:00
14 changed files with 480 additions and 377 deletions

View File

@@ -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>

View File

@@ -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
}

View File

@@ -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

View File

@@ -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

View File

@@ -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() {

View File

@@ -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
}

View File

@@ -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="加油站名称" />
<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 class="action" @tap="loadMore">
更多
</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>
</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="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 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>
<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 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>

View File

@@ -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({

View File

@@ -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)

View File

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

View File

@@ -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',

View File

@@ -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]

View File

@@ -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}`,

View File

@@ -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,