Browse Source

feature_20250811_拜访拍照任务连拍

zhujindu 3 tháng trước cách đây
mục cha
commit
1c30fc03ee

+ 8 - 0
src/components/H5Camera.vue

@@ -13,6 +13,10 @@ export default {
       type: String,
       default: '',
     },
+    objectType: {
+      type: String,
+      default: '',
+    },
   },
   data() {
     return {
@@ -44,6 +48,10 @@ export default {
       }
     },
     camera() {
+      if (this.objectType == '' || this.objectType == null) {
+        this.$toast('请选择类型!');
+        return;
+      }
       if (this.input) this.input.click();
     },
   },

+ 2 - 5
src/components/uploadVNormal.vue

@@ -9,6 +9,7 @@
     <H5Camera
       @getImg="getImg"
       ref="H5Camera"
+      :objectType="objectType"
       :capture="pictureSource == '1' ? '' : 'camera'"
       v-else />
     <div id="allmap"></div>
@@ -164,10 +165,6 @@ export default {
     // 原生H5拍照图片
     // url: base64
     getImg(base64) {
-      if (this.objectType == '' || this.objectType == null) {
-        this.$toast('请选择类型!');
-        return;
-      }
       // 图片名称:用户名-时间戳
       let username = localStorage.getItem('loginName');
       let imgName = username + '-' + new Date().getTime();
@@ -271,7 +268,7 @@ export default {
                 count: count,
                 sizeType: ['original'], // 可以指定是原图还是压缩图,默认二者都有
                 sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有
-                defaultCameraMode: 'batch', //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
+                defaultCameraMode: count == 1 ? 'normal' : 'batch', //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
                 isSaveToAlbum: 0, //整型值,0表示拍照时不保存到系统相册,1表示自动保存,默认值是1
                 success: function (res) {
                   let localIds = res.localIds;

+ 1 - 0
src/views/deviceWithin/addStoreVisit.vue

@@ -3183,6 +3183,7 @@ export default {
     // 拍照次数重置
     store.dispatch('setShotsNum', 0);
     this.show = false;
+    this.PhotoTypeText = '';
     this.stillDistribute = false;
     clearInterval(this.time);
     this.time = null; //计时