CRM_26-08-05#story#9126,车辆管理、服务商管理系统需求
This commit is contained in:
@@ -459,7 +459,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
// uploadImage
|
// uploadImage
|
||||||
import {Dialog} from "vant";
|
import {Dialog, ImagePreview} from "vant";
|
||||||
import {formatDate1} from "@/utils/common"
|
import {formatDate1} from "@/utils/common"
|
||||||
import {myMixins} from "@/utils/myMixins"
|
import {myMixins} from "@/utils/myMixins"
|
||||||
import {vehicleTypeList,saveVehicle,getInfoById,supplierServiceTree, uploadImage, ocrHandler,
|
import {vehicleTypeList,saveVehicle,getInfoById,supplierServiceTree, uploadImage, ocrHandler,
|
||||||
@@ -960,8 +960,21 @@ export default {
|
|||||||
isCameraSupported() { // 是否支持 getUserMedia(不支持则降级系统选择器)
|
isCameraSupported() { // 是否支持 getUserMedia(不支持则降级系统选择器)
|
||||||
return !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) && window.isSecureContext !== false
|
return !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) && window.isSecureContext !== false
|
||||||
},
|
},
|
||||||
onLicenseSlotClick(type) { // 行驶证三槽位点击拦截:跳独立拍摄页,不支持相机则直接降级系统选择器
|
onLicenseSlotClick(type) { // 行驶证三槽位点击:已有图片→预览,无图片→跳拍摄页(不支持相机则降级系统选择器)
|
||||||
this.cameraGuideType = type
|
this.cameraGuideType = type
|
||||||
|
const listMap = {
|
||||||
|
front: 'vehicleLicenseFrontList',
|
||||||
|
back: 'vehicleLicenseBackList',
|
||||||
|
car: 'vehicleLicenseCarPhotoList'
|
||||||
|
}
|
||||||
|
const item = (this[listMap[type]] || [])[0]
|
||||||
|
const src = item && (item.url || item.content)
|
||||||
|
if (src) {
|
||||||
|
// 已有图片:预览(删除按钮在拦截层之上,可删除后重拍)
|
||||||
|
ImagePreview({ images: [src], closeable: true })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 无图片:拍照
|
||||||
if (!this.isCameraSupported()) {
|
if (!this.isCameraSupported()) {
|
||||||
// 不支持 getUserMedia(如 iOS 微信、非 HTTPS、老 WebView):直接调系统选择器
|
// 不支持 getUserMedia(如 iOS 微信、非 HTTPS、老 WebView):直接调系统选择器
|
||||||
this.triggerNativeUpload(type)
|
this.triggerNativeUpload(type)
|
||||||
|
|||||||
Reference in New Issue
Block a user