Browse Source

购物车bug

yangc 7 years ago
parent
commit
cbd99698b9
2 changed files with 4 additions and 4 deletions
  1. 2 2
      pages/mobile/center/user/cart.vue
  2. 2 2
      store/index.js

+ 2 - 2
pages/mobile/center/user/cart.vue

@@ -328,12 +328,12 @@
       },
       removeInvalidGoods () {
         let arr = []
-        this.allActiveObj.forEach(item => {
+        this.cartData.content.forEach(item => {
           if (item.status === 1) {
             arr.push(item.id)
           }
         })
-        if (!arr.length) {
+        if (arr.length === 0) {
           this.setRemindText('购物车内目前没有失效的产品')
         } else {
           this.doDelete(arr, '成功清除购物车内的无效产品')

+ 2 - 2
store/index.js

@@ -38,8 +38,8 @@ export const actions = {
       let messageType = route.query.messageType || ''
       store.commit('option/GET_MESSAGETYPE', messageType)
     }
-    if (cookie) {
-      if (cookie && cookie.length) {
+    if (cookie && cookie.length) {
+      if (cookie) {
         for (let i = 0; i < cookie.length; i++) {
           if (cookie[i].indexOf('JSESSIONID') > -1) {
             const sessionId = cookie[i]