更新
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div class="homeNavBar_body">
|
||||
<div class="homeNavBar_body_title">
|
||||
<div class="vc homeNavBar_body_title_compantName">
|
||||
<div class="textov">{{$pinia.state.value.user.user?.networkName||'--'}}</div>
|
||||
<div class="textov">{{ $pinia.state.value.user.user?.networkName || '- -' }}</div>
|
||||
</div>
|
||||
<div class="vc homeNavBar_body_title_right">
|
||||
<van-icon @click="golist" size="20" name="orders-o" />
|
||||
@@ -12,19 +12,15 @@
|
||||
<div class="homeNavBar_body_seach">
|
||||
<div @click="isShow.filter = !isShow.filter" class="homeNavBar_body_seach_left">
|
||||
<span>油品</span>
|
||||
<van-icon :style="{transform:`rotate(${isShow.filter?180:0}deg)`}" style="margin-left: 10px;transition: all .3s;" name="arrow-down" />
|
||||
<van-icon :style="{ transform: `rotate(${isShow.filter ? 180 : 0}deg)` }" style="margin-left: 10px; transition: all 0.3s" name="arrow-down" />
|
||||
</div>
|
||||
<div class="homeNavBar_body_seach_right">
|
||||
<input @keydown.enter="input" v-model="value" placeholder="请输入油站查询" class="homeNavBar_body_seach_input" type="text">
|
||||
<input @keydown.enter="input" v-model="value" placeholder="请输入油站查询" class="homeNavBar_body_seach_input" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
<div :style="{height:isShow.filter?'':'0px'}" class="homeNavBar_body_filter">
|
||||
<van-tree-select
|
||||
style="margin-top:5px"
|
||||
:items="productCodeList"
|
||||
:active-id.sync="activeId"
|
||||
:main-active-index.sync="activeIndex" />
|
||||
<div style="padding:10px 0;background-color: #ffffff;" class="flex sa">
|
||||
<div :style="{ height: isShow.filter ? '' : '0px' }" class="homeNavBar_body_filter">
|
||||
<van-tree-select style="margin-top: 5px" :items="productCodeList" :active-id.sync="activeId" :main-active-index.sync="activeIndex" />
|
||||
<div style="padding: 10px 0; background-color: #ffffff" class="flex sa">
|
||||
<van-button @click="seleFn" size="small" type="danger">确定</van-button>
|
||||
<van-button @click="clearFn" size="small" type="default">重置</van-button>
|
||||
</div>
|
||||
@@ -34,66 +30,65 @@
|
||||
|
||||
<script>
|
||||
import filterList from '../components/oilType'
|
||||
import useStore from '@/store/piniaIndex';
|
||||
let store = useStore();
|
||||
import useStore from '@/store/piniaIndex'
|
||||
let store = useStore()
|
||||
export default {
|
||||
name: 'homeNavBar',
|
||||
props:{
|
||||
productCodeList:{
|
||||
type:Array,
|
||||
default:()=>[]
|
||||
props: {
|
||||
productCodeList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timer:null,
|
||||
isShow:{
|
||||
filter:false
|
||||
timer: null,
|
||||
isShow: {
|
||||
filter: false
|
||||
},
|
||||
value:'',
|
||||
value: '',
|
||||
show: false,
|
||||
activeId:'',
|
||||
activeId: '',
|
||||
activeIndex: '',
|
||||
items: filterList
|
||||
}
|
||||
},
|
||||
created(){},
|
||||
watch:{
|
||||
activeId(n){
|
||||
console.log(n,'activeId')
|
||||
created() {
|
||||
// console.log('$pinia', this.$pinia)
|
||||
},
|
||||
activeIndex(n){
|
||||
console.log(n,'activeIndex')
|
||||
watch: {
|
||||
// activeId(n) {
|
||||
// console.log(n, 'activeId')
|
||||
// },
|
||||
// activeIndex(n) {
|
||||
// console.log(n, 'activeIndex')
|
||||
// },
|
||||
// networkName: function () {}
|
||||
},
|
||||
networkName:function(){}
|
||||
mounted() {},
|
||||
methods: {
|
||||
clearFn() {
|
||||
this.activeIndex = ''
|
||||
this.activeId = ''
|
||||
this.$emit('input', this.activeId)
|
||||
},
|
||||
mounted(){
|
||||
input() {
|
||||
this.$emit('seach', this.value)
|
||||
},
|
||||
methods:{
|
||||
clearFn(){
|
||||
this.activeIndex='';
|
||||
this.activeId='';
|
||||
this.$emit("input", this.activeId);
|
||||
},
|
||||
input(){
|
||||
this.$emit('seach',this.value)
|
||||
},
|
||||
golist(){
|
||||
golist() {
|
||||
this.$router.push('/personalOrderList')
|
||||
},
|
||||
seleFn(){
|
||||
this.$emit("input", this.activeId);
|
||||
this.isShow.filter = !this.isShow.filter;
|
||||
seleFn() {
|
||||
this.$emit('input', this.activeId)
|
||||
this.isShow.filter = !this.isShow.filter
|
||||
this.$emit('getlist')
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<style></style>
|
||||
<style scoped lang="scss">
|
||||
|
||||
.homeNavBar_body_filter {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
@@ -102,8 +97,8 @@ export default {
|
||||
height: calc(100vh - 250px);
|
||||
color: black;
|
||||
overflow: hidden;
|
||||
transition: all .3s;
|
||||
padding: 0px ;
|
||||
transition: all 0.3s;
|
||||
padding: 0px;
|
||||
box-sizing: border-box;
|
||||
z-index: 99;
|
||||
|
||||
@@ -120,7 +115,7 @@ export default {
|
||||
margin-left: 20px;
|
||||
flex: 1;
|
||||
}
|
||||
.homeNavBar_body_seach_input input{
|
||||
.homeNavBar_body_seach_input input {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
padding: 0 10px;
|
||||
@@ -143,7 +138,6 @@ export default {
|
||||
// background-color: aqua;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.van_icon {
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
<div class="list_item_body_informationContainer">
|
||||
<div class="list_item_body_title tv">{{ listItem.siteName || '暂无' }}</div>
|
||||
<div class="list_item_body_lable">
|
||||
<div :style="{ background: item.color }" v-for="(item, index) in lableArray " :key="index"
|
||||
class="list_item_body_lable_item">{{ item.lable }}</div>
|
||||
<div :style="{ background: item.color }" v-for="(item, index) in lableArray" :key="index" class="list_item_body_lable_item">
|
||||
{{ item.lable }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="list_item_body_tip tv">
|
||||
{{ listItem.address || '暂无' }}
|
||||
@@ -15,7 +16,9 @@
|
||||
<div class="flex ac list_item_body_footer">
|
||||
<span class="list_item_body_oilTypeText">{{ listItem.oilProductCode }}</span>
|
||||
<span class="list_item_body_oilPriceText">¥{{ moneyIntercept(listItem.sitePrice) }}</span>
|
||||
<span class="list_item_body_oilDiscountText">省¥{{ Number(( moneyIntercept(listItem.oilSitePrice) - moneyIntercept(listItem.sitePrice) )).toFixed(2) }}</span>
|
||||
<span class="list_item_body_oilDiscountText"
|
||||
>省¥{{ Number(moneyIntercept(listItem.oilSitePrice) - moneyIntercept(listItem.sitePrice)).toFixed(2) }}</span
|
||||
>
|
||||
<span class="list_item_body_oilOriginaltText">¥{{ moneyIntercept(listItem.oilSitePrice) }}/L</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -25,11 +28,11 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "listItem",
|
||||
name: 'listItem',
|
||||
props: {
|
||||
index:{
|
||||
type:Number,
|
||||
default:0
|
||||
index: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
listItem: {
|
||||
type: Object,
|
||||
@@ -40,25 +43,24 @@ export default {
|
||||
return {
|
||||
lableArray: [],
|
||||
defaultImg: 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/logo_default.png'
|
||||
};
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.lableGenerate()
|
||||
},
|
||||
watch:{
|
||||
listItem:{
|
||||
handler(){
|
||||
watch: {
|
||||
listItem: {
|
||||
handler() {
|
||||
this.lableGenerate()
|
||||
},
|
||||
deep:true
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
distance(e) {
|
||||
let defaulObj = e || null;
|
||||
return !isNaN(Number(defaulObj)) ? String(defaulObj).length >= 4 ? `${(Number(defaulObj) / 1000).toFixed(2)}KM` : `${defaulObj}M` : '---'
|
||||
},
|
||||
|
||||
let defaulObj = e || null
|
||||
return !isNaN(Number(defaulObj)) ? (String(defaulObj).length >= 4 ? `${(Number(defaulObj) / 1000).toFixed(2)}KM` : `${defaulObj}M`) : '---'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
lableGenerate() {
|
||||
@@ -66,32 +68,31 @@ export default {
|
||||
Object.keys(this.listItem).forEach((keys, index) => {
|
||||
switch (keys) {
|
||||
case 'siteType':
|
||||
console.log(this.listItem.siteType,'siteType')
|
||||
this.lableArray.push({
|
||||
lable: this.listItem.siteType==1?'加油站':'加气站',
|
||||
color: this.listItem.siteType==1?'#FF6700':'#00c15e'
|
||||
lable: this.listItem.siteType == 1 ? '加油站' : '加气站',
|
||||
color: this.listItem.siteType == 1 ? '#FF6700' : '#00c15e'
|
||||
})
|
||||
break;
|
||||
break
|
||||
case 'siteLevel':
|
||||
this.lableArray.push({
|
||||
lable: this.listItem['siteLevel'] + '级',
|
||||
color: '#FF6700'
|
||||
})
|
||||
break;
|
||||
break
|
||||
case 'listTag':
|
||||
this.lableArray.push({
|
||||
lable: this.listItem['listTag'] ? this.listItem['listTag'] : '未知',
|
||||
color: this.listItem.channelCode == 'XOIL' ? 'red' : '#FF9000'
|
||||
})
|
||||
break;
|
||||
case 'highSpeedMark' :
|
||||
if (this.listItem.highSpeedMark ) {
|
||||
break
|
||||
case 'highSpeedMark':
|
||||
if (this.listItem.highSpeedMark) {
|
||||
this.lableArray.push({
|
||||
lable: this.speedMark(this.listItem.highSpeedMark, this.listItem.roadTpye) + (this.listItem.roadName ? this.listItem.roadName : ''),
|
||||
color: this.speedMarkColor(this.listItem.highSpeedMark, this.listItem.roadTpye)
|
||||
})
|
||||
}
|
||||
break;
|
||||
break
|
||||
case 'roadTpye':
|
||||
if (this.listItem.roadTpye) {
|
||||
this.lableArray.push({
|
||||
@@ -100,7 +101,6 @@ export default {
|
||||
})
|
||||
}
|
||||
break
|
||||
|
||||
}
|
||||
})
|
||||
if (this.index == 0) {
|
||||
@@ -139,19 +139,18 @@ export default {
|
||||
}
|
||||
} else if (val == 1) {
|
||||
return '高速'
|
||||
}else{
|
||||
} else {
|
||||
return '未知-'
|
||||
}
|
||||
},
|
||||
filterImg(e) {
|
||||
return e ? e.indexOf('.png') == -1 ? `${e}.png` : e : this.defaultImg
|
||||
return e ? (e.indexOf('.png') == -1 ? `${e}.png` : e) : this.defaultImg
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<style></style>
|
||||
<style scoped lang="scss">
|
||||
.list_item_body_lable {
|
||||
color: #ffffff;
|
||||
|
||||
@@ -15,8 +15,10 @@ router.beforeEach(async (to, from, next) => {
|
||||
store.getPosition()
|
||||
|
||||
if (!token) {
|
||||
let target = obtainUrlPathParameterTarget(location.href)
|
||||
store.login(target).then(() => {
|
||||
let paramsTarget = obtainUrlPathParameterTarget(location.href)
|
||||
console.log('paramsTarget', paramsTarget)
|
||||
sessionStorage.setItem('paramsTarget', JSON.stringify(paramsTarget))
|
||||
store.login(paramsTarget).then(() => {
|
||||
next()
|
||||
})
|
||||
return
|
||||
|
||||
@@ -26,14 +26,6 @@ const instance = defineStore('user', {
|
||||
},
|
||||
|
||||
actions: {
|
||||
setPosition(position) {
|
||||
;({ latitude: this.position.latitude, longitude: this.position.longitude } = position)
|
||||
},
|
||||
update_username(username) {
|
||||
this.$patch(state => {
|
||||
state.username = username
|
||||
})
|
||||
},
|
||||
getPosition() {
|
||||
// initAMap().then(() => {
|
||||
// console.log(3)
|
||||
@@ -48,16 +40,11 @@ const instance = defineStore('user', {
|
||||
// })
|
||||
// return
|
||||
|
||||
// let that = this
|
||||
if (navigator?.geolocation?.getCurrentPosition) {
|
||||
// console.log('navigator?.geolocation?.getCurrentPosition')
|
||||
console.log(1111)
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
position => {
|
||||
console.log(' position.coords position.coords', `${position.coords.longitude},${position.coords.latitude}`)
|
||||
let { latitude, longitude } = position.coords
|
||||
this.position = { latitude, longitude }
|
||||
// console.log('positionpositionposition', position)
|
||||
},
|
||||
// function (position) {
|
||||
// console.log('position', position)
|
||||
@@ -106,8 +93,6 @@ const instance = defineStore('user', {
|
||||
}
|
||||
},
|
||||
getUser() {
|
||||
// encode.decrypt(getToken(), 'Clco2uJjhZRgDHzl')
|
||||
// console.log('获取user信息')
|
||||
oilSite
|
||||
.getCompanyInfo({
|
||||
accessToken: getToken()
|
||||
@@ -118,7 +103,6 @@ const instance = defineStore('user', {
|
||||
},
|
||||
|
||||
login(info) {
|
||||
console.log(info)
|
||||
let { username, networkId } = info
|
||||
if (username && networkId) {
|
||||
return serve
|
||||
@@ -134,19 +118,6 @@ const instance = defineStore('user', {
|
||||
})
|
||||
}
|
||||
return Promise.reject()
|
||||
|
||||
// this.token = data.accessToken
|
||||
// setToken(data.accessToken)
|
||||
// this.getUser()
|
||||
// if (data?.latitude && data?.longitude) {
|
||||
// console.log('标记!!!')
|
||||
// // ;({ latitude: this.position.latitude, longitude: this.longitude } = data)
|
||||
// // localStorage.setItem('position', JSON.stringify(this.position))
|
||||
// } else {
|
||||
// console.log(data, '地理位置参数错误,手动获取位置')
|
||||
// this.getPosition()
|
||||
// }
|
||||
// return true
|
||||
},
|
||||
clearToken() {
|
||||
removeToken()
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import Cookies from 'js-cookie'
|
||||
|
||||
const TokenKey = 'Authorization'
|
||||
const NetWorkId = 'networkId'
|
||||
const UserName = 'username'
|
||||
const PassWord = 'password'
|
||||
const Checked = 'checked'
|
||||
// const NetWorkId = 'networkId'
|
||||
// const UserName = 'username'
|
||||
// const PassWord = 'password'
|
||||
// const Checked = 'checked'
|
||||
|
||||
export function getToken() {
|
||||
return Cookies.get(TokenKey)
|
||||
@@ -18,47 +18,47 @@ export function removeToken() {
|
||||
return Cookies.remove(TokenKey)
|
||||
}
|
||||
|
||||
export function setNet(networkId) {
|
||||
return Cookies.set(NetWorkId, networkId, { expires: 7 })
|
||||
}
|
||||
// export function setNet(networkId) {
|
||||
// return Cookies.set(NetWorkId, networkId, { expires: 7 })
|
||||
// }
|
||||
|
||||
export function setUsername(username) {
|
||||
return Cookies.set(UserName, username, { expires: 7 })
|
||||
}
|
||||
// export function setUsername(username) {
|
||||
// return Cookies.set(UserName, username, { expires: 7 })
|
||||
// }
|
||||
|
||||
export function setPassword(password) {
|
||||
return Cookies.set(PassWord, password, { expires: 7 })
|
||||
}
|
||||
// export function setPassword(password) {
|
||||
// return Cookies.set(PassWord, password, { expires: 7 })
|
||||
// }
|
||||
|
||||
export function getNet(networkId) {
|
||||
return Cookies.get(NetWorkId)
|
||||
}
|
||||
// export function getNet(networkId) {
|
||||
// return Cookies.get(NetWorkId)
|
||||
// }
|
||||
|
||||
export function getUsername(username) {
|
||||
return Cookies.get(UserName)
|
||||
}
|
||||
// export function getUsername(username) {
|
||||
// return Cookies.get(UserName)
|
||||
// }
|
||||
|
||||
export function getPassword(password) {
|
||||
return Cookies.get(PassWord)
|
||||
}
|
||||
// export function getPassword(password) {
|
||||
// return Cookies.get(PassWord)
|
||||
// }
|
||||
|
||||
export function setChecked(checked) {
|
||||
return Cookies.set(Checked, checked, { expires: 7 })
|
||||
}
|
||||
// export function setChecked(checked) {
|
||||
// return Cookies.set(Checked, checked, { expires: 7 })
|
||||
// }
|
||||
|
||||
export function getChecked() {
|
||||
return Cookies.get(Checked)
|
||||
}
|
||||
// export function getChecked() {
|
||||
// return Cookies.get(Checked)
|
||||
// }
|
||||
|
||||
export function removeNet() {
|
||||
return Cookies.remove(NetWorkId)
|
||||
}
|
||||
export function removeChecked() {
|
||||
return Cookies.remove(Checked)
|
||||
}
|
||||
export function removeUsername() {
|
||||
return Cookies.remove(UserName)
|
||||
}
|
||||
export function removePassword() {
|
||||
return Cookies.remove(PassWord)
|
||||
}
|
||||
// export function removeNet() {
|
||||
// return Cookies.remove(NetWorkId)
|
||||
// }
|
||||
// export function removeChecked() {
|
||||
// return Cookies.remove(Checked)
|
||||
// }
|
||||
// export function removeUsername() {
|
||||
// return Cookies.remove(UserName)
|
||||
// }
|
||||
// export function removePassword() {
|
||||
// return Cookies.remove(PassWord)
|
||||
// }
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import axios from 'axios'
|
||||
import encode from '@/utils/encode'
|
||||
import { Notify, Toast } from 'vant'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { obtainUrlPathParameterTarget } from '@/utils/index.js'
|
||||
import { getToken, removeToken } from '@/utils/auth'
|
||||
import useStore from 'store/piniaIndex.js'
|
||||
|
||||
const CancelToken = axios.CancelToken
|
||||
|
||||
const service = axios.create({
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
timeout: 20000
|
||||
@@ -17,22 +14,13 @@ const env = process.env.VUE_APP_ENV
|
||||
// request 拦截器
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
// console.log('config', config)
|
||||
Toast.loading({
|
||||
message: '加载中...',
|
||||
forbidClick: true,
|
||||
duration: 0
|
||||
})
|
||||
|
||||
// let source = CancelToken.source()
|
||||
// config.cancelToken = source.token
|
||||
// if (a.includes(config.url)) {
|
||||
// source.cancel(`tooRapid`)
|
||||
// return config
|
||||
// }
|
||||
// a.push(config.url)
|
||||
|
||||
// const notEncrypt = config.notEncrypt
|
||||
|
||||
let token = getToken()
|
||||
if (token) {
|
||||
config.headers['Authorization'] = token
|
||||
@@ -71,11 +59,12 @@ service.interceptors.response.use(
|
||||
|
||||
if (res && res.code) {
|
||||
if (res.code === 42011) {
|
||||
console.log(42011420114201142011)
|
||||
let instance = useStore()
|
||||
// 无感处理
|
||||
let target = obtainUrlPathParameterTarget(location.href)
|
||||
instance.login(target)
|
||||
// let instance = useStore()
|
||||
// let paramsTargetJson = sessionStorage.getItem('paramsTarget')
|
||||
// let paramsTarget = JSON.parse(paramsTargetJson)
|
||||
// instance.login(paramsTarget).then(location.reload())
|
||||
removeToken()
|
||||
location.reload()
|
||||
return
|
||||
}
|
||||
if (![20000].includes(res.code)) {
|
||||
@@ -90,25 +79,12 @@ service.interceptors.response.use(
|
||||
return res
|
||||
},
|
||||
error => {
|
||||
// if (error.message == 'tooRapid') {
|
||||
// console.log(error, 'res防抖拦截')
|
||||
// Notify({
|
||||
// message: '请求过于频繁!',
|
||||
// type: 'warning',
|
||||
// duration: 5 * 1000
|
||||
// })
|
||||
// } else {
|
||||
// let urlIndex = a.indexOf(error.config.url)
|
||||
// if (urlIndex !== -1) {
|
||||
// a.splice(urlIndex, 1)
|
||||
// }
|
||||
// Notify({
|
||||
// message: '操作失败!',
|
||||
// type: 'danger',
|
||||
// duration: 5 * 1000
|
||||
// })
|
||||
// }
|
||||
// return Promise.reject(error)
|
||||
Notify({
|
||||
message: '操作失败!',
|
||||
type: 'danger',
|
||||
duration: 5000
|
||||
})
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
return {
|
||||
productCodeList: [],
|
||||
refreshing: false,
|
||||
homeNavBarStyle: null,
|
||||
// homeNavBarStyle: null,
|
||||
show: false,
|
||||
loading: false,
|
||||
finished: false,
|
||||
@@ -67,7 +67,7 @@ export default {
|
||||
// },
|
||||
methods: {
|
||||
getmenu() {
|
||||
return
|
||||
// return
|
||||
oilSiteApi.getCheckInfo().then(res => {
|
||||
this.productCodeList = []
|
||||
Object.keys(res.data.productCodeList).forEach(key => {
|
||||
@@ -105,7 +105,6 @@ export default {
|
||||
let container = document.getElementById('vanList')
|
||||
container.onscroll = function (e) {
|
||||
console.log(e.currentTarget.scrollTop, '滚动到底部')
|
||||
|
||||
if (Math.ceil(e.currentTarget.scrollTop + e.currentTarget.clientHeight) >= e.currentTarget.scrollHeight) {
|
||||
//容差:20px
|
||||
console.log(e.currentTarget.scrollTop, '滚动到底部')
|
||||
@@ -115,7 +114,7 @@ export default {
|
||||
init() {
|
||||
this.getmenu()
|
||||
this.getlist()
|
||||
this.homeNavBarStyle = this.$refs.homeNavBar.$el.clientHeight
|
||||
// this.homeNavBarStyle = this.$refs.homeNavBar.$el.clientHeight
|
||||
|
||||
// this.onscroll()
|
||||
},
|
||||
@@ -124,12 +123,12 @@ export default {
|
||||
},
|
||||
getlist() {
|
||||
let position = this.$pinia.state.value.user.position
|
||||
console.log('position', position)
|
||||
console.log(Object.assign(this.page.params, position), position, '地理位置数据')
|
||||
// console.log('position', position)
|
||||
// console.log(Object.assign(this.page.params, position), position, '地理位置数据')
|
||||
if (this.positionChenk(position)) {
|
||||
position = JSON.parse(localStorage.getItem('position'))
|
||||
if (this.positionChenk(position)) {
|
||||
console.log(position, this.$pinia.state.value.user.position, '地理位置错误')
|
||||
// console.log(position, this.$pinia.state.value.user.position, '地理位置错误')
|
||||
this.finished = true
|
||||
return
|
||||
}
|
||||
@@ -151,20 +150,12 @@ export default {
|
||||
this.loading = false
|
||||
this.refreshing = false
|
||||
}
|
||||
console.log(res)
|
||||
// console.log(res)
|
||||
})
|
||||
.catch(error => {
|
||||
this.finished = true
|
||||
})
|
||||
},
|
||||
getPosition() {
|
||||
let that = this
|
||||
navigator.geolocation.getCurrentPosition(function (position) {
|
||||
that.position = position
|
||||
}, this.showError)
|
||||
},
|
||||
onClickLeft() {},
|
||||
onClickRight() {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
<div class="oilEvaluate-lable-item">服务周到</div>
|
||||
<div class="oilEvaluate-lable-item">交通便利</div>
|
||||
<div class="oilEvaluate-lable-item">便捷高效</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="oilDetails.oilSiteOrderInfoVos" class="oilEvaluate-order-body flex">
|
||||
@@ -19,22 +18,25 @@
|
||||
<span> {{ item.plateNumber | plateNumberF }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>加 {{ item.oilsCode }} {{ Number(item.volume).toFixed(2) }}L 节省 <span class="red">¥{{
|
||||
Number(item.discountAmount).toFixed(2)
|
||||
}}</span> </span>
|
||||
<span
|
||||
>加 {{ item.oilsCode }} {{ Number(item.volume).toFixed(2) }}L 节省
|
||||
<span class="red">¥{{ Number(item.discountAmount).toFixed(2) }}</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oilEvaluate-footer">
|
||||
<van-button :disabled="!open" @click="gopaly('/nextOrderDetails')" class="oilEvaluate-footer-butten" block
|
||||
color="#FF6700" type="primary">一键支付</van-button>
|
||||
<van-button :disabled="!open" @click="gopaly('/nextOrderDetails')" class="oilEvaluate-footer-butten" block color="#FF6700" type="primary"
|
||||
>一键支付</van-button
|
||||
>
|
||||
<!-- <van-button class="oilEvaluate-footer-butten" block color="#FF6700" type="primary">二维码支付</van-button> -->
|
||||
</div>
|
||||
<van-dialog @cancel="show=false" @confirm="gopaly('/nextOrderDetails',true)" v-model="show" title="距离提示" show-cancel-button>
|
||||
<div style="margin:20px">
|
||||
距离油站距离大于500M,<br/> 是否确认下单
|
||||
<van-dialog @cancel="show = false" @confirm="gopaly('/nextOrderDetails', true)" v-model="show" title="距离提示" show-cancel-button>
|
||||
<div style="margin: 20px">
|
||||
距离油站距离大于500M,<br />
|
||||
是否确认下单
|
||||
</div>
|
||||
</van-dialog>
|
||||
</div>
|
||||
@@ -43,26 +45,24 @@
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
|
||||
oilDetails: {
|
||||
type: Object,
|
||||
default: () => null
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show:false,
|
||||
show: false,
|
||||
open: 1
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
juliFn() {
|
||||
return this.oilDetails.juli > 500?true:false
|
||||
return this.oilDetails.juli > 500 ? true : false
|
||||
},
|
||||
gopaly(path,open=false) {
|
||||
if(this.juliFn()&&!open){
|
||||
this.show = true;
|
||||
gopaly(path, open = false) {
|
||||
if (this.juliFn() && !open) {
|
||||
this.show = true
|
||||
return
|
||||
}
|
||||
this.$router.push({
|
||||
@@ -75,15 +75,15 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.open = (() => {
|
||||
let xoil = this.oilDetails.oilSiteChannelDetailsVos.filter((item) => item.channelCode == 'XOIL')[0]
|
||||
return xoil.activePay;
|
||||
let xoil = this.oilDetails.oilSiteChannelDetailsVos.filter(item => item.channelCode == 'XOIL')[0]
|
||||
return xoil?.activePay
|
||||
})()
|
||||
console.log(this.open)
|
||||
},
|
||||
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'
|
||||
}
|
||||
},
|
||||
usernameF(value) {
|
||||
@@ -116,7 +116,8 @@ export default {
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
.oilEvaluate-footer {}
|
||||
.oilEvaluate-footer {
|
||||
}
|
||||
|
||||
.red {
|
||||
color: red;
|
||||
@@ -152,10 +153,10 @@ export default {
|
||||
}
|
||||
|
||||
.oilEvaluate-lable-item {
|
||||
background: #F6F6F6;
|
||||
background: #f6f6f6;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
opacity: 1;
|
||||
border: 2px solid #F6F6F6;
|
||||
border: 2px solid #f6f6f6;
|
||||
font-size: 24px;
|
||||
color: #999999;
|
||||
margin-top: 21px;
|
||||
|
||||
@@ -3,20 +3,35 @@
|
||||
<div class="seleOilGun">
|
||||
<div class="seleOilGun-title">油枪选择:</div>
|
||||
<div class="seleOilGun-container">
|
||||
<div @click="seleGun(index, item)"
|
||||
:style="{ background: seleIndex == item ? '#FF6700' : '', color: seleIndex == item ? '#FFFFFF' : '', border: seleIndex == item ? '0px' : '' }"
|
||||
v-for="(item, index) in 9" :key="index" class="seleOilGun-item ac jc">
|
||||
<div
|
||||
@click="seleGun(index, item)"
|
||||
:style="{
|
||||
background: seleIndex == item ? '#FF6700' : '',
|
||||
color: seleIndex == item ? '#FFFFFF' : '',
|
||||
border: seleIndex == item ? '0px' : ''
|
||||
}"
|
||||
v-for="(item, index) in 9"
|
||||
:key="index"
|
||||
class="seleOilGun-item ac jc"
|
||||
>
|
||||
{{ item }}
|
||||
</div>
|
||||
<div :style="{background:seleIndex==0 ? '#FF6700' : '',color:seleIndex==0 ? '#FFFFFF' : '',border: seleIndex==0 ?'0px' : ''}" @click="isShow.keyboard=true;seleIndex=0" class="other-seleOilGun-item ac jc">
|
||||
{{seleIndex?'other':otherOilsBar}}
|
||||
<div
|
||||
:style="{ background: seleIndex == 0 ? '#FF6700' : '', color: seleIndex == 0 ? '#FFFFFF' : '', border: seleIndex == 0 ? '0px' : '' }"
|
||||
@click="
|
||||
isShow.keyboard = true
|
||||
seleIndex = 0
|
||||
"
|
||||
class="other-seleOilGun-item ac jc"
|
||||
>
|
||||
{{ seleIndex ? 'other' : otherOilsBar }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oilGun-information">
|
||||
<div @click="isShowFn" class="oilGun-information-item ac">
|
||||
<img src="@/assets/kc.png" alt="" />
|
||||
<span :class="page.plateNumber ? 'cp' : ''" class="oilGun-information-item-text ">
|
||||
<span :class="page.plateNumber ? 'cp' : ''" class="oilGun-information-item-text">
|
||||
{{ page.plateNumber ? page.plateNumber : '请输入车牌号' }}
|
||||
</span>
|
||||
<van-icon name="arrow" />
|
||||
@@ -31,16 +46,23 @@
|
||||
<div class="flex bw">
|
||||
<div class="refuelingAmount-import">
|
||||
<span class="refuelingAmount-import-lable">加油金额</span>
|
||||
<input @blur="blur" @input="change" v-model="price" class="refuelingAmount-import-input"
|
||||
type="number" />
|
||||
<input @blur="blur" @input="change" v-model="price" class="refuelingAmount-import-input" type="number" />
|
||||
<span class="refuelingAmount-import-lable">元</span>
|
||||
</div>
|
||||
<div class="samall-text">升数约 {{ Number(page.volume).toFixed(2) }} L</div>
|
||||
</div>
|
||||
<div class="priceSelection-container flex top">
|
||||
<div @click="selePrice(index)"
|
||||
:style="{ background: price == item * 100 ? '#FF6700' : '', color: price == item * 100 ? '#FFFFFF' : '', border: price == item * 100 ? '0px' : '' }"
|
||||
v-for="(item, index) in 5" :key="index" class="priceSelection-container-item flex ac jc">
|
||||
<div
|
||||
@click="selePrice(index)"
|
||||
:style="{
|
||||
background: price == item * 100 ? '#FF6700' : '',
|
||||
color: price == item * 100 ? '#FFFFFF' : '',
|
||||
border: price == item * 100 ? '0px' : ''
|
||||
}"
|
||||
v-for="(item, index) in 5"
|
||||
:key="index"
|
||||
class="priceSelection-container-item flex ac jc"
|
||||
>
|
||||
{{ item }}00 ¥
|
||||
</div>
|
||||
</div>
|
||||
@@ -62,7 +84,7 @@
|
||||
<div class="license-plate-popup-input flex ac">
|
||||
<div class="license-plate-popup-input-lable">
|
||||
<span>车牌号</span>
|
||||
<input v-model="plateNumber" class="license-plate-popup-input-input" type="text">
|
||||
<input v-model="plateNumber" class="license-plate-popup-input-input" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -82,9 +104,9 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
otherOilsBar:'',
|
||||
otherOilsBar: '',
|
||||
timer: null,
|
||||
plateNumber:'',
|
||||
plateNumber: '',
|
||||
page: {
|
||||
oilDiscountAmount: '',
|
||||
volume: '',
|
||||
@@ -97,15 +119,15 @@ export default {
|
||||
seleIndex: 1,
|
||||
isShow: {
|
||||
licensePlate: false,
|
||||
keyboard:false
|
||||
keyboard: false
|
||||
},
|
||||
show: true,
|
||||
selePriceIndex: null
|
||||
};
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
seleIndex:function(n){
|
||||
if(n!==0){
|
||||
seleIndex: function (n) {
|
||||
if (n !== 0) {
|
||||
this.otherOilsBar = ''
|
||||
}
|
||||
},
|
||||
@@ -115,7 +137,7 @@ export default {
|
||||
this.blur()
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
deep: true
|
||||
},
|
||||
'isShow.licensePlate': {
|
||||
handler(n) {
|
||||
@@ -129,7 +151,6 @@ export default {
|
||||
this.page.plateNumber = ''
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
@@ -137,15 +158,19 @@ export default {
|
||||
page: {
|
||||
handler() {
|
||||
this.$nextTick(function () {
|
||||
console.log(this.page.oilsBar,'this.page.oilsBar')
|
||||
this.$emit('input', Object.assign(JSON.parse(JSON.stringify(this.seleOil)), {...this.page,oilsBar:this.page.oilsBar?this.page.oilsBar:this.otherOilsBar}));
|
||||
this.$emit(
|
||||
'input',
|
||||
Object.assign(JSON.parse(JSON.stringify(this.seleOil)), {
|
||||
...this.page,
|
||||
oilsBar: this.page.oilsBar ? this.page.oilsBar : this.otherOilsBar
|
||||
})
|
||||
)
|
||||
})
|
||||
},
|
||||
deep: true
|
||||
|
||||
}
|
||||
},
|
||||
created() { },
|
||||
created() {},
|
||||
mounted() {
|
||||
this.plateNumber = this.$pinia.state.value.user.user.plateNumber
|
||||
this.page.plateNumber = this.$pinia.state.value.user.user.plateNumber
|
||||
@@ -154,25 +179,25 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
keyboardHide(){
|
||||
setTimeout(()=>{
|
||||
if(this.otherOilsBar){
|
||||
keyboardHide() {
|
||||
setTimeout(() => {
|
||||
if (this.otherOilsBar) {
|
||||
this.page = Object.assign({}, { ...this.page, oilsBar: this.otherOilsBar })
|
||||
}else{
|
||||
this.seleIndex= 1
|
||||
} else {
|
||||
this.seleIndex = 1
|
||||
}
|
||||
},0)
|
||||
}, 0)
|
||||
},
|
||||
chenkFn() {
|
||||
let chenk = /^\d+(.\d{1,2})?$/
|
||||
if (!chenk.test(Number(this.price))) {
|
||||
this.$nextTick(function () {
|
||||
this.price = this.price.slice(0, this.price.length - 1);
|
||||
this.price = this.price.slice(0, this.price.length - 1)
|
||||
})
|
||||
} else {
|
||||
if (this.price.indexOf('.') !== -1 && this.price.split('.')[1].length > 2) {
|
||||
this.$nextTick(function () {
|
||||
this.price = Number(this.price).toFixed(2);
|
||||
this.price = Number(this.price).toFixed(2)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -180,19 +205,19 @@ export default {
|
||||
checkFn(e, n) {
|
||||
switch (e) {
|
||||
case 'name':
|
||||
/(^[\u4e00-\u9fa5]{1}[\u4e00-\u9fa5\.·。]{0,18}[\u4e00-\u9fa5]{1}$)|(^[a-zA-Z]{1}[a-zA-Z\s]{0,18}[a-zA-Z]{1}$)/
|
||||
.test(n);
|
||||
;/(^[\u4e00-\u9fa5]{1}[\u4e00-\u9fa5\.·。]{0,18}[\u4e00-\u9fa5]{1}$)|(^[a-zA-Z]{1}[a-zA-Z\s]{0,18}[a-zA-Z]{1}$)/.test(n)
|
||||
break
|
||||
case 'plateNumber':
|
||||
return /(^[\u4E00-\u9FA5]{1}[A-Z0-9]{6}$)|(^[A-Z]{2}[A-Z0-9]{2}[A-Z0-9\u4E00-\u9FA5]{1}[A-Z0-9]{4}$)|(^[\u4E00-\u9FA5]{1}[A-Z0-9]{5}[挂学警军港澳]{1}$)|(^[A-Z]{2}[0-9]{5}$)|(^(08|38){1}[A-Z0-9]{4}[A-Z0-9挂学警军港澳]{1}$)/
|
||||
.test(n)
|
||||
return /(^[\u4E00-\u9FA5]{1}[A-Z0-9]{6}$)|(^[A-Z]{2}[A-Z0-9]{2}[A-Z0-9\u4E00-\u9FA5]{1}[A-Z0-9]{4}$)|(^[\u4E00-\u9FA5]{1}[A-Z0-9]{5}[挂学警军港澳]{1}$)|(^[A-Z]{2}[0-9]{5}$)|(^(08|38){1}[A-Z0-9]{4}[A-Z0-9挂学警军港澳]{1}$)/.test(
|
||||
n
|
||||
)
|
||||
break
|
||||
case 'phone':
|
||||
return /^1[3456789]\d{9}$/.test(n);
|
||||
break;
|
||||
return /^1[3456789]\d{9}$/.test(n)
|
||||
break
|
||||
case 'replacePhone':
|
||||
/^1[3456789]\d{9}$/.test(n);
|
||||
break;
|
||||
;/^1[3456789]\d{9}$/.test(n)
|
||||
break
|
||||
}
|
||||
},
|
||||
resetFn() {
|
||||
@@ -204,7 +229,8 @@ export default {
|
||||
payRealAmount: '',
|
||||
plateNumber: '',
|
||||
oilsBar: 1
|
||||
})
|
||||
}
|
||||
)
|
||||
},
|
||||
blur() {
|
||||
let page = {
|
||||
@@ -214,16 +240,16 @@ export default {
|
||||
priceId: this.seleOil.priceId
|
||||
}
|
||||
oilSiteApi.getOrderDiscountInfo(page).then(res => {
|
||||
let { payRealAmount, oilDiscountAmount, volume } = res.data;
|
||||
this.page = Object.assign(JSON.parse(JSON.stringify(this.page)), { payRealAmount, oilDiscountAmount, volume });
|
||||
let { payRealAmount, oilDiscountAmount, volume } = res.data
|
||||
this.page = Object.assign(JSON.parse(JSON.stringify(this.page)), { payRealAmount, oilDiscountAmount, volume })
|
||||
})
|
||||
},
|
||||
seleGun(index, item) {
|
||||
this.seleIndex = item;
|
||||
this.seleIndex = item
|
||||
this.page = Object.assign({}, { ...this.page, oilsBar: item })
|
||||
},
|
||||
selePrice(index) {
|
||||
this.price = (index + 1) * 100;
|
||||
this.price = (index + 1) * 100
|
||||
this.blur()
|
||||
},
|
||||
change() {
|
||||
@@ -233,13 +259,13 @@ export default {
|
||||
}
|
||||
this.timer = setTimeout(() => {
|
||||
this.blur()
|
||||
}, 600);
|
||||
}, 600)
|
||||
},
|
||||
isShowFn() {
|
||||
this.isShow.licensePlate = !this.isShow.licensePlate;
|
||||
},
|
||||
},
|
||||
};
|
||||
this.isShow.licensePlate = !this.isShow.licensePlate
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -264,8 +290,6 @@ export default {
|
||||
font-family: PingFang SC-中等, PingFang SC;
|
||||
font-weight: normal;
|
||||
color: #000000;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.license-plate-popup-input {
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
<div class="oilLable">
|
||||
<div class="oilLable-sele flex ac jc">
|
||||
<div class="oilLable-sele-item flex ac">
|
||||
<img :src=" `${imgURL}${oilType.channelCode}.png` " alt="">
|
||||
<span>{{oilType.channelCode|channelCodeFamt}}</span>
|
||||
<img :src="`${imgURL}${oilType.channelCode}.png`" alt="" />
|
||||
<span>{{ oilType.channelCode | channelCodeFamt }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oilLableDetails">
|
||||
<div v-for="(itemx, index) in oilType.oilSitePriceDetailsVos" :key="index" class="oilLableDetails-item flex ac">
|
||||
<span class="oilLableDetails-item-tip">惠</span>
|
||||
<span class="oilLableDetails-item-oilNumber">{{ itemx.oilProductCode }}</span>
|
||||
<span class="oilLableDetails-item-oilPrice">¥{{ moneyIntercept(itemx.sitePrice)}}/L</span>
|
||||
<span class="oilLableDetails-item-oilPrice">¥{{ moneyIntercept(itemx.sitePrice) }}/L</span>
|
||||
<span class="oilLableDetails-item-originalPrice">¥{{ itemx.oilSitePrice | moneyIntercept }}/L</span>
|
||||
<span class="oilLableDetails-item-text">预计每100L节省{{ (100 * (itemx.oilSitePrice - itemx.sitePrice)) | moneyFormat}}元</span>
|
||||
<span class="oilLableDetails-item-text">预计每100L节省{{ (100 * (itemx.oilSitePrice - itemx.sitePrice)) | moneyFormat }}元</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -28,28 +28,33 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imgURL:'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/site-'
|
||||
imgURL: 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/site-'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log(this.oilType, '---------------')
|
||||
|
||||
// console.log(this.oilType, '---------------')
|
||||
},
|
||||
mounted() { },
|
||||
mounted() {},
|
||||
filters: {
|
||||
moneyIntercept(value) {
|
||||
if (value != 'xxx.x') {
|
||||
console.log(value, '************************')
|
||||
return String(value).split('.')[1] && String(value).split('.')[1].length > 2 ? Number(`${String(value).split('.')[0]}.${String(value).split('.')[1].substring(0, 1)}${Number(String(value).split('.')[1].substring(1, 2)) + 1}`) : Number(value).toFixed(2);
|
||||
// console.log(value, '************************')
|
||||
return String(value).split('.')[1] && String(value).split('.')[1].length > 2
|
||||
? Number(
|
||||
`${String(value).split('.')[0]}.${String(value).split('.')[1].substring(0, 1)}${
|
||||
Number(String(value).split('.')[1].substring(1, 2)) + 1
|
||||
}`
|
||||
)
|
||||
: Number(value).toFixed(2)
|
||||
} else {
|
||||
return Number(value).toFixed(2)
|
||||
}
|
||||
},
|
||||
moneyFormat(value) {
|
||||
if (value != 'xxx.x') {
|
||||
console.log('old:', value)
|
||||
// console.log('old:', value)
|
||||
let realAmount = Math.floor(value * 100) / 100
|
||||
console.log('new:', realAmount)
|
||||
// console.log('new:', realAmount)
|
||||
// return realAmount
|
||||
return Number(value).toFixed(2)
|
||||
} else {
|
||||
@@ -103,12 +108,11 @@ export default {
|
||||
font-size: 32px;
|
||||
font-family: PingFang SC-特粗, PingFang SC;
|
||||
font-weight: normal;
|
||||
color: #FF6700;
|
||||
color: #ff6700;
|
||||
margin-left: 34px;
|
||||
}
|
||||
|
||||
.oilLableDetails-item-oilNumber {
|
||||
|
||||
color: #000000;
|
||||
font-size: 34px;
|
||||
margin-left: 17px;
|
||||
@@ -118,9 +122,9 @@ export default {
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
box-sizing: border-box;
|
||||
border: solid 1px #FF6700;
|
||||
border: solid 1px #ff6700;
|
||||
font-size: 25px;
|
||||
color: #FF6700;
|
||||
color: #ff6700;
|
||||
}
|
||||
|
||||
.oilLableDetails-item {
|
||||
@@ -133,7 +137,7 @@ export default {
|
||||
|
||||
.oilLable-sele-item {
|
||||
width: fit-content;
|
||||
border-bottom: 4px solid #FF6700;
|
||||
border-bottom: 4px solid #ff6700;
|
||||
padding-bottom: 5px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@@ -146,11 +150,11 @@ export default {
|
||||
|
||||
.oilLable-sele {
|
||||
width: 100%;
|
||||
border-bottom: 3px solid #F2F2F2;
|
||||
border-bottom: 3px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.oilLable {
|
||||
--pd: calc((100vw - 684px)/2);
|
||||
--pd: calc((100vw - 684px) / 2);
|
||||
width: 100%;
|
||||
background-color: #ffffff;
|
||||
margin-top: -62px;
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
<div @click="gopaly" class="oilNextFooter-butten flex jc ac">
|
||||
{{ text }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<van-popup round :style="{ height: '60%' }" position="bottom" v-model="isShow.details">
|
||||
<div class="details-popup">
|
||||
@@ -21,11 +20,10 @@
|
||||
</div>
|
||||
</van-popup>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import detailsCard from "../../cashier/components/detailsCard.vue";
|
||||
import detailsCard from '../../cashier/components/detailsCard.vue'
|
||||
import oilOrderApi from '@/api/oil-order.js'
|
||||
export default {
|
||||
props: {
|
||||
@@ -58,7 +56,7 @@ export default {
|
||||
{
|
||||
lable: '加油升数:',
|
||||
value: '---'
|
||||
},
|
||||
}
|
||||
],
|
||||
|
||||
[
|
||||
@@ -86,9 +84,8 @@ export default {
|
||||
valueStyle: {
|
||||
color: '#FF0000'
|
||||
}
|
||||
},
|
||||
],
|
||||
|
||||
}
|
||||
]
|
||||
],
|
||||
isShow: {
|
||||
details: false
|
||||
@@ -103,21 +100,19 @@ export default {
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
created() {},
|
||||
mounted() {
|
||||
|
||||
this.updateFn()
|
||||
},
|
||||
methods: {
|
||||
updateFn() {
|
||||
this.$nextTick(function () {
|
||||
this.detailsList[0][0].value = this.oilDetails.siteName;
|
||||
this.detailsList[0][1].value = this.seleOil.oilProductCode + ' ' + this.seleOil.oilsBar + '号枪';
|
||||
this.detailsList[0][2].value = Number(this.seleOil.volume).toFixed(2) + 'L';
|
||||
this.detailsList[1][0].value = '¥' + Number(this.seleOil.payRealAmount + this.seleOil.oilDiscountAmount).toFixed(2);
|
||||
this.detailsList[1][1].value = '-¥' + Number(this.seleOil.oilDiscountAmount).toFixed(2);
|
||||
this.detailsList[1][3].value = '-¥' + Number(this.seleOil.payRealAmount).toFixed(2);
|
||||
this.detailsList[0][0].value = this.oilDetails.siteName
|
||||
this.detailsList[0][1].value = this.seleOil.oilProductCode + ' ' + this.seleOil.oilsBar + '号枪'
|
||||
this.detailsList[0][2].value = Number(this.seleOil.volume).toFixed(2) + 'L'
|
||||
this.detailsList[1][0].value = '¥' + Number(this.seleOil.payRealAmount + this.seleOil.oilDiscountAmount).toFixed(2)
|
||||
this.detailsList[1][1].value = '-¥' + Number(this.seleOil.oilDiscountAmount).toFixed(2)
|
||||
this.detailsList[1][3].value = '-¥' + Number(this.seleOil.payRealAmount).toFixed(2)
|
||||
})
|
||||
},
|
||||
update(e) {
|
||||
@@ -127,31 +122,31 @@ export default {
|
||||
return !position?.latitude && !position?.longitude ? true : false
|
||||
},
|
||||
gopaly() {
|
||||
let position = this.$pinia.state.value.user.position;
|
||||
let position = this.$pinia.state.value.user.position
|
||||
if (this.positionChenk(position)) {
|
||||
position = JSON.parse(localStorage.getItem("position"))
|
||||
position = JSON.parse(localStorage.getItem('position'))
|
||||
if (this.positionChenk(position)) {
|
||||
console.log(position, this.$pinia.state.value.user.position, '地理位置错误');
|
||||
console.log(position, this.$pinia.state.value.user.position, '地理位置错误')
|
||||
return
|
||||
}
|
||||
}
|
||||
let page = {
|
||||
shareCompanyQuota: 0, // 共享标识
|
||||
priceId: this.seleOil.priceId, //类型:String 必有字段 备注:油价主键
|
||||
orderType: "REAL_ORDER", //类型:String 必有字段 备注:订单类型(REAL_ORDER:真实订单 VIRTUAL_ORDER:虚拟订单)
|
||||
orderSource: "WECHAT_MINIAPPS", //类型:String 必有字段 备注:订单来源(WECHAT_MINIAPPS)
|
||||
plateNumber: this.seleOil.plateNumber, //类型:String 必有字段 备注:车牌号
|
||||
siteUserName: '一号加油员', //类型:String 必有字段 备注:加油员
|
||||
oilsBar: this.seleOil.oilsBar, //类型:Number 必有字段 备注:油枪
|
||||
volume: this.seleOil.volume, //类型:Number 必有字段 备注:加油升数
|
||||
realPrice: this.seleOil.payRealAmount, //类型:Number 必有字段 备注:实际加油价格
|
||||
suppleMark: 0, //类型:Number 必有字段 备注:补录标识(0:实时订单 1:补录订单)
|
||||
createSource: "H5_COMPANY_AUTH", //类型:String 必有字段 备注:创建来源( XOIL_DRIVER_COMPANY_WECHAT_APPLET)
|
||||
// "deviceImei": "mock", //类型:String 可有字段 备注:设备唯一码
|
||||
// "networkIp": "mock" //类型:String 可有字段 备注:ip地址
|
||||
priceId: this.seleOil.priceId, //油价主键
|
||||
orderType: 'REAL_ORDER', //订单类型(REAL_ORDER:真实订单 VIRTUAL_ORDER:虚拟订单)
|
||||
orderSource: 'WECHAT_MINIAPPS', //订单来源(WECHAT_MINIAPPS)
|
||||
plateNumber: this.seleOil.plateNumber, //车牌号
|
||||
siteUserName: '一号加油员', //加油员
|
||||
oilsBar: this.seleOil.oilsBar, //油枪
|
||||
volume: this.seleOil.volume, //加油升数
|
||||
realPrice: this.seleOil.payRealAmount, //实际加油价格
|
||||
suppleMark: 0, //补录标识(0:实时订单 1:补录订单)
|
||||
createSource: 'H5_COMPANY_AUTH', //创建来源( XOIL_DRIVER_COMPANY_WECHAT_APPLET)
|
||||
// "deviceImei": "mock", //设备唯一码
|
||||
// "networkIp": "mock" //ip地址
|
||||
kaliState: 1,
|
||||
'version': 1,
|
||||
'xoilAmountGun': Number(Number(this.seleOil.payRealAmount + this.seleOil.oilDiscountAmount).toFixed(2)),
|
||||
version: 1,
|
||||
xoilAmountGun: Number(Number(this.seleOil.payRealAmount + this.seleOil.oilDiscountAmount).toFixed(2)),
|
||||
latitude: position.latitude,
|
||||
longitude: position.longitude
|
||||
}
|
||||
@@ -162,7 +157,7 @@ export default {
|
||||
oilOrderApi.createOrder(page).then(res => {
|
||||
if (res.code == 20000) {
|
||||
this.$router.push({
|
||||
'path': '/cashier',
|
||||
path: '/cashier',
|
||||
query: {
|
||||
order: JSON.stringify(res.data)
|
||||
}
|
||||
@@ -173,7 +168,7 @@ export default {
|
||||
console.log(page, '+++')
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -186,9 +181,8 @@ export default {
|
||||
|
||||
.details-popup-one:last-child {
|
||||
margin-top: 0px;
|
||||
border-top: dashed 0px #B9B9B9;
|
||||
border-bottom: dashed 0px #B9B9B9;
|
||||
|
||||
border-top: dashed 0px #b9b9b9;
|
||||
border-bottom: dashed 0px #b9b9b9;
|
||||
}
|
||||
|
||||
.details-popup-title {
|
||||
@@ -200,9 +194,9 @@ export default {
|
||||
|
||||
.details-popup-one {
|
||||
height: 220px;
|
||||
border-top: dashed 1px #B9B9B9;
|
||||
border-top: dashed 1px #b9b9b9;
|
||||
margin-top: 45px;
|
||||
border-bottom: dashed 1px #B9B9B9;
|
||||
border-bottom: dashed 1px #b9b9b9;
|
||||
overflow: auto;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
@@ -220,8 +214,7 @@ export default {
|
||||
|
||||
.oilNextFooter-price {
|
||||
font-size: 28px;
|
||||
color: #FE0505;
|
||||
|
||||
color: #fe0505;
|
||||
}
|
||||
|
||||
.oilNextFooter-hj {
|
||||
@@ -232,14 +225,13 @@ export default {
|
||||
.oilNextFooter-butten {
|
||||
width: 314px;
|
||||
height: 90px;
|
||||
background: #FF6700;
|
||||
background: #ff6700;
|
||||
border-radius: 15px 15px 15px 15px;
|
||||
opacity: 1;
|
||||
font-family: PingFang SC-中等, PingFang SC;
|
||||
font-weight: normal;
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
font-size: 32px;
|
||||
|
||||
}
|
||||
|
||||
.oilNextFooter {
|
||||
|
||||
@@ -60,9 +60,9 @@ export default {
|
||||
},
|
||||
moneyFormat(value) {
|
||||
if (value != 'xxx.x') {
|
||||
console.log('old:', value)
|
||||
// console.log('old:', value)
|
||||
let realAmount = Math.floor(value * 100) / 100
|
||||
console.log('new:', realAmount)
|
||||
// console.log('new:', realAmount)
|
||||
// return realAmount
|
||||
return Number(value).toFixed(2)
|
||||
} else {
|
||||
|
||||
@@ -20,8 +20,10 @@ export default {
|
||||
oilNextFooter
|
||||
},
|
||||
created() {
|
||||
this.oilDetails = JSON.parse(this.$route.query.oilDetails);
|
||||
this.oilDetails = JSON.parse(this.$route.query.oilDetails)
|
||||
// console.log('this.oilDetails', this.oilDetails)
|
||||
this.oilTypeFn()
|
||||
console.log('seleOil', this.seleOil)
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -37,26 +39,25 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
update(e) {
|
||||
this.$refs.oilNextFooter.update(e)
|
||||
},
|
||||
showPopup() { },
|
||||
oilTypeFn() {
|
||||
let a = this.oilDetails.oilSiteChannelDetailsVos.filter((item) => item.channelCode == 'XOIL');
|
||||
this.oilType = a.length ? a[0] : null;
|
||||
},
|
||||
let target = this.oilDetails.oilSiteChannelDetailsVos.filter(item => item.channelCode == 'XOIL')
|
||||
this.oilType = target.length ? target[0] : null
|
||||
// console.log('this.oilType', this.oilType)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
:root {
|
||||
--pd: calc((100vw - 684px)/2);
|
||||
--pd: calc((100vw - 684px) / 2);
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.nextOrderDetails {
|
||||
background: #F1F2F7;
|
||||
background: #f1f2f7;
|
||||
flex-direction: column;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
}
|
||||
},
|
||||
refreshing: false,
|
||||
homeNavBarStyle: null,
|
||||
// homeNavBarStyle: null,
|
||||
show: false,
|
||||
loading: false,
|
||||
finished: false,
|
||||
@@ -50,7 +50,7 @@ export default {
|
||||
this.init()
|
||||
},
|
||||
mounted() {
|
||||
this.homeNavBarStyle = this.$refs.homeNavBar.$el.clientHeight
|
||||
// this.homeNavBarStyle = this.$refs.homeNavBar.$el.clientHeight
|
||||
},
|
||||
methods: {
|
||||
goPlay(e, type) {
|
||||
|
||||
@@ -16,8 +16,9 @@ module.exports = defineConfig({
|
||||
// https: true,
|
||||
proxy: {
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
target: `http://192.168.110.10:38080`,
|
||||
// target: `http://192.168.110.230:38080`,
|
||||
// target: `https://www.xingoil.com/adminapi`,
|
||||
target: `http://uat.xingoil.com/adminapi`,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||
|
||||
Reference in New Issue
Block a user