pull/7/head
zhangyouji 1 year ago
parent f96dccb8c8
commit abe3126e89
  1. 7
      api/oli-user.js
  2. 101
      pages/stationDetail/ZYSite.vue

@ -94,4 +94,11 @@ export default{
method: 'GET'
})
},
// 查询企业配置
getCompanyConfigByCompanyId(id) {
return request({
url: `/${service_name}/sysCompanyConfig/getCompanyConfigByCompanyId/${id}`,
method: 'GET'
})
},
}

@ -116,6 +116,19 @@
<text class="cuIcon-write text-orange"></text>
</view>
<view class="cu-form-group margin margin-top-0 radius">
<view class="title text-black ">
车牌识别
</view>
<view @tap="srcPhoto" class="text-center" style="width: 60%;margin: 0 2%;">
<input v-model="plateNumberOcr" type="digit" class="block"
placeholder="请点击拍照识别车牌" value="" style="border-bottom: 1px solid #efefef;" />
</view>
<view @tap="srcPhoto">
<uni-icons type="camera-filled" size="30"></uni-icons>
</view>
</view>
<!-- 油品卡片 -->
<view class="padding-top-xs margin margin-top-xs margin-bottom-0 padding-bottom radius">
@ -309,6 +322,7 @@
import g7Api from '@/api/g7.js'
import utils from '@/utils/encode'
import PlateNumberPicker from '@/components/plate-number-picker/plate-number-picker.vue'
import user from '@/api/oli-user.js'
export default {
components: {
PlateNumberPicker
@ -375,6 +389,8 @@
type: '',
curIndex: null,
InputNumber: 0,
plateNumberOcr:'',
plateNumberOcrShow:false
}
},
onLoad(option) {
@ -416,6 +432,7 @@
this.timer = null;
}
},
watch: {
oilTypeList: {
handler(newVal, oldVal) {
@ -466,6 +483,60 @@
},
methods: {
getCompanyConfig(companyId){
if(companyId){
user.getCompanyConfigByCompanyId(companyId).then(res=>{
console.log(res,'res')
if(res.data.plateNumberOcr==1){
this.plateNumberOcrShow = true
}else{
this.plateNumberOcrShow = false
}
})
}
},
srcPhoto(){
let _that = this
uni.chooseImage({
count: 1, //9
sizeType: ['original', 'compressed'], //
sourceType: ['camera'], //
success: function(res) {
uni.showLoading({
title: '识别中',
mask: true
});
const JSESSIONID = utils.uuid()
uni.uploadFile({
url: 'http://uat.xingoil.com/adminapi/oil-oss/obejct/carNoIdentify',
filePath: res.tempFilePaths[0],
name: 'file',
header: {
"Content-Type": "multipart/form-data",
"Authorization": uni.getStorageSync('Authorization'),
'dataSources': 'MP',
"imei": uni.getStorageSync('unionid'),
"openId": uni.getStorageSync('openid'),
'JSESSIONID': JSESSIONID,
'token': utils.md5Salt(JSESSIONID)
},
success(e) {
uni.hideLoading()
console.log(e)
let obj = JSON.parse(e.data)
console.log(obj,obj.data,obj.data.carNo)
_that.plateNumberOcr = obj.data.carNo
},fail(res){
uni.hideLoading()
}
})
}
})
},
hz(e){
// carNumber.length>0
// console.log(new RegExp("[\u4E00-\u9FA5]+").test(e),'*-*-*-*-*-*')
@ -1066,6 +1137,32 @@
xoilAmountGun: this.insertResult.vol, //String
}
} else {
if(this.plateNumberOcrShow == true){
var data6 = {
siteId: this.siteData.siteId,
priceId: this.insertResult.priceId,
customerOrderId: this.siteData.customerOrderId,
volume: this.insertResult.vol,
plateNumberImage: this.PlateNumberImages,
engineImage: this.refuellerImages,
createSource: "WECHAT_MINIAPPS", //String
orderSource: "WECHAT_MINIAPPS",
vehicleLicenseNum: this.plateNumberOcr,
customerId: this.siteData.customerId, //String id
companyId: this.siteData.companyId, //String id
oilsBar: this.insertResult.bar,
oilsCode: this.insertResult.oilProductCode,
orderMethod: "SITE_SCAN", //String
suppleMark: 0,
orderType: "REAL_ORDER", //String ( REAL_ORDER VIRTUAL_ORDER)
payChannel: "BALANCE_PAYMENT", //String
oilCardType: this.siteData.oilCardNature, //String 1 2 3
accountCardCode: this.siteData.accountCardCode, //String
siteUserName: "1", //String
version: this.siteData.siteType=='2'?null:"1", //Number
xoilAmountGun: this.insertResult.vol, //String
}
}else{
var data6 = {
siteId: this.siteData.siteId,
priceId: this.insertResult.priceId,
@ -1092,6 +1189,8 @@
}
}
}
if (!data6.oilsCode) {
uni.showToast({
title: '请选择油品',
@ -1372,7 +1471,7 @@
} else if (res.data.plateNumbers) {
this.carNumber = res.data.plateNumbers[0]
}
this.getCompanyConfig(res.data.companyId)
} else {
uni.showToast({
title: res.msg ? res.msg : '请确认是否油站二维码',

Loading…
Cancel
Save