更新
This commit is contained in:
@@ -32,7 +32,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group margin margin-top-0 radius" v-if="type!= 'rrs'">
|
<view class="cu-form-group margin margin-top-0 radius" v-if="type!= 'rrs'">
|
||||||
<view class="title mini-label text-black">车牌号</view>
|
<view class="title mini-label text-black">车牌号</view>
|
||||||
<input :maxlength="7" @tap="showModel='show'" v-model="carNumber" disabled placeholder="请输入车牌号"
|
<input :maxlength="7" @tap="showModel='show'" v-model="carNumber" disabled placeholder="请输入车牌号"
|
||||||
name="input" />
|
name="input" />
|
||||||
@@ -58,49 +58,53 @@
|
|||||||
<text class="s-rich">市场价¥{{insertResult.oilSitePrice|numberFilter}}/L</text>
|
<text class="s-rich">市场价¥{{insertResult.oilSitePrice|numberFilter}}/L</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="grid col-5 padding-top justify-start">
|
<view class="grid col-5 padding-top justify-start">
|
||||||
<view class="padding-xs" v-for="(item,index) in siteData.oilSitePriceDetailsVos" @tap="oilNameSel(item)"
|
<view class="padding-xs" v-for="(item,index) in siteData.oilSitePriceDetailsVos"
|
||||||
:key="item.priceId">
|
@tap="oilNameSel(item)" :key="item.priceId">
|
||||||
<button class="cu-btn"
|
<button class="cu-btn"
|
||||||
:class="[insertResult.oilProductCode===item.oilProductCode?'bg-main-oil':'line-gray']">{{item.oilProductCode}}</button>
|
:class="[insertResult.oilProductCode===item.oilProductCode?'bg-main-oil':'line-gray']">{{item.oilProductCode}}</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- **** 抢号选择 -->
|
<!-- **** 抢号选择 -->
|
||||||
<view class="padding padding-bottom-0 padding-top-xs bg-white">
|
<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 style="color: #333333;font-size: 30rpx;" class="padding-bottom-sm text-lg">枪号选择:</view>
|
||||||
<view class="grid col-5 justify-start">
|
<view class="grid col-5 justify-start">
|
||||||
<view style="width: calc(100% / 4);" class="padding-xs" v-for="(item,index) in ColorList" :key="index">
|
<view style="width: calc(100% / 4);" class="padding-xs" v-for="(item,index) in ColorList"
|
||||||
<button @tap="gunIdSel(index)" :style="{width: '100%',color:insertResult.bar===index+1?'':'#333333'}" class="cu-btn"
|
:key="index">
|
||||||
:class="[insertResult.bar===index+1?'bg-main-oil':'line-gray']">{{index+1}}</button>
|
<button @tap="gunIdSel(index)"
|
||||||
</view>
|
:style="{width: '100%',color:insertResult.bar===index+1?'':'#333333'}" class="cu-btn"
|
||||||
</view>
|
:class="[insertResult.bar===index+1?'bg-main-oil':'line-gray']">{{index+1}}</button>
|
||||||
</view>
|
</view>
|
||||||
<!-- ***油品金额区域 insertResult.oilProductCode 动态控制显示加注的类型和单位 KG/L -->
|
</view>
|
||||||
<view class=" padding bg-white">
|
</view>
|
||||||
<view class="shadow-warp bg-white">
|
<!-- ***油品金额区域 insertResult.oilProductCode 动态控制显示加注的类型和单位 KG/L -->
|
||||||
<view class="cu-form-group">
|
<view class=" padding bg-white">
|
||||||
<view class="title newtitle"> {{siteData.siteType=='2'?'加气升数':'加油金额'}}</view>
|
<view class="shadow-warp bg-white">
|
||||||
<input class="newtitle" :placeholder="`请输入${siteData.siteType=='2'?'加气升数':'加油金额'}`" @input="checkNumber" type="digit"
|
<view class="cu-form-group">
|
||||||
v-model="insertResult.vol" name="input" />
|
<view class="title newtitle"> {{siteData.siteType=='2'?'加气升数':'加油金额'}}</view>
|
||||||
<view style="width: 170rpx;text-align: end;" class="textEllipsis">
|
<input class="newtitle" :placeholder="`请输入${siteData.siteType=='2'?'加气升数':'加油金额'}`"
|
||||||
<text class="">
|
@input="checkNumber" type="digit" v-model="insertResult.vol" name="input" />
|
||||||
<text v-if="siteData.siteType!='2'">{{vlom?'约' + ( (Math.round(vlom*100)/100).toFixed(2) ) + (siteData.siteType=='2'?'元':'L'):''}}</text>
|
<view style="width: 170rpx;text-align: end;" class="textEllipsis">
|
||||||
<text v-if="siteData.siteType=='2'">{{vlom?'约' + ( insertResult.vDoMoney ? insertResult.vDoMoney+insertResult.discountMoney:'') + (siteData.siteType=='2'?'元':'L'):''}}</text>
|
<text class="">
|
||||||
</text>
|
<text
|
||||||
</view>
|
v-if="siteData.siteType!='2'">{{vlom?'约' + ( numberHandle(vlom) ) + (siteData.siteType=='2'?'元':'L'):''}}</text>
|
||||||
</view>
|
<text
|
||||||
<view class="my-cell">
|
v-if="siteData.siteType=='2'">{{vlom?'约' + ( insertResult.vDoMoney ? insertResult.vDoMoney+insertResult.discountMoney:'') + (siteData.siteType=='2'?'元':'L'):''}}</text>
|
||||||
<text class="font-12">星卡优惠金额</text>
|
</text>
|
||||||
<text
|
</view>
|
||||||
class="fr">-¥{{insertResult.discountMoney ?insertResult.discountMoney :'' |numberFilter}}</text>
|
</view>
|
||||||
</view>
|
<view class="my-cell">
|
||||||
<view class="my-cell">
|
<text class="font-12">星卡优惠金额</text>
|
||||||
<text class="font-12">实际支付金额</text>
|
<text
|
||||||
<text
|
class="fr">-¥{{insertResult.discountMoney ?insertResult.discountMoney :'' |numberFilter}}</text>
|
||||||
class="oil-main-color fr">¥{{insertResult.vDoMoney ?insertResult.vDoMoney :''|numberFilter}}</text>
|
</view>
|
||||||
</view>
|
<view class="my-cell">
|
||||||
</view>
|
<text class="font-12">实际支付金额</text>
|
||||||
</view>
|
<text
|
||||||
|
class="oil-main-color fr">¥{{insertResult.vDoMoney ?insertResult.vDoMoney :''|numberFilter}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<button class="margin round bg-main-oil" @tap="charge">确定</button>
|
<button class="margin round bg-main-oil" @tap="charge">确定</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -183,8 +187,8 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
changTypes:0,
|
changTypes: 0,
|
||||||
vlom: '',
|
vlom: '',
|
||||||
siteData: {
|
siteData: {
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -235,14 +239,14 @@
|
|||||||
},
|
},
|
||||||
orderKey: '',
|
orderKey: '',
|
||||||
payState: '0',
|
payState: '0',
|
||||||
type : ''
|
type: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
console.log("option============",option) //接收option.type
|
console.log("option============", option) //接收option.type
|
||||||
if(option.type =='rrs'){
|
if (option.type == 'rrs') {
|
||||||
console.log('这里是日日顺')
|
console.log('这里是日日顺')
|
||||||
this.type = 'rrs' //根据option.type 进行本地赋值
|
this.type = 'rrs' //根据option.type 进行本地赋值
|
||||||
}
|
}
|
||||||
@@ -271,10 +275,11 @@
|
|||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
},
|
},
|
||||||
selected: function(newVal, oldVal){
|
selected: function(newVal, oldVal) {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
this.selected = newVal
|
this.selected = newVal
|
||||||
console.log('selected发生变化',this.insertResult.oilSitePrice,this.selected.oilSitePrice,this.insertResult.realPrice,this.selected.xkPrice)
|
console.log('selected发生变化', this.insertResult.oilSitePrice, this.selected.oilSitePrice, this
|
||||||
|
.insertResult.realPrice, this.selected.xkPrice)
|
||||||
// oilSitePrice 市场价格 sitePrice 实际加油价格
|
// oilSitePrice 市场价格 sitePrice 实际加油价格
|
||||||
if (this.selected.oilSitePrice) {
|
if (this.selected.oilSitePrice) {
|
||||||
this.insertResult.oilSitePrice = this.selected.oilSitePrice
|
this.insertResult.oilSitePrice = this.selected.oilSitePrice
|
||||||
@@ -299,98 +304,104 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeType(){
|
numberHandle(num) {
|
||||||
|
num *= 10000
|
||||||
|
num /= 100
|
||||||
|
num = Math.ceil(num) / 100
|
||||||
|
return num.toFixed(2)
|
||||||
|
},
|
||||||
|
changeType() {
|
||||||
this.changTypes = 1
|
this.changTypes = 1
|
||||||
},
|
},
|
||||||
backType(){
|
backType() {
|
||||||
this.changTypes = 0
|
this.changTypes = 0
|
||||||
},
|
},
|
||||||
checkNumber(e) {
|
checkNumber(e) {
|
||||||
e.detail.value = e.detail.value.match(/^\d*(\.?\d{0,2})/g)[0] || null;
|
e.detail.value = e.detail.value.match(/^\d*(\.?\d{0,2})/g)[0] || null;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.insertResult.vol = e.detail.value
|
this.insertResult.vol = e.detail.value
|
||||||
this.getMoney(e)
|
this.getMoney(e)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
oilNameSel(item) {
|
oilNameSel(item) {
|
||||||
console.log(item, 'item')
|
console.log(item, 'item')
|
||||||
this.selected = {
|
this.selected = {
|
||||||
...item
|
...item
|
||||||
}
|
}
|
||||||
this.activeSitePrice = item.priceId
|
this.activeSitePrice = item.priceId
|
||||||
console.log(this.insertResult.vol)
|
console.log(this.insertResult.vol)
|
||||||
let e = {
|
let e = {
|
||||||
detail:{
|
detail: {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e.detail.value = this.insertResult.vol
|
e.detail.value = this.insertResult.vol
|
||||||
this.getMoney(e)
|
this.getMoney(e)
|
||||||
console.log('选择你/n', this.selected, '/n')
|
console.log('选择你/n', this.selected, '/n')
|
||||||
},
|
},
|
||||||
isNumber(value) { // 判断是否为正常数字
|
isNumber(value) { // 判断是否为正常数字
|
||||||
const regPos = /^\d+(\.\d+)?$/; //非负浮点数
|
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]*)))$/; //负浮点数
|
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
|
return false
|
||||||
}
|
}
|
||||||
if (regPos.test(value) || regNeg.test(value)) {
|
if (regPos.test(value) || regNeg.test(value)) {
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getMoney(e) {
|
getMoney(e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
if (e.detail.value == '') {
|
if (e.detail.value == '') {
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: '请输入金额',
|
// title: '请输入金额',
|
||||||
// icon: 'none'
|
// icon: 'none'
|
||||||
// })
|
// })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let isNumber = this.isNumber(e.detail.value)
|
let isNumber = this.isNumber(e.detail.value)
|
||||||
if (!isNumber) {
|
if (!isNumber) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请输入正确金额',
|
title: '请输入正确金额',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.InputNumber = e
|
this.InputNumber = e
|
||||||
if (this.siteData.oilCardNature == 1) {
|
if (this.siteData.oilCardNature == 1) {
|
||||||
var uerTyps = '0' // 0是个人 1是企业
|
var uerTyps = '0' // 0是个人 1是企业
|
||||||
} else {
|
} else {
|
||||||
console.log('当前为企业')
|
console.log('当前为企业')
|
||||||
var uerTyps = '1' // 0是个人 1是企业
|
var uerTyps = '1' // 0是个人 1是企业
|
||||||
}
|
}
|
||||||
if (this.type == 'ZEYI' || this.type == 'RIRISHUN') {
|
if (this.type == 'ZEYI' || this.type == 'RIRISHUN') {
|
||||||
var number = {
|
var number = {
|
||||||
payType: 'SITE_SCAN',
|
payType: 'SITE_SCAN',
|
||||||
userType: uerTyps,
|
userType: uerTyps,
|
||||||
xoilAmountGun: e.detail.value,
|
xoilAmountGun: e.detail.value,
|
||||||
priceId: this.activeSitePrice,
|
priceId: this.activeSitePrice,
|
||||||
companyId: this.siteData.companyId,
|
companyId: this.siteData.companyId,
|
||||||
createSource: this.type
|
createSource: this.type
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var number = {
|
var number = {
|
||||||
payType: 'SITE_SCAN',
|
payType: 'SITE_SCAN',
|
||||||
userType: uerTyps,
|
userType: uerTyps,
|
||||||
xoilAmountGun: e.detail.value,
|
xoilAmountGun: e.detail.value,
|
||||||
priceId: this.activeSitePrice,
|
priceId: this.activeSitePrice,
|
||||||
companyId: this.siteData.companyId,
|
companyId: this.siteData.companyId,
|
||||||
createSource:this.siteData.createSource
|
createSource: this.siteData.createSource
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.xoilAmountGun = e.detail.value
|
this.xoilAmountGun = e.detail.value
|
||||||
let _that = this
|
let _that = this
|
||||||
oliSiteApi.getOrderDiscountInfo(number).then(res => {
|
oliSiteApi.getOrderDiscountInfo(number).then(res => {
|
||||||
this.insertResult.vDoMoney = res.data.payRealAmount
|
this.insertResult.vDoMoney = res.data.payRealAmount
|
||||||
this.insertResult.discountMoney = res.data.oilDiscountAmount
|
this.insertResult.discountMoney = res.data.oilDiscountAmount
|
||||||
_that.vlom = res.data.volume.toFixed(2)
|
_that.vlom = res.data.volume
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
charge() {
|
charge() {
|
||||||
this.tsetPlate()
|
this.tsetPlate()
|
||||||
console.log(this.plateText)
|
console.log(this.plateText)
|
||||||
@@ -409,19 +420,20 @@
|
|||||||
|
|
||||||
// 支付订单
|
// 支付订单
|
||||||
saveOrder() {
|
saveOrder() {
|
||||||
console.log("加油升数:",this.vlom)
|
console.log("加油升数:", this.vlom)
|
||||||
console.log("加油金额:",this.insertResult.vol)
|
console.log("加油金额:", this.insertResult.vol)
|
||||||
const orderParams = {
|
const orderParams = {
|
||||||
siteId: this.siteData.siteId,
|
siteId: this.siteData.siteId,
|
||||||
oilsId: this.insertResult.priceId,
|
oilsId: this.insertResult.priceId,
|
||||||
volume: this.siteData.siteType=='2'?this.insertResult.vol:this.vlom,
|
volume: this.siteData.siteType == '2' ? this.insertResult.vol : this.vlom,
|
||||||
orderNum:this.siteData.otherSerialNumber,
|
orderNum: this.siteData.otherSerialNumber,
|
||||||
customerOrderId: this.siteData.customerOrderId,
|
customerOrderId: this.siteData.customerOrderId,
|
||||||
money: this.siteData.siteType=='2'?this.insertResult.vDoMoney+this.insertResult.discountMoney:this.insertResult.vol,
|
money: this.siteData.siteType == '2' ? this.insertResult.vDoMoney + this.insertResult
|
||||||
|
.discountMoney : this.insertResult.vol,
|
||||||
createSource: "WECHAT_MINIAPPS", //类型:String 必有字段 备注:创建来源
|
createSource: "WECHAT_MINIAPPS", //类型:String 必有字段 备注:创建来源
|
||||||
orderSource: "WECHAT_MINIAPPS",
|
orderSource: "WECHAT_MINIAPPS",
|
||||||
driverName:this.siteData.customerName,
|
driverName: this.siteData.customerName,
|
||||||
driverPhone:this.siteData.customerPhone,
|
driverPhone: this.siteData.customerPhone,
|
||||||
plateNumber: this.carNumber,
|
plateNumber: this.carNumber,
|
||||||
customerId: this.siteData.customerId, //类型:String 必有字段 备注:司机id
|
customerId: this.siteData.customerId, //类型:String 必有字段 备注:司机id
|
||||||
companyId: this.siteData.companyId, //类型:String 必有字段 备注:企业id
|
companyId: this.siteData.companyId, //类型:String 必有字段 备注:企业id
|
||||||
@@ -519,13 +531,14 @@
|
|||||||
oliSiteApi.verifyQrCode(this.zyInfo).then(res => {
|
oliSiteApi.verifyQrCode(this.zyInfo).then(res => {
|
||||||
if (res.code === 20000) {
|
if (res.code === 20000) {
|
||||||
this.siteData = res.data
|
this.siteData = res.data
|
||||||
if(res.data.oilSitePriceDetailsVos){
|
if (res.data.oilSitePriceDetailsVos) {
|
||||||
this.insertResult = Object.assign(this.insertResult,res.data.oilSitePriceDetailsVos[0])
|
this.insertResult = Object.assign(this.insertResult, res.data.oilSitePriceDetailsVos[
|
||||||
|
0])
|
||||||
console.log(this.insertResult)
|
console.log(this.insertResult)
|
||||||
}
|
}
|
||||||
this.carNumber = res.data.plateNumber;
|
this.carNumber = res.data.plateNumber;
|
||||||
this.selected = res.data.oilSitePriceDetailsVos[0]
|
this.selected = res.data.oilSitePriceDetailsVos[0]
|
||||||
this.activeSitePrice = this.selected.priceId
|
this.activeSitePrice = this.selected.priceId
|
||||||
} else {
|
} else {
|
||||||
console.log('此处为verifyQrCode false')
|
console.log('此处为verifyQrCode false')
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -541,22 +554,24 @@
|
|||||||
tRadio() {
|
tRadio() {
|
||||||
this.radio === 'A' ? this.radio = '' : this.radio = 'A'
|
this.radio === 'A' ? this.radio = '' : this.radio = 'A'
|
||||||
},
|
},
|
||||||
changeMoney(){
|
changeMoney() {
|
||||||
this.insertResult.vMoney = this.insertResult.vol * this.selected.oilSitePrice
|
this.insertResult.vMoney = this.insertResult.vol * this.selected.oilSitePrice
|
||||||
this.insertResult.discountMoney = this.insertResult.vol * (this.selected.oilSitePrice - this.insertResult.sitePrice)
|
this.insertResult.discountMoney = this.insertResult.vol * (this.selected.oilSitePrice - this.insertResult
|
||||||
|
.sitePrice)
|
||||||
this.insertResult.vDoMoney = this.insertResult.vol * this.selected.sitePrice
|
this.insertResult.vDoMoney = this.insertResult.vol * this.selected.sitePrice
|
||||||
},
|
},
|
||||||
calcMoney(e) {
|
calcMoney(e) {
|
||||||
// console.log(e)
|
// console.log(e)
|
||||||
if(this.changTypes = 1){
|
if (this.changTypes = 1) {
|
||||||
let rrs = e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]; // 处理输入油升数 只保留小数点后两位
|
let rrs = e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]; // 处理输入油升数 只保留小数点后两位
|
||||||
this.$nextTick(() => { //重新赋值给input
|
this.$nextTick(() => { //重新赋值给input
|
||||||
this.insertResult.vol= rrs
|
this.insertResult.vol = rrs
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// oilSitePrice 市场价格 sitePrice 实际加油价格
|
// oilSitePrice 市场价格 sitePrice 实际加油价格
|
||||||
this.insertResult.vMoney = this.insertResult.vol * this.selected.oilSitePrice
|
this.insertResult.vMoney = this.insertResult.vol * this.selected.oilSitePrice
|
||||||
this.insertResult.discountMoney = this.insertResult.vol * (this.selected.oilSitePrice - this.insertResult.sitePrice)
|
this.insertResult.discountMoney = this.insertResult.vol * (this.selected.oilSitePrice - this.insertResult
|
||||||
|
.sitePrice)
|
||||||
this.insertResult.vDoMoney = this.insertResult.vol * this.selected.sitePrice
|
this.insertResult.vDoMoney = this.insertResult.vol * this.selected.sitePrice
|
||||||
},
|
},
|
||||||
queryTimer() {
|
queryTimer() {
|
||||||
|
|||||||
Reference in New Issue
Block a user