|
@@ -1,7 +1,7 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="mainPage">
|
3
|
3
|
<div>
|
4
|
|
- <loadMore :on-infinite="onInfinite" :dataList="books.list">
|
|
4
|
+ <loadMore :on-infinite="onInfinite" :dataList="scrollData">
|
5
|
5
|
<div class="header flex-h">
|
6
|
6
|
<div class="flex-item flex-h">
|
7
|
7
|
<i class="iconfont icon-sousuo"></i>
|
|
@@ -54,7 +54,7 @@
|
54
|
54
|
<div class="dialogContent">
|
55
|
55
|
<span class="title">确认在线预约当前图书?</span>
|
56
|
56
|
<div>
|
57
|
|
- <span style="color: #666;">在线预约需在2018年12月20日前前往案场借阅图书, 否则 将取消预约资格</span>
|
|
57
|
+ <span style="color: #666;">在线预约需在{{reserveEndDate}}前前往案场借阅图书, 否则 将取消预约资格</span>
|
58
|
58
|
</div>
|
59
|
59
|
<div class="btn">
|
60
|
60
|
<a @click="sureAppointmentBook">确定</a>
|
|
@@ -70,6 +70,7 @@
|
70
|
70
|
import loadMore from '@/components/vue-load-more/index'
|
71
|
71
|
import libraryListItem from '../../../../components/libraryListItem/index'
|
72
|
72
|
import radio from '../../../../components/radio/index'
|
|
73
|
+import toolClass from '../../../../util/util'
|
73
|
74
|
import { mapState, createNamespacedHelpers } from 'vuex'
|
74
|
75
|
const { mapActions: mapAppActions } = createNamespacedHelpers('app')
|
75
|
76
|
const { mapState: mapBookState, mapActions: mapBookActions } = createNamespacedHelpers('book')
|
|
@@ -85,10 +86,11 @@ export default {
|
85
|
86
|
cases: [],
|
86
|
87
|
indexSearchKey: '',
|
87
|
88
|
page: 0,
|
88
|
|
- pagesize: 2,
|
|
89
|
+ pagesize: 4,
|
89
|
90
|
scrollData: {
|
90
|
91
|
noFlag: false // 暂无更多数据显示
|
91
|
|
- }
|
|
92
|
+ },
|
|
93
|
+ reserveBookId: '',
|
92
|
94
|
}
|
93
|
95
|
},
|
94
|
96
|
computed: {
|
|
@@ -98,8 +100,12 @@ export default {
|
98
|
100
|
}),
|
99
|
101
|
...mapBookState({
|
100
|
102
|
navList: x => x.types.list,
|
101
|
|
- books: x => x.recommends
|
|
103
|
+ books: x => x.recommends,
|
|
104
|
+ mineBooks: x => x.minebooks,
|
102
|
105
|
}),
|
|
106
|
+ reserveEndDate() {
|
|
107
|
+ return toolClass.calDate(7)
|
|
108
|
+ }
|
103
|
109
|
},
|
104
|
110
|
components: {
|
105
|
111
|
libraryListItem,
|
|
@@ -137,6 +143,7 @@ export default {
|
137
|
143
|
'getBookType',
|
138
|
144
|
'getRecommendBook',
|
139
|
145
|
'getMineBook',
|
|
146
|
+ 'reserveBook',
|
140
|
147
|
]),
|
141
|
148
|
selectCaseId () { // 选择案场
|
142
|
149
|
if (this.currentCaseId !== this.caseId) {
|
|
@@ -172,25 +179,42 @@ export default {
|
172
|
179
|
}).then((res) => {
|
173
|
180
|
console.log(res)
|
174
|
181
|
if (res.list.length < res.pageSize) {
|
175
|
|
- console.log(res.list.length)
|
176
|
|
- more.style.display = 'none' // 隐藏加载条
|
|
182
|
+ console.log(more.style.display)
|
|
183
|
+ more.style.display='none'// 隐藏加载条
|
177
|
184
|
} else {
|
178
|
|
- console.log(res.list.length)
|
|
185
|
+ console.log(more.style.display)
|
|
186
|
+ more.style.display='none'// 隐藏加载条
|
179
|
187
|
this.scrollData.noFlag = true
|
180
|
188
|
}
|
181
|
189
|
})
|
|
190
|
+ this.getMineBook({
|
|
191
|
+ page: 1,
|
|
192
|
+ pagesize: 1000,
|
|
193
|
+ })
|
182
|
194
|
},
|
183
|
|
- appointmentBook () { // 预约图书
|
|
195
|
+ appointmentBook (id) { // 预约图书
|
|
196
|
+ this.reserveBookId = id
|
184
|
197
|
this.showAppointmentDialog = true
|
185
|
198
|
},
|
186
|
199
|
sureAppointmentBook () { // 确定预约图书
|
|
200
|
+ this.reserveBook({
|
|
201
|
+ bookid: this.reserveBookId,
|
|
202
|
+ }).then(() => {
|
|
203
|
+ this.getMineBook({
|
|
204
|
+ page: 1,
|
|
205
|
+ pagesize: 1000,
|
|
206
|
+ })
|
|
207
|
+ })
|
187
|
208
|
this.showAppointmentDialog = false
|
188
|
209
|
},
|
189
|
210
|
navClick (item) { // 点击nav
|
190
|
211
|
this.$router.push({ name: 'booksList', query: { type: item.BookTypeId, caseid: this.currentCaseId } })
|
191
|
212
|
},
|
192
|
213
|
moreNav () {
|
193
|
|
- this.$router.push({ name: 'libraryNavList', query: { caseid: this.currentCaseId } })
|
|
214
|
+ this.$router.push({ name: 'libraryNavList', query: {caseid: this.currentCaseId} })
|
|
215
|
+ },
|
|
216
|
+ mineBookStatus (item) {
|
|
217
|
+ return ((this.mineBooks.list || []).filter(x => x.BookId === item.BookId)[0] || {}).BorrowStatus
|
194
|
218
|
}
|
195
|
219
|
}
|
196
|
220
|
}
|