This commit is contained in:
xiaozhiyong
2023-11-27 14:46:36 +08:00
parent 858948fbe4
commit 0554adda71
8 changed files with 546 additions and 573 deletions

View File

@@ -8,26 +8,31 @@
</view>
</view>
<scroll-view scroll-x class=" nav text-center">
<view class="cu-item" v-for="(item,index) in channelList" v-if="index==activeCur" :class="index==activeCur?'text-blues cur':''" :key="item.channelId"
@tap="tabSelect" :data-id="index" :data-channel-code="item.channelCode">
<view class="cu-item" v-for="(item,index) in channelList" v-if="index==activeCur"
:class="index==activeCur?'text-blues cur':''" :key="item.channelId" @tap="tabSelect" :data-id="index"
:data-channel-code="item.channelCode">
<image class="site-icon margin-right-sm" :src="imgURL+'site-'+item.channelCode+'.png'" mode="widthFix">
</image>
{{item.channelCode|channelCodeFamt}}
<!-- 少了壳牌 -->
</view>
</view>
</scroll-view>
<radio-group class="block" @change="changePrice">
<view class="cu-list menu text-left">
<view class="cu-item" v-for="(itemx,index) in oilSitePriceDetailsVo" :key="index" v-if="itemx.sitePrice>0">
<view class="cu-item" v-for="(itemx,index) in oilSitePriceDetailsVo" :key="index"
v-if="itemx.sitePrice>0">
<label class="flex justify-between align-center flex-sub">
<radio class="round blue" :class="radio=='radio' + index?'checked':''" :checked= " radio ==index?true : false" :value="index"></radio>
<radio class="round blue" :class="radio=='radio' + index?'checked':''"
:checked=" radio ==index?true : false" :value="index"></radio>
<text class="cu-tag my-tag line-red text-lg">
</text>
<text class="text-bold text-black text-lg">{{itemx.oilProductCode}}</text>
<text class="text-bold text-blues text-lg">{{itemx.sitePrice!=0?itemx.sitePrice:'-.--'}}/L</text>
<text
class="text-bold text-blues text-lg">{{itemx.sitePrice!=0?itemx.sitePrice:'-.--'}}/L</text>
<text class="text-delete">{{itemx.oilSitePrice}}/L</text>
<text class="text-sm">预计每100L节省{{(100*(itemx.oilSitePrice - itemx.sitePrice))|moneyFormat}}</text>
<text
class="text-sm">预计每100L节省{{(100*(itemx.oilSitePrice - itemx.sitePrice))|moneyFormat}}</text>
</label>
</view>
</view>
@@ -39,14 +44,17 @@
<view class="padding-top-sm">
<view class="grid col-5 ">
<view v-for="(item,index) in checkBar" class="padding-xs" :key="index">
<button class="cu-btn red block" :class="item.checked?'bg-blue':'line-blues'" @tap="ChooseBar" :data-value="item.value">
<button class="cu-btn red block" :class="item.checked?'bg-blue':'line-blues'"
@tap="ChooseBar" :data-value="item.value">
{{item.name}}
<view class="cu-tag sm round" :class="item.checked?'bg-white text-blues':'bg-blue'" v-if="item.hot">HOT</view>
<view class="cu-tag sm round" :class="item.checked?'bg-white text-blues':'bg-blue'"
v-if="item.hot">HOT</view>
</button>
</view>
<view class="padding-xs" style="width:40% ;" v-if="activeChannelCode!='TY'">
<input type="number" @input="onInputBar" v-model="inputBar" class="cu-btn red block" placeholder="其他油枪" value="" />
<input type="number" @input="onInputBar" v-model="inputBar" class="cu-btn red block"
placeholder="其他油枪" value="" />
</view>
</view>
</view>
@@ -73,7 +81,7 @@
<!-- @tap="showJober='show'" -->
<!-- 请选择加油员 -->
<view class="cu-form-group ">
<view class="">
<view class="">
<view class="site-icon-sm">
<image :src="imgURL+'site-jober.png'" mode="widthFix" width="100upx"></image>
</view>
@@ -89,28 +97,32 @@
</form>
</view>
<!-- 非团油加油输入框 -->
<view class="margin solid radius" v-if="activeChannelCode!='TY'&&radio!==null">
<view class="margin solid radius" v-if="activeChannelCode!='TY'&&radio!==null">
<view class=" menu cu-list ">
<view class="cu-item nowrap">
<view class="text-bold ">
油机金额
</view>
<view class="text-center" style="width: 60%;margin: 0 2%;">
<input v-model="vol" @input='checkNumber' @blur="getMoneyVol" type="digit" class="block" placeholder="请输入油机金额" value=""style="border-bottom: 1px solid #efefef;" />
<input v-model="vol" @input='checkNumber' @blur="getMoneyVol" type="digit" class="block"
placeholder="请输入油机金额" value="" style="border-bottom: 1px solid #efefef;" />
</view>
<view class="">
<text class=" padding-right-sm">
{{vlom?vlom :'' | moneyVolm}}L
{{vlom?vlom :'' | moneyVolm}}L
</text>
</view>
</view>
<view class="grid col-5 padding-sm">
<view v-for="(item,index) in checkMoney" class="padding-xs" :key="index">
<button class="cu-btn blue block" style=" padding: 0;" :class="item.checked?'bg-blue':'line-blues'" @tap="ChooseCheckMoney(item.value)" :data-value="item.value">
{{item.name}}&yen;
<view class="cu-tag sm round" :class="item.checked?'bg-white text-blues':'bg-blue'" v-if="item.hot">HOT</view>
</button>
<button class="cu-btn blue block" style=" padding: 0;"
:class="item.checked?'bg-blue':'line-blues'" @tap="ChooseCheckMoney(item.value)"
:data-value="item.value">
{{item.name}}&yen;
<view class="cu-tag sm round" :class="item.checked?'bg-white text-blues':'bg-blue'"
v-if="item.hot">HOT</view>
</button>
</view>
</view>
</view>
@@ -124,7 +136,8 @@
加油金额
</view>
<view class="text-center">
<input v-model="ty.realMoney" @input="onInputTyMoney" type="digit" class="block" placeholder="加油金额" value="" />
<input v-model="ty.realMoney" @input="onInputTyMoney" type="digit" class="block"
placeholder="加油金额" value="" />
</view>
<view class="">
<text class="text-bold padding-right-sm">
@@ -135,9 +148,11 @@
</view>
<view class="grid col-5 padding-sm">
<view v-for="(item,index) in checkVol" class="padding-xs" :key="index">
<button class="cu-btn red block" :class="item.checked?'bg-blue':'line-red'" @tap="ChooseCheckVol" :data-value="item.value">
<button class="cu-btn red block" :class="item.checked?'bg-blue':'line-red'"
@tap="ChooseCheckVol" :data-value="item.value">
{{item.name}}
<view class="cu-tag sm round" :class="item.checked?'bg-white text-blues':'bg-blue'" v-if="item.hot">HOT</view>
<view class="cu-tag sm round" :class="item.checked?'bg-white text-blues':'bg-blue'"
v-if="item.hot">HOT</view>
</button>
</view>
@@ -155,12 +170,12 @@
<view class="padding-top-sm" v-else>
直降金额
<text class="fr">-{{tyRes.depreciateAmount>0?tyRes.depreciateAmount:'xxx.x'|moneyFormat}}</text>
</view>
</view>
<view class="padding-top-sm">
优惠券 <text class="fr">{{'----'}}</text>
</view>
</view>
<view class="placeholder-hidden">
<view class="placeholder-hidden">
<view class="margin cu-list pay-bar menu radius solid-top solid-bottom solid-left">
<view class="cu-item ">
<view class="">
@@ -181,8 +196,10 @@
<view class="margin cu-list pay-bar menu radius solid-top solid-bottom solid-left">
<view class="cu-item ">
<view class="">
合计<text class="text-blues fr" v-if="activeChannelCode!='TY'">{{realMoney>0?realMoney:'xxx.x'|moneyFormat}}</text>
<text class="text-blues fr" v-else>{{ty.realMoney>0?ty.realMoney-tyRes.depreciateAmount:'xxx.x'|moneyFormat}}</text>
合计<text class="text-blues fr"
v-if="activeChannelCode!='TY'">{{realMoney>0?realMoney:'xxx.x'|moneyFormat}}</text>
<text class="text-blues fr"
v-else>{{ty.realMoney>0?ty.realMoney-tyRes.depreciateAmount:'xxx.x'|moneyFormat}}</text>
</view>
<view class="" @tap="showOrderMsg">
明细<text class="cuIcon-unfold padding-left-xs"></text>
@@ -238,7 +255,8 @@
</view>
<view class="padding-tb-xs text-left">
直降金额
<text class="text-blues fr">{{tyRes.depreciateAmount>0?tyRes.depreciateAmount:'xxx.x'|moneyFormat}}</text>
<text
class="text-blues fr">{{tyRes.depreciateAmount>0?tyRes.depreciateAmount:'xxx.x'|moneyFormat}}</text>
</view>
</view>
<view class="padding-tb-xs text-left">
@@ -247,16 +265,20 @@
</view>
<view class="padding-tb-xs text-left">
合计
<text class="text-blues fr" v-if="activeChannelCode!='TY'">{{realMoney>0?realMoney:'xxx.x'|moneyFormat}}</text>
<text class="text-blues fr" v-else>{{ty.realMoney>0?ty.realMoney:'xxx.x'|moneyFormat}}</text>
<text class="text-blues fr"
v-if="activeChannelCode!='TY'">{{realMoney>0?realMoney:'xxx.x'|moneyFormat}}</text>
<text class="text-blues fr"
v-else>{{ty.realMoney>0?ty.realMoney:'xxx.x'|moneyFormat}}</text>
</view>
</view>
<view class="cu-list margin pay-bar menu radius solid-top solid-bottom solid-left">
<view class="cu-item ">
<view class="">
合计<text class="text-blues" v-if="activeChannelCode!='TY'">{{realMoney>0?realMoney:'xxx.x'|moneyFormat}}</text>
<text class="text-blues" v-else>{{ty.realMoney>0?ty.realMoney-tyRes.depreciateAmount:'xxx.x'|moneyFormat}}</text>
合计<text class="text-blues"
v-if="activeChannelCode!='TY'">{{realMoney>0?realMoney:'xxx.x'|moneyFormat}}</text>
<text class="text-blues"
v-else>{{ty.realMoney>0?ty.realMoney-tyRes.depreciateAmount:'xxx.x'|moneyFormat}}</text>
</view>
<view class="" @tap="showOrder=''">
明细<text class="cuIcon-fold padding-left-xs"></text>
@@ -285,8 +307,8 @@
</view>
<input type="text" value="" placeholder="请选择或输入车牌号" v-model="plateNumber" />
</view>
<picker-view :indicator-style="indicatorStyle" v-if="plateNumbers.length" :value="plateIndex" @change="pickPlate"
class="picker-view">
<picker-view :indicator-style="indicatorStyle" v-if="plateNumbers.length" :value="plateIndex"
@change="pickPlate" class="picker-view">
<picker-view-column>
<view class="item" v-for="(item,index) in plateNumbers" :key="index">{{item}}</view>
</picker-view-column>
@@ -303,10 +325,10 @@
<view class="">
<image src="../../../static/img/errIcon.png" mode="" style="width:100rpx;height: 100rpx;"></image>
</view>
<view class="cu-bar box-panding text-centerS" >
<text class="headShow">支付提醒</text>
<view class="cu-bar box-panding text-centerS">
<text class="headShow">支付提醒</text>
</view>
<view class="cu-bar box-panding" >
<view class="cu-bar box-panding">
<text class="showtext">当前油站距离您较远请与加油员确认您选择的油站是否正确</text>
</view>
<view class="checklocation_box_button">
@@ -332,7 +354,7 @@
type: Array,
default () {}
},
channelJuli:{
channelJuli: {
type: Number,
default: ''
},
@@ -347,11 +369,11 @@
},
data() {
return {
timer:null,
discount:'',
activeSitePrice:'',
showtitles:"",
showtitle:false,
timer: null,
discount: '',
activeSitePrice: '',
showtitles: "",
showtitle: false,
oilBarTy: '',
ty: {
realMoney: ""
@@ -365,7 +387,7 @@
indicatorStyle: `height: 50px;`,
visiblePlateNumbers: true,
inputBar: '',
oilBar: '',
oilBar: 1,
testPlateResult: false,
plateIndex: 0,
joberIndex: 0,
@@ -406,7 +428,7 @@
hot: false,
}],
plateNumber: '',
checkMoney:[{
checkMoney: [{
value: 100,
name: '100 ',
checked: false,
@@ -435,7 +457,7 @@
checkbox: [{
value: 1,
name: '1',
checked: false,
checked: true,
hot: false,
}, {
value: 2,
@@ -475,45 +497,46 @@
}],
activeChannelCode: '',
checkBar: [],
realMoney:'',
xoilAmountGun:'',
vlom:''
realMoney: '',
xoilAmountGun: '',
vlom: ''
}
},
created() {
let oilItem = uni.getStorageSync('oilItem')
this.showtitles = oilItem.listTag
this.showtitles = oilItem.listTag
},
watch: {
activeChannelCode: {
handler(newval) {
this.oilBar = ''
setTimeout(() => {
this.oilBar = 1
this.checkBar = this.calcBar()
}, 2)
}, 0)
}
},
priceId: {
handler(newval) {
this.oilBar = ''
setTimeout(() => {
this.checkBar = this.calcBar()
}, 2)
// setTimeout(() => {
// this.oilBar = 1
// this.checkBar = this.calcBar()
// }, 0)
}
},
radio:{
handler(n,o) {
console.log(n,o,'handler');
this.checkBar.forEach(item=>{
item.checked = false
});
this.oilBar = ''
radio: {
handler(n, o) {
// console.log(n,o,'handler');
// this.checkBar.forEach(item => {
// item.checked = false
// });
// this.oilBar = ''
}
}
},
computed: {
priceId() {
if (this.channelList.length && this.channelList[this.activeCur] && this.oilSitePriceDetailsVo[this.radio]) {
if (this.channelList.length && this.channelList[this.activeCur] && this.oilSitePriceDetailsVo[this
.radio]) {
return this.oilSitePriceDetailsVo[this.radio].priceId
}
},
@@ -527,7 +550,7 @@
},
plateNumberSel() {
if (this.plateNumbers.length) {
return this.plateNumbers[this.plateIndex]?this.plateNumbers[this.plateIndex]:'非必填'
return this.plateNumbers[this.plateIndex] ? this.plateNumbers[this.plateIndex] : '非必填'
}
},
jober() {
@@ -558,97 +581,97 @@
}
}
},
methods: {
checkNumber(e){
checkNumber(e) {
e.detail.value = e.detail.value.match(/^\d*(\.?\d{0,2})/g)[0] || null;
this.$nextTick(()=>{
this.$nextTick(() => {
this.vol = e.detail.value
})
},
checkMoneyVol(e){
checkMoneyVol(e) {
console.log(e)
if(e == ''){
if (e == '') {
uni.showToast({
title:'请输入金额',
icon:'none'
title: '请输入金额',
icon: 'none'
})
return
}
let isNumber = this.isNumber(e)
if(!isNumber){
uni.showToast({
title:'请输入正确金额',
icon:'none'
})
return
if (!isNumber) {
uni.showToast({
title: '请输入正确金额',
icon: 'none'
})
return
}
let number = {
payType : 'CUSTOMER_ACTIVE',
userType:'0',
xoilAmountGun:e ,
priceId:this.activeSitePrice,
clientBelong: "ZHONGPIN"
}
this.xoilAmountGun = e
oilSiteApi.getOrderDiscountInfo(number).then( res=>{
console.log(res)
payType: 'CUSTOMER_ACTIVE',
userType: '0',
xoilAmountGun: e,
priceId: this.activeSitePrice,
clientBelong: "ZHONGPIN"
}
this.xoilAmountGun = e
oilSiteApi.getOrderDiscountInfo(number).then(res => {
// console.log(res)
this.realMoney = res.data.payRealAmount
this.discount = res.data.oilDiscountAmount
this.vlom = res.data.volume
this.discount = res.data.oilDiscountAmount
this.vlom = res.data.volume
})
},
ChooseCheckMoney(e){
console.log(e)
this.vol = e+''
this.checkMoneyVol(this.vol )
ChooseCheckMoney(e) {
// console.log(e)
this.vol = e + ''
this.checkMoneyVol(this.vol)
},
isNumber(value){ // 判断是否为正常数字
isNumber(value) { // 判断是否为正常数字
const regPos = /^\d+(\.\d+)?$/; //非负浮点数
const regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
if(value.indexOf('-') != -1){
if (value.indexOf('-') != -1) {
return false
}
if( regPos.test(value) || regNeg.test(value)){
if (regPos.test(value) || regNeg.test(value)) {
return true
}else{
} else {
return false
}
},
getMoneyVol(e){
console.log(e)
if(e.detail.value == ''){
getMoneyVol(e) {
// console.log(e)
if (e.detail.value == '') {
uni.showToast({
title:'请输入金额',
icon:'none'
title: '请输入金额',
icon: 'none'
})
return
}
let isNumber = this.isNumber(e.detail.value)
if(!isNumber){
uni.showToast({
title:'请输入正确金额',
icon:'none'
})
return
if (!isNumber) {
uni.showToast({
title: '请输入正确金额',
icon: 'none'
})
return
}
let number = {
payType : 'CUSTOMER_ACTIVE',
userType:'0',
xoilAmountGun:e.detail.value,
priceId:this.activeSitePrice,
clientBelong: "ZHONGPIN"
}
payType: 'CUSTOMER_ACTIVE',
userType: '0',
xoilAmountGun: e.detail.value,
priceId: this.activeSitePrice,
clientBelong: "ZHONGPIN"
}
this.xoilAmountGun = e.detail.value
oilSiteApi.getOrderDiscountInfo(number).then( res=>{
oilSiteApi.getOrderDiscountInfo(number).then(res => {
console.log(res)
this.realMoney = res.data.payRealAmount
this.discount = res.data.oilDiscountAmount
this.vlom = res.data.volume
this.discount = res.data.oilDiscountAmount
this.vlom = res.data.volume
})
},
checkInfo(){
console.log(this.radio)
checkInfo() {
// console.log(this.radio)
this.tsetPlate(this.plateNumber ? this.plateNumber : this.plateNumberSel)
// if (!this.testPlateResult) {
// this.plateNumber=''
@@ -658,7 +681,7 @@
// })
// // return false
// }
if (this.radio==null||!this.oilSitePriceDetailsVo[this.radio].priceId) {
if (this.radio == null || !this.oilSitePriceDetailsVo[this.radio].priceId) {
uni.showToast({
icon: 'none',
title: '请选择油品'
@@ -693,7 +716,7 @@
})
return false
}
if (this.vol < 0.01&& !this.tyRes.liter) {
if (this.vol < 0.01 && !this.tyRes.liter) {
uni.showToast({
icon: 'none',
title: '加油金额不能为空'
@@ -707,18 +730,18 @@
})
return false
}
this.makerOrder()
},
gotoPay(){
gotoPay() {
this.checkInfo()
},
hidendialog(){
this.showtitle =false
hidendialog() {
this.showtitle = false
},
backTohome(){
backTohome() {
uni.switchTab({
url:'../../../pages/tabbar/home/home'
url: '../../../pages/tabbar/home/home'
})
},
calcBar() {
@@ -728,21 +751,22 @@
mask: false
});
if (this.oilSitePriceDetailsVo[this.radio] && this.oilSitePriceDetailsVo[this.radio].oilsBar) {
console.log('计算有钱', this.oilSitePriceDetailsVo[this.radio].oilsBar)
// console.log('计算有钱', this.oilSitePriceDetailsVo[this.radio].oilsBar)
this.oilBarTy = this.oilSitePriceDetailsVo[this.radio].oilsBar
}
if (this.channelId && this.oilBarTy) {
let gunLsit = this.oilBarTy.split(',')
let gunCheck = []
gunLsit.forEach(item => {
gunLsit.forEach((item, index) => {
gunCheck.push({
value: item,
name: item,
checked: false,
checked: index == 0,
hot: false
})
})
// this.oilBar = values
uni.hideLoading()
return gunCheck
}
@@ -807,7 +831,7 @@
}
},
beforeMake() {
console.log(this.radio,'beforeMake')
// console.log(this.radio, 'beforeMake')
this.tsetPlate(this.plateNumber ? this.plateNumber : this.plateNumberSel)
// if (!this.testPlateResult) {
// this.plateNumber=''
@@ -817,7 +841,7 @@
// })
// // return false
// }
if (this.radio==null||!this.oilSitePriceDetailsVo[this.radio].priceId) {
if (this.radio == null || !this.oilSitePriceDetailsVo[this.radio].priceId) {
uni.showToast({
icon: 'none',
title: '请选择油品'
@@ -838,13 +862,13 @@
})
return false
}
if (!this.oilBar) {
uni.showToast({
icon: 'none',
title: '未选择加油员'
})
return false
}
// if (!this.oilBar) {
// uni.showToast({
// icon: 'none',
// title: '未选择加油员'
// })
// return false
// }
if (!this.vol && !this.tyRes.liter) {
uni.showToast({
icon: 'none',
@@ -852,7 +876,7 @@
})
return false
}
if (this.vol < 0.01&& !this.tyRes.liter) {
if (this.vol < 0.01 && !this.tyRes.liter) {
uni.showToast({
icon: 'none',
title: '加油金额不能为空'
@@ -866,10 +890,10 @@
})
return false
}
if(this.channelJuli>1000){
if (this.channelJuli > 1000) {
this.showtitle = true
return
}
}
this.makerOrder()
},
// 下单
@@ -877,42 +901,48 @@
// // console.log('下单数据',
// this.plateNumber, this.jober,
// )
if(!this.timer){
this.timer = setTimeout(()=>{
let orderData = {
'clientBelong':'ZHONGPIN',
"amountGun": this.activeChannelCode == 'TY' ? this.ty.realMoney : '',
"shareCompanyQuota": 0, // 共享标识
"priceId": this.oilSitePriceDetailsVo[this.radio].priceId, //类型String 必有字段 备注:油价主键
"orderType": "REAL_ORDER", //类型String 必有字段 备注订单类型REAL_ORDER真实订单 VIRTUAL_ORDER虚拟订单
"orderSource": "WECHAT_MINIAPPS", //类型String 必有字段 备注:订单来源WECHAT_MINIAPPS
"plateNumber": this.plateNumber ? this.plateNumber : this.plateNumberSel, //类型String 必有字段 备注:车牌号
"siteUserName": this.jober, //类型String 必有字段 备注:加油员
"oilsBar": this.oilBar, //类型:Number 必有字段 备注:油枪
"volume": this.activeChannelCode == 'TY' ? this.tyRes.liter : this.vol, //类型:Number 必有字段 备注:加油升数
"realPrice": this.oilSitePriceDetailsVo[this.radio].sitePrice, //类型Number 必有字段 备注:实际加油价格
"suppleMark": 0, //类型Number 必有字段 备注补录标识0实时订单 1补录订单
"createSource": "XOIL_DRIVER_WECHAT_APPLET", //类型:String 必有字段 备注:创建来源( XOIL_DRIVER_WECHAT_APPLET
// "deviceImei": "mock", //类型String 可有字段 备注:设备唯一码
// "networkIp": "mock" //类型String 有字段 备注:ip地址,
'version':1,
'xoilAmountGun':this.vol
}
console.log(orderData,'orderDataorderDataorderDataorderDataorderDataorderDataorderDataorderData');
oilOrderApi.createOrder(orderData).then(res => {
if (res.code == 20000) {
if (!this.timer) {
this.timer = setTimeout(() => {
let orderData = {
'clientBelong': 'ZHONGPIN',
"amountGun": this.activeChannelCode == 'TY' ? this.ty.realMoney : '',
"shareCompanyQuota": 0, // 共享标识
"priceId": this.oilSitePriceDetailsVo[this.radio]
.priceId, //类型String 必有字段 备注:油价主键
"orderType": "REAL_ORDER", //类型String 必有字段 备注:订单类型REAL_ORDER真实订单 VIRTUAL_ORDER虚拟订单
"orderSource": "WECHAT_MINIAPPS", //类型String 必有字段 备注:订单来源WECHAT_MINIAPPS
"plateNumber": this.plateNumber ? this.plateNumber : this
.plateNumberSel, //类型:String 必有字段 备注:车牌号
"siteUserName": this.jober, //类型:String 必有字段 备注:加油
"oilsBar": this.oilBar, //类型Number 必有字段 备注:油枪
"volume": this.activeChannelCode == 'TY' ? this.tyRes.liter : this
.vol, //类型:Number 必有字段 备注:加油升数
"realPrice": this.oilSitePriceDetailsVo[this.radio]
.sitePrice, //类型Number 有字段 备注:实际加油价格
"suppleMark": 0, //类型Number 必有字段 备注补录标识0实时订单 1补录订单
"createSource": "XOIL_DRIVER_WECHAT_APPLET", //类型String 必有字段 备注:创建来源( XOIL_DRIVER_WECHAT_APPLET
// "deviceImei": "mock", //类型String 可有字段 备注:设备唯一码
// "networkIp": "mock" //类型String 可有字段 备注ip地址,
'version': 1,
'xoilAmountGun': this.vol
}
console.log(orderData,
'orderDataorderDataorderDataorderDataorderDataorderDataorderDataorderData');
oilOrderApi.createOrder(orderData).then(res => {
if (res.code == 20000) {
clearTimeout(this.timer)
uni.setStorageSync('orderMade', res.data)
uni.redirectTo({
url: '/BagStation/pages/makeOrder/orderPaying?payMethod=' + res
.data.payMethod
})
}
}).finally(msg => {
clearTimeout(this.timer)
uni.setStorageSync('orderMade', res.data)
uni.redirectTo({
url: '/BagStation/pages/makeOrder/orderPaying?payMethod='+res.data.payMethod
})
}
}).finally(msg=>{
clearTimeout(this.timer)
})
},500)
}
})
}, 500)
}
},
tsetPlate(plateNumber) {
this.testPlateResult =
@@ -923,18 +953,18 @@
getNewSitePrice(channelId) {
this.oilSitePriceDetailsVo = []
oilSiteApi.getNewSitePriceZp({
channelId:channelId,
clientBelong: "ZHONGPIN"
channelId: channelId,
clientBelong: "ZHONGPIN"
}).then(res => {
if (res.code == 20000) {
this.plateNumbers = res.data.plateNumbers
this.oilSitePriceDetailsVo = res.data.oilSitePriceDetailsVo;
this.siteUserNames = res.data.siteUserNames;
if(this.oilSitePriceDetailsVo.length==1){
if (this.oilSitePriceDetailsVo.length == 1) {
this.radio = 0
this.activeSitePrice = res.data.oilSitePriceDetailsVo[0].priceId
}
}
})
},
@@ -944,7 +974,7 @@
pickPlate(e) {
this.plateIndex = e.detail.value
this.plateNumber = this.plateNumberSel
console.log(this.plateIndex, this.plateNumber)
// console.log(this.plateIndex, this.plateNumber)
},
showOrderMsg() {
this.showOrder = 'show'
@@ -975,16 +1005,16 @@
},
changePrice(e) {
this.radio = e.detail.value
console.log(e,'changePrice')
this.vol =''
console.log(e, 'changePrice')
this.vol = ''
this.activeSitePrice = this.oilSitePriceDetailsVo[this.radio].priceId
this.realMoney ='--'
this.realMoney = '--'
this.xoilAmountGun = '';
Object.keys(this.tyRes).forEach(key=>{
this.tyRes[key]=''
Object.keys(this.tyRes).forEach(key => {
this.tyRes[key] = ''
})
Object.keys(this.ty).forEach(key=>{
this.ty[key]=''
Object.keys(this.ty).forEach(key => {
this.ty[key] = ''
})
this.vlom = ''
// // console.log(this.radio)
@@ -999,13 +1029,13 @@
},
filters: {
moneyVolm(value) {
if (value != 'xxx.x') {
return Math.round(value * 100) / 100;
} else {
return value
}
if (value != 'xxx.x') {
return Math.round(value * 100) / 100;
} else {
return value
}
},
channelCodeFamt(value) {
if (value) {
@@ -1024,9 +1054,9 @@
}
}
},
moneyFormats(value){
moneyFormats(value) {
if (value != 'xxx.x') {
return Math.round(value * 100) / 100
return Math.round(value * 100) / 100
} else {
return value
}
@@ -1037,7 +1067,8 @@
} else {
return value
}
} }
}
}
}
</script>
@@ -1071,61 +1102,69 @@
.picker-view {
min-height: 300upx;
}
.close-icon{
.close-icon {
position: absolute;
right: 2%;
top: 2%;
}
.dialog-box{
.dialog-box {
position: relative;
}
.site-icon {
width: 2rem;
vertical-align: middle;
}
.my-tag {
padding: 0 12rpx;
}
.pay-bar>>>.self-btn {
padding: 0 64rpx;
height: 94rpx !important;
}
.pay-bar>.cu-item {
padding-right: 0;
}
.site-icon-sm {
width: 50upx;
}
.nowrap {
white-space: nowrap;
}
.picker-view {
min-height: 300upx;
}
.text-centerS{
.text-centerS {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}
.red_btn{
.red_btn {
color: #FFFFFF;
background-color: #1890FF;
}
.box-paddings{
padding:40rpx 0;
.box-paddings {
padding: 40rpx 0;
}
.headShow{
.headShow {
font-size: 36rpx;
font-weight: 600;
}
.showtext{
.showtext {
line-height: 2;
font-size: 30rpx;
margin-bottom: 30rpx;
@@ -1134,13 +1173,15 @@
letter-spacing: 3px;
text-align: left;
}
.checklocation_box_button{
.checklocation_box_button {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 5%;
}
.btn-box{
.btn-box {
width: 45%;
flex: 0 0 auto;
text-align: center;
@@ -1150,7 +1191,8 @@
box-sizing: border-box;
border: 2rpx solid #bfbfbf;
}
.box-panding{
padding:10 0;
.box-panding {
padding: 10 0;
}
</style>

View File

@@ -82,6 +82,7 @@
return tagList
}
},
activePay() {
if (this.channelList.length && this.channelList[this.TabCur]) {
let activePay = this.channelList[this.TabCur].activePay

View File

@@ -4,8 +4,10 @@
<block slot="content">中石化紫云路</block>
<block slot="backText">返回</block>
</cu-custom> -->
<view class="bg-img fixed-top flex align-end margin-bottom-lg " :style="'background-image: url('+otherImgURL+'bg.png '+');width: 750upx;height: 326rpx;background-size:cover'">
<image @tap="goBack" :src="imgURL+'site-back.png'" width="20upx" mode="widthFix" class="position-ab site-back">
<view class="bg-img fixed-top flex align-end margin-bottom-lg "
:style="'background-image: url('+otherImgURL+'bg.png '+');width: 750upx;height: 326rpx;background-size:cover'">
<image @tap="goBack" :src="imgURL+'site-back.png'" width="20upx" mode="widthFix"
class="position-ab site-back">
</image>
<view class="flex-sub">
<view class="cu-list menu margin padding-sm radius my-shadow bg-white yu-card-xuan">
@@ -28,8 +30,10 @@
</view>
</view>
</view>
<view class="bg-img placeholder-hidden flex align-end margin-bottom-lg " :style="'background-image: url('+imgURL+'site-bg.png '+');width: 750upx;height: 326rpx;background-size:cover'">
<image @tap="goBack" :src="imgURL+'site-back.png'" width="20upx" mode="widthFix" class="position-ab site-back">
<view class="bg-img placeholder-hidden flex align-end margin-bottom-lg "
:style="'background-image: url('+imgURL+'site-bg.png '+');width: 750upx;height: 326rpx;background-size:cover'">
<image @tap="goBack" :src="imgURL+'site-back.png'" width="20upx" mode="widthFix"
class="position-ab site-back">
</image>
<view class="flex-sub">
<view class="cu-list menu margin padding-sm radius my-shadow bg-white yu-card-xuan">
@@ -57,8 +61,9 @@
</view>
<!-- 价格 -->
<price-select-tab @onChangePayQr="onChangePayQr" @onChangePay="onChangePay" :active-cur="activeCur" :site-name="siteInfo.siteName"
:channel-list="siteInfo.oilSiteChannelDetailsVos" :channelJuli="siteInfo.juli"></price-select-tab>
<price-select-tab @onChangePayQr="onChangePayQr" @onChangePay="onChangePay" :active-cur="activeCur"
:site-name="siteInfo.siteName" :channel-list="siteInfo.oilSiteChannelDetailsVos"
:channelJuli="siteInfo.juli"></price-select-tab>
</view>
@@ -73,7 +78,8 @@
},
data() {
return {
otherImgURL:this.global.otherImgURL,
isBackPrev: true,
otherImgURL: this.global.otherImgURL,
radio: 'B',
mainURL: this.global.mainURL,
imgURL: this.global.imgURL,
@@ -82,7 +88,7 @@
siteInfo: {
},
activeCur:0,
activeCur: 0,
activePay: null,
qrcodePay: null,
@@ -95,6 +101,19 @@
}
},
onLoad(option) {
if (option.q) {
try {
let originLink = decodeURIComponent(option.q)
let target = this.obtainUrlPathParameterTarget(originLink)
let authorization = uni.getStorageSync('Authorization')
if (authorization && target.siteId) {
// 扫码进入 返回按钮点击回到首页
this.isBackPrev = false
this.getSiteInfo(target.siteId)
}
} catch (e) {}
return
}
// console.log(option.siteId)
if (this.tempScanSite) {
this.siteInfo = this.tempScanSite
@@ -104,17 +123,31 @@
}
},
methods: {
obtainUrlPathParameterTarget(url) {
let target = {}
if (url.includes('?')) {
let paramsText = url.split("?")[1]
let paramsArr = paramsText.split("&")
paramsArr.forEach(item => {
target[item.split('=')[0]] = item.split('=')[1]
})
}
return target
},
siteQrPay() {
uni.navigateTo({
url: '/BagStation/pages/stationDetail/stieQr'
})
},
getSiteInfo(id) {
let location = uni.getStorageSync('location') || {}
let data2 = {
...uni.getStorageSync('location'),
...location,
siteId: id,
clientBelong: "ZHONGPIN"
}
oilSiteApi.getSiteDetails(data2).then(res => {
if (res.code == 20000) {
this.siteInfo = res.data
@@ -142,8 +175,8 @@
},
goBack() {
uni.navigateBack({
this.isBackPrev ? uni.navigateBack() : uni.navigateBack({
url: '../../../pages/tabbar/home/home'
})
},
selectRadio() {
@@ -180,15 +213,14 @@
return value > 1000 ? ((value / 1000).toFixed(2) + 'km') : (value + 'm')
}
}
}
,
},
onHide() {
console.log('这里是hiden')
this.innerAudioContext.stop()
// this.innerAudioContext.stop()
},
onUnload() {
console.log('这里是卸载页面')
this.innerAudioContext.stop()
// this.innerAudioContext.stop()
},
}
</script>

View File

@@ -4,8 +4,10 @@
<block slot="content">中石化紫云路</block>
<block slot="backText">返回</block>
</cu-custom> -->
<view class="bg-img fixed-top flex align-end margin-bottom-lg " :style="'background-image: url('+otherImgURL+'bg.png '+');width: 750upx;height: 326rpx;background-size:cover'">
<image @tap="goBack" :src="imgURL+'site-back.png'" width="20upx" mode="widthFix" class="position-ab site-back">
<view class="bg-img fixed-top flex align-end margin-bottom-lg "
:style="'background-image: url('+otherImgURL+'bg.png '+');width: 750upx;height: 326rpx;background-size:cover'">
<image @tap="goBack" :src="imgURL+'site-back.png'" width="20upx" mode="widthFix"
class="position-ab site-back">
</image>
<view class="cu-list menu margin padding-sm radius my-shadow bg-white yu-card-xuan">
<view class="cu-item ">
@@ -24,14 +26,16 @@
<view class="oil-main-color">
<my-icon iconName="sy-der-icon.png" class="padding-right-xs text-sm"></my-icon>
<text v-if="!location">暂无信息</text>
<text v-else >{{siteInfo.juli|distanceFilter}}</text>
<text v-else>{{siteInfo.juli|distanceFilter}}</text>
</view>
</view>
</view>
</view>
</view>
<view class="bg-img placeholder-hidden flex align-end margin-bottom-lg " :style="'background-image: url('+imgURL+'site-bg.png '+');width: 750upx;height: 326rpx;background-size:cover'">
<image @tap="goBack" :src="imgURL+'site-back.png'" width="20upx" mode="widthFix" class="position-ab site-back">
<view class="bg-img placeholder-hidden flex align-end margin-bottom-lg "
:style="'background-image: url('+imgURL+'site-bg.png '+');width: 750upx;height: 326rpx;background-size:cover'">
<image @tap="goBack" :src="imgURL+'site-back.png'" width="20upx" mode="widthFix"
class="position-ab site-back">
</image>
<view class="flex-sub">
<view class="cu-list menu margin padding-sm radius my-shadow bg-white yu-card-xuan">
@@ -51,7 +55,7 @@
<view class="oil-main-color">
<my-icon iconName="sy-der-icon.png" class="padding-right-xs text-sm"></my-icon>
<text v-if="!location">暂无信息</text>
<text v-else >{{siteInfo.juli|distanceFilter}}</text>
<text v-else>{{siteInfo.juli|distanceFilter}}</text>
</view>
</view>
</view>
@@ -63,7 +67,7 @@
</view>
<!-- 价格 -->
<price-tab @onChangeChannelCode="getChannelCode" @onChangePayQr="onChangePayQr" @onChangePay="onChangePay"
:channel-list="siteInfo.oilSiteChannelDetailsVos" :siteInfo="siteInfo"></price-tab>
:channel-list="siteInfo.oilSiteChannelDetailsVos" :siteInfo="siteInfo"></price-tab>
<!-- 客户评价 -->
@@ -90,7 +94,8 @@
<text class=" text-black "> {{itm.oilsCode}} {{itm.volume}}L 节省 <text class="text-red">
{{itm.discountAmount}}</text></text>
</view>
<view class="cu-item no-border" v-if="siteInfo.oilSiteOrderInfoVos && !siteInfo.oilSiteOrderInfoVos.length">
<view class="cu-item no-border"
v-if="siteInfo.oilSiteOrderInfoVos && !siteInfo.oilSiteOrderInfoVos.length">
暂无
</view>
@@ -108,11 +113,11 @@
</view> -->
<view class="btn bg-white fixed ">
<view class="flex bg-white padding flex-direction">
<button class="cu-btn block bg-main-oil lg" @tap="makePay">
<button class="cu-btn block bg-main-oil lg" @tap="makePay">
<image class="site-icon margin-right-sm" :src="imgURL+'site-yz.png'" mode="widthFix">
</image>
一键支付
</button>
</button>
</view>
</view>
</view>
@@ -125,10 +130,10 @@
<view class="">
<image src="../../../static/img/errIcon.png" mode="" style="width:100rpx;height: 100rpx;"></image>
</view>
<view class="cu-bar box-panding text-centerS" >
<text class="headShow"> 支付提醒 </text>
<view class="cu-bar box-panding text-centerS">
<text class="headShow"> 支付提醒 </text>
</view>
<view class="cu-bar box-panding" >
<view class="cu-bar box-panding">
<text class="showtext">当前油站距离您较远请与加油员确认您选择的油站是否正确</text>
</view>
<view class="checklocation_box_button">
@@ -153,15 +158,15 @@
},
data() {
return {
location:null,
showtitle:false,
location: null,
showtitle: false,
radio: 'B',
mainURL: this.global.mainURL,
imgURL: this.global.imgURL,
otherImgURL:this.global.otherImgURL,
otherImgURL: this.global.otherImgURL,
active: 0,
ColorList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
siteInfo: { },
siteInfo: {},
activeCur: '',
activePay: null,
qrcodePay: null,
@@ -171,59 +176,68 @@
}
},
onHide() {
this.innerAudioContext && this.innerAudioContext.stop()
if (this.innerAudioContext) {
this.innerAudioContext.stop()
}
},
onUnload() {
this.innerAudioContext && this.innerAudioContext.stop()
},
if (this.innerAudioContext) {
this.innerAudioContext.stop()
this.innerAudioContext.destroy()
}
},
onLoad(option) {
this.location = uni.getStorageSync('location')
// console.log('option',option)
// let userInfo = uni.getStorageSync('user')
// if(!userInfo && option.q) {
// uni.redirectTo({
// url: `/BagAuth/pages/login/login?scanningParams=${option.q}`
// })
// return
// }
if(option.q) {
let originLink = decodeURIComponent(option.q)
let target = this.obtainUrlPathParameterTarget(originLink)
console.log('target',target)
if(target.siteId) {
this.siteId = target.siteId
this.getSiteInfo(target.siteId)
}
return
if (option.q) {
try {
let originLink = decodeURIComponent(option.q)
let target = this.obtainUrlPathParameterTarget(originLink)
let authorization = uni.getStorageSync('Authorization')
if (authorization && target.siteId) {
uni.showModal({
content: '该二维码非最新版,请提示油站工作人员更新',
success: res => {
if(res.confirm) {
this.siteId = target.siteId
this.gotoPay()
}
if(res.cancel) {
this.backTohome()
}
}
})
}
} catch (e) {}
return
}
if(!option.item){
let siteInfos = uni.getStorageSync('siteInfo')
var oilItem = JSON.parse(decodeURIComponent(siteInfos))
}else{
var oilItem = JSON.parse(decodeURIComponent(option.item));
}
console.log(oilItem,'oilItemoilItemoilItem')
uni.setStorageSync('oilItem',oilItem)
this.getSiteInfo(oilItem)
this.location = uni.getStorageSync('location')
if (!option.item) {
let siteInfos = uni.getStorageSync('siteInfo')
var oilItem = JSON.parse(decodeURIComponent(siteInfos))
} else {
var oilItem = JSON.parse(decodeURIComponent(option.item));
}
// console.log(oilItem, 'oilItemoilItemoilItem')
uni.setStorageSync('oilItem', oilItem)
this.getSiteInfo(oilItem)
this.siteId = oilItem.siteId
if(oilItem.listTag == '万金油'){
if (oilItem.listTag == '万金油') {
this.audioUrl = 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/wanjinyou.mp3'
}else if(oilItem.listTag == '星油'){
} else if (oilItem.listTag == '星油') {
this.audioUrl = 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/xingyouyunzhan.mp3'
}else if(oilItem.listTag == '壳牌'){
} else if (oilItem.listTag == '壳牌') {
this.audioUrl = 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/qiaopainew.mp3'
}else if(oilItem.listTag == '上汽联名卡'){
} else if (oilItem.listTag == '上汽联名卡') {
this.audioUrl = 'https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/shangqi.mp3'
}
this.ContextAudio(this.audioUrl);
this.ContextAudio(this.audioUrl);
},
methods: {
methods: {
obtainUrlPathParameterTarget(url) {
let target = {}
if(url.includes('?')) {
if (url.includes('?')) {
let paramsText = url.split("?")[1]
let paramsArr = paramsText.split("&")
paramsArr.forEach(item => {
@@ -233,28 +247,30 @@
return target
},
// 生成音频文件
ContextAudio(url){
ContextAudio(url) {
this.innerAudioContext = uni.createInnerAudioContext();
this.innerAudioContext.autoplay = true;
this.innerAudioContext.src = url;
this.innerAudioContext.onPlay(() => {
console.log('开始播放');
console.log('开始播放');
});
this.innerAudioContext.onError((res) => {
console.log(res);
console.log(res);
});
},
backTohome(){
this.innerAudioContext && this.innerAudioContext.stop()
backTohome() {
// this.innerAudioContext && this.innerAudioContext.stop()
uni.switchTab({
url:'../../../pages/tabbar/home/home'
url: '../../../pages/tabbar/home/home'
})
},
hidendialog(){
this.showtitle =false
hidendialog() {
this.showtitle = false
},
gotoPay(){
this.innerAudioContext && this.innerAudioContext.stop()
gotoPay() {
// this.innerAudioContext && this.innerAudioContext.stop()
// console.log('this.activeCur',this.activeCur)
// return
uni.navigateTo({
url: `/BagStation/pages/makeOrder/makeOrder?siteId=${this.siteId}&activeCur=${this.activeCur}`
})
@@ -264,7 +280,7 @@
this.secondChannelCode = sec
},
siteQrPay() {
this.innerAudioContext && this.innerAudioContext.stop()
// this.innerAudioContext && this.innerAudioContext.stop()
uni.navigateTo({
url: `/BagStation/pages/stationDetail/stieQr?siteId=${this.siteId}&activeChannelCode=${this.activeChannelCode}&secondChannelCode=${this.secondChannelCode}`
})
@@ -276,20 +292,20 @@
clientBelong: "ZHONGPIN"
}
let user = uni.getStorageSync('user');
if (user) {
if (user) {
oilSiteApi.getSiteDetails(data2).then(res => {
if (res.code == 20000) {
this.siteInfo = Object.assign(item,res.data);
this.siteInfo = Object.assign(item, res.data);
}
})
})
} else {
this.siteInfo = item;
}
},
makePay() {
let user = uni.getStorageSync('user');
if(!user){
if (!user) {
uni.showModal({
title: '请您登录',
content: "登录佰川加油才可以加油 |˛˙꒳​˙)♡",
@@ -304,10 +320,10 @@
});
return
}
if(this.siteInfo.juli > 1000 ){
if (this.siteInfo.juli > 1000) {
this.showtitle = true
}else{
this.innerAudioContext && this.innerAudioContext.stop()
} else {
// this.innerAudioContext && this.innerAudioContext.stop()
uni.navigateTo({
url: `/BagStation/pages/makeOrder/makeOrder?siteId=${this.siteId}&activeCur=${this.activeCur}`
})
@@ -335,7 +351,7 @@
},
goBack() {
// this.innerAudioContext.stop()
// this.innerAudioContext.stop()
uni.switchTab({
url: '/pages/tabbar/home/home'
@@ -486,69 +502,83 @@
.yu-card-xuan .action {
white-space: nowrap;
}.close-icon{
position: absolute;
right: 2%;
top: 2%;
}
.dialog-box{
position: relative;
}
.text-centerS{
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}
.red_btn{
color: #FFFFFF;
background-color: #1890FF ;
}
.box-paddings{
padding:40rpx 0;
}
.headShow{
font-size: 36rpx;
font-weight: 600;
}
.showtext{
line-height: 2;
font-size: 30rpx;
margin-bottom: 30rpx;
padding: 0 10%;
word-spacing: 10px;
letter-spacing: 3px;
text-align: left;
}
.checklocation_box_button{
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 5%;
}
.btn-box{
width: 45%;
flex: 0 0 auto;
text-align: center;
padding: 3%;
border-radius: 20rpx;
font-size: 28rpx;
box-sizing: border-box;
border: 2rpx solid #bfbfbf;
}
.box-panding{
padding:10 0;
}
.checklocation{
}
.close-icon {
position: absolute;
right: 2%;
top: 2%;
}
.dialog-box {
position: relative;
}
.text-centerS {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}
.red_btn {
color: #FFFFFF;
background-color: #1890FF;
}
.box-paddings {
padding: 40rpx 0;
}
.headShow {
font-size: 36rpx;
font-weight: 600;
}
.showtext {
line-height: 2;
font-size: 30rpx;
margin-bottom: 30rpx;
padding: 0 10%;
word-spacing: 10px;
letter-spacing: 3px;
text-align: left;
}
.checklocation_box_button {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 5%;
}
.btn-box {
width: 45%;
flex: 0 0 auto;
text-align: center;
padding: 3%;
border-radius: 20rpx;
font-size: 28rpx;
box-sizing: border-box;
border: 2rpx solid #bfbfbf;
}
.box-panding {
padding: 10 0;
}
.checklocation {
position: fixed;
top: 50%;
left: 20%;
right: 20%;
z-index: 999;
}
.checklocation_box{
.checklocation_box {
background-color: #FFFFFF;
}
.content {
min-height: 100%;
position: relative;