Merge pull request 'caolc' (#9) from caolc into master

Reviewed-on: http://192.168.0.140:3000/xkhl/LSM_OIL_SITE/pulls/9
This commit is contained in:
2022-04-25 17:12:52 +08:00
7 changed files with 316 additions and 114 deletions

View File

@@ -92,7 +92,7 @@
</view>
<view class="bottom text-left margin-top-xs margin-bottom-xs">
<text class="padding-left-xs text-lg">
<text class=" text-lg " v-if="item.volume">{{item.volume|numberFilter}} {{item.oilProductType=='GAS'?'KG':'L'}}</text>
<text class=" text-lg " v-if="item.volume">{{item.volume|numberFilter}} {{item.oilProductType=='GAS'?'L':'L'}}</text>
<!-- {{item.createTime}} -->
</text>
</view>

View File

@@ -129,8 +129,21 @@
this.longiCheck()
// //console.log('++++++++')
//console.log('这里是传值处menus',this.menusList)
this.getPosition()
},
methods: {
getPosition(){
let that = this
uni.getLocation({
type: 'gcj02',
success: function(res) {
uni.setStorage({
key:'location',
data:res
})
}
});
},
changMenus(data){
//console.log('这里是获取子级数据的地方+++++',data)
this.menusList =data

View File

@@ -105,11 +105,11 @@
name="input" /> -->
<view style="flex-grow: 1; display: flex;" @tap="showModel='show'">
<view v-if="hz(carNumber.charAt(0))" class="sign">
{{carNumber.charAt(0)||''}}
<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">{{carNumber.substr(1,6)||'请输入车牌号'}}</view>
<view class="flexcenter">{{String(carNumber).substr(1,6)||'请输入车牌号'}}</view>
</view>
<!-- <text class="cuIcon-roundclosefill text-gray"></text> -->
@@ -168,7 +168,10 @@
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>
<text style="margin-left: 75rpx; color: #222222;font-weight: bold;" >油站价格:{{insertResult.oilSitePrice }}/{{siteData.siteType|company }}</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>
@@ -203,13 +206,15 @@
<text>{{insertResult.vMoney|numberFilter}}</text>
</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"
<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" />
<view style="width: 170rpx;text-align: end;" class="textEllipsis">
<text class="">
<!-- {{ vlom? vlom:'xxx.x' }} L clc 注销 -->
{{vlom?'约' + ( (Math.round(vlom*100)/100).toFixed(2) ) + (siteData.siteType=='2'?'KG':'L'):''}}
<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>
@@ -226,7 +231,7 @@
</view>
</view>
</view>
<button class="margin round bg-main-oil" @tap="charge">立即下单</button>
<button :disabled="shake!==null" class="margin round bg-main-oil" @tap="charge"> {{shake==null?'立即下单':'下单中'}}</button>
</view>
</view>
<view class v-show="!beforePay&&isG7">
@@ -501,10 +506,10 @@
getMoney(e) {
console.log(e)
if (e.detail.value == '') {
uni.showToast({
title: '请输入金额',
icon: 'none'
})
// uni.showToast({
// title: '请输入金额',
// icon: 'none'
// })
return
}
let isNumber = this.isNumber(e.detail.value)
@@ -537,7 +542,8 @@
userType: uerTyps,
xoilAmountGun: e.detail.value,
priceId: this.activeSitePrice,
companyId: this.siteData.companyId
companyId: this.siteData.companyId,
createSource:this.siteData.siteType=='2'?'XOIL':''
}
}
this.xoilAmountGun = e.detail.value
@@ -627,6 +633,7 @@
this.changTypes = 0
},
charge() {
//防抖
clearTimeout(this.shake)
this.shake = setTimeout(()=>{
this.tsetPlate()
@@ -658,12 +665,14 @@
title: '车牌号校验不通过',
icon: 'none'
});
this.shake=null
}
} else {
uni.showToast({
title: '您选择的油品没有油价,不能加油',
icon: 'none'
});
this.shake=null
}
},500)
@@ -687,6 +696,7 @@
title: 'qrCode为空',
icon: 'none'
});
this.shake=null
return false
}
if (!data6.siteId) {
@@ -694,6 +704,7 @@
title: '请选择油站id',
icon: 'none'
});
this.shake=null
return false
}
if (!data6.companyId) {
@@ -701,6 +712,7 @@
title: '请选择企业id',
icon: 'none'
});
this.shake=null
return false
}
if (!data6.customerId) {
@@ -708,6 +720,7 @@
title: '请选择司机id',
icon: 'none'
});
this.shake=null
return false
}
if (!data6.volume) {
@@ -715,6 +728,7 @@
title: '请输入加油体积',
icon: 'none'
});
this.shake=null
return false
}
oliSiteApi.FYPay(data6).then(res => {
@@ -741,7 +755,7 @@
this.getPayStatus(this.orderId)
}, 400)
}
this.shake=null
}
})
},
@@ -764,6 +778,7 @@
title: 'qrCode为空',
icon: 'none'
});
this.shake=null
return false
}
if (!data6.siteId) {
@@ -771,6 +786,7 @@
title: '请选择油站id',
icon: 'none'
});
this.shake=null
return false
}
if (!data6.companyId) {
@@ -778,6 +794,7 @@
title: '请选择企业id',
icon: 'none'
});
this.shake=null
return false
}
if (!data6.customerId) {
@@ -785,6 +802,7 @@
title: '请选择司机id',
icon: 'none'
});
this.shake=null
return false
}
if (!data6.volume) {
@@ -792,6 +810,7 @@
title: '请输入加油体积',
icon: 'none'
});
this.shake=null
return false
}
oliSiteApi.sfPay(data6).then(res => {
@@ -818,7 +837,7 @@
// this.getPayStatus(this.orderId)
// }, 400)
// }
this.shake=null
}
})
},
@@ -857,6 +876,7 @@
title: '请选择油品',
icon: 'none'
});
this.shake=null
return false
}
if (!data6.volume) {
@@ -864,6 +884,7 @@
title: '请输入加油体积',
icon: 'none'
});
this.shake=null
return false
}
oliSiteApi.RrsPay(data6).then(res => {
@@ -903,7 +924,7 @@
this.getPayStatus(this.orderId)
}, 400)
}
this.shake=null
}
})
},
@@ -913,6 +934,7 @@
let PlateNumberImages = this.PlateNumberImages,
refuellerImages = this.refuellerImages
if (PlateNumberImages == '') {
this.shake=null
uni.showToast({
icon: 'none',
title: '请上传车辆照片'
@@ -924,6 +946,7 @@
icon: 'none',
title: '请上传油机照片'
})
this.shake=null
return
}
var data6 = {
@@ -950,7 +973,7 @@
oilCardType: this.siteData.oilCardNature, //类型String 必有字段 备注:油卡性质 1个人 2企业 3外请
accountCardCode: this.siteData.accountCardCode, //类型String 必有字段 备注:油卡卡号
siteUserName: "1", //类型String 必有字段 备注:加油员名称
version: 1, //类型Number 必有字段 备注:版本号
version: this.siteData.siteType=='2'?null:'1', //类型Number 必有字段 备注:版本号
xoilAmountGun: this.insertResult.vol, //类型String 必有字段 备注:加油升数
}
} else {
@@ -975,7 +998,7 @@
oilCardType: this.siteData.oilCardNature, //类型String 必有字段 备注:油卡性质 1个人 2企业 3外请
accountCardCode: this.siteData.accountCardCode, //类型String 必有字段 备注:油卡卡号
siteUserName: "1", //类型String 必有字段 备注:加油员名称
version: 1, //类型Number 必有字段 备注:版本号
version: this.siteData.siteType=='2'?null:"1", //类型Number 必有字段 备注:版本号
xoilAmountGun: this.insertResult.vol, //类型String 必有字段 备注:加油升数
}
}
@@ -985,17 +1008,80 @@
title: '请选择油品',
icon: 'none'
});
this.shake=null
return false
}
if (!data6.volume) {
uni.showToast({
title: '请输入加油体积',
icon: 'none'
});
if (!Number(data6.volume)) {
if(this.siteData.siteType=='2'){
uni.showToast({
title: '请输入加油升数',
icon: 'none'
});
}else{
uni.showToast({
title: '请输入加油金额',
icon: 'none'
});
}
this.shake=null
return false
}
let location = uni.getStorageSync('location')||{longitude:'',latitude:''};
// if(!location){
// let locationChenk = true
// let that = this
// uni.getLocation({
// type: 'gcj02',
// success: function(res) {
// uni.setStorage({
// key:'location',
// data:res
// })
// },
// fail(e) {
// locationChenk = false
// },
// });
// if(!locationChenk){
// uni.showToast({
// title:'请授权位置',
// icon:'error'
// })
// }
// console.log(location,'**************************************************')
// return
// }
// uni.getLocation({
// type: 'gcj02',
// success: function(res) {
// uni.setStorage({
// key:'location',
// data:res
// })
// },
// fail(e) {
// uni.showModal({
// title:'获取定位',
// content:'是否重新获取定位?',
// success:function(e){
// wx.openSetting({
// success:function(e){
// if (res.authSetting['scope.userLocation']){
// console.log('******')
// }
// },
// fail:function(e){
// console.log(e,'//////')
// }
// })
// }
// })
// },
// });
// return
//
console.log(data6, 'data6+++++')
oliSiteApi.xoilPay(data6).then(res => {
oliSiteApi.xoilPay(Object.assign(data6,{longitude:location.longitude,latitude:location.latitude})).then(res => {
console.log(res)
if (res.code === 20000) {
uni.showToast({
@@ -1017,7 +1103,6 @@
// createDatetime: res.data.orderTime,
// realamount: res.data.payRealAmount,
// istate: res.data.orderStatus
// }
// uni.setStorageSync('tempOrderInfo', data8)
uni.setStorageSync('orderSource', 'mpxoil')
@@ -1033,8 +1118,8 @@
this.getPayStatus(this.orderId)
}, 400)
}
}
this.shake=null
})
},
// 收费则yi
@@ -1061,6 +1146,7 @@
title: '请选择油品',
icon: 'none'
});
this.shake=null
return false
}
if (!data6.volume) {
@@ -1068,6 +1154,7 @@
title: '请输入加油体积',
icon: 'none'
});
this.shake=null
return false
}
oliSiteApi.zeyiPay(data6).then(res => {
@@ -1108,7 +1195,7 @@
this.getPayStatus(this.orderId)
}, 400)
}
this.shake=null
}
})
},
@@ -1172,7 +1259,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
@@ -1316,7 +1403,7 @@
if(e){
return e=='2' ?'KG':'L';
} else {
return 'L'
return ''
}
},
moneyVolm(value) {