wangfei пре 6 година
родитељ
комит
037aa8d6f2
3 измењених фајлова са 30 додато и 3 уклоњено
  1. 5
    1
      src/pages/user/mainPage/libraryIndex/index.vue
  2. 20
    1
      src/store/book/index.js
  3. 5
    1
      src/util/api.js

+ 5
- 1
src/pages/user/mainPage/libraryIndex/index.vue Прегледај датотеку

121
   },
121
   },
122
   methods: {
122
   methods: {
123
     ...mapAppActions(['getCaseList']),
123
     ...mapAppActions(['getCaseList']),
124
-    ...mapBookActions(['getBookType', 'getRecommendBook']),
124
+    ...mapBookActions([
125
+      'getBookType', 
126
+      'getRecommendBook', 
127
+      'getMineBook',
128
+    ]),
125
     selectCaseId () { // 选择案场
129
     selectCaseId () { // 选择案场
126
       if (this.currentCaseId !== this.caseId) {
130
       if (this.currentCaseId !== this.caseId) {
127
         this.currentCaseId = this.caseId
131
         this.currentCaseId = this.caseId

+ 20
- 1
src/store/book/index.js Прегледај датотеку

7
     types: {},
7
     types: {},
8
     recommends: {},
8
     recommends: {},
9
     books: {},
9
     books: {},
10
+    minebooks: {},
10
   },
11
   },
11
   mutations: {
12
   mutations: {
12
     updateTypeList (state, payload) {
13
     updateTypeList (state, payload) {
17
     },
18
     },
18
     updateBookList (state, payload) {
19
     updateBookList (state, payload) {
19
       state.books = payload
20
       state.books = payload
20
-    }
21
+    },
22
+    updateMineBook (state, payload) {
23
+      state.minebooks = payload
24
+    },
21
   },
25
   },
22
   actions: {
26
   actions: {
23
     getBookType ({ commit }, payload) {
27
     getBookType ({ commit }, payload) {
71
         })
75
         })
72
       })
76
       })
73
     },
77
     },
78
+    getMineBook ({ commit }, payload) {
79
+      return new Promise((resolve, reject) => {
80
+        Ajax({
81
+          ...api.library.getMineRecord,
82
+          queryData: {
83
+            ...payload
84
+          },
85
+        }).then(res => {
86
+          commit('updateMineBook', res)
87
+          resolve(res)
88
+        }).catch((err) => {
89
+          reject(err)
90
+        })
91
+      })
92
+    }
74
   }
93
   }
75
 }
94
 }

+ 5
- 1
src/util/api.js Прегледај датотеку

345
     getBookList: { // 获取书籍列表
345
     getBookList: { // 获取书籍列表
346
       method: 'get',
346
       method: 'get',
347
       url: `${baseUrl}${wechat}/book`
347
       url: `${baseUrl}${wechat}/book`
348
-    }
348
+    },
349
+    getMineRecord: {
350
+      method: 'get',
351
+      url: `${baseUrl}${wechat}/customer/book`
352
+    },
349
   }
353
   }
350
 }
354
 }
351
 export default $api
355
 export default $api