panhui hace 4 años
padre
commit
8051bb727e
Se han modificado 4 ficheros con 23 adiciones y 14 borrados
  1. BIN
      .DS_Store
  2. 4 2
      src/components/ProductInfo.vue
  3. 11 7
      src/pages/details.vue
  4. 8 5
      src/pages/store/homePage.vue

BIN
.DS_Store


+ 4 - 2
src/components/ProductInfo.vue

@@ -21,7 +21,7 @@
             </div>
 
             <div class="button" v-if="showBtn">
-                <van-button @click.stop="manage" type="info" plain size="small" v-if="isMine">管理拼箱</van-button>
+                <van-button @click.stop="manage" type="primary" size="small" v-if="isMine">管理拼箱</van-button>
                 <van-button @click.stop="cancelFollow" type="info" plain size="small" v-else-if="showType === 'collect'"
                     >取消关注</van-button
                 >
@@ -88,7 +88,9 @@ export default {
         }
     },
     methods: {
-        manage() {},
+        manage() {
+            this.navigateTo('/pages/store/administration?id=' + this.info.cardCaseId);
+        },
         detail() {
             if (this.isMine && this.showBtn) {
                 this.$emit('choose', this.info.cardCaseId);

+ 11 - 7
src/pages/details.vue

@@ -166,13 +166,17 @@ export default {
         },
         goChat() {
             this.checkLogin().then(() => {
-                wx.navigateTo({
-                    url: `/pages/chat?toUserId=${this.storeInfo.userId}&toName=${this.storeInfo.storeName}`,
-                    success: res => {
-                        // success
-                        res.eventChannel.emit('productInfo', this.cardCaseInfo);
-                    }
-                });
+                if (this.storeInfo.userId !== this.$store.state.userInfo.id) {
+                    wx.navigateTo({
+                        url: `/pages/chat?toUserId=${this.storeInfo.userId}&toName=${this.storeInfo.storeName}`,
+                        success: res => {
+                            // success
+                            res.eventChannel.emit('productInfo', this.cardCaseInfo);
+                        }
+                    });
+                } else {
+                    this.toast('此商品是你店铺所有');
+                }
             });
         }
     },

+ 8 - 5
src/pages/store/homePage.vue

@@ -51,13 +51,14 @@
             <div class="list-content">
                 <div class="procuct" v-for="(item, index) in list" :key="index">
                     <van-icon
+                        @click="choose(item.cardCaseId)"
                         v-if="isManage"
-                        :color="checkChoose(item.id) ? $colors.prim : '#C8C9CC'"
+                        :color="checkChoose(item.cardCaseId) ? $colors.prim : '#C8C9CC'"
                         class="check"
-                        :name="checkChoose(item.id) ? 'checked' : 'circle'"
+                        :name="checkChoose(item.cardCaseId) ? 'checked' : 'circle'"
                         size="18px"
                     />
-                    <product-info :info="item" :isMine="isMineShop" :showBtn="isManage" @click="choose"></product-info>
+                    <product-info :info="item" :isMine="isMineShop" :showBtn="isManage" @choose="choose"></product-info>
                 </div>
                 <van-empty
                     v-if="empty"
@@ -70,7 +71,7 @@
 
         <div class="bottom">
             <block v-if="isManage">
-                <button-bg type="warning">新增商品 </button-bg>
+                <button-bg type="warning" @click="navigateTo('/pages/store/productEdit')">新增商品 </button-bg>
                 <button-bg type="prim" isRight v-if="chooseIds.length > 0" @click="del">删除</button-bg>
                 <button-bg type="prim" isRight v-else @click="isManage = false">完成</button-bg>
             </block>
@@ -208,9 +209,10 @@ export default {
             });
         },
         del() {
+            console.log(this.chooseIds);
             this.$http
                 .get('/cardCase/multipleDelete', {
-                    caseIds: this.chooseIds
+                    caseIds: [...this.chooseIds].join(',')
                 })
                 .then(res => {
                     return this.getData();
@@ -233,6 +235,7 @@ export default {
             return list.includes(id);
         },
         choose(id) {
+            console.log(id);
             let list = [...this.chooseIds];
             if (this.checkChoose(id)) {
                 list.splice(list.indexOf(id), 1);