pull/8/head^2
xiaozhiyong 1 year ago
parent a7f693f88f
commit cb258ddd51
  1. 395
      pages/stationDetail/ZYSite.vue

@ -12,14 +12,15 @@
<!-- 顶部填充区域 -->
<view class="fill"></view>
<!-- 油站位置卡片 -->
<view style="margin-top: 10rpx;" class=" serviceStation my-cell margin-left margin-right padding-top padding-bottom radius shadow ">
<view style="margin-top: 10rpx;"
class=" serviceStation my-cell margin-left margin-right padding-top padding-bottom radius shadow ">
<view style="padding-bottom: 25rpx;" class="strong padding-bottom-xs">{{siteData.siteName}}</view>
<view class=" textEllipsis font-12 color-999">
<uni-icons color="#666666" type="location-filled" size="15"></uni-icons>
<text class="text-cut">{{siteData.siteAddress}}</text>
</view>
</view>
<!-- clc <view class="cu-list menu-avatar">
<view class="cu-item margin-sm margin-left margin-right radius">
<view v-if="siteData.headUrl" class="cu-avatar round lg"
@ -48,20 +49,24 @@
</view>
</view>
</view> -->
<!-- 司机卡片 -->
<view class="newdirvercard">
<view class="newdirvercard_left">
<view class="newdirvercard_left">
<view style="flex-shrink: 1;">
<view style="height: 119rpx; width: 119rpx;overflow: hidden;" v-if="siteData.headUrl" class="cu-avatar round lg" :style="'background-image:url('+siteData.headUrl+');'"></view>
<view style="height: 119rpx; width: 119rpx;overflow: hidden;" v-else class="cu-avatar round lg"></view>
<view style="height: 119rpx; width: 119rpx;overflow: hidden;" v-if="siteData.headUrl"
class="cu-avatar round lg" :style="'background-image:url('+siteData.headUrl+');'"></view>
<view style="height: 119rpx; width: 119rpx;overflow: hidden;" v-else class="cu-avatar round lg">
</view>
</view>
<view class="newdirvercard_name ">
<view class="newdirvercard_name_text ">{{ type=='RIRISHUN'? '日日顺司机': type=='shunfeng'?'顺丰司机': siteData.customerName}}</view>
<view class="newdirvercard_name_phone ">{{ type=='RIRISHUN'? '保密': type=='shunfeng'?'保密': siteData.customerPhone}}</view>
<view class="newdirvercard_name_text ">
{{ type=='RIRISHUN'? '日日顺司机': type=='shunfeng'?'顺丰司机': siteData.customerName}}</view>
<view class="newdirvercard_name_phone ">
{{ type=='RIRISHUN'? '保密': type=='shunfeng'?'保密': siteData.customerPhone}}</view>
</view>
</view>
<view class="newdirvercard_right">
<view class="newdirvercard_right">
{{siteData.userBalance || 0}}
</view>
</view>
@ -93,65 +98,63 @@
<view class="text-p">需包含加油升数和价格</view>
</view>
</view>
<!-- <uni-file-picker :value='plateNumberValue' @success='successplateNumber' auto-upload='true' @fail='failplateNumber' limit='1' file-mediatype='image' mode='grid' /> -->
</view>
<!-- 车牌号卡片 -->
<view class="cu-form-group margin margin-top-0 radius" v-if="type!= 'RIRISHUN'">
<view class="title text-black">车牌号</view>
<!-- clc <input :maxlength="7" @tap="showModel='show'" v-model="carNumber" disabled placeholder="请输入车牌号"
name="input" /> -->
<view style="flex-grow: 1; display: flex;" @tap="showModel='show'">
<view v-if="hz( String(carNumber).charAt(0))" class="sign">
<view style="flex-grow: 1; display: flex;" @tap="showModel='show'">
<view v-if="hz( String(carNumber).charAt(0))" class="sign">
<text v-if="carNumber">{{String(carNumber).charAt(0)||''}}</text>
<uni-icons color="#ffffff" type="forward" size="15"></uni-icons>
</view>
<view class="flexcenter">{{String(carNumber).substr(1,6)||'请输入车牌号'}}</view>
</view>
<view class="flexcenter">{{String(carNumber).substr(1,6)||'请输入车牌号'}}</view>
</view>
<!-- <text class="cuIcon-roundclosefill text-gray"></text> -->
<text class="cuIcon-write text-orange"></text>
</view>
<!-- 油品卡片 -->
<view class="padding-top-xs margin margin-top-xs margin-bottom-0 padding-bottom radius">
<view style="border-radius: 6px; overflow: hidden; " >
<view style="border-radius: 6px; overflow: hidden; ">
<!-- 油品类型 油品价格区域 -->
<view class="bg-white padding padding-bottom-sm">
<!-- 油品类型 v-for siteData.oilSitePriceDetailsVos -->
<view style="width: 100%;display: flex;flex-wrap: wrap; margin-bottom: 28rpx;">
<view
style="margin-right: 15rpx;"
v-for="(item,index) in siteData.oilSitePriceDetailsVos"
:key="item.priceId"
@tap="oilNameSel(item)"
:class="insertResult.oilProductCode===item.oilProductCode?'selecardoil':'cardoil'"
class="strong padding-right-xs font-16 cardoil">
{{item.oilProductCode}}
<view style="margin-right: 15rpx;" v-for="(item,index) in siteData.oilSitePriceDetailsVos"
:key="item.priceId" @tap="oilNameSel(item)"
:class="insertResult.oilProductCode===item.oilProductCode?'selecardoil':'cardoil'"
class="strong padding-right-xs font-16 cardoil">
{{item.oilProductCode}}
</view>
</view>
<!-- clc <view class="padding-bottom-sm text-lg">油号选择</view> -->
<!-- **** 油品价格 sitePrice价格 oilProductCode 选中油品的类型动态控制单位 -->
<view class="padding-top-xs" v-if='type == ""'>
<!-- clc <text class="strong padding-right-xs font-16">{{insertResult.oilProductCode}}</text> -->
<text class="padding-right-xs">
星油价格:
<text class="text-blod oil-main-color"
v-if="(insertResult.sitePrice -1+1)>0">{{(insertResult.sitePrice -1+1)|numberFilter}}/{{siteData.siteType|company}}</text>
<text class="text-blod oil-main-color" v-else>无价格</text>
</text>
<text class="s-rich">市场价{{insertResult.oilSitePrice|numberFilter}}/{{siteData.siteType|company}}</text>
</view>
<text
class="s-rich">市场价{{insertResult.oilSitePrice|numberFilter}}/{{siteData.siteType|company}}</text>
</view>
<view class="padding-top-xs" v-else>
<!-- clc <view class="grid col-5 padding-top justify-start" v-if='type == ""'>
<view class="padding-xs" v-for="(item,index) in siteData.oilSitePriceDetailsVos"
:key="item.priceId">
@ -159,24 +162,25 @@
:class="[insertResult.oilProductCode===item.oilProductCode?'bg-main-oil':'line-gray']">{{item.oilProductCode}}</button>
</view>
</view> -->
<!-- clc <view class="strong padding-right-xs font-16 cardoil">{{insertResult.oilProductCode}}</view> -->
<text style="font-size: 26rpx; color: #222222;font-weight: bold;" class="padding-right-xs">
星油价格:
<text style="font-weight: bold;" class="text-blod oil-main-color"
v-if="(insertResult.sitePrice -1+1)>0">{{ insertResult.sitePrice|numberFilter}}/{{siteData.siteType|company}}</text>
<text class="text-blod oil-main-color" v-else>无价格</text>
<text class="text-blod oil-main-color" v-else>无价格</text>
</text>
<text style="margin-left: 75rpx; color: #222222;font-weight: bold;" >油站价格:
<text v-if="insertResult.oilSitePrice">{{insertResult.oilSitePrice}}/{{siteData.siteType|company }}</text>
<text class="text-blod oil-main-color" v-else>无价格</text>
<text style="margin-left: 75rpx; color: #222222;font-weight: bold;">油站价格:
<text
v-if="insertResult.oilSitePrice">{{insertResult.oilSitePrice}}/{{siteData.siteType|company }}</text>
<text class="text-blod oil-main-color" v-else>无价格</text>
</text>
</view>
<!-- clc <view class="grid col-5 padding-top justify-start" v-else>
<!-- clc <view class="grid col-5 padding-top justify-start" v-else>
<view class="padding-xs" v-for="(item,index) in siteData.oilSitePriceDetailsVos"
:key="item.priceId">
<button class="cu-btn" @tap="changeBar(item,index)"
@ -184,21 +188,24 @@
</view>
</view> -->
</view>
<!-- **** 抢号选择 -->
<view class="padding padding-bottom-0 padding-top-xs bg-white">
<view style="color: #333333;font-size: 30rpx;" class="padding-bottom-sm text-lg">枪号选择</view>
<view class="grid col-5 justify-start">
<view style="width: calc(100% / 4);" class="padding-xs" v-for="(item,index) in ColorList" :key="index">
<button @tap="gunIdSel(index)" :style="{width: '100%',color:insertResult.bar===index+1?'':'#333333'}" class="cu-btn"
<view style="width: calc(100% / 4);" class="padding-xs" v-for="(item,index) in ColorList"
:key="index">
<button @tap="gunIdSel(index)"
:style="{width: '100%',color:insertResult.bar===index+1?'':'#333333'}"
class="cu-btn"
:class="[insertResult.bar===index+1?'bg-main-oil':'line-gray']">{{index+1}}</button>
</view>
</view>
</view>
<!-- ***油品金额区域 insertResult.oilProductCode 动态控制显示加注的类型和单位 KG/L -->
<view class=" padding bg-white">
<view class="shadow-warp bg-white">
<view class="shadow-warp bg-white">
<view class="cu-form-group" v-if='type == ""'>
<view class="title">加油升数</view>
<input placeholder="请输入加油升数" type="digit" @input="calcMoney" @blur="backType"
@ -207,16 +214,19 @@
</view>
<view class="cu-form-group" v-else>
<view class="title newtitle"> {{siteData.siteType=='2'?'加气升数':'加油金额'}}</view>
<input class="newtitle" :placeholder="`请输入${siteData.siteType=='2'?'加气升数':'加油金额'}`" @input="checkNumber" type="digit" @blur="getMoney"
v-model="insertResult.vol" name="input" />
<input class="newtitle" :placeholder="`请输入${siteData.siteType=='2'?'加气升数':'加油金额'}`"
@input="checkNumber" type="digit" @blur="getMoney" v-model="insertResult.vol"
name="input" />
<view style="width: 170rpx;text-align: end;" class="textEllipsis">
<text class="">
<!-- {{ vlom? vlom:'xxx.x' }} L clc 注销 -->
<text v-if="siteData.siteType!='2'">{{vlom?'' + ( (Math.round(vlom*100)/100).toFixed(2) ) + (siteData.siteType=='2'?'':'L'):''}}</text>
<text v-if="siteData.siteType=='2'">{{vlom?'' + ( insertResult.vDoMoney ? insertResult.vDoMoney+insertResult.discountMoney:'') + (siteData.siteType=='2'?'':'L'):''}}</text>
<text
v-if="siteData.siteType!='2'">{{vlom?'约' + ( (Math.round(vlom*100)/100).toFixed(2) ) + (siteData.siteType=='2'?'元':'L'):''}}</text>
<text
v-if="siteData.siteType=='2'">{{vlom?'约' + ( insertResult.vDoMoney ? insertResult.vDoMoney+insertResult.discountMoney:'') + (siteData.siteType=='2'?'元':'L'):''}}</text>
<!-- {{vlom?'约' + ( (Math.round(vlom*100)/100).toFixed(2) ) + 'L':''}} -->
</text>
</view>
</view>
</view>
<view class="my-cell">
<text class="font-12">星卡优惠金额</text>
@ -231,7 +241,8 @@
</view>
</view>
</view>
<button :disabled="shake!==null" class="margin round bg-main-oil" @tap="charge"> {{shake==null?'立即下单':'下单中'}}</button>
<button :disabled="shake!==null" class="margin round bg-main-oil" @tap="charge">
{{shake==null?'立即下单':'下单中'}}</button>
</view>
</view>
<view class v-show="!beforePay&&isG7">
@ -315,7 +326,7 @@
},
data() {
return {
shake:null,
shake: null,
vlom: '',
companyId: '',
activeSitePrice: '',
@ -403,7 +414,7 @@
// this.type = 'fykc' //option.type
// }
if (this.qrCode) {
if (this.qrCode.substr(0, 2) == 'HT' || this.qrCode.substr(0, 2) == 'G7'|| this.type === 'G7') {
if (this.qrCode.substr(0, 2) == 'HT' || this.qrCode.substr(0, 2) == 'G7' || this.type === 'G7') {
this.isG7 = true
console.log('G7加油站')
}
@ -466,7 +477,7 @@
},
methods: {
hz(e){
hz(e) {
// carNumber.length>0
// console.log(new RegExp("[\u4E00-\u9FA5]+").test(e),'*-*-*-*-*-*')
return new RegExp("[\u4E00-\u9FA5]+").test(e)
@ -543,7 +554,7 @@
xoilAmountGun: e.detail.value,
priceId: this.activeSitePrice,
companyId: this.siteData.companyId,
createSource:this.siteData.siteType=='2'?'XOIL':''
createSource: this.siteData.siteType == '2' ? 'XOIL' : ''
}
}
this.xoilAmountGun = e.detail.value
@ -635,7 +646,7 @@
charge() {
//
clearTimeout(this.shake)
this.shake = setTimeout(()=>{
this.shake = setTimeout(() => {
this.tsetPlate()
console.log(this.plateText)
console.log(this.plateNo)
@ -650,10 +661,10 @@
this.SfOrder()
return
}
if (this.type === 'G7') {
this.G7Order()
return
}
if (this.type === 'G7') {
this.G7Order()
return
}
if (this.type == 'fykc') {
this.FyOrder()
return
@ -669,17 +680,17 @@
title: '车牌号校验不通过',
icon: 'none'
});
this.shake=null
this.shake = null
}
} else {
uni.showToast({
title: '您选择的油品没有油价,不能加油',
icon: 'none'
});
this.shake=null
this.shake = null
}
},500)
}, 500)
},
//
FyOrder() {
@ -700,7 +711,7 @@
title: 'qrCode为空',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
if (!data6.siteId) {
@ -708,7 +719,7 @@
title: '请选择油站id',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
if (!data6.companyId) {
@ -716,7 +727,7 @@
title: '请选择企业id',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
if (!data6.customerId) {
@ -724,7 +735,7 @@
title: '请选择司机id',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
if (!data6.volume) {
@ -732,7 +743,7 @@
title: '请输入加油体积',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
oliSiteApi.FYPay(data6).then(res => {
@ -784,7 +795,7 @@
title: 'qrCode为空',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
if (!data6.siteId) {
@ -792,7 +803,7 @@
title: '请选择油站id',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
if (!data6.companyId) {
@ -800,7 +811,7 @@
title: '请选择企业id',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
if (!data6.customerId) {
@ -808,7 +819,7 @@
title: '请选择司机id',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
if (!data6.volume) {
@ -816,7 +827,7 @@
title: '请输入加油体积',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
oliSiteApi.sfPay(data6).then(res => {
@ -855,87 +866,87 @@
url: '/pages/stationDetail/OrderStatus?item=' + item
})
},
// g7
G7Order() {
const g7OrderInfo = {
qr_code: uni.getStorageSync('qrCode'), //String qrcode
station_id: this.siteData.siteId, //String id siteId
oilPriceId: this.insertResult.priceId, //String id priceId
driver_phone: this.siteData.customerPhone, //String id priceId
companyId: this.siteData.companyId, //String id companyId
customerId: this.siteData.customerId, //String id customerId
truck_no: this.carNumber,
gun_money: this.insertResult.vol, //String
gun_number: this.insertResult.bar, //String
deduction_mode: 1,
}
console.log("加油信息===================",this.insertResult)
console.log(g7OrderInfo)
if (!g7OrderInfo.qr_code) {
uni.showToast({
title: 'qr_code为空',
icon: 'none'
});
this.shake=null
return false
}
if (!g7OrderInfo.station_id) {
uni.showToast({
title: '请选择油站id',
icon: 'none'
});
this.shake=null
return false
}
if (!g7OrderInfo.companyId) {
uni.showToast({
title: '请选择企业id',
icon: 'none'
});
this.shake=null
return false
}
if (!g7OrderInfo.customerId) {
uni.showToast({
title: '请选择司机id',
icon: 'none'
});
this.shake=null
return false
}
if (!g7OrderInfo.gun_money) {
uni.showToast({
title: '请输入加油金额',
icon: 'none'
});
this.shake=null
return false
}
oliSiteApi.G7Pay(g7OrderInfo).then(res => {
if (res.code === 20000) {
uni.showToast({
title: '下单成功!'
});
uni.setStorageSync('orderSource', 'mpxoil')
console.log("是否是g7================",this.isG7)
if (!this.isG7) {
setTimeout(() => {
this.toDetails(res.data.orderId)
}, 400)
} else {
this.beforePay = false
setTimeout(() => {
this.orderId = res.data.orderId
console.log("queryTimer",this.orderId)
this.queryTimer()
console.log("getPayStatus",this.orderId)
this.getPayStatus(this.orderId)
}, 400)
}
this.shake=null
}
})
},
// g7
G7Order() {
const g7OrderInfo = {
qr_code: uni.getStorageSync('qrCode'), //String qrcode
station_id: this.siteData.siteId, //String id siteId
oilPriceId: this.insertResult.priceId, //String id priceId
driver_phone: this.siteData.customerPhone, //String id priceId
companyId: this.siteData.companyId, //String id companyId
customerId: this.siteData.customerId, //String id customerId
truck_no: this.carNumber,
gun_money: this.insertResult.vol, //String
gun_number: this.insertResult.bar, //String
deduction_mode: 1,
}
console.log("加油信息===================", this.insertResult)
console.log(g7OrderInfo)
if (!g7OrderInfo.qr_code) {
uni.showToast({
title: 'qr_code为空',
icon: 'none'
});
this.shake = null
return false
}
if (!g7OrderInfo.station_id) {
uni.showToast({
title: '请选择油站id',
icon: 'none'
});
this.shake = null
return false
}
if (!g7OrderInfo.companyId) {
uni.showToast({
title: '请选择企业id',
icon: 'none'
});
this.shake = null
return false
}
if (!g7OrderInfo.customerId) {
uni.showToast({
title: '请选择司机id',
icon: 'none'
});
this.shake = null
return false
}
if (!g7OrderInfo.gun_money) {
uni.showToast({
title: '请输入加油金额',
icon: 'none'
});
this.shake = null
return false
}
oliSiteApi.G7Pay(g7OrderInfo).then(res => {
if (res.code === 20000) {
uni.showToast({
title: '下单成功!'
});
uni.setStorageSync('orderSource', 'mpxoil')
console.log("是否是g7================", this.isG7)
if (!this.isG7) {
setTimeout(() => {
this.toDetails(res.data.orderId)
}, 400)
} else {
this.beforePay = false
setTimeout(() => {
this.orderId = res.data.orderId
console.log("queryTimer", this.orderId)
this.queryTimer()
console.log("getPayStatus", this.orderId)
this.getPayStatus(this.orderId)
}, 400)
}
this.shake = null
}
})
},
//
RrsOrder() {
const data6 = {
@ -965,7 +976,7 @@
title: '请选择油品',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
if (!data6.volume) {
@ -973,7 +984,7 @@
title: '请输入加油体积',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
oliSiteApi.RrsPay(data6).then(res => {
@ -1025,7 +1036,7 @@
let PlateNumberImages = this.PlateNumberImages,
refuellerImages = this.refuellerImages
if (PlateNumberImages == '') {
this.shake=null
this.shake = null
uni.showToast({
icon: 'none',
title: '请上传车辆照片'
@ -1037,7 +1048,7 @@
icon: 'none',
title: '请上传油机照片'
})
this.shake=null
this.shake = null
return
}
var data6 = {
@ -1062,7 +1073,7 @@
oilCardType: this.siteData.oilCardNature, //String 1 2 3
accountCardCode: this.siteData.accountCardCode, //String
siteUserName: "1", //String
version: this.siteData.siteType=='2'?null:'1', //Number
version: this.siteData.siteType == '2' ? null : '1', //Number
xoilAmountGun: this.insertResult.vol, //String
}
} else {
@ -1087,7 +1098,7 @@
oilCardType: this.siteData.oilCardNature, //String 1 2 3
accountCardCode: this.siteData.accountCardCode, //String
siteUserName: "1", //String
version: this.siteData.siteType=='2'?null:"1", //Number
version: this.siteData.siteType == '2' ? null : "1", //Number
xoilAmountGun: this.insertResult.vol, //String
}
}
@ -1097,25 +1108,28 @@
title: '请选择油品',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
if (!Number(data6.volume)) {
if(this.siteData.siteType=='2'){
if (this.siteData.siteType == '2') {
uni.showToast({
title: '请输入加油升数',
icon: 'none'
});
}else{
} else {
uni.showToast({
title: '请输入加油金额',
icon: 'none'
});
}
this.shake=null
this.shake = null
return false
}
let location = uni.getStorageSync('location')||{longitude:'',latitude:''};
let location = uni.getStorageSync('location') || {
longitude: '',
latitude: ''
};
// if(!location){
// let locationChenk = true
// let that = this
@ -1170,7 +1184,10 @@
// return
//
console.log(data6, 'data6+++++')
oliSiteApi.xoilPay(Object.assign(data6,{longitude:location.longitude,latitude:location.latitude})).then(res => {
oliSiteApi.xoilPay(Object.assign(data6, {
longitude: location.longitude,
latitude: location.latitude
})).then(res => {
console.log(res)
if (res.code === 20000) {
uni.showToast({
@ -1208,9 +1225,9 @@
}, 400)
}
}
setTimeout(()=>{
this.shake=null
},1000)
setTimeout(() => {
this.shake = null
}, 1000)
})
},
// yi
@ -1237,7 +1254,7 @@
title: '请选择油品',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
if (!data6.volume) {
@ -1245,7 +1262,7 @@
title: '请输入加油体积',
icon: 'none'
});
this.shake=null
this.shake = null
return false
}
oliSiteApi.zeyiPay(data6).then(res => {
@ -1286,9 +1303,9 @@
this.getPayStatus(this.orderId)
}, 400)
}
setTimeout(()=>{
this.shake=null
},1000)
setTimeout(() => {
this.shake = null
}, 1000)
}
})
},
@ -1353,7 +1370,7 @@
oilsStationId: uni.getStorageSync('oilSiteId') //String id
}
// }
console.log(obj,'**************');
console.log(obj, '**************');
oliSiteApi.verifyQrCode(obj).then(res => {
if (res.code === 20000) {
this.siteData = res.data
@ -1392,12 +1409,12 @@
// this.insertResult.discountMoney = this.insertResult.vol * (this.selected.oilSitePrice - this.insertResult
// .sitePrice)
// this.insertResult.vDoMoney = this.insertResult.vol * this.selected.sitePrice
console.log('%c look me ↓','font-size:50px;color:green')
console.log(this.insertResult.vMoney,this.insertResult,this.selected)
if(this.insertResult.vol!==''){
console.log('%c look me ↓', 'font-size:50px;color:green')
console.log(this.insertResult.vMoney, this.insertResult, this.selected)
if (this.insertResult.vol !== '') {
this.getMoney({
detail:{
value:this.insertResult.vol
detail: {
value: this.insertResult.vol
}
})
}
@ -1493,9 +1510,9 @@
}
},
filters: {
company(e){
if(e){
return e=='2' ?'KG':'L';
company(e) {
if (e) {
return e == '2' ? 'KG' : 'L';
} else {
return ''
}

Loading…
Cancel
Save