Bläddra i källkod

Merge branch 'feature_20250116_拜访门店任务添加照片从相册选择功能' into release

zhujindu 9 månader sedan
förälder
incheckning
0cc3a27ba4

+ 9 - 2
src/components/uploadImgVStore.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="cameraDiv1">
-      <div class="imgPre" v-if="imgArr.length">
+      <div class="imgPre" v-if="imgArr && imgArr.length">
         <van-icon
           class="photobrowsing"
           name="expand-o"
@@ -54,11 +54,17 @@ export default {
     },
     imgArr: {
       type: [String, Array],
+      default: '',
     },
     count: {
       type: Number,
       default: 1,
     },
+    disabled: {
+      // 是否可以添加或修改 true:不可以
+      type: Boolean,
+      default: false,
+    },
   },
   data() {
     return {
@@ -73,7 +79,7 @@ export default {
   watch: {
     imgArr: {
       handler(val) {
-        this.imgUrlArr = val.split(',');
+        if (val) this.imgUrlArr = val.split(',');
       },
       immediate: true,
     },
@@ -83,6 +89,7 @@ export default {
       ImagePreview(this.imgUrlArr);
     },
     uploadImg() {
+      if (this.disabled) return;
       if (localStorage.getItem('chainName') == null) {
         this.$toast('请输入名称!');
         return;

+ 9 - 2
src/components/uploadVNormal.vue

@@ -80,6 +80,11 @@ export default {
       type: String,
       default: '',
     },
+    pictureSource: {
+      // 是否允许从相册选择图片 1:允许;0:不允许
+      type: String,
+      default: '0',
+    },
   },
   data() {
     return {
@@ -158,10 +163,12 @@ export default {
                   });
                 },
               });
+              console.log(that.pictureSource);
+              let sourceType = that.pictureSource == '1' ? ['album', 'camera'] : ['camera'];
               wx.chooseImage({
                 count: 1,
-                sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
-                sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
+                sizeType: ['original'], // 可以指定是原图还是压缩图,默认二者都有
+                sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有
                 defaultCameraMode: 'normal', //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
                 isSaveToAlbum: 0,
                 success: function (res) {

+ 35 - 2
src/views/deviceWithin/addStoreVisit.vue

@@ -2545,7 +2545,7 @@
         <template #label> <span class="van-f-red">*</span>图片类型 </template>
       </van-field>
       <van-cell>
-        <template #title> <span class="van-f-red">*</span>拍照上传 </template>
+        <template #title> <span class="van-f-red">*</span>图片上传 </template>
         <template #right-icon>
           <upload-img
             :collectionId="collectionId"
@@ -2566,9 +2566,37 @@
             :deviceCode="deviceCode"
             :putInCode="putInCode"
             @newimgarr="newimgarr1"
-            @typeshow="typeshow"></upload-img>
+            @typeshow="typeshow"
+            :pictureSource="pictureSource"></upload-img>
         </template>
       </van-cell>
+      <!-- <van-cell v-if="pictureSource == '1'">
+        <template #title> <span class="van-f-red">*</span>相册选择</template>
+        <template #right-icon>
+          <upload-img
+            :collectionId="collectionId"
+            :parentCollectionId="parentCollectionId"
+            :secondCollectionId="secondCollectionId"
+            :firstCollectionId="firstCollectionId"
+            :fourthCollectionId="fourthCollectionId"
+            :thirdCollectionId="thirdCollectionId"
+            :imgArr="imgs"
+            :objectType="PhotoType"
+            :shouws="true"
+            :storeGroupId="storeGroupId"
+            :taskId="taskId"
+            :uploadid="uploadid2"
+            :visitModel="1 + ''"
+            :visitsId="visitId"
+            :childIndex="childIndex"
+            :deviceCode="deviceCode"
+            :putInCode="putInCode"
+            @newimgarr="newimgarr1"
+            @typeshow="typeshow"
+            :photoIdentifyType="photoIdentifyType"
+            updateImgMode="album"></upload-img>
+        </template>
+      </van-cell> -->
     </van-dialog>
     <!--    list-->
     <van-dialog v-model="listShow" title="历史回显" show-cancel-button :showConfirmButton="false">
@@ -2726,6 +2754,8 @@ export default {
       deviceCode: '',
       putInCode: '',
       examplePhotoImg: '', //示例-操作说明图标地址
+      photoIdentifyType: null, //图片识别类型
+      pictureSource: '0',
     };
   },
   beforeRouteLeave(to, from, next) {
@@ -2745,6 +2775,7 @@ export default {
     this.taskId = this.$route.query.taskId + '';
     this.storeId = this.$route.query.storeId + '';
     this.isMust == this.$route.query.isMust + '';
+    this.photoIdentifyType = this.$route.query.photoIdentifyType;
     this.storeGroupId = this.$route.query.storeGroupId + '';
     if (this.$route.query.photoType != null) {
       this.indexselect = 0;
@@ -2762,6 +2793,7 @@ export default {
     this.taskId = this.$route.query.taskId + '';
     this.storeId = this.$route.query.storeId + '';
     this.isMust == this.$route.query.isMust + '';
+    this.photoIdentifyType = this.$route.query.photoIdentifyType;
     this.storeGroupId = this.$route.query.storeGroupId + '';
     if (this.$route.query.photoType != null) {
       this.indexselect = 0;
@@ -3744,6 +3776,7 @@ export default {
       this.secondCollectionId = val.secondCollectionId;
       this.thirdCollectionId = val.thirdCollectionId;
       this.fourthCollectionId = val.fourthCollectionId;
+      this.pictureSource = val.pictureSource; //是否允许从相册选择图片
       this.indeximg = index;
       this.childIndex = childIndex;
       this.childIndex1 = childIndex1;

+ 1 - 0
src/views/storeManagement/storeEdit.vue

@@ -340,6 +340,7 @@
                         :imgArr="fromValue.img"
                         @newimgarr="newimgarr1"
                         :imgText="fromValue.ifJzStoreType != 1 ? '门店照' : '家装前台照片'"
+                        :disabled="true"
                         :type="1"></upload-img>
                     </div>
                     <div v-else>