duanqianwen 1 ano atrás
pai
commit
71e911ba46
2 arquivos alterados com 17 adições e 11 exclusões
  1. 1 1
      src/api/client/goods.js
  2. 16 10
      src/pageMerchant/storeModule/shopManage.vue

+ 1 - 1
src/api/client/goods.js

@@ -18,7 +18,7 @@ export function getCategories(merchantId) {
   return request({
     url: '/maintain/merchant/getCategories',
     method: 'post',
-    data: {type:1,merchantId},
+    data: {merchantId},
     headers: {
       'content-type': 'application/json',
     },

+ 16 - 10
src/pageMerchant/storeModule/shopManage.vue

@@ -113,7 +113,6 @@
     </view>
     <view class="bottom-box" v-if="delete_type == 1">
       <p @click="upStore">批量上架</p>
-      <p @click="deleteShop">批量删除</p>
     </view>
   </view>
 </template>
@@ -351,18 +350,25 @@
 
       },
       async upStore() {
-       const ids = this.rightTabbar.filter(obj=>obj.checked).map(item=>item.id)
+        const ids = this.rightTabbar.filter(obj => obj.checked).map(item => item.id)
+        if (ids.length == 0) {
+          uni.showToast({
+            icon: 'none',
+            title: '请选择需要上架的商品'
+          })
+          return
+        }
         const res = await upGoods(ids)
-        if(res.code=='OK'){
+        if (res.code == 'OK') {
           uni.showToast({
-            icon:'none',
-            title:'上架成功'
+            icon: 'none',
+            title: '上架成功'
           })
           this.getGoodsList()
-        }else{
+        } else {
           uni.showToast({
-            icon:'none',
-            title:'上架失败'
+            icon: 'none',
+            title: '上架失败'
           })
         }
       },
@@ -391,7 +397,7 @@
                 })
                 this.tabbar = res.data
 
-                if(this.delete_type==1){
+                if (this.delete_type) {
                   this.rightTabbar = result.data.map(obj => {
                     return {
                       ...obj,
@@ -403,7 +409,7 @@
 
               } else {
                 this.tabbar = []
-                 this.rightTabbar = []
+                this.rightTabbar = []
               }