OCR
This commit is contained in:
@@ -189,11 +189,17 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view>
|
<view class=" menu cu-list " v-if="plateNumberOcrShow==true">
|
||||||
<view>车牌识别</view>
|
<view class="cu-item nowrap">
|
||||||
<view>
|
<view class="text-bold ">
|
||||||
<view class="cu-tn btn-box" @tap="srcPhoto">
|
车牌识别
|
||||||
拍照
|
</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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -517,13 +523,16 @@
|
|||||||
activeChannelCode: '',
|
activeChannelCode: '',
|
||||||
checkBar: [],
|
checkBar: [],
|
||||||
realMoney: '',
|
realMoney: '',
|
||||||
xoilAmountGun: ''
|
xoilAmountGun: '',
|
||||||
|
plateNumberOcr:'',
|
||||||
|
plateNumberOcrShow:false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
let oilItem = uni.getStorageSync('oilItem'),
|
let oilItem = uni.getStorageSync('oilItem'),
|
||||||
oilSite = uni.getStorageSync(''),
|
oilSite = uni.getStorageSync(''),
|
||||||
otherUser = uni.getStorageSync('otherUserInfo')
|
otherUser = uni.getStorageSync('otherUserInfo'),
|
||||||
|
companyId = JSON.parse(uni.getStorageSync('companyCard')).companyId
|
||||||
if (otherUser) {
|
if (otherUser) {
|
||||||
// console.log('这里是卡里')
|
// console.log('这里是卡里')
|
||||||
this.isOtherUser = true
|
this.isOtherUser = true
|
||||||
@@ -533,6 +542,8 @@
|
|||||||
console.log('oilItem', oilItem)
|
console.log('oilItem', oilItem)
|
||||||
this.showtitles = oilItem.listTag;
|
this.showtitles = oilItem.listTag;
|
||||||
this.init()
|
this.init()
|
||||||
|
console.log(companyId)
|
||||||
|
this.getCompanyConfig(companyId)
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
activeChannelCode: {
|
activeChannelCode: {
|
||||||
@@ -611,6 +622,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getCompanyConfig(companyId){
|
||||||
|
if(companyId){
|
||||||
|
user.getCompanyConfigByCompanyId(companyId).then(res=>{
|
||||||
|
if(res.data.plateNumberOcr==1){
|
||||||
|
this.plateNumberOcrShow = true
|
||||||
|
}else{
|
||||||
|
this.plateNumberOcrShow = false
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
srcPhoto(){
|
srcPhoto(){
|
||||||
let _that = this
|
let _that = this
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
@@ -618,25 +641,15 @@
|
|||||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||||
sourceType: ['camera'], // 只能拍照
|
sourceType: ['camera'], // 只能拍照
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
console.log(res)
|
uni.showLoading({
|
||||||
// uni.showLoading({
|
title: '识别中',
|
||||||
// title: '识别中',
|
mask: true
|
||||||
// mask: true
|
});
|
||||||
// });
|
|
||||||
uni.saveImageToPhotosAlbum({
|
|
||||||
filePath: res.tempFilePaths[0],
|
|
||||||
success: function (file) {
|
|
||||||
console.log('save success',res,file);
|
|
||||||
|
|
||||||
const JSESSIONID = utils.uuid()
|
const JSESSIONID = utils.uuid()
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: 'http://uat.xingoil.com/oil-oss/obejct/uploadFile',
|
url: 'http://uat.xingoil.com/adminapi/oil-oss/obejct/carNoIdentify',
|
||||||
filePath: res.tempFilePaths[0],
|
filePath: res.tempFilePaths[0],
|
||||||
formData: {
|
|
||||||
ossKey: 'xingyou',
|
|
||||||
pathKey: 'certificate',
|
|
||||||
encrypt: 'PUBLIC',
|
|
||||||
},
|
|
||||||
name: 'file',
|
name: 'file',
|
||||||
header: {
|
header: {
|
||||||
"Content-Type": "multipart/form-data",
|
"Content-Type": "multipart/form-data",
|
||||||
@@ -649,25 +662,13 @@
|
|||||||
},
|
},
|
||||||
success(e) {
|
success(e) {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
console.log('进入2')
|
let obj = JSON.parse(e.data)
|
||||||
console.log(e)
|
_that.plateNumberOcr = obj.data.carNo
|
||||||
// let obj = JSON.parse(e.data),
|
|
||||||
// url = obj.data.publicUrl
|
|
||||||
// user.carNoIdentify(data).then((res) => {
|
|
||||||
// console.log(res)
|
|
||||||
// let obj = JSON.parse(res.data)
|
|
||||||
// console.log(obj)
|
|
||||||
// })
|
|
||||||
},fail(res){
|
},fail(res){
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
console.log(res,'fail')
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -1210,6 +1211,28 @@
|
|||||||
'version': 1,
|
'version': 1,
|
||||||
'xoilAmountGun': this.vol
|
'xoilAmountGun': this.vol
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if(this.plateNumberOcrShow == true){
|
||||||
|
var orderData = {
|
||||||
|
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.plateNumberOcrShow == true ? this.plateNumberOcr : this
|
||||||
|
.plateNumber, //类型: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_COMPANY_WECHAT_APPLET", //类型:String 必有字段 备注:创建来源( XOIL_DRIVER_COMPANY_WECHAT_APPLET)
|
||||||
|
// "deviceImei": "mock", //类型:String 可有字段 备注:设备唯一码
|
||||||
|
// "networkIp": "mock" //类型:String 可有字段 备注:ip地址
|
||||||
|
'version': 1,
|
||||||
|
'xoilAmountGun': this.vol
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
var orderData = {
|
var orderData = {
|
||||||
amountGun: this.activeChannelCode == 'TY' ? this.ty.realMoney : '',
|
amountGun: this.activeChannelCode == 'TY' ? this.ty.realMoney : '',
|
||||||
@@ -1232,6 +1255,8 @@
|
|||||||
'xoilAmountGun': this.vol
|
'xoilAmountGun': this.vol
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
// console.log(orderData)
|
// console.log(orderData)
|
||||||
let location = uni.getStorageSync('location') || {
|
let location = uni.getStorageSync('location') || {
|
||||||
longitude: '',
|
longitude: '',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
const service_name = "user"
|
const service_name = "oil-user"
|
||||||
const group_name = "oilCustomerInfo"
|
const group_name = "oilCustomerInfo"
|
||||||
export default{
|
export default{
|
||||||
carNoIdentify(data) { //图片上传-ORC识别
|
carNoIdentify(data) { //图片上传-ORC识别
|
||||||
@@ -9,4 +9,11 @@ export default{
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 查询企业配置
|
||||||
|
getCompanyConfigByCompanyId(id) {
|
||||||
|
return request({
|
||||||
|
url: `/${service_name}/oil-user/getCompanyConfigByCompanyId?companyId=${id}`,
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user