gdy96 5 anni fa
parent
commit
7707614f15
3 ha cambiato i file con 13 aggiunte e 3 eliminazioni
  1. 6 1
      src/api/index.js
  2. 1 1
      src/manifest.json
  3. 6 1
      src/views/Shelf/index.ux

+ 6 - 1
src/api/index.js

@@ -39,4 +39,9 @@ export const getSimilarBooks = (category_id, bid) => {
 // 获取充值列表
 export const getChargeList = () => {
   return fly.get("/order/chargeList");
-}
+}
+
+// 获取书架数据
+export const getUserShelfBooks = () => {
+  return fly.get(`/userShelfBooks`);
+};

+ 1 - 1
src/manifest.json

@@ -37,7 +37,7 @@
     "logLevel": "debug"
   },
   "router": {
-    "entry": "views/Index",
+    "entry": "views/Shelf",
     "pages": {
       "views/Index": {
         "component": "index"

+ 6 - 1
src/views/Shelf/index.ux

@@ -53,11 +53,13 @@
 </template>
 
 <script>
+import { getUserShelfBooks } from "../../api";
+
 export default {
   props: {},
   data() {
     return {
-      current: 1,
+      current: 0,
       isDelMode: false,
       modeText: "管理",
       mockList: [0, 1, 2, 3, 4],
@@ -74,6 +76,9 @@ export default {
     }
   },
   onInit() {
+    getUserShelfBooks().then(r => {
+      console.log(r)
+    })
     this.$watch('isDelMode', 'listenMode')
   },
   changeMode() {