许成详 6 年前
父节点
当前提交
4c32d7e3ab

+ 15
- 1
src/components/libraryListItem/index.vue 查看文件

@@ -8,13 +8,15 @@
8 8
     <div class="flex-item">
9 9
       <div>
10 10
         <span>{{data.BookName}}</span>
11
+        <h5>{{data.BookDescription}}</h5>
11 12
         <div class="flex-h" style="margin-top: .06rem;">
12 13
           <span class="flex-item">{{data.Author}} 著</span>
13 14
           <span class="status" @click="appointmentBook(data.BookId)">{{data.Status}}</span>
14 15
         </div>
15 16
         <div class="flex-h">
16 17
           <span class="flex-item">{{data.Publisher}}</span>
17
-          <span>剩余可借
18
+          <span>
19
+            剩余可借
18 20
             <em>{{data.LeftNum}}</em>本
19 21
           </span>
20 22
         </div>
@@ -86,6 +88,18 @@ export default {
86 88
         -webkit-line-clamp: 2;
87 89
         max-height: 0.43rem;
88 90
       }
91
+      > h5 {
92
+        font-size: .12rem;
93
+        color: #ccc;
94
+        line-height: .16rem;
95
+        font-weight: normal;
96
+        overflow: hidden;
97
+        text-overflow: ellipsis;
98
+        display: -webkit-box;
99
+        -webkit-box-orient: vertical;
100
+        -webkit-line-clamp: 2;
101
+        max-height: 0.31rem;
102
+      }
89 103
       > div {
90 104
         margin-top: 0.03rem;
91 105
         align-items: center;

+ 1
- 1
src/components/slideTabH/index.vue 查看文件

@@ -6,7 +6,7 @@
6 6
         v-for="(item, index) in data"
7 7
         :key="index"
8 8
         @click="cutNav(index)"
9
-        :style="{fontSize: fontSize + 'px', color: index === activeIndex ? (activeColor || 'red') : (normalColor || '#333')}"
9
+        :style="{fontSize: fontSize + 'px', fontWeight: index === activeIndex ? 'bolder' : 'normal'}"
10 10
       >{{item.value}}</a>
11 11
       <div class="activeLine" id="activeLine"></div>
12 12
     </div>

+ 36
- 20
src/pages/user/library/borrowedRecord/index.vue 查看文件

@@ -7,8 +7,24 @@
7 7
       normalColor="#666"
8 8
       @slideChange="slideChange"
9 9
     >
10
-      <div slot="slideTabH-1">1</div>
11
-      <div slot="slideTabH-2">2</div>
10
+      <div class="subMain" slot="slideTabH-1">
11
+        <div>
12
+          <ul>
13
+            <li v-for="(item, index) in borrowedRecordList" :key="index">
14
+              <libraryListItem :data="item"></libraryListItem>
15
+            </li>
16
+          </ul>
17
+        </div>
18
+      </div>
19
+      <div class="subMain" slot="slideTabH-2">
20
+        <div>
21
+          <ul>
22
+            <li v-for="(item, index) in appointmentList" :key="index">
23
+              <libraryListItem :data="item"></libraryListItem>
24
+            </li>
25
+          </ul>
26
+        </div>
27
+      </div>
12 28
     </slideTabH>
13 29
   </div>
14 30
 </template>
@@ -34,7 +50,9 @@ export default {
34 50
     }),
35 51
     ...mapLibraryState({
36 52
       navList: x => x.navList,
37
-      bookTypeList: x => x.bookTypeList
53
+      bookTypeList: x => x.bookTypeList,
54
+      borrowedRecordList: x => x.borrowedRecordList,
55
+      appointmentList: x => x.appointmentList
38 56
     })
39 57
   },
40 58
   components: {
@@ -48,14 +66,9 @@ export default {
48 66
     ...mapLibraryAction(['getBookListByType']),
49 67
     navClick (item) {
50 68
     },
51
-    appointmentBook () { // 预约图书
52
-      this.showAppointmentDialog = true
53
-    },
54
-    sureAppointmentBook () { // 确定预约图书
55
-      this.showAppointmentDialog = false
56
-    },
57 69
     slideChange (e) {
58
-      console.log(e)
70
+      if (e === 1 && !this.appointmentList.length) {
71
+      }
59 72
     }
60 73
   }
61 74
 }
@@ -63,23 +76,26 @@ export default {
63 76
 
64 77
 <style lang="scss" scoped>
65 78
 .mainPage {
66
-  > div {
79
+  .subMain {
67 80
     width: 100%;
68
-    position: absolute;
69
-    left: 0;
70
-    top: 0;
71
-    bottom: 0;
81
+    height: 100%;
82
+    position: relative;
72 83
     overflow-y: scroll;
73 84
     -webkit-overflow-scrolling: touch;
74 85
     transform: translateZ(0);
75 86
     -webkit-transform: translateZ(0);
76
-    > ul {
77
-      padding: 0 0.16rem;
78
-      margin-bottom: 0.1rem;
87
+    > div {
88
+      width: 100%;
79 89
       position: relative;
80 90
       overflow: hidden;
81
-      li {
82
-        margin: 0.1rem auto 0;
91
+      > ul {
92
+        padding: 0 0.16rem;
93
+        margin-bottom: 0.1rem;
94
+        position: relative;
95
+        overflow: hidden;
96
+        li {
97
+          margin: 0.1rem auto 0;
98
+        }
83 99
       }
84 100
     }
85 101
   }

+ 28
- 24
src/store/library/index.js 查看文件

@@ -4,22 +4,24 @@ import api from '../../util/api'
4 4
 var booksData = [],
5 5
   recordData = [],
6 6
   aTarget = {
7
-    img: '',
8
-    name: '书名',
7
+    BookImg: '',
8
+    BookName: '书名',
9 9
     id: '',
10
-    status: '状态',
11
-    author: '作者',
12
-    publishingHouses: '出版社',
13
-    stock: '10'
10
+    Status: '状态',
11
+    Author: '作者',
12
+    Publisher: '出版社',
13
+    LeftNum: '10',
14
+    BookDescription: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述'
14 15
   },
15 16
   bTarget = {
16
-    img: '',
17
-    name: '书名',
17
+    BookImg: '',
18
+    BookName: '书名',
18 19
     id: '',
19
-    status: '状态',
20
-    author: '作者',
21
-    publishingHouses: '出版社',
22
-    stock: '10'
20
+    Status: '状态',
21
+    Author: '作者',
22
+    Publisher: '出版社',
23
+    LeftNum: '10',
24
+    BookDescription: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述'
23 25
   }
24 26
 for (var n = 0; n < 10; n++) {
25 27
   booksData.push(aTarget)
@@ -88,13 +90,14 @@ export default {
88 90
     setRecommendBookList (state, data) { // 赋值精选推荐书籍列表
89 91
       (data || []).map((item) => {
90 92
         state.bookList.push({
91
-          img: '',
92
-          name: '书名',
93
+          BookImg: '',
94
+          BookName: '书名',
93 95
           id: '',
94
-          status: '状态',
95
-          author: '作者',
96
-          publishingHouses: '出版社',
97
-          stock: '10'
96
+          Status: '状态',
97
+          Author: '作者',
98
+          Publisher: '出版社',
99
+          LeftNum: '10',
100
+          BookDescription: '描述描述描述描述描述描述描述描述描述'
98 101
         })
99 102
       })
100 103
     },
@@ -104,13 +107,14 @@ export default {
104 107
     setBookTypeList (state, data) { // 赋值分类书籍列表
105 108
       (data || []).map((item) => {
106 109
         state.bookList.push({
107
-          img: '',
108
-          name: '书名',
110
+          BookImg: '',
111
+          BookName: '书名',
109 112
           id: '',
110
-          status: '状态',
111
-          author: '作者',
112
-          publishingHouses: '出版社',
113
-          stock: '10'
113
+          Status: '状态',
114
+          Author: '作者',
115
+          Publisher: '出版社',
116
+          LeftNum: '10',
117
+          BookDescription: '描述描述描述描述描述描述描述描述描述'
114 118
         })
115 119
       })
116 120
     },