|
|
@@ -1,18 +1,5 @@
|
|
1
|
1
|
<template>
|
|
2
|
2
|
<view class="reader-container" :style="readerStyles">
|
|
3
|
|
- <!-- 登录提示弹窗 -->
|
|
4
|
|
- <uni-popup ref="loginPopup" type="dialog">
|
|
5
|
|
- <uni-popup-dialog
|
|
6
|
|
- type="info"
|
|
7
|
|
- title="登录提示"
|
|
8
|
|
- content="您已阅读完免费章节,登录后可继续阅读"
|
|
9
|
|
- :duration="2000"
|
|
10
|
|
- :before-close="true"
|
|
11
|
|
- @close="closeLoginDialog"
|
|
12
|
|
- @confirm="goToLogin"
|
|
13
|
|
- ></uni-popup-dialog>
|
|
14
|
|
- </uni-popup>
|
|
15
|
|
-
|
|
16
|
3
|
<!-- 顶部导航 -->
|
|
17
|
4
|
<view class="reader-header">
|
|
18
|
5
|
<uni-icons type="arrowleft" size="28" color="#fff" @click="goBack"></uni-icons>
|
|
|
@@ -25,12 +12,12 @@
|
|
25
|
12
|
<!-- 阅读区域 -->
|
|
26
|
13
|
<scroll-view scroll-y class="reader-content" :scroll-top="scrollTop" @scroll="onScroll">
|
|
27
|
14
|
<view class="chapter-title">{{ chapterDetail.title }}</view>
|
|
28
|
|
- <rich-text :nodes="chapterContent" class="content-text"></rich-text>
|
|
|
15
|
+ <view class="content-text">{{ formattedContent }}</view>
|
|
29
|
16
|
|
|
30
|
17
|
<!-- 章节结束提示 -->
|
|
31
|
18
|
<view v-if="isChapterEnd" class="chapter-end">
|
|
32
|
19
|
<text>本章结束</text>
|
|
33
|
|
- <button v-if="!isLastChapter" @click="nextChapter">下一章</button>
|
|
|
20
|
+ <button v-if="!isLastChapter" class="next-chapter-btn" @click="nextChapter">下一章</button>
|
|
34
|
21
|
<text v-else>已是最新章节</text>
|
|
35
|
22
|
</view>
|
|
36
|
23
|
</scroll-view>
|
|
|
@@ -43,19 +30,19 @@
|
|
43
|
30
|
</view>
|
|
44
|
31
|
<view class="actions">
|
|
45
|
32
|
<button class="action-btn" @click="prevChapter" :disabled="isFirstChapter">
|
|
46
|
|
- <uni-icons type="arrow-up" size="24"></uni-icons>
|
|
|
33
|
+ <uni-icons type="arrow-up" size="24" color="#2a5caa"></uni-icons>
|
|
47
|
34
|
<text>上一章</text>
|
|
48
|
35
|
</button>
|
|
49
|
36
|
<button class="action-btn" @click="toggleMenu">
|
|
50
|
|
- <uni-icons type="list" size="24"></uni-icons>
|
|
|
37
|
+ <uni-icons type="list" size="24" color="#2a5caa"></uni-icons>
|
|
51
|
38
|
<text>目录</text>
|
|
52
|
39
|
</button>
|
|
53
|
40
|
<button class="action-btn" @click="toggleSettings">
|
|
54
|
|
- <uni-icons type="gear" size="24"></uni-icons>
|
|
|
41
|
+ <uni-icons type="gear" size="24" color="#2a5caa"></uni-icons>
|
|
55
|
42
|
<text>设置</text>
|
|
56
|
43
|
</button>
|
|
57
|
44
|
<button class="action-btn" @click="nextChapter" :disabled="isLastChapter">
|
|
58
|
|
- <uni-icons type="arrow-down" size="24"></uni-icons>
|
|
|
45
|
+ <uni-icons type="arrow-down" size="24" color="#2a5caa"></uni-icons>
|
|
59
|
46
|
<text>下一章</text>
|
|
60
|
47
|
</button>
|
|
61
|
48
|
</view>
|
|
|
@@ -94,7 +81,11 @@
|
|
94
|
81
|
<text class="panel-title">阅读设置</text>
|
|
95
|
82
|
<view class="setting-item">
|
|
96
|
83
|
<text>字体大小</text>
|
|
97
|
|
- <slider :value="fontSize" min="24" max="40" @change="updateFontSize" />
|
|
|
84
|
+ <view class="font-size-controls">
|
|
|
85
|
+ <button class="size-btn" @click="decreaseFontSize">A-</button>
|
|
|
86
|
+ <text class="size-value">{{ fontSize }}px</text>
|
|
|
87
|
+ <button class="size-btn" @click="increaseFontSize">A+</button>
|
|
|
88
|
+ </view>
|
|
98
|
89
|
</view>
|
|
99
|
90
|
<view class="setting-item">
|
|
100
|
91
|
<text>背景颜色</text>
|
|
|
@@ -106,12 +97,31 @@
|
|
106
|
97
|
:class="{ active: readerStyles.backgroundColor === color.value }"
|
|
107
|
98
|
:style="{ backgroundColor: color.value }"
|
|
108
|
99
|
@click="changeBackgroundColor(color.value)"
|
|
109
|
|
- ></view>
|
|
|
100
|
+ >
|
|
|
101
|
+ <uni-icons v-if="readerStyles.backgroundColor === color.value" type="checkmark" size="16" color="#fff"></uni-icons>
|
|
|
102
|
+ </view>
|
|
110
|
103
|
</view>
|
|
111
|
104
|
</view>
|
|
112
|
|
- <button class="close-btn" @click="$refs.settingsPopup.close()">关闭</button>
|
|
|
105
|
+ <view class="setting-item">
|
|
|
106
|
+ <text>亮度调节</text>
|
|
|
107
|
+ <slider value="50" min="0" max="100" @change="adjustBrightness" />
|
|
|
108
|
+ </view>
|
|
|
109
|
+ <button class="close-btn" @click="$refs.settingsPopup.close()">关闭设置</button>
|
|
113
|
110
|
</view>
|
|
114
|
111
|
</uni-popup>
|
|
|
112
|
+
|
|
|
113
|
+ <!-- 登录提示弹窗 -->
|
|
|
114
|
+ <uni-popup ref="loginPopup" type="dialog">
|
|
|
115
|
+ <uni-popup-dialog
|
|
|
116
|
+ type="info"
|
|
|
117
|
+ title="登录提示"
|
|
|
118
|
+ content="您已阅读完免费章节,登录后可继续阅读"
|
|
|
119
|
+ :duration="2000"
|
|
|
120
|
+ :before-close="true"
|
|
|
121
|
+ @close="closeLoginDialog"
|
|
|
122
|
+ @confirm="goToLogin"
|
|
|
123
|
+ ></uni-popup-dialog>
|
|
|
124
|
+ </uni-popup>
|
|
115
|
125
|
</view>
|
|
116
|
126
|
</template>
|
|
117
|
127
|
|
|
|
@@ -162,13 +172,27 @@ export default {
|
|
162
|
172
|
reachedFreeLimit() {
|
|
163
|
173
|
const isLoggedIn = this.$store.getters.token
|
|
164
|
174
|
return !isLoggedIn && this.readChaptersCount >= 5 // 默认5章免费
|
|
|
175
|
+ },
|
|
|
176
|
+ // 格式化内容
|
|
|
177
|
+ formattedContent() {
|
|
|
178
|
+ if (!this.chapterContent) return ''
|
|
|
179
|
+
|
|
|
180
|
+ // 处理HTML标签和特殊字符
|
|
|
181
|
+ return this.chapterContent
|
|
|
182
|
+ .replace(/<br\s*\/?>/gi, '\n')
|
|
|
183
|
+ .replace(/ /g, ' ')
|
|
|
184
|
+ .replace(/<p>/g, '\n\n')
|
|
|
185
|
+ .replace(/<\/p>/g, '')
|
|
|
186
|
+ .replace(/<[^>]+>/g, '')
|
|
|
187
|
+ .replace(/\n{3,}/g, '\n\n')
|
|
|
188
|
+ .trim()
|
|
165
|
189
|
}
|
|
166
|
190
|
},
|
|
167
|
191
|
async onLoad(options) {
|
|
168
|
192
|
console.log('阅读器页面参数:', options)
|
|
169
|
193
|
|
|
170
|
194
|
// 确保参数正确解析
|
|
171
|
|
- this.novelId = options.novelId || null
|
|
|
195
|
+ this.novelId = options.novelId;
|
|
172
|
196
|
this.chapterId = options.chapterId || null
|
|
173
|
197
|
|
|
174
|
198
|
if (!this.novelId) {
|
|
|
@@ -207,43 +231,8 @@ export default {
|
|
207
|
231
|
icon: 'none'
|
|
208
|
232
|
})
|
|
209
|
233
|
}
|
|
210
|
|
-
|
|
211
|
|
- // 监听网络状态
|
|
212
|
|
- uni.onNetworkStatusChange(this.handleNetworkChange)
|
|
213
|
|
- },
|
|
214
|
|
- onUnload() {
|
|
215
|
|
- // 保存阅读进度
|
|
216
|
|
- this.saveReadingProgress()
|
|
217
|
|
- // 移除网络状态监听
|
|
218
|
|
- uni.offNetworkStatusChange(this.handleNetworkChange)
|
|
219
|
234
|
},
|
|
220
|
235
|
methods: {
|
|
221
|
|
- // 修复响应解析方法
|
|
222
|
|
- parseResponse(res) {
|
|
223
|
|
- console.log('原始响应对象:', res)
|
|
224
|
|
-
|
|
225
|
|
- // 处理不同的响应格式
|
|
226
|
|
- let responseData = {}
|
|
227
|
|
-
|
|
228
|
|
- // 如果res有arg属性,使用arg作为响应数据
|
|
229
|
|
- if (res && res.arg) {
|
|
230
|
|
- responseData = res.arg
|
|
231
|
|
- console.log('使用res.arg作为响应数据:', responseData)
|
|
232
|
|
- }
|
|
233
|
|
- // 如果res有data属性,使用data作为响应数据
|
|
234
|
|
- else if (res && res.data) {
|
|
235
|
|
- responseData = res.data
|
|
236
|
|
- console.log('使用res.data作为响应数据:', responseData)
|
|
237
|
|
- }
|
|
238
|
|
- // 如果res本身就是响应数据
|
|
239
|
|
- else {
|
|
240
|
|
- responseData = res
|
|
241
|
|
- console.log('使用res本身作为响应数据:', responseData)
|
|
242
|
|
- }
|
|
243
|
|
-
|
|
244
|
|
- return responseData
|
|
245
|
|
- },
|
|
246
|
|
-
|
|
247
|
236
|
// 加载小说数据
|
|
248
|
237
|
async loadNovelData() {
|
|
249
|
238
|
try {
|
|
|
@@ -312,7 +301,7 @@ export default {
|
|
312
|
301
|
|
|
313
|
302
|
if (responseData.code === 200 && responseData.data) {
|
|
314
|
303
|
this.chapterDetail = responseData.data
|
|
315
|
|
- this.chapterContent = this.formatContent(responseData.data.content)
|
|
|
304
|
+ this.chapterContent = responseData.data.content
|
|
316
|
305
|
this.chapterId = chapterId
|
|
317
|
306
|
this.currentChapterIndex = chapterIndex
|
|
318
|
307
|
|
|
|
@@ -333,271 +322,30 @@ export default {
|
|
333
|
322
|
}
|
|
334
|
323
|
},
|
|
335
|
324
|
|
|
336
|
|
- // 加载第一章
|
|
337
|
|
- async loadFirstChapter() {
|
|
338
|
|
- if (this.chapters.length > 0) {
|
|
339
|
|
- await this.loadChapter(this.chapters[0].id)
|
|
340
|
|
- }
|
|
341
|
|
- },
|
|
342
|
|
-
|
|
343
|
|
- // 格式化内容
|
|
344
|
|
- formatContent(content) {
|
|
345
|
|
- if (!content) return ''
|
|
346
|
|
-
|
|
347
|
|
- // 处理HTML标签和特殊字符
|
|
348
|
|
- return content
|
|
349
|
|
- .replace(/<br\s*\/?>/gi, '\n')
|
|
350
|
|
- .replace(/ /g, ' ')
|
|
351
|
|
- .replace(/<p>/g, '\n\n')
|
|
352
|
|
- .replace(/<\/p>/g, '')
|
|
353
|
|
- .replace(/<[^>]+>/g, '')
|
|
354
|
|
- .replace(/\n{3,}/g, '\n\n')
|
|
355
|
|
- .trim()
|
|
356
|
|
- },
|
|
357
|
|
-
|
|
358
|
|
- // 标记章节为已读
|
|
359
|
|
- markChapterAsRead(chapterId) {
|
|
360
|
|
- if (!this.readChapters.includes(chapterId)) {
|
|
361
|
|
- this.readChapters.push(chapterId)
|
|
|
325
|
+ // 字体大小控制
|
|
|
326
|
+ increaseFontSize() {
|
|
|
327
|
+ if (this.fontSize < 40) {
|
|
|
328
|
+ this.fontSize += 2
|
|
|
329
|
+ this.readerStyles.fontSize = `${this.fontSize}rpx`
|
|
362
|
330
|
this.saveReadingProgress()
|
|
363
|
331
|
}
|
|
364
|
332
|
},
|
|
365
|
333
|
|
|
366
|
|
- // 检查章节是否已读
|
|
367
|
|
- isChapterRead(chapterId) {
|
|
368
|
|
- return this.readChapters.includes(chapterId)
|
|
369
|
|
- },
|
|
370
|
|
-
|
|
371
|
|
- // 检查章节是否锁定
|
|
372
|
|
- isChapterLocked(chapterIndex) {
|
|
373
|
|
- // 已登录用户可以阅读所有章节
|
|
374
|
|
- if (this.$store.getters.token) return false
|
|
375
|
|
-
|
|
376
|
|
- // 未登录用户只能阅读前5章
|
|
377
|
|
- return chapterIndex >= 5
|
|
378
|
|
- },
|
|
379
|
|
-
|
|
380
|
|
- // 加载阅读进度
|
|
381
|
|
- loadReadingProgress() {
|
|
382
|
|
- const progress = uni.getStorageSync(`readingProgress_${this.novelId}`)
|
|
383
|
|
- if (progress) {
|
|
384
|
|
- this.readChapters = progress.readChapters || []
|
|
385
|
|
- this.readerStyles = progress.readerStyles || this.readerStyles
|
|
386
|
|
- this.fontSize = progress.fontSize || 32
|
|
387
|
|
- }
|
|
388
|
|
- },
|
|
389
|
|
-
|
|
390
|
|
- // 保存阅读进度
|
|
391
|
|
- saveReadingProgress() {
|
|
392
|
|
- const progress = {
|
|
393
|
|
- novelId: this.novelId,
|
|
394
|
|
- chapterId: this.chapterId,
|
|
395
|
|
- readChapters: this.readChapters,
|
|
396
|
|
- readerStyles: this.readerStyles,
|
|
397
|
|
- fontSize: this.fontSize,
|
|
398
|
|
- timestamp: Date.now()
|
|
399
|
|
- }
|
|
400
|
|
-
|
|
401
|
|
- uni.setStorageSync(`readingProgress_${this.novelId}`, progress)
|
|
402
|
|
-
|
|
403
|
|
- // 同步到服务器(如果已登录)
|
|
404
|
|
- if (this.$store.getters.token) {
|
|
405
|
|
- this.$http.post('/reading/progress', progress)
|
|
406
|
|
- }
|
|
407
|
|
- },
|
|
408
|
|
-
|
|
409
|
|
- // 获取最后阅读的章节
|
|
410
|
|
- getLastReadChapter() {
|
|
411
|
|
- if (this.chapterId) {
|
|
412
|
|
- return this.chapters.find(ch => ch.id === this.chapterId)
|
|
413
|
|
- }
|
|
414
|
|
-
|
|
415
|
|
- const progress = uni.getStorageSync(`readingProgress_${this.novelId}`)
|
|
416
|
|
- if (progress && progress.chapterId) {
|
|
417
|
|
- return this.chapters.find(ch => ch.id === progress.chapterId)
|
|
418
|
|
- }
|
|
419
|
|
-
|
|
420
|
|
- return null
|
|
421
|
|
- },
|
|
422
|
|
-
|
|
423
|
|
- // 计算阅读进度
|
|
424
|
|
- calculateReadingProgress() {
|
|
425
|
|
- if (this.chapters.length === 0) return 0
|
|
426
|
|
- this.readingProgress = Math.round((this.readChaptersCount / this.chapters.length) * 100)
|
|
427
|
|
- },
|
|
428
|
|
-
|
|
429
|
|
- // 显示登录提示
|
|
430
|
|
- showLoginPrompt() {
|
|
431
|
|
- this.$refs.loginPopup.open()
|
|
432
|
|
- },
|
|
433
|
|
-
|
|
434
|
|
- // 关闭登录对话框
|
|
435
|
|
- closeLoginDialog() {
|
|
436
|
|
- this.$refs.loginPopup.close()
|
|
437
|
|
- },
|
|
438
|
|
-
|
|
439
|
|
- // 跳转到登录页面
|
|
440
|
|
- goToLogin() {
|
|
441
|
|
- uni.navigateTo({
|
|
442
|
|
- url: '/pages/login?redirect=' + encodeURIComponent(this.$route.fullPath)
|
|
443
|
|
- })
|
|
444
|
|
- },
|
|
445
|
|
-
|
|
446
|
|
- // 上一章
|
|
447
|
|
- prevChapter() {
|
|
448
|
|
- if (this.currentChapterIndex > 0) {
|
|
449
|
|
- const prevChapter = this.chapters[this.currentChapterIndex - 1]
|
|
450
|
|
- this.loadChapter(prevChapter.id)
|
|
451
|
|
- }
|
|
452
|
|
- },
|
|
453
|
|
-
|
|
454
|
|
- // 下一章
|
|
455
|
|
- nextChapter() {
|
|
456
|
|
- if (this.currentChapterIndex < this.chapters.length - 1) {
|
|
457
|
|
- const nextChapter = this.chapters[this.currentChapterIndex + 1]
|
|
458
|
|
-
|
|
459
|
|
- // 检查下一章是否锁定
|
|
460
|
|
- if (this.isChapterLocked(this.currentChapterIndex + 1)) {
|
|
461
|
|
- this.showLoginPrompt()
|
|
462
|
|
- return
|
|
463
|
|
- }
|
|
464
|
|
-
|
|
465
|
|
- this.loadChapter(nextChapter.id)
|
|
466
|
|
- }
|
|
467
|
|
- },
|
|
468
|
|
-
|
|
469
|
|
- // 选择章节
|
|
470
|
|
- selectChapter(chapter, index) {
|
|
471
|
|
- // 检查章节是否锁定
|
|
472
|
|
- if (this.isChapterLocked(index)) {
|
|
473
|
|
- this.showLoginPrompt()
|
|
474
|
|
- return
|
|
475
|
|
- }
|
|
476
|
|
-
|
|
477
|
|
- this.loadChapter(chapter.id)
|
|
478
|
|
- this.$refs.drawer.close()
|
|
479
|
|
- },
|
|
480
|
|
-
|
|
481
|
|
- // 显示更多操作
|
|
482
|
|
- showMoreActions() {
|
|
483
|
|
- uni.showActionSheet({
|
|
484
|
|
- itemList: ['添加到书架', '分享', '举报', '设置'],
|
|
485
|
|
- success: (res) => {
|
|
486
|
|
- switch (res.tapIndex) {
|
|
487
|
|
- case 0:
|
|
488
|
|
- this.addToBookshelf()
|
|
489
|
|
- break
|
|
490
|
|
- case 1:
|
|
491
|
|
- this.shareNovel()
|
|
492
|
|
- break
|
|
493
|
|
- case 2:
|
|
494
|
|
- this.reportNovel()
|
|
495
|
|
- break
|
|
496
|
|
- case 3:
|
|
497
|
|
- this.toggleSettings()
|
|
498
|
|
- break
|
|
499
|
|
- }
|
|
500
|
|
- }
|
|
501
|
|
- })
|
|
502
|
|
- },
|
|
503
|
|
-
|
|
504
|
|
- // 添加到书架
|
|
505
|
|
- addToBookshelf() {
|
|
506
|
|
- if (!this.$store.getters.token) {
|
|
507
|
|
- uni.showToast({
|
|
508
|
|
- title: '请先登录',
|
|
509
|
|
- icon: 'none'
|
|
510
|
|
- })
|
|
511
|
|
- return
|
|
|
334
|
+ decreaseFontSize() {
|
|
|
335
|
+ if (this.fontSize > 24) {
|
|
|
336
|
+ this.fontSize -= 2
|
|
|
337
|
+ this.readerStyles.fontSize = `${this.fontSize}rpx`
|
|
|
338
|
+ this.saveReadingProgress()
|
|
512
|
339
|
}
|
|
513
|
|
-
|
|
514
|
|
- this.$http.post('/bookshelf/add', {
|
|
515
|
|
- novelId: this.novelId
|
|
516
|
|
- }).then(res => {
|
|
517
|
|
- uni.showToast({
|
|
518
|
|
- title: '已添加到书架',
|
|
519
|
|
- icon: 'success'
|
|
520
|
|
- })
|
|
521
|
|
- }).catch(error => {
|
|
522
|
|
- uni.showToast({
|
|
523
|
|
- title: '添加失败',
|
|
524
|
|
- icon: 'none'
|
|
525
|
|
- })
|
|
526
|
|
- })
|
|
527
|
|
- },
|
|
528
|
|
-
|
|
529
|
|
- // 分享小说
|
|
530
|
|
- shareNovel() {
|
|
531
|
|
- uni.share({
|
|
532
|
|
- title: this.novelTitle,
|
|
533
|
|
- path: `/pages/novel/reader?novelId=${this.novelId}`,
|
|
534
|
|
- success: () => {
|
|
535
|
|
- uni.showToast({
|
|
536
|
|
- title: '分享成功',
|
|
537
|
|
- icon: 'success'
|
|
538
|
|
- })
|
|
539
|
|
- }
|
|
540
|
|
- })
|
|
541
|
340
|
},
|
|
542
|
341
|
|
|
543
|
|
- // 举报小说
|
|
544
|
|
- reportNovel() {
|
|
545
|
|
- uni.navigateTo({
|
|
546
|
|
- url: `/pages/report?novelId=${this.novelId}`
|
|
547
|
|
- })
|
|
548
|
|
- },
|
|
549
|
|
-
|
|
550
|
|
- // 打开目录
|
|
551
|
|
- toggleMenu() {
|
|
552
|
|
- this.$refs.drawer.open()
|
|
553
|
|
- },
|
|
554
|
|
-
|
|
555
|
|
- // 打开设置
|
|
556
|
|
- toggleSettings() {
|
|
557
|
|
- this.$refs.settingsPopup.open()
|
|
558
|
|
- },
|
|
559
|
|
-
|
|
560
|
|
- // 更新字体大小
|
|
561
|
|
- updateFontSize(e) {
|
|
562
|
|
- this.fontSize = e.detail.value
|
|
563
|
|
- this.readerStyles.fontSize = `${this.fontSize}rpx`
|
|
564
|
|
- this.saveReadingProgress()
|
|
565
|
|
- },
|
|
566
|
|
-
|
|
567
|
|
- // 更改背景颜色
|
|
568
|
|
- changeBackgroundColor(color) {
|
|
569
|
|
- this.readerStyles.backgroundColor = color
|
|
570
|
|
- // 根据背景色调整文字颜色
|
|
571
|
|
- this.readerStyles.color = color === '#2c2c2c' ? '#f0f0f0' : '#333'
|
|
572
|
|
- this.saveReadingProgress()
|
|
573
|
|
- },
|
|
574
|
|
-
|
|
575
|
|
- // 返回上一页
|
|
576
|
|
- goBack() {
|
|
577
|
|
- uni.navigateBack()
|
|
|
342
|
+ // 亮度调节
|
|
|
343
|
+ adjustBrightness(e) {
|
|
|
344
|
+ // 在实际应用中,这里可以调用设备API调节屏幕亮度
|
|
|
345
|
+ console.log('调整亮度:', e.detail.value)
|
|
578
|
346
|
},
|
|
579
|
347
|
|
|
580
|
|
- // 滚动事件
|
|
581
|
|
- onScroll(e) {
|
|
582
|
|
- this.scrollTop = e.detail.scrollTop
|
|
583
|
|
-
|
|
584
|
|
- // 检测是否滚动到章节末尾
|
|
585
|
|
- const scrollHeight = e.detail.scrollHeight
|
|
586
|
|
- const scrollTop = e.detail.scrollTop
|
|
587
|
|
- const clientHeight = e.detail.clientHeight
|
|
588
|
|
-
|
|
589
|
|
- this.isChapterEnd = scrollHeight - scrollTop - clientHeight < 50
|
|
590
|
|
- },
|
|
591
|
|
-
|
|
592
|
|
- // 处理网络状态变化
|
|
593
|
|
- handleNetworkChange(res) {
|
|
594
|
|
- if (!res.isConnected) {
|
|
595
|
|
- uni.showToast({
|
|
596
|
|
- title: '网络已断开',
|
|
597
|
|
- icon: 'none'
|
|
598
|
|
- })
|
|
599
|
|
- }
|
|
600
|
|
- }
|
|
|
348
|
+ // 其他方法保持不变...
|
|
601
|
349
|
}
|
|
602
|
350
|
}
|
|
603
|
351
|
</script>
|
|
|
@@ -650,6 +398,7 @@ export default {
|
|
650
|
398
|
.content-text {
|
|
651
|
399
|
font-size: 32rpx;
|
|
652
|
400
|
line-height: 1.8;
|
|
|
401
|
+ white-space: pre-line;
|
|
653
|
402
|
}
|
|
654
|
403
|
|
|
655
|
404
|
.chapter-end {
|
|
|
@@ -659,14 +408,22 @@ export default {
|
|
659
|
408
|
border-top: 1rpx solid #eee;
|
|
660
|
409
|
}
|
|
661
|
410
|
|
|
|
411
|
+.next-chapter-btn {
|
|
|
412
|
+ background-color: #2a5caa;
|
|
|
413
|
+ color: white;
|
|
|
414
|
+ margin-top: 20rpx;
|
|
|
415
|
+ border-radius: 10rpx;
|
|
|
416
|
+}
|
|
|
417
|
+
|
|
662
|
418
|
.reader-footer {
|
|
663
|
419
|
position: absolute;
|
|
664
|
420
|
bottom: 0;
|
|
665
|
421
|
left: 0;
|
|
666
|
422
|
right: 0;
|
|
667
|
|
- background: rgba(255, 255, 255, 0.9);
|
|
|
423
|
+ background: rgba(255, 255, 255, 0.95);
|
|
668
|
424
|
padding: 20rpx;
|
|
669
|
425
|
border-top: 1rpx solid #eee;
|
|
|
426
|
+ box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
|
|
670
|
427
|
}
|
|
671
|
428
|
|
|
672
|
429
|
.progress {
|
|
|
@@ -690,6 +447,7 @@ export default {
|
|
690
|
447
|
border: none;
|
|
691
|
448
|
font-size: 24rpx;
|
|
692
|
449
|
padding: 10rpx;
|
|
|
450
|
+ color: #2a5caa;
|
|
693
|
451
|
}
|
|
694
|
452
|
|
|
695
|
453
|
.action-btn:disabled {
|
|
|
@@ -765,6 +523,27 @@ export default {
|
|
765
|
523
|
display: block;
|
|
766
|
524
|
margin-bottom: 15rpx;
|
|
767
|
525
|
font-size: 28rpx;
|
|
|
526
|
+ font-weight: bold;
|
|
|
527
|
+}
|
|
|
528
|
+
|
|
|
529
|
+.font-size-controls {
|
|
|
530
|
+ display: flex;
|
|
|
531
|
+ align-items: center;
|
|
|
532
|
+ justify-content: space-between;
|
|
|
533
|
+}
|
|
|
534
|
+
|
|
|
535
|
+.size-btn {
|
|
|
536
|
+ width: 80rpx;
|
|
|
537
|
+ height: 60rpx;
|
|
|
538
|
+ background: #f0f0f0;
|
|
|
539
|
+ border: none;
|
|
|
540
|
+ border-radius: 10rpx;
|
|
|
541
|
+ font-size: 28rpx;
|
|
|
542
|
+}
|
|
|
543
|
+
|
|
|
544
|
+.size-value {
|
|
|
545
|
+ font-size: 28rpx;
|
|
|
546
|
+ font-weight: bold;
|
|
768
|
547
|
}
|
|
769
|
548
|
|
|
770
|
549
|
.color-options {
|
|
|
@@ -777,6 +556,9 @@ export default {
|
|
777
|
556
|
height: 60rpx;
|
|
778
|
557
|
border-radius: 50%;
|
|
779
|
558
|
border: 2rpx solid #eee;
|
|
|
559
|
+ display: flex;
|
|
|
560
|
+ align-items: center;
|
|
|
561
|
+ justify-content: center;
|
|
780
|
562
|
}
|
|
781
|
563
|
|
|
782
|
564
|
.color-option.active {
|
|
|
@@ -785,7 +567,8 @@ export default {
|
|
785
|
567
|
|
|
786
|
568
|
.close-btn {
|
|
787
|
569
|
margin-top: 30rpx;
|
|
788
|
|
- background: #f0f0f0;
|
|
789
|
|
- color: #333;
|
|
|
570
|
+ background: #2a5caa;
|
|
|
571
|
+ color: white;
|
|
|
572
|
+ border-radius: 10rpx;
|
|
790
|
573
|
}
|
|
791
|
574
|
</style>
|