许成详 6 년 전
부모
커밋
a66255d598
4개의 변경된 파일88개의 추가작업 그리고 20개의 파일을 삭제
  1. 49
    9
      src/components/libraryListItem/index.vue
  2. 2
    2
      src/components/slideTabH/index.vue
  3. 25
    4
      src/pages/user/library/borrowedRecord/index.vue
  4. 12
    5
      src/store/library/index.js

+ 49
- 9
src/components/libraryListItem/index.vue 파일 보기

1
 <template>
1
 <template>
2
-  <div class="libraryListItem flex-h">
2
+  <div class="libraryListItem flex-h" @click="itemClick(data)">
3
     <div class="img">
3
     <div class="img">
4
       <a>
4
       <a>
5
         <img :src="data.BookImg" class="centerLabel cover" alt>
5
         <img :src="data.BookImg" class="centerLabel cover" alt>
6
       </a>
6
       </a>
7
+      <span v-if="type === 1" class="active">状态值</span>
7
     </div>
8
     </div>
8
     <div class="flex-item">
9
     <div class="flex-item">
9
       <div>
10
       <div>
10
         <span>{{data.BookName}}</span>
11
         <span>{{data.BookName}}</span>
11
-        <h5>{{data.BookDescription}}</h5>
12
-        <div class="flex-h" style="margin-top: .06rem;">
12
+        <h5 v-if="!type">{{data.BookDescription}}</h5>
13
+        <div v-if="!type" class="flex-h" style="margin-top: .06rem;">
13
           <span class="flex-item">{{data.Author}} 著</span>
14
           <span class="flex-item">{{data.Author}} 著</span>
14
           <span class="status" @click="appointmentBook(data.BookId)">{{data.Status}}</span>
15
           <span class="status" @click="appointmentBook(data.BookId)">{{data.Status}}</span>
15
         </div>
16
         </div>
16
-        <div class="flex-h">
17
+        <div v-if="!type" class="flex-h">
17
           <span class="flex-item">{{data.Publisher}}</span>
18
           <span class="flex-item">{{data.Publisher}}</span>
18
           <span>
19
           <span>
19
             剩余可借
20
             剩余可借
20
             <em>{{data.LeftNum}}</em>本
21
             <em>{{data.LeftNum}}</em>本
21
           </span>
22
           </span>
22
         </div>
23
         </div>
24
+        <div v-if="type === 1" class="flex-h" style="margin-top: .06rem;">
25
+          <span class="flex-item">应还时间:{{data.ReturnDate}}</span>
26
+        </div>
27
+        <div v-if="type === 1" class="flex-h">
28
+          <span class="flex-item">{{data.CaseName}}</span>
29
+          <span>已归还</span>
30
+          <span>已逾期
31
+            <em>4</em>天
32
+          </span>
33
+        </div>
34
+        <div v-if="type === 2" class="flex-h" style="margin-top: .06rem;">
35
+          <span class="flex-item">预约时间:{{data.appointmentDate}}</span>
36
+        </div>
37
+        <div v-if="type === 2" class="flex-h" style="margin-top: 0;">
38
+          <span class="flex-item">预约资格将保留至:2018-12-08</span>
39
+        </div>
40
+        <div v-if="type === 2" class="flex-h" style="margin-top: 0;">
41
+          <span class="flex-item">{{data.CaseName}}</span>
42
+        </div>
23
       </div>
43
       </div>
24
     </div>
44
     </div>
25
   </div>
45
   </div>
29
 
49
 
30
 export default {
50
 export default {
31
   name: '',
51
   name: '',
32
-  props: ['data'],
52
+  props: ['data', 'type'],
33
   data () {
53
   data () {
34
     return {
54
     return {
35
     }
55
     }
43
   methods: {
63
   methods: {
44
     appointmentBook (id) {
64
     appointmentBook (id) {
45
       this.$emit('appointmentBook', id)
65
       this.$emit('appointmentBook', id)
66
+    },
67
+    itemClick (target) {
68
+      this.$emit('itemClick', target)
46
     }
69
     }
47
   }
70
   }
48
 }
71
 }
53
 .libraryListItem {
76
 .libraryListItem {
54
   width: 100%;
77
   width: 100%;
55
   position: relative;
78
   position: relative;
56
-  overflow: hidden;
79
+  overflow: visible;
57
   align-items: center;
80
   align-items: center;
58
   .img {
81
   .img {
59
     width: 0.78rem;
82
     width: 0.78rem;
60
     position: relative;
83
     position: relative;
61
-    overflow: hidden;
84
+    overflow: visible;
62
     a {
85
     a {
63
       width: 100%;
86
       width: 100%;
64
       display: block;
87
       display: block;
68
       padding-bottom: 143.5%;
91
       padding-bottom: 143.5%;
69
       background: #eee;
92
       background: #eee;
70
       border-radius: 0.03rem;
93
       border-radius: 0.03rem;
94
+      z-index: 1;
95
+    }
96
+    > span {
97
+      display: inline-block;
98
+      position: absolute;
99
+      left: -0.1rem;
100
+      bottom: 0.2rem;
101
+      z-index: 2;
102
+      font-size: 0.12rem;
103
+      color: #fff;
104
+      background: #333;
105
+      line-height: 0.25rem;
106
+      border-radius: 0.25rem;
107
+      padding: 0 0.15rem;
108
+      &.active{
109
+        background: #fc5534;
110
+      }
71
     }
111
     }
72
   }
112
   }
73
   > div.flex-item {
113
   > div.flex-item {
89
         max-height: 0.43rem;
129
         max-height: 0.43rem;
90
       }
130
       }
91
       > h5 {
131
       > h5 {
92
-        font-size: .12rem;
132
+        font-size: 0.11rem;
93
         color: #ccc;
133
         color: #ccc;
94
-        line-height: .16rem;
134
+        line-height: 0.16rem;
95
         font-weight: normal;
135
         font-weight: normal;
96
         overflow: hidden;
136
         overflow: hidden;
97
         text-overflow: ellipsis;
137
         text-overflow: ellipsis;

+ 2
- 2
src/components/slideTabH/index.vue 파일 보기

148
     }
148
     }
149
     .activeLine {
149
     .activeLine {
150
       height: 0.02rem;
150
       height: 0.02rem;
151
-      background: #f9064b;
151
+      background: #fc6243;
152
       position: absolute;
152
       position: absolute;
153
       left: 0;
153
       left: 0;
154
       bottom: -.02rem;
154
       bottom: -.02rem;
155
       z-index: 1000;
155
       z-index: 1000;
156
-      box-shadow: 0 0 .1rem .01rem rgba(249, 6, 75, 0.9);
156
+      box-shadow: 0 0 .1rem .01rem rgba(252, 98, 67, 0.9);
157
     }
157
     }
158
   }
158
   }
159
   > .flex-item {
159
   > .flex-item {

+ 25
- 4
src/pages/user/library/borrowedRecord/index.vue 파일 보기

11
         <div>
11
         <div>
12
           <ul>
12
           <ul>
13
             <li v-for="(item, index) in borrowedRecordList" :key="index">
13
             <li v-for="(item, index) in borrowedRecordList" :key="index">
14
-              <libraryListItem :data="item"></libraryListItem>
14
+              <libraryListItem :data="item" :type="1" @itemClick="borrowedRecordClick"></libraryListItem>
15
             </li>
15
             </li>
16
           </ul>
16
           </ul>
17
         </div>
17
         </div>
18
       </div>
18
       </div>
19
       <div class="subMain" slot="slideTabH-2">
19
       <div class="subMain" slot="slideTabH-2">
20
         <div>
20
         <div>
21
+          <span>请在资格保留时间内至案场借阅图书,超出预约时间将取消预约资格</span>
21
           <ul>
22
           <ul>
22
             <li v-for="(item, index) in appointmentList" :key="index">
23
             <li v-for="(item, index) in appointmentList" :key="index">
23
-              <libraryListItem :data="item"></libraryListItem>
24
+              <libraryListItem :data="item" :type="2"></libraryListItem>
24
             </li>
25
             </li>
25
           </ul>
26
           </ul>
26
         </div>
27
         </div>
27
       </div>
28
       </div>
28
     </slideTabH>
29
     </slideTabH>
30
+    <van-dialog v-model="showDialog" :show-confirm-button="false">
31
+      <div class="borrowedRecordContent" @click="showDialog = false">
32
+        1
33
+      </div>
34
+    </van-dialog>
29
   </div>
35
   </div>
30
 </template>
36
 </template>
31
 
37
 
39
   data () {
45
   data () {
40
     return {
46
     return {
41
       tabList: [{ value: '借阅记录', id: '1' }, { value: '线上预约记录', id: '2' }],
47
       tabList: [{ value: '借阅记录', id: '1' }, { value: '线上预约记录', id: '2' }],
42
-      showAppointmentDialog: false
48
+      showDialog: false
43
     }
49
     }
44
   },
50
   },
45
   created () {
51
   created () {
69
     slideChange (e) {
75
     slideChange (e) {
70
       if (e === 1 && !this.appointmentList.length) {
76
       if (e === 1 && !this.appointmentList.length) {
71
       }
77
       }
72
-    }
78
+    },
79
+    borrowedRecordClick (e) { // 借阅记录点击事件
80
+      this.showDialog = true
81
+    },
73
   }
82
   }
74
 }
83
 }
75
 </script>
84
 </script>
88
       width: 100%;
97
       width: 100%;
89
       position: relative;
98
       position: relative;
90
       overflow: hidden;
99
       overflow: hidden;
100
+      > span {
101
+        width: 100%;
102
+        display: block;
103
+        white-space: nowrap;
104
+        overflow: hidden;
105
+        font-size: 0.1rem;
106
+        background: #fdecec;
107
+        color: #fc6243;
108
+        line-height: 0.24rem;
109
+        text-indent: 0.15rem;
110
+        padding-top: 0.02rem;
111
+      }
91
       > ul {
112
       > ul {
92
         padding: 0 0.16rem;
113
         padding: 0 0.16rem;
93
         margin-bottom: 0.1rem;
114
         margin-bottom: 0.1rem;

+ 12
- 5
src/store/library/index.js 파일 보기

3
 
3
 
4
 var booksData = [],
4
 var booksData = [],
5
   recordData = [],
5
   recordData = [],
6
+  appointmentListData = [],
6
   aTarget = {
7
   aTarget = {
7
     BookImg: '',
8
     BookImg: '',
8
     BookName: '书名',
9
     BookName: '书名',
18
     BookName: '书名',
19
     BookName: '书名',
19
     id: '',
20
     id: '',
20
     Status: '状态',
21
     Status: '状态',
21
-    Author: '作者',
22
-    Publisher: '出版社',
23
-    LeftNum: '10',
24
-    BookDescription: '描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述'
22
+    ReturnDate: '2018-08-02',
23
+    CaseName: '案场名称'
24
+  },
25
+  cTarget = {
26
+    BookImg: '',
27
+    BookName: '书名',
28
+    id: '',
29
+    appointmentDate: '2018-08-02 12:00:00',
30
+    CaseName: '案场名称'
25
   }
31
   }
26
 for (var n = 0; n < 10; n++) {
32
 for (var n = 0; n < 10; n++) {
27
   booksData.push(aTarget)
33
   booksData.push(aTarget)
28
   recordData.push(bTarget)
34
   recordData.push(bTarget)
35
+  appointmentListData.push(cTarget)
29
 }
36
 }
30
 
37
 
31
 export default {
38
 export default {
69
     bookTypeList: booksData, // 分类书籍列表
76
     bookTypeList: booksData, // 分类书籍列表
70
     searchBooksList: booksData, // 搜索书籍列表
77
     searchBooksList: booksData, // 搜索书籍列表
71
     borrowedRecordList: recordData, // 借阅记录列表
78
     borrowedRecordList: recordData, // 借阅记录列表
72
-    appointmentList: recordData // 线上预约列表
79
+    appointmentList: appointmentListData // 线上预约列表
73
   },
80
   },
74
   mutations: {
81
   mutations: {
75
     setIndexSearchKey (state, data) { // 赋值图书首页搜索关键词
82
     setIndexSearchKey (state, data) { // 赋值图书首页搜索关键词