Browse Source

feature_20260513_新建专业五金店

zhujindu 2 weeks ago
parent
commit
92111dd532
1 changed files with 92 additions and 22 deletions
  1. 92 22
      src/views/storeManagement/storeAdd.vue

+ 92 - 22
src/views/storeManagement/storeAdd.vue

@@ -322,7 +322,7 @@
               <deleteImgView :imgs="fromValue.carShopImgList"></deleteImgView>
             </div>
             <div v-if="fromValue.storeCategory != 'C917'">
-              <div style="padding: 20px; height: 228px; background-color: #f1f1f1" v-if="imgShow">
+              <div style="padding: 20px; height: 228px; background-color: #f1f1f1">
                 <van-row gutter="20">
                   <van-col span="12">
                     <div v-if="!storeTypePOP">
@@ -361,30 +361,57 @@
                         </div>
                       </van-col>
                     </template>
-                    <!-- 专业五金店 -->
                     <template
-                      v-else-if="
+                      v-if="
                         fromValue.storeCategory == '126565' &&
                         fromValue.orgName &&
                         fromValue.orgName.indexOf('BMD') != -1
                       ">
                       <van-col span="12">
-                        <div v-if="storeTypePOP">
+                        <div>
                           <upload-img
                             :uploadid="uploadid2"
-                            :imgArr="fromValue.imgSed"
+                            imgArr=""
                             @newimgarr="newimgarr1"
+                            imgText="陈列照"
                             :type="2"
-                            displayPhoto="'1'"
-                            :imgText="'陈列照'">
-                          </upload-img>
+                            :displayPhoto="'1'"
+                            :count="1"></upload-img>
                         </div>
                       </van-col>
                     </template>
                   </template>
                 </van-row>
+                <!-- 专业五金店 -->
+                <div
+                  v-if="
+                    fromValue.storeCategory == '126565' &&
+                    fromValue.orgName &&
+                    fromValue.orgName.indexOf('BMD') != -1
+                  "
+                  class="displayImg">
+                  <template v-if="displayImg.length">
+                    <div class="displayImgBox" v-for="(urls, index) in displayImg" :key="index">
+                      <van-icon name="close" size="16" @click="deleteImg(index)" />
+                      <img :src="urls" width="99%" height="99%" @click="previewsImg(index)" />
+                      <div class="title">陈列照</div>
+                    </div>
+                  </template>
+                  <!-- <div class="displayImgBox">
+                    <div>
+                      <upload-img
+                        :uploadid="uploadid2"
+                        imgArr=""
+                        @newimgarr="newimgarr1"
+                        imgText="陈列照"
+                        :type="2"
+                        :displayPhoto="'1'"
+                        :count="1"></upload-img>
+                    </div>
+                  </div> -->
+                </div>
               </div>
-              <div style="padding: 20px; height: 228px; background-color: #f1f1f1" v-if="!imgShow">
+              <!-- <div style="padding: 20px; height: 228px; background-color: #f1f1f1" v-if="!imgShow">
                 <van-row gutter="20">
                   <van-col span="12">
                     <div v-if="!storeTypePOP">
@@ -404,7 +431,6 @@
                         :type="1"></uploadImgView>
                     </div>
                   </van-col>
-                  <!-- 新建同城A、B店不显示陈列照 -->
                   <template v-if="verifyStoreType(fromValue.storeCategory)">
                     <template v-if="!verifyStoreType(fromValue.storeCategory).type == 'fxd'">
                       <van-col span="12" v-if="fromValue.ifJzStoreType != 1">
@@ -420,7 +446,6 @@
                         </div>
                       </van-col>
                     </template>
-                    <!-- 专业五金店 -->
                     <template
                       v-else-if="
                         fromValue.storeCategory == '126565' &&
@@ -442,7 +467,7 @@
                     </template>
                   </template>
                 </van-row>
-              </div>
+              </div> -->
             </div>
           </van-tab>
           <van-tab title="属性信息" name="Planpic">
@@ -806,6 +831,7 @@ import { getPosition, getTicketFun } from '@/utils/TXApiFun';
 import { listChainsByCategory, checkStoreBeforeAdd } from '@/api/store';
 import store from '@/store';
 import { mapState } from 'vuex';
+import { ImagePreview } from 'vant';
 export default {
   name: 'storeAdd',
   components: { uploadImg, uploadImgView, mapmarker, uploadImgc, deleteImgView },
@@ -952,6 +978,7 @@ export default {
       progressFlag: false,
       percentage: 0,
       timeFlag: null,
+      displayImg: [],
     };
   },
   created() {
@@ -1033,6 +1060,7 @@ export default {
           storeCompetitorList: [],
           otherCompetitor: '', //主营竞品品牌-其他
         };
+        this.displayImg = [];
         setTimeout(() => {
           // this.getLocation()
         });
@@ -1375,15 +1403,15 @@ export default {
         this.fromValue.img = val.fileUrl;
       } else if (val.type == '2') {
         //
-        // if (
-        //   this.fromValue.storeCategory == '126565' &&
-        //   this.fromValue.orgName &&
-        //   this.fromValue.orgName.indexOf('BMD') != -1
-        // ) {
-        //   this.displayImg.push(val.fileUrl);
-        // } else {
-        this.fromValue.imgSed = val.fileUrl;
-        // }
+        if (
+          this.fromValue.storeCategory == '126565' &&
+          this.fromValue.orgName &&
+          this.fromValue.orgName.indexOf('BMD') != -1
+        ) {
+          this.displayImg.push(val.fileUrl);
+        } else {
+          this.fromValue.imgSed = val.fileUrl;
+        }
       } else {
         this.fromValue.carShopImgList.push(val.fileUrl);
       }
@@ -1985,6 +2013,7 @@ export default {
           this.fromValue.orgName &&
           this.fromValue.orgName.indexOf('BMD') != -1
         ) {
+          this.fromValue.imgSed = this.displayImg.join(',');
           if (!this.fromValue.imgSed && this.fromValue.imgSed.length == 0) {
             this.$toast('陈列照未上传');
             return;
@@ -2274,6 +2303,21 @@ export default {
     format(percentage) {
       return `${percentage} %\n图像识别中`;
     },
+    // 陈列照 图片删除
+    deleteImg(index) {
+      this.displayImg.splice(index, 1);
+    },
+    // 预览
+    previewsImg(index) {
+      var arrimg = [];
+      for (var imgi = 0; imgi < this.displayImg.length; imgi++) {
+        arrimg.push(this.displayImg[imgi]);
+      }
+      ImagePreview({
+        images: arrimg,
+        startPosition: index,
+      });
+    },
   },
 };
 </script>
@@ -2420,7 +2464,7 @@ export default {
     bottom: 0;
     width: 100%;
     height: 100%;
-    background: rgba(255, 255, 255, 1);
+    background: rgba(255, 255, 255, 0.3);
     display: flex;
     justify-content: center;
     align-items: center;
@@ -2439,5 +2483,31 @@ export default {
       font-size: 12px;
     }
   }
+  .displayImg {
+    overflow: hidden;
+    .displayImgBox {
+      position: relative;
+      width: 48%;
+      padding: 20px 0;
+      height: 210px;
+      float: left;
+      margin-right: 4%;
+      .title {
+        text-align: center;
+        padding: 5px 0;
+      }
+    }
+    .displayImgBox:nth-child(even) {
+      margin-right: 0;
+    }
+    // i {
+    //   position: absolute;
+    //   right: 4px;
+    //   color: white;
+    //   background: red;
+    //   overflow: hidden;
+    //   border-radius: 50%;
+    // }
+  }
 }
 </style>