许成详 6 years ago
parent
commit
4c32d7e3ab

+ 15
- 1
src/components/libraryListItem/index.vue View File

8
     <div class="flex-item">
8
     <div class="flex-item">
9
       <div>
9
       <div>
10
         <span>{{data.BookName}}</span>
10
         <span>{{data.BookName}}</span>
11
+        <h5>{{data.BookDescription}}</h5>
11
         <div class="flex-h" style="margin-top: .06rem;">
12
         <div class="flex-h" style="margin-top: .06rem;">
12
           <span class="flex-item">{{data.Author}} 著</span>
13
           <span class="flex-item">{{data.Author}} 著</span>
13
           <span class="status" @click="appointmentBook(data.BookId)">{{data.Status}}</span>
14
           <span class="status" @click="appointmentBook(data.BookId)">{{data.Status}}</span>
14
         </div>
15
         </div>
15
         <div class="flex-h">
16
         <div class="flex-h">
16
           <span class="flex-item">{{data.Publisher}}</span>
17
           <span class="flex-item">{{data.Publisher}}</span>
17
-          <span>剩余可借
18
+          <span>
19
+            剩余可借
18
             <em>{{data.LeftNum}}</em>本
20
             <em>{{data.LeftNum}}</em>本
19
           </span>
21
           </span>
20
         </div>
22
         </div>
86
         -webkit-line-clamp: 2;
88
         -webkit-line-clamp: 2;
87
         max-height: 0.43rem;
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
       > div {
103
       > div {
90
         margin-top: 0.03rem;
104
         margin-top: 0.03rem;
91
         align-items: center;
105
         align-items: center;

+ 1
- 1
src/components/slideTabH/index.vue View File

6
         v-for="(item, index) in data"
6
         v-for="(item, index) in data"
7
         :key="index"
7
         :key="index"
8
         @click="cutNav(index)"
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
       >{{item.value}}</a>
10
       >{{item.value}}</a>
11
       <div class="activeLine" id="activeLine"></div>
11
       <div class="activeLine" id="activeLine"></div>
12
     </div>
12
     </div>

+ 36
- 20
src/pages/user/library/borrowedRecord/index.vue View File

7
       normalColor="#666"
7
       normalColor="#666"
8
       @slideChange="slideChange"
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
     </slideTabH>
28
     </slideTabH>
13
   </div>
29
   </div>
14
 </template>
30
 </template>
34
     }),
50
     }),
35
     ...mapLibraryState({
51
     ...mapLibraryState({
36
       navList: x => x.navList,
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
   components: {
58
   components: {
48
     ...mapLibraryAction(['getBookListByType']),
66
     ...mapLibraryAction(['getBookListByType']),
49
     navClick (item) {
67
     navClick (item) {
50
     },
68
     },
51
-    appointmentBook () { // 预约图书
52
-      this.showAppointmentDialog = true
53
-    },
54
-    sureAppointmentBook () { // 确定预约图书
55
-      this.showAppointmentDialog = false
56
-    },
57
     slideChange (e) {
69
     slideChange (e) {
58
-      console.log(e)
70
+      if (e === 1 && !this.appointmentList.length) {
71
+      }
59
     }
72
     }
60
   }
73
   }
61
 }
74
 }
63
 
76
 
64
 <style lang="scss" scoped>
77
 <style lang="scss" scoped>
65
 .mainPage {
78
 .mainPage {
66
-  > div {
79
+  .subMain {
67
     width: 100%;
80
     width: 100%;
68
-    position: absolute;
69
-    left: 0;
70
-    top: 0;
71
-    bottom: 0;
81
+    height: 100%;
82
+    position: relative;
72
     overflow-y: scroll;
83
     overflow-y: scroll;
73
     -webkit-overflow-scrolling: touch;
84
     -webkit-overflow-scrolling: touch;
74
     transform: translateZ(0);
85
     transform: translateZ(0);
75
     -webkit-transform: translateZ(0);
86
     -webkit-transform: translateZ(0);
76
-    > ul {
77
-      padding: 0 0.16rem;
78
-      margin-bottom: 0.1rem;
87
+    > div {
88
+      width: 100%;
79
       position: relative;
89
       position: relative;
80
       overflow: hidden;
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 View File

4
 var booksData = [],
4
 var booksData = [],
5
   recordData = [],
5
   recordData = [],
6
   aTarget = {
6
   aTarget = {
7
-    img: '',
8
-    name: '书名',
7
+    BookImg: '',
8
+    BookName: '书名',
9
     id: '',
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
   bTarget = {
16
   bTarget = {
16
-    img: '',
17
-    name: '书名',
17
+    BookImg: '',
18
+    BookName: '书名',
18
     id: '',
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
 for (var n = 0; n < 10; n++) {
26
 for (var n = 0; n < 10; n++) {
25
   booksData.push(aTarget)
27
   booksData.push(aTarget)
88
     setRecommendBookList (state, data) { // 赋值精选推荐书籍列表
90
     setRecommendBookList (state, data) { // 赋值精选推荐书籍列表
89
       (data || []).map((item) => {
91
       (data || []).map((item) => {
90
         state.bookList.push({
92
         state.bookList.push({
91
-          img: '',
92
-          name: '书名',
93
+          BookImg: '',
94
+          BookName: '书名',
93
           id: '',
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
     setBookTypeList (state, data) { // 赋值分类书籍列表
107
     setBookTypeList (state, data) { // 赋值分类书籍列表
105
       (data || []).map((item) => {
108
       (data || []).map((item) => {
106
         state.bookList.push({
109
         state.bookList.push({
107
-          img: '',
108
-          name: '书名',
110
+          BookImg: '',
111
+          BookName: '书名',
109
           id: '',
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
     },