|
|
@@ -39,6 +39,7 @@ import {baseImg} from "@/views/menu/LZRegister/api";
|
|
|
import {upload, uploadBase64} from "@/api/public";
|
|
|
import ImageCompressor from "js-image-compressor";
|
|
|
import config from "@/config";
|
|
|
+import {imgUrl} from "@/utils";
|
|
|
export default {
|
|
|
components:{SelectCell},
|
|
|
data(){
|
|
|
@@ -65,7 +66,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- window.openCameraCallBack = this.openCameraCallBack;
|
|
|
+
|
|
|
},
|
|
|
watch:{
|
|
|
visible(val){
|
|
|
@@ -81,14 +82,23 @@ export default {
|
|
|
let params = {
|
|
|
extension:img.extension,
|
|
|
content:img.content,
|
|
|
-
|
|
|
}
|
|
|
+ this.$toast.loading({
|
|
|
+ duration: 0, // 持续展示 toast
|
|
|
+ forbidClick: true,
|
|
|
+ message: "上传中..."
|
|
|
+ });
|
|
|
uploadBase64(params).then(res=>{
|
|
|
+ this.$toast.clear();
|
|
|
+ /*上传成功*/
|
|
|
+ this.$toast.success('上传成功')
|
|
|
//上传成功后,将图片显示在页面上并禁用退出
|
|
|
this.nfcImage = res.data.url;
|
|
|
this.showBottomBox = false;
|
|
|
- })
|
|
|
-
|
|
|
+ }).catch((err) => {
|
|
|
+ /*上传失败*/
|
|
|
+ this.$toast.fail('上传失败')
|
|
|
+ });
|
|
|
},
|
|
|
isAndroidOrIos(){
|
|
|
const urls = navigator.userAgent;
|
|
|
@@ -102,6 +112,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
useCamera(actionType){
|
|
|
+ window.openCameraCallBack = null;
|
|
|
+ window.openCameraCallBack = this.openCameraCallBack;
|
|
|
let parms = {};
|
|
|
if(actionType){
|
|
|
parms.actionType = actionType;
|