OCR
This commit is contained in:
@@ -188,6 +188,18 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view>
|
||||||
|
<view>车牌识别</view>
|
||||||
|
<view>
|
||||||
|
<view class="cu-tn btn-box" @tap="srcPhoto">
|
||||||
|
拍照
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="bg-white padding">
|
<view class="bg-white padding">
|
||||||
<view class="">
|
<view class="">
|
||||||
<text class="text-bold">优惠</text>
|
<text class="text-bold">优惠</text>
|
||||||
@@ -377,6 +389,7 @@
|
|||||||
import oilOssApi from '@/api/oil-oss.js'
|
import oilOssApi from '@/api/oil-oss.js'
|
||||||
import utils from '@/utils/encode'
|
import utils from '@/utils/encode'
|
||||||
import oilInterfacesApi from '@/api/oil-interfaces.js'
|
import oilInterfacesApi from '@/api/oil-interfaces.js'
|
||||||
|
import user from '@/api/user.js'
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
channelList: {
|
channelList: {
|
||||||
@@ -598,6 +611,69 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
srcPhoto(){
|
||||||
|
let _that = this
|
||||||
|
uni.chooseImage({
|
||||||
|
count: 1, //默认9
|
||||||
|
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);
|
||||||
|
|
||||||
|
const JSESSIONID = utils.uuid()
|
||||||
|
uni.uploadFile({
|
||||||
|
url: 'http://uat.xingoil.com/oil-oss/obejct/uploadFile',
|
||||||
|
filePath: res.tempFilePaths[0],
|
||||||
|
formData: {
|
||||||
|
ossKey: 'xingyou',
|
||||||
|
pathKey: 'certificate',
|
||||||
|
encrypt: 'PUBLIC',
|
||||||
|
},
|
||||||
|
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('进入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)
|
||||||
|
// })
|
||||||
|
},fail(res){
|
||||||
|
uni.hideLoading()
|
||||||
|
console.log(res,'fail')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
typeChenk() {
|
typeChenk() {
|
||||||
return this.channelList[this.activeCur]?.secondChannelCode && this.thirdPartyDynamicData.includes(this
|
return this.channelList[this.activeCur]?.secondChannelCode && this.thirdPartyDynamicData.includes(this
|
||||||
.channelList[this.activeCur].secondChannelCode)
|
.channelList[this.activeCur].secondChannelCode)
|
||||||
|
|||||||
12
api/user.js
Normal file
12
api/user.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
const service_name = "user"
|
||||||
|
const group_name = "oilCustomerInfo"
|
||||||
|
export default{
|
||||||
|
carNoIdentify(data) { //图片上传-ORC识别
|
||||||
|
return request({
|
||||||
|
url: `/${service_name}/${group_name}/carNoIdentify`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user