Просмотр исходного кода

feature_20260211_同城分销店-主营竞品品牌

zhujindu 5 дней назад
Родитель
Сommit
e3b2c9e3b8
2 измененных файлов с 6 добавлено и 10 удалено
  1. 2 4
      src/views/storeManagement/storeAdd.vue
  2. 4 6
      src/views/storeManagement/storeEdit.vue

+ 2 - 4
src/views/storeManagement/storeAdd.vue

@@ -1927,10 +1927,8 @@ export default {
               })
               .then(() => {
                 this.toastLoading(0, '上传中...', true);
-                this.fromValue.storeCompetitorList =
-                  this.otherCompetitor != ''
-                    ? this.fromValue.storeCompetitorList.push(this.otherCompetitor)
-                    : this.fromValue.storeCompetitorList;
+                if (this.fromValue.otherCompetitor != '')
+                  this.fromValue.storeCompetitorList.push(this.fromValue.otherCompetitor);
                 this.addStoreFun();
               });
           }

+ 4 - 6
src/views/storeManagement/storeEdit.vue

@@ -423,7 +423,7 @@
                 </van-checkbox-group>
                 <van-field
                   class="otherCompetitor"
-                  v-model="otherCompetitor"
+                  v-model="fromValue.otherCompetitor"
                   label="其他"
                   placeholder="请输入" />
               </div>
@@ -1848,7 +1848,7 @@ export default {
           this.$toast('图片未上传');
           return;
         }
-        if (!fromValue.storeCompetitorList.length && this.otherCompetitor == '') {
+        if (!fromValue.storeCompetitorList.length && fromValue.otherCompetitor == '') {
           this.$toast('主营竞品品牌未填写');
           return;
         }
@@ -1874,10 +1874,8 @@ export default {
       this.fromValue.myLat = this.location.lat;
       this.fromValue.myLon = this.location.lon;
       console.log(this.fromValue);
-      this.fromValue.storeCompetitorList =
-        this.otherCompetitor != ''
-          ? this.fromValue.storeCompetitorList.push(this.otherCompetitor)
-          : this.fromValue.storeCompetitorList;
+      if (this.fromValue.otherCompetitor != '')
+        this.fromValue.storeCompetitorList.push(this.fromValue.otherCompetitor);
       updateStore(this.fromValue).then((res) => {
         loading1.clear();
         if (res.code == 200) {