更新
This commit is contained in:
@@ -117,11 +117,11 @@
|
||||
<text class="cuIcon-write text-orange"></text>
|
||||
</view>
|
||||
|
||||
<view class="cu-form-group margin margin-top-0 radius">
|
||||
<view class="cu-form-group margin margin-top-0 radius" v-if="plateNumberOcrShow==true">
|
||||
<view class="title text-black ">
|
||||
车牌识别
|
||||
</view>
|
||||
<view @tap="srcPhoto" class="text-center" style="width: 60%;margin: 0 2%;">
|
||||
<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>
|
||||
@@ -312,6 +312,39 @@
|
||||
<PlateNumberPicker @newPlate="showPlateModal(false,true)" @onDeleteInput="onDeleteInput"
|
||||
:showInputList="showInputList" :showPlateList="showPlateList" @selectNo="selectNo"
|
||||
@clearAll="clearPlateNumber" @selectName="selectText" @hideModal="showModel=''" :modalName="showModel" />
|
||||
|
||||
<view class="cu-modal bottom-modal " :class="showPlicePhoto">
|
||||
|
||||
<view class="cu-dialog bg-white">
|
||||
<view class="cu-bar bg-white justify-end">
|
||||
<view class="content"></view>
|
||||
<view class="action" @tap="showPlicePhoto=''">
|
||||
<text class="cuIcon-close text-red"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="height: 1000rpx;">
|
||||
<view style="margin: 100rpx 0;">
|
||||
<uni-icons type="clear" size="80" color="#f56c6c"></uni-icons>
|
||||
<view>
|
||||
<text style="color: #d9001b;font-size: 30rpx;font-weight: bold;">识别失败!</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view style="margin: 60rpx 0;">
|
||||
<button @tap="srcPhoto" style="width: 60%;background-color: #409EFF;color: #ffffff;">重新拍照</button>
|
||||
</view>
|
||||
<view style="margin: 60rpx 0;">
|
||||
<button style="width: 60%;background-color: #F59A23;color: #ffffff;" @click="manualInput">手动输入车牌号</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<uni-popup ref="inputDialog" type="dialog">
|
||||
<uni-popup-dialog mode="input" title="请输入车牌号" value="" :before-close="true"
|
||||
placeholder="请输入" @close="inputClose" @confirm="inputConfirm"></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -390,7 +423,9 @@
|
||||
curIndex: null,
|
||||
InputNumber: 0,
|
||||
plateNumberOcr:'',
|
||||
plateNumberOcrShow:false
|
||||
plateNumberOcrShow:false,
|
||||
showPlicePhoto:'',
|
||||
plateNumberImages:''
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
@@ -483,6 +518,25 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
manualInput(){
|
||||
this.showPlicePhoto=''
|
||||
this.$refs.inputDialog.open()
|
||||
},
|
||||
inputClose(){
|
||||
this.$refs.inputDialog.close()
|
||||
},
|
||||
inputConfirm(val){
|
||||
if(val){
|
||||
this.plateNumberOcr = val
|
||||
this.$refs.inputDialog.close()
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '请输入车牌号',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
getCompanyConfig(companyId){
|
||||
if(companyId){
|
||||
user.getCompanyConfigByCompanyId(companyId).then(res=>{
|
||||
@@ -497,6 +551,7 @@
|
||||
}
|
||||
},
|
||||
srcPhoto(){
|
||||
this.showPlicePhoto=''
|
||||
let _that = this
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
@@ -526,10 +581,16 @@
|
||||
uni.hideLoading()
|
||||
console.log(e)
|
||||
let obj = JSON.parse(e.data)
|
||||
console.log(obj,obj.data,obj.data.carNo)
|
||||
_that.plateNumberOcr = obj.data.carNo
|
||||
if(obj.data&&obj.data.carNo){
|
||||
_that.plateNumberOcr = obj.data.carNo
|
||||
_that.plateNumberImages = obj.data.imgUrl
|
||||
}else{
|
||||
_that.plateNumberOcr = ''
|
||||
_that.showPlicePhoto = 'show'
|
||||
}
|
||||
},fail(res){
|
||||
uni.hideLoading()
|
||||
_that.showPlicePhoto = 'show'
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1138,6 +1199,13 @@
|
||||
}
|
||||
} else {
|
||||
if(this.plateNumberOcrShow == true){
|
||||
if(!this.plateNumberOcr){
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请上传车牌照片'
|
||||
})
|
||||
return
|
||||
}
|
||||
var data6 = {
|
||||
siteId: this.siteData.siteId,
|
||||
priceId: this.insertResult.priceId,
|
||||
@@ -1148,6 +1216,7 @@
|
||||
createSource: "WECHAT_MINIAPPS", //类型:String 必有字段 备注:创建来源
|
||||
orderSource: "WECHAT_MINIAPPS",
|
||||
vehicleLicenseNum: this.plateNumberOcr,
|
||||
plateNumberImages: this.plateNumberImages, // 车牌照片地址
|
||||
customerId: this.siteData.customerId, //类型:String 必有字段 备注:司机id
|
||||
companyId: this.siteData.companyId, //类型:String 必有字段 备注:企业id
|
||||
oilsBar: this.insertResult.bar,
|
||||
|
||||
Reference in New Issue
Block a user