pull/14/head
zhangyouji 1 year ago
parent 16bbe24e5b
commit d7746faca3
  1. 97
      BagStation/pages/components/price-select-tab.vue
  2. 9
      api/user.js

@ -189,11 +189,17 @@
</view>
</view>
<view>
<view>车牌识别</view>
<view>
<view class="cu-tn btn-box" @tap="srcPhoto">
拍照
<view class=" menu cu-list " v-if="plateNumberOcrShow==true">
<view class="cu-item nowrap">
<view class="text-bold ">
车牌识别
</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>
@ -517,13 +523,16 @@
activeChannelCode: '',
checkBar: [],
realMoney: '',
xoilAmountGun: ''
xoilAmountGun: '',
plateNumberOcr:'',
plateNumberOcrShow:false
}
},
created() {
let oilItem = uni.getStorageSync('oilItem'),
oilSite = uni.getStorageSync(''),
otherUser = uni.getStorageSync('otherUserInfo')
otherUser = uni.getStorageSync('otherUserInfo'),
companyId = JSON.parse(uni.getStorageSync('companyCard')).companyId
if (otherUser) {
// console.log('')
this.isOtherUser = true
@ -533,6 +542,8 @@
console.log('oilItem', oilItem)
this.showtitles = oilItem.listTag;
this.init()
console.log(companyId)
this.getCompanyConfig(companyId)
},
watch: {
activeChannelCode: {
@ -611,6 +622,18 @@
}
},
methods: {
getCompanyConfig(companyId){
if(companyId){
user.getCompanyConfigByCompanyId(companyId).then(res=>{
if(res.data.plateNumberOcr==1){
this.plateNumberOcrShow = true
}else{
this.plateNumberOcrShow = false
}
})
}
},
srcPhoto(){
let _that = this
uni.chooseImage({
@ -618,25 +641,15 @@
sizeType: ['original', 'compressed'], //
sourceType: ['camera'], //
success: function(res) {
console.log(res)
// uni.showLoading({
// title: '',
// mask: true
// });
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePaths[0],
success: function (file) {
console.log('save success',res,file);
uni.showLoading({
title: '识别中',
mask: true
});
const JSESSIONID = utils.uuid()
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],
formData: {
ossKey: 'xingyou',
pathKey: 'certificate',
encrypt: 'PUBLIC',
},
name: 'file',
header: {
"Content-Type": "multipart/form-data",
@ -649,25 +662,13 @@
},
success(e) {
uni.hideLoading()
console.log('进入2')
console.log(e)
// 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)
// })
let obj = JSON.parse(e.data)
_that.plateNumberOcr = obj.data.carNo
},fail(res){
uni.hideLoading()
console.log(res,'fail')
}
})
}
});
}
})
@ -1210,6 +1211,28 @@
'version': 1,
'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{
var orderData = {
amountGun: this.activeChannelCode == 'TY' ? this.ty.realMoney : '',
@ -1232,6 +1255,8 @@
'xoilAmountGun': this.vol
}
}
}
// console.log(orderData)
let location = uni.getStorageSync('location') || {
longitude: '',

@ -1,5 +1,5 @@
import request from '@/utils/request'
const service_name = "user"
const service_name = "oil-user"
const group_name = "oilCustomerInfo"
export default{
carNoIdentify(data) { //图片上传-ORC识别
@ -9,4 +9,11 @@ export default{
data: data
})
},
// 查询企业配置
getCompanyConfigByCompanyId(id) {
return request({
url: `/${service_name}/oil-user/getCompanyConfigByCompanyId?companyId=${id}`,
method: 'GET'
})
},
}
Loading…
Cancel
Save