|
@@ -1,16 +1,20 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="mainPage">
|
3
|
3
|
<div>
|
|
4
|
+ <div class="noData" v-if="show && (books.list || []).length < 1">
|
|
5
|
+ <img src="../../../../common/icon/kong.png" alt>
|
|
6
|
+ <span>暂无内容</span>
|
|
7
|
+ </div>
|
4
|
8
|
<ul>
|
5
|
|
- <li v-for="(item, index) in (books.list || [])" :key="index">
|
6
|
|
- <libraryListItem :data="item" @appointmentBook="appointmentBook"></libraryListItem>
|
|
9
|
+ <li v-for="(item, index) in (books.list || [])" :key="index" v-if="show">
|
|
10
|
+ <libraryListItem :data="item" :status="mineBookStatus(item)" @appointmentBook="appointmentBook"></libraryListItem>
|
7
|
11
|
</li>
|
8
|
12
|
</ul>
|
9
|
13
|
<van-dialog v-model="showAppointmentDialog" :show-confirm-button="false">
|
10
|
14
|
<div class="dialogContent">
|
11
|
15
|
<span class="title">确认在线预约当前图书?</span>
|
12
|
16
|
<div>
|
13
|
|
- <span style="color: #666;">在线预约需在2018年12月20日前前往案场借阅图书, 否则 将取消预约资格</span>
|
|
17
|
+ <span style="color: #666;">在线预约需在{{reserveEndDate}}前前往案场借阅图书, 否则 将取消预约资格</span>
|
14
|
18
|
</div>
|
15
|
19
|
<div class="btn">
|
16
|
20
|
<a @click="sureAppointmentBook">确定</a>
|
|
@@ -25,6 +29,7 @@
|
25
|
29
|
<script>
|
26
|
30
|
import libraryListItem from '../../../../components/libraryListItem/index'
|
27
|
31
|
import { createNamespacedHelpers } from 'vuex'
|
|
32
|
+import toolClass from '../../../../util/util'
|
28
|
33
|
const { mapState: mapBookState, mapActions: mapBookAction } = createNamespacedHelpers('book')
|
29
|
34
|
export default {
|
30
|
35
|
data () {
|
|
@@ -35,18 +40,30 @@ export default {
|
35
|
40
|
bookType: '',
|
36
|
41
|
page: 1,
|
37
|
42
|
pagesize: 10,
|
38
|
|
- }
|
|
43
|
+ },
|
|
44
|
+ reserveBookId: '',
|
|
45
|
+ show: false,
|
39
|
46
|
}
|
40
|
47
|
},
|
41
|
48
|
created () {
|
42
|
49
|
this.query.bookType = this.$route.query.type
|
43
|
50
|
this.query.caseid = this.$route.query.caseid
|
44
|
|
- this.getBookList(this.query)
|
|
51
|
+ this.getBookList(this.query).then(() => {
|
|
52
|
+ this.show = true
|
|
53
|
+ })
|
|
54
|
+ this.getMineBook({
|
|
55
|
+ page: 1,
|
|
56
|
+ pagesize: 1000,
|
|
57
|
+ })
|
45
|
58
|
},
|
46
|
59
|
computed: {
|
47
|
60
|
...mapBookState({
|
48
|
|
- books: x => x.books
|
49
|
|
- })
|
|
61
|
+ books: x => x.books,
|
|
62
|
+ mineBooks: x => x.minebooks,
|
|
63
|
+ }),
|
|
64
|
+ reserveEndDate() {
|
|
65
|
+ return toolClass.calDate(7)
|
|
66
|
+ }
|
50
|
67
|
},
|
51
|
68
|
components: {
|
52
|
69
|
libraryListItem,
|
|
@@ -54,12 +71,26 @@ export default {
|
54
|
71
|
methods: {
|
55
|
72
|
...mapBookAction([
|
56
|
73
|
'getBookList',
|
|
74
|
+ "getMineBook",
|
|
75
|
+ "reserveBook",
|
57
|
76
|
]),
|
58
|
|
- appointmentBook () { // 预约图书
|
|
77
|
+ appointmentBook (id) { // 预约图书
|
|
78
|
+ this.reserveBookId = id
|
59
|
79
|
this.showAppointmentDialog = true
|
60
|
80
|
},
|
61
|
81
|
sureAppointmentBook () { // 确定预约图书
|
|
82
|
+ this.reserveBook({
|
|
83
|
+ bookid: this.reserveBookId,
|
|
84
|
+ }).then(() => {
|
|
85
|
+ this.getMineBook({
|
|
86
|
+ page: 1,
|
|
87
|
+ pagesize: 1000,
|
|
88
|
+ })
|
|
89
|
+ })
|
62
|
90
|
this.showAppointmentDialog = false
|
|
91
|
+ },
|
|
92
|
+ mineBookStatus (item) {
|
|
93
|
+ return ((this.mineBooks.list || []).filter(x => x.BookId === item.BookId && (x.BorrowStatus == '4' || x.BorrowStatus == '1' || x.BorrowStatus == '0'))[0] || {}).BorrowStatus
|
63
|
94
|
}
|
64
|
95
|
}
|
65
|
96
|
}
|
|
@@ -77,6 +108,26 @@ export default {
|
77
|
108
|
-webkit-overflow-scrolling: touch;
|
78
|
109
|
transform: translateZ(0);
|
79
|
110
|
-webkit-transform: translateZ(0);
|
|
111
|
+ .noData {
|
|
112
|
+ width: 100%;
|
|
113
|
+ margin: 0.5rem auto 0;
|
|
114
|
+ position: relative;
|
|
115
|
+ overflow: hidden;
|
|
116
|
+ img {
|
|
117
|
+ width: 0.7rem;
|
|
118
|
+ display: block;
|
|
119
|
+ margin: 0 auto;
|
|
120
|
+ }
|
|
121
|
+ span {
|
|
122
|
+ width: 100%;
|
|
123
|
+ display: block;
|
|
124
|
+ text-align: center;
|
|
125
|
+ line-height: 0.3rem;
|
|
126
|
+ color: #b4b4b4;
|
|
127
|
+ font-size: 0.14rem;
|
|
128
|
+ margin: 0.05rem auto 0;
|
|
129
|
+ }
|
|
130
|
+ }
|
80
|
131
|
>ul{
|
81
|
132
|
padding: 0 .16rem;
|
82
|
133
|
margin-bottom: .1rem;
|