zhujindu пре 1 година
родитељ
комит
7a2b516cac
2 измењених фајлова са 35 додато и 0 уклоњено
  1. 34 0
      src/components/uploadImgVStore.vue
  2. 1 0
      src/views/storeManagement/storeAdd.vue

+ 34 - 0
src/components/uploadImgVStore.vue

@@ -17,6 +17,9 @@
       </p>
     </div>
     <p style="text-align: center">{{ imgText }}</p>
+    <div class="mask" v-if="progressFlag">
+      <el-progress type="circle" :percentage="percentage"></el-progress>
+    </div>
   </div>
 </template>
 
@@ -59,6 +62,10 @@ export default {
       type: Number,
       default: 1,
     },
+    photoIdentifyType: {
+      type: String,
+      default: '',
+    },
   },
   data() {
     return {
@@ -68,6 +75,9 @@ export default {
       num: 0,
       serverIdArr: [],
       imgUrlArr: [],
+      progressFlag: false,
+      percentage: 0,
+      timeFlag: null,
     };
   },
   watch: {
@@ -140,6 +150,8 @@ export default {
         message: '上传中...',
         forbidClick: true,
       });
+      // loading
+      this.progress();
       uploadImagev(form).then((res) => {
         if (res.code == 200) {
           // that.imgArr = res.data.url;
@@ -148,6 +160,10 @@ export default {
             imgArr.push(item.url);
           });
           loind1.clear();
+          this.percentage = 100;
+          clearInterval(this.timeFlag);
+          this.progressFlag = false;
+          this.percentage = 0;
           that.$toast('上传成功!');
           that.$emit('newimgarr', { fileUrl: imgArr.join(','), type: that.type });
         } else {
@@ -155,6 +171,14 @@ export default {
         }
       });
     },
+    progress() {
+      this.progressFlag = true;
+      this.percentage = 10;
+      this.timeFlag = setInterval(() => {
+        if (this.percentage == 90) clearInterval(this.timeFlag);
+        this.percentage = this.percentage + 10;
+      }, 1000);
+    },
   },
 };
 </script>
@@ -212,4 +236,14 @@ export default {
 .coverImg .ico {
   top: 42%;
 }
+.mask {
+  position: absolute;
+  width: 100%;
+  height: 100%;
+  top: 0;
+  background: rgba(255, 255, 255, 0.8);
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
 </style>

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

@@ -293,6 +293,7 @@
                         :imgArr="fromValue.img"
                         @newimgarr="newimgarr1"
                         :imgText="fromValue.ifJzStoreType != 1 ? '门店照' : '家装前台照片'"
+                        :photoIdentifyType="fromValue.ifJzStoreType != 1 ? 'dz' : ''"
                         :type="1"></upload-img>
                     </div>
                   </van-col>