|
@@ -7,8 +7,9 @@
|
7
|
7
|
<i class="iconfont icon-sousuo"></i>
|
8
|
8
|
<router-link
|
9
|
9
|
class="flex-item"
|
|
10
|
+ style="line-height: .3rem;color: #ccc;"
|
10
|
11
|
:to="{name: 'booksSearch', query: {caseid: currentCaseId}}"
|
11
|
|
- >{{indexSearchKey}}</router-link>
|
|
12
|
+ >书本名称</router-link>
|
12
|
13
|
</div>
|
13
|
14
|
<a @click="showDialog = true">
|
14
|
15
|
<i class="iconfont icon-dingwei"></i>
|
|
@@ -26,7 +27,7 @@
|
26
|
27
|
<span>{{item.BookTypeName}}</span>
|
27
|
28
|
</a>
|
28
|
29
|
<a v-if="(navList || []).length > 8 " @click="moreNav()">
|
29
|
|
- <img src="https://spaceofcheng.oss-cn-beijing.aliyuncs.com/test-icon8.png" alt>
|
|
30
|
+ <img src="https://spaceofcheng.oss-cn-beijing.aliyuncs.com/icon_more.png" alt>
|
30
|
31
|
<span>更多</span>
|
31
|
32
|
</a>
|
32
|
33
|
</nav>
|
|
@@ -58,7 +59,7 @@
|
58
|
59
|
<div class="dialogContent">
|
59
|
60
|
<span class="title">确认在线预约当前图书?</span>
|
60
|
61
|
<div>
|
61
|
|
- <span style="color: #666;">在线预约需在{{reserveEndDate}}前前往案场借阅图书, 否则 将取消预约资格</span>
|
|
62
|
+ <span style="color: #666;font-size:0.14rem;">在线预约需在{{reserveEndDate}}前前往案场借阅图书, 否则将取消预约资格</span>
|
62
|
63
|
</div>
|
63
|
64
|
<div class="btn">
|
64
|
65
|
<a @click="sureAppointmentBook">确定</a>
|
|
@@ -108,6 +109,7 @@ export default {
|
108
|
109
|
navList: x => x.types.list,
|
109
|
110
|
books: x => x.recommends,
|
110
|
111
|
mineBooks: x => x.minebooks,
|
|
112
|
+ bookcaseid: x => x.bookcaseid,
|
111
|
113
|
}),
|
112
|
114
|
reserveEndDate () {
|
113
|
115
|
return toolClass.calDate(7)
|
|
@@ -118,7 +120,7 @@ export default {
|
118
|
120
|
radio,
|
119
|
121
|
loadMore
|
120
|
122
|
},
|
121
|
|
- created () {
|
|
123
|
+ mounted () {
|
122
|
124
|
if (!this.CaseList.length || this.CaseList === null) {
|
123
|
125
|
this.getCaseList().then((res) => {
|
124
|
126
|
(res.cases || []).map((item) => {
|
|
@@ -147,6 +149,7 @@ export default {
|
147
|
149
|
'getMineBook',
|
148
|
150
|
'reserveBook',
|
149
|
151
|
'updateRecommendBookLeftNum',
|
|
152
|
+ 'setBookCase',
|
150
|
153
|
]),
|
151
|
154
|
Location () {
|
152
|
155
|
let that = this
|
|
@@ -157,37 +160,52 @@ export default {
|
157
|
160
|
thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
|
158
|
161
|
}).then(() => {
|
159
|
162
|
})
|
160
|
|
- wx.getLocation({
|
161
|
|
- type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
|
162
|
|
- success: function (res) {
|
163
|
|
- let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
|
164
|
|
- let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
|
165
|
|
- for (let i = 0; i < that.CaseList.length; i++) {
|
166
|
|
- let result = that.CaseList[i].Coordinate.split(",")
|
167
|
|
- let latitude2 = parseFloat(result[0])
|
168
|
|
- let longitude2 = parseFloat(result[1])
|
169
|
|
- if (that.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
|
170
|
|
- that.currentCaseId = that.CaseList[i].CaseId
|
171
|
|
- that.currentCaseName = that.CaseList[i].CaseName
|
|
163
|
+ console.log(this.bookcaseid)
|
|
164
|
+ if(this.bookcaseid === '') {
|
|
165
|
+ wx.getLocation({
|
|
166
|
+ type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
|
|
167
|
+ success: function (res) {
|
|
168
|
+ let latitude1 = res.latitude // 纬度,浮点数,范围为90 ~ -90
|
|
169
|
+ let longitude1 = res.longitude // 经度,浮点数,范围为180 ~ -180。
|
|
170
|
+ for (let i = 0; i < that.CaseList.length; i++) {
|
|
171
|
+ let result = that.CaseList[i].Coordinate.split(",")
|
|
172
|
+ let latitude2 = parseFloat(result[0])
|
|
173
|
+ let longitude2 = parseFloat(result[1])
|
|
174
|
+ if (that.toolClass.getGreatCircleDistance(latitude1, longitude1, latitude2, longitude2) < 500) {
|
|
175
|
+ that.currentCaseId = that.CaseList[i].CaseId
|
|
176
|
+ that.caseId = that.currentCaseId
|
|
177
|
+ that.setBookCase(that.caseid)
|
|
178
|
+ that.currentCaseName = that.CaseList[i].CaseName
|
|
179
|
+ }
|
172
|
180
|
}
|
173
|
|
- }
|
174
|
|
- if (!that.currentCaseId || !that.currentCaseName) {
|
|
181
|
+ if (!that.currentCaseId || !that.currentCaseName) {
|
|
182
|
+ that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
|
|
183
|
+ that.caseId = that.currentCaseId
|
|
184
|
+ that.setBookCase(that.caseid)
|
|
185
|
+ that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
|
|
186
|
+ }
|
|
187
|
+ that.init()
|
|
188
|
+ },
|
|
189
|
+ cancel: function () {
|
|
190
|
+ that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
|
|
191
|
+ that.caseId = that.currentCaseId
|
|
192
|
+ that.setBookCase(that.caseid)
|
|
193
|
+ that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
|
|
194
|
+ that.init()
|
|
195
|
+ },
|
|
196
|
+ fail: function () {
|
175
|
197
|
that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
|
|
198
|
+ that.caseId = that.currentCaseId
|
|
199
|
+ that.setBookCase(that.caseid)
|
176
|
200
|
that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
|
|
201
|
+ that.init()
|
177
|
202
|
}
|
178
|
|
- that.init()
|
179
|
|
- },
|
180
|
|
- cancel: function () {
|
181
|
|
- that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
|
182
|
|
- that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
|
183
|
|
- that.init()
|
184
|
|
- },
|
185
|
|
- fail: function () {
|
186
|
|
- that.currentCaseId = ((that.CaseList || [])[0] || {}).CaseId
|
187
|
|
- that.currentCaseName = ((that.CaseList || [])[0] || {}).CaseName
|
188
|
|
- that.init()
|
189
|
|
- }
|
190
|
|
- })
|
|
203
|
+ })
|
|
204
|
+ } else {
|
|
205
|
+ this.currentCaseId = this.bookcaseid
|
|
206
|
+ this.caseId = this.bookcaseid
|
|
207
|
+ this.currentCaseName = (this.CaseList.filter(x => x.CaseId === this.currentCaseId)[0] || {}).CaseName
|
|
208
|
+ }
|
191
|
209
|
},
|
192
|
210
|
selectCaseId () { // 选择案场
|
193
|
211
|
if (this.currentCaseId !== this.caseId) {
|
|
@@ -195,6 +213,7 @@ export default {
|
195
|
213
|
this.CaseList.map((item) => {
|
196
|
214
|
if (item.CaseId === this.currentCaseId) this.currentCaseName = item.CaseName
|
197
|
215
|
})
|
|
216
|
+ this.setBookCase(this.caseId)
|
198
|
217
|
this.page = 1
|
199
|
218
|
this.init()
|
200
|
219
|
}
|