|
@@ -42,11 +42,19 @@ export default {
|
|
|
success(res) {
|
|
|
console.log(res.authSetting['scope.camera'])
|
|
|
if(!res.authSetting['scope.camera']){
|
|
|
- uni.openSetting({
|
|
|
- success(res) {
|
|
|
- console.log(res.authSetting)
|
|
|
- }
|
|
|
- })
|
|
|
+ uni.showModal({
|
|
|
+ title: '您未开启摄像机权限',
|
|
|
+ content: '请点击右上角,然后在设置里面开启。',
|
|
|
+ success: (ret) => {
|
|
|
+ if(ret.confirm){
|
|
|
+ uni.openSetting({
|
|
|
+ success(res) {
|
|
|
+ console.log(res.authSetting)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -70,6 +78,17 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ delImgs(filePath){
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ const fs = wx.getFileSystemManager();
|
|
|
+ try {
|
|
|
+ const res = fs.unlinkSync(filePath)
|
|
|
+ console.log(res)
|
|
|
+ } catch(e) {
|
|
|
+ console.error(e)
|
|
|
+ }
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
// 裁剪图片
|
|
|
cutImg(fileUrl){
|
|
|
const vm = this
|
|
@@ -96,6 +115,8 @@ export default {
|
|
|
success: function(res) {
|
|
|
// 在H5平台下,tempFilePath 为 base64
|
|
|
vm.parseImgs(res.tempFilePath)
|
|
|
+ // 删除临时文件
|
|
|
+ // vm.delImgs(fileUrl)
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -166,10 +187,17 @@ export default {
|
|
|
imageByte: data
|
|
|
}).then(res => {
|
|
|
console.log(res, '识别VIN')
|
|
|
+ if(res.status == 200){
|
|
|
+ uni.redirectTo({
|
|
|
+ url: "/pages/vinInput/confirmVin?verifyCode=123456ads11234567&filePath="+base64Str + "&verifyCode="+res.data
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.message
|
|
|
+ })
|
|
|
+ }
|
|
|
uni.hideLoading()
|
|
|
- uni.redirectTo({
|
|
|
- url: "/pages/vinInput/confirmVin?verifyCode=123456ads11234567&filePath="+base64Str + "&verifyCode="+res.data
|
|
|
- })
|
|
|
}).catch(err => {
|
|
|
uni.hideLoading()
|
|
|
uni.showToast({
|