wangfei 6 years ago
parent
commit
3575d95e9b
1 changed files with 10 additions and 0 deletions
  1. 10
    0
      src/store/book/index.js

+ 10
- 0
src/store/book/index.js View File

32
         }
32
         }
33
         return x
33
         return x
34
       })}
34
       })}
35
+      // let list = state.recommends.list
36
+      // list = list.map(x => {
37
+      //   if(x.BookId == bookid){
38
+      //     x.LeftNum = x.LeftNum - 1
39
+      //     return x
40
+      //   }
41
+      //   return x
42
+      // })
43
+      // list.splice(list.findIndex(item => item.LeftNum < 1), 1)
44
+      // state.recommends = {...state.recommends, list}
35
     },
45
     },
36
     updateBookLeftNum(state, bookid) {
46
     updateBookLeftNum(state, bookid) {
37
       state.books = {...state.books, list: state.books.list.map(x => {
47
       state.books = {...state.books, list: state.books.list.map(x => {