fstarter 2.10.56 → 2.10.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/.babelrc +6 -6
  2. package/.editorconfig +9 -9
  3. package/index.html +22 -22
  4. package/index.js +222 -222
  5. package/package.json +104 -104
  6. package/src/App.vue +38 -38
  7. package/src/i18n/en-US.js +35 -35
  8. package/src/i18n/zh-CN.js +35 -35
  9. package/src/main.js +95 -95
  10. package/src/plugins/assets/ak.js +948 -948
  11. package/src/plugins/assets/callNative.js +490 -490
  12. package/src/plugins/assets/compressImg.js +75 -75
  13. package/src/plugins/assets/config.js +106 -106
  14. package/src/plugins/assets/fileServer.js +469 -469
  15. package/src/plugins/assets/http.js +344 -344
  16. package/src/plugins/assets/ua.js +27 -27
  17. package/src/plugins/components/BSButton.vue +61 -61
  18. package/src/plugins/components/BSCascader.vue +465 -465
  19. package/src/plugins/components/BSCell.vue +48 -48
  20. package/src/plugins/components/BSDatePicker.vue +167 -167
  21. package/src/plugins/components/BSImage.vue +42 -42
  22. package/src/plugins/components/BSInput.vue +140 -140
  23. package/src/plugins/components/BSList.vue +81 -81
  24. package/src/plugins/components/BSPicCode.vue +96 -96
  25. package/src/plugins/components/BSPopup.vue +43 -43
  26. package/src/plugins/components/BSRadio.vue +97 -97
  27. package/src/plugins/components/BSSearch.vue +109 -109
  28. package/src/plugins/components/BSSelect.vue +144 -144
  29. package/src/plugins/components/BSSign.vue +454 -454
  30. package/src/plugins/components/BSStepper.vue +115 -115
  31. package/src/plugins/components/BSUpload.vue +92 -92
  32. package/src/plugins/components/BSUpload2.vue +397 -397
  33. package/src/plugins/components/BSVerCode.vue +128 -128
  34. package/src/plugins/components/BSViewer.vue +92 -92
  35. package/src/plugins/components/base.js +496 -496
  36. package/src/plugins/components/base2.js +489 -489
  37. package/src/plugins/lib/weixin.js +20 -20
  38. package/src/plugins/platform/index.js +7 -7
  39. package/src/plugins/platform/isp_phone.js +310 -310
  40. package/src/plugins/plugins/README.md +560 -0
  41. package/src/plugins/plugins/browserUtils.js +925 -0
  42. package/src/plugins/plugins/components/imageCropper.vue +299 -0
  43. package/src/plugins/plugins/components/images/bz.png +0 -0
  44. package/src/plugins/plugins/components/images/correct.png +0 -0
  45. package/src/plugins/plugins/components/images/error.png +0 -0
  46. package/src/plugins/plugins/components/images/mohu.png +0 -0
  47. package/src/plugins/plugins/components/images/qs.png +0 -0
  48. package/src/plugins/plugins/components/images/zd.png +0 -0
  49. package/src/plugins/plugins/components/pdfPreview.vue +688 -0
  50. package/src/plugins/plugins/demo.vue +832 -0
  51. package/src/plugins/plugins/native-js-sdk.js +360 -0
  52. package/src/plugins/plugins/nativeUtils.js +1444 -0
  53. package/src/plugins/route/index.js +140 -140
  54. package/src/plugins/selector/index.js +342 -342
  55. package/src/plugins/service/index.js +81 -81
  56. package/src/plugins/services/callCamera.js +53 -53
  57. package/src/plugins/services/exit.js +37 -36
  58. package/src/plugins/services/face.js +69 -69
  59. package/src/plugins/services/faceH5.js +54 -54
  60. package/src/plugins/services/faceInApp.js +31 -31
  61. package/src/plugins/services/faceTx.js +61 -61
  62. package/src/plugins/services/getFaceResult.js +104 -104
  63. package/src/plugins/services/getH5FaceResult.js +62 -62
  64. package/src/plugins/services/getMenus.js +40 -40
  65. package/src/plugins/services/getSystemData.js +144 -128
  66. package/src/plugins/services/getToken.js +93 -79
  67. package/src/plugins/services/getTxFaceResult.js +83 -83
  68. package/src/plugins/services/getUserInfo.js +47 -47
  69. package/src/plugins/services/goSetPage.js +40 -40
  70. package/src/plugins/services/hideFhoneTitle.js +36 -36
  71. package/src/plugins/services/index.js +45 -45
  72. package/src/plugins/services/init.js +35 -35
  73. package/src/plugins/services/jumpView.js +42 -40
  74. package/src/plugins/services/logout.js +44 -43
  75. package/src/plugins/services/share.js +113 -113
  76. package/src/plugins/services/statusBarHeight.js +39 -39
  77. package/src/plugins/session/index.js +32 -32
  78. package/src/services/getAuthInfo.js +22 -22
  79. package/src/services/index.js +9 -9
  80. package/src/services/sendVerCode.js +23 -23
  81. package/src/views/auth.vue +367 -367
  82. package/src/views/auth2.vue +90 -90
  83. package/src/views/auth3.vue +157 -157
  84. package/src/views/auth4.vue +8979 -8979
  85. package/src/views/auth5.vue +50 -50
  86. package/src/views/authh5.vue +369 -369
  87. package/src/views/components/BankSelect.vue +55 -55
  88. package/src/views/foot.vue +140 -140
  89. package/src/views/page.vue +222 -222
  90. package/src/views/shellFunc.vue +41 -41
  91. package/themes/basic.css +1 -1
  92. package/webpack.config.js +144 -144
  93. package/fstarter.iml +0 -9
@@ -0,0 +1,688 @@
1
+ <template>
2
+ <div v-if="visible" class="pdf-preview-overlay">
3
+ <div class="pdf-preview-container" @click.stop>
4
+ <div class="pdf-header" v-if="currentPdf.title">
5
+ <div class="pdf-title">
6
+ {{ currentPdf.title }}
7
+ </div>
8
+ </div>
9
+ <div class="pdf-content" ref="pdfContent" @scroll="checkIfScrolledToBottom">
10
+ <div ref="pdfContainer" class="pdf-container" role="region" aria-label="PDF内容">
11
+ </div>
12
+ <div v-if="loading" class="loading" role="status">加载中...</div>
13
+ <div v-if="error" class="error" role="alert">
14
+ 加载失败: {{ error }}
15
+ </div>
16
+ </div>
17
+ <!-- 预览多个pdf,并且不需要倒计时 -->
18
+ <div class="pdf-navigation" v-if="pdfList.length > 1 && !showCountdown" role="navigation" aria-label="PDF导航">
19
+ <button :disabled="currentIndex === 0" class="nav-btn prev-btn" @click="prevPdf" aria-label="上一个PDF">
20
+ 上一个
21
+ </button>
22
+ <span class="pdf-counter" aria-live="polite">
23
+ {{ currentIndex + 1 }} / {{ pdfList.length }}
24
+ </span>
25
+ <button :disabled="currentIndex === pdfList.length - 1" class="nav-btn next-btn" @click="nextPdf"
26
+ aria-label="下一个PDF">
27
+ 下一个
28
+ </button>
29
+ </div>
30
+ <!-- 仅预览(不区分多个 单个) 显示返回 -->
31
+ <div class="back" @click="close" v-if="!showCountdown">返回</div>
32
+ <!-- 需要倒计时按钮 -->
33
+ <div class="back" @click="handleCountdownClick" v-if="showCountdown">{{ countdownDisplayText }}</div>
34
+ </div>
35
+ </div>
36
+ </template>
37
+
38
+ <script>
39
+ let Pdfh5;
40
+
41
+ // 动态导入pdfh5以避免构建时错误
42
+ try {
43
+ Pdfh5 = require("pdfh5").default || require("pdfh5");
44
+ } catch (e) {
45
+ console.warn("Failed to load pdfh5:", e);
46
+ }
47
+
48
+ // 确保CSS也被正确导入
49
+ try {
50
+ require("pdfh5/css/pdfh5.css");
51
+ } catch (e) {
52
+ console.warn("Failed to load pdfh5 css:", e);
53
+ }
54
+
55
+ export default {
56
+ name: "PdfPreview",
57
+ data() {
58
+ return {
59
+ visible: false,
60
+ pdfList: [],
61
+ currentIndex: 0,
62
+ pdfh5: null,
63
+ countdown: 0,
64
+ countdownTimer: null,
65
+ autoPlayTimer: null,
66
+ showCountdown: false,
67
+ countdownInterval: null,
68
+ userScrolledToBottom: false,
69
+ isCountingDown: false,
70
+ loading: false,
71
+ error: null
72
+ };
73
+ },
74
+ computed: {
75
+ currentPdf() {
76
+ return this.pdfList[this.currentIndex] || {};
77
+ },
78
+
79
+ countdownDisplayText() {
80
+ // 倒计时正在进行中,显示倒计时数字
81
+ if (this.countdown > 0) {
82
+ return this.countdown;
83
+ }
84
+
85
+ // 倒计时结束,根据PDF总数和当前位置决定显示文本
86
+ const isLastPdf = this.currentIndex === this.pdfList.length - 1;
87
+
88
+ if (this.pdfList.length > 1) {
89
+ // 多个PDF:未到最后一个显示"下一个",否则显示"返回"
90
+ return isLastPdf ? '返回' : '下一个';
91
+ } else {
92
+ // 单个PDF直接显示"返回"
93
+ return '返回';
94
+ }
95
+ }
96
+ },
97
+ methods: {
98
+ handleCountdownClick() {
99
+ // 如果还在倒计时中,不允许点击
100
+ if (this.countdown > 0) {
101
+ return;
102
+ }
103
+
104
+ if (this.pdfList.length > 1) {
105
+ // 多个PDF文件的情况
106
+ if (this.currentIndex < this.pdfList.length - 1) {
107
+ // 还有下一个PDF,切换到下一个
108
+ this.nextPdf();
109
+ // 为下一个PDF启动倒计时
110
+ if (this.showCountdown) {
111
+ this.startCountdown();
112
+ }
113
+ } else {
114
+ // 已经是最后一个PDF,关闭预览
115
+ this.close();
116
+ }
117
+ } else {
118
+ // 单个PDF文件的情况
119
+ this.close();
120
+ }
121
+ },
122
+ /**
123
+ * 打开PDF预览
124
+ * @param {Array|Object} pdfs - PDF文件信息,可以是单个对象或对象数组
125
+ * @param {Object} options - 配置选项
126
+ */
127
+ open(pdfs, options = {}) {
128
+ console.log('Opening PDFs:', pdfs, 'with options:', options);
129
+
130
+ // 格式化PDF列表
131
+ if (Array.isArray(pdfs)) {
132
+ this.pdfList = pdfs;
133
+ } else {
134
+ this.pdfList = [pdfs];
135
+ }
136
+
137
+ console.log('Formatted PDF list:', this.pdfList);
138
+
139
+ // 设置配置选项
140
+ this.showCountdown = options.showCountdown || false;
141
+
142
+ // 重置所有状态
143
+ this.currentIndex = 0;
144
+ this.visible = true;
145
+ this.error = null;
146
+ this.userScrolledToBottom = false;
147
+ this.isCountingDown = false;
148
+ this.countdown = 0;
149
+ this.stopCountdown();
150
+
151
+ this.$nextTick(() => {
152
+ console.log('Next tick after setting visible to true');
153
+ this.renderPdf();
154
+
155
+ // 确保滚动事件监听器已添加
156
+ if (this.$refs.pdfContent) {
157
+ this.$refs.pdfContent.addEventListener('scroll', this.handleScroll);
158
+ }
159
+
160
+ // 如果需要倒计时,进入页面立即开始倒计时
161
+ if (this.showCountdown) {
162
+ console.log('Starting countdown immediately on page entry');
163
+ this.startCountdown();
164
+ }
165
+ });
166
+ },
167
+
168
+ /**
169
+ * 渲染当前PDF
170
+ */
171
+ renderPdf() {
172
+ console.log('Rendering PDF at index:', this.currentIndex, 'URL:', this.currentPdf.url);
173
+
174
+ // 检查是否成功导入了Pdfh5
175
+ if (!Pdfh5) {
176
+ this.error = "PDF查看器未正确加载";
177
+ this.loading = false;
178
+ console.error("Pdfh5 not loaded");
179
+ return;
180
+ }
181
+
182
+ this.loading = true;
183
+ this.error = null;
184
+
185
+ // 更安全的销毁之前的实例
186
+ if (this.pdfh5) {
187
+ try {
188
+ console.log('Destroying previous PDF instance');
189
+ // 先移除所有事件监听器
190
+ if (this.pdfh5.off) {
191
+ this.pdfh5.off("render");
192
+ this.pdfh5.off("complete");
193
+ }
194
+
195
+ // 更安全的销毁方式
196
+ if (this.pdfh5 && typeof this.pdfh5.destroy === 'function') {
197
+ this.pdfh5.destroy();
198
+ }
199
+ } catch (e) {
200
+ console.warn("Failed to destroy pdfh5 instance:", e);
201
+ }
202
+ this.pdfh5 = null;
203
+ }
204
+
205
+ // 清除容器
206
+ if (this.$refs.pdfContainer) {
207
+ console.log('Clearing PDF container');
208
+ try {
209
+ // 更安全的清理方式:直接清空容器内容
210
+ while (this.$refs.pdfContainer.firstChild) {
211
+ this.$refs.pdfContainer.removeChild(this.$refs.pdfContainer.firstChild);
212
+ }
213
+ } catch (e) {
214
+ console.warn("Error clearing container:", e);
215
+ }
216
+ }
217
+
218
+ const pdfUrl = this.currentPdf.url;
219
+ if (!pdfUrl) {
220
+ this.loading = false;
221
+ console.warn('No PDF URL provided');
222
+ return;
223
+ }
224
+
225
+ // 延迟创建新实例,确保旧实例完全销毁
226
+ setTimeout(() => {
227
+ try {
228
+ console.log('Creating new PDF instance with URL:', pdfUrl);
229
+ // 创建PDF实例
230
+ this.pdfh5 = new Pdfh5(this.$refs.pdfContainer, {
231
+ pdfurl: pdfUrl,
232
+ lazy: true,
233
+ renderType: "svg", // 使用svg渲染,避免canvas依赖问题
234
+ ...this.currentPdf.options
235
+ });
236
+
237
+ console.log('PDF instance created:', this.pdfh5);
238
+
239
+ // 监听渲染事件
240
+ if (this.pdfh5 && this.pdfh5.on) {
241
+ this.pdfh5.on("render", (pageNum, time) => {
242
+ try {
243
+ console.log(`当前加载页码:${pageNum},耗时:${time}毫秒,总页数:${this.pdfh5 ? this.pdfh5.totalNum : 'N/A'}`);
244
+ } catch (e) {
245
+ console.warn("Error accessing pdfh5 properties:", e);
246
+ }
247
+ });
248
+ }
249
+
250
+ // 监听完成事件
251
+ if (this.pdfh5 && this.pdfh5.on) {
252
+ this.pdfh5.on("complete", (status, msg, time) => {
253
+ this.loading = false;
254
+ if (status !== 1) {
255
+ this.error = msg || "PDF加载失败";
256
+ console.error('PDF loading failed:', msg);
257
+ } else {
258
+ console.log('PDF loaded successfully');
259
+ }
260
+ try {
261
+ console.log(`状态:${status},信息:${msg},耗时:${time}毫秒,总页数:${this.pdfh5 ? this.pdfh5.totalNum : 'N/A'}`);
262
+ } catch (e) {
263
+ console.warn("Error accessing pdfh5 properties:", e);
264
+ }
265
+ });
266
+ }
267
+ } catch (e) {
268
+ this.loading = false;
269
+ this.error = e.message || "PDF加载过程中发生错误";
270
+ console.error("PDF加载错误:", e);
271
+ }
272
+ }, 150); // 延迟150ms确保清理完成
273
+ },
274
+
275
+ /**
276
+ * 开始倒计时
277
+ */
278
+ startCountdown() {
279
+ this.stopCountdown();
280
+
281
+ // 设置倒计时初始值
282
+ if (this.pdfList.length === 1) {
283
+ // 单个PDF,使用返回倒计时(默认5秒)
284
+ this.countdown = this.currentPdf.countdownTime || 5;
285
+ } else {
286
+ // 多个PDF,使用下一个倒计时(默认5秒)
287
+ this.countdown = this.currentPdf.countdownTime || 5;
288
+ }
289
+
290
+ this.isCountingDown = true;
291
+
292
+ this.countdownInterval = setInterval(() => {
293
+ if (this.countdown > 0) {
294
+ this.countdown--;
295
+ } else {
296
+ // 倒计时结束
297
+ this.isCountingDown = false;
298
+
299
+ // 倒计时结束后根据PDF数量和位置自动执行操作
300
+ if (this.pdfList.length === 1) {
301
+ // 单个PDF,倒计时结束自动关闭
302
+ console.log('Single PDF countdown finished, closing preview');
303
+ this.close();
304
+ } else {
305
+ // 多个PDF,倒计时结束切换到下一个或关闭
306
+ if (this.currentIndex < this.pdfList.length - 1) {
307
+ // 还有下一个PDF
308
+ console.log('Multiple PDFs countdown finished, moving to next');
309
+ this.nextPdf();
310
+ // 为下一个PDF启动倒计时
311
+ this.startCountdown();
312
+ } else {
313
+ // 已经是最后一个PDF,关闭预览
314
+ console.log('Last PDF countdown finished, closing preview');
315
+ this.close();
316
+ }
317
+ }
318
+ // 倒计时器由stopCountdown()统一管理,这里不主动清除
319
+ }
320
+ }, 1000);
321
+ },
322
+
323
+ /**
324
+ * 停止倒计时
325
+ */
326
+ stopCountdown() {
327
+ try {
328
+ if (this.countdownInterval) {
329
+ console.log('Clearing countdown interval');
330
+ clearInterval(this.countdownInterval);
331
+ this.countdownInterval = null;
332
+ }
333
+ } catch (e) {
334
+ console.warn('Error stopping countdown:', e);
335
+ }
336
+ },
337
+
338
+
339
+ /**
340
+ * 停止自动播放
341
+ */
342
+ stopAutoPlay() {
343
+ try {
344
+ if (this.autoPlayTimer) {
345
+ console.log('Clearing auto play timeout');
346
+ clearTimeout(this.autoPlayTimer);
347
+ this.autoPlayTimer = null;
348
+ }
349
+ } catch (e) {
350
+ console.warn('Error stopping auto play:', e);
351
+ }
352
+ },
353
+
354
+ /**
355
+ * 切换到下一个PDF
356
+ */
357
+ nextPdf() {
358
+ console.log('Next PDF clicked, current index:', this.currentIndex, 'total:', this.pdfList.length);
359
+ if (this.currentIndex < this.pdfList.length - 1) {
360
+ this.currentIndex++;
361
+ console.log('Switching to index:', this.currentIndex);
362
+
363
+ // 重置状态
364
+ this.userScrolledToBottom = false;
365
+ this.isCountingDown = false;
366
+ this.stopCountdown();
367
+ // this.stopAutoPlay();
368
+
369
+ // 添加延迟确保上一个实例完全销毁
370
+ setTimeout(() => {
371
+ this.$nextTick(() => {
372
+ try {
373
+ this.renderPdf();
374
+ // 重置PDF内容的滚动位置
375
+ if (this.$refs.pdfContent) {
376
+ this.$refs.pdfContent.scrollTop = 0;
377
+ }
378
+ // 重新启动计时器,包括倒计时(如果showCountdown为true)
379
+ this.resetTimers();
380
+ } catch (e) {
381
+ console.error('Error during nextPdf:', e);
382
+ this.error = '切换PDF时发生错误';
383
+ }
384
+ });
385
+ }, 150); // 150ms延迟确保清理完成
386
+
387
+ // 确保界面更新
388
+ this.$forceUpdate();
389
+ } else {
390
+ console.log('Already at last PDF, closing preview');
391
+ // 最后一个PDF,关闭预览或循环
392
+ this.close();
393
+ }
394
+ },
395
+
396
+ /**
397
+ * 切换到上一个PDF
398
+ */
399
+ prevPdf() {
400
+ console.log('Previous PDF clicked, current index:', this.currentIndex);
401
+ if (this.currentIndex > 0) {
402
+ this.currentIndex--;
403
+ console.log('Switching to index:', this.currentIndex);
404
+
405
+ // 重置状态
406
+ this.userScrolledToBottom = false;
407
+ this.isCountingDown = false;
408
+ this.stopCountdown();
409
+ this.stopAutoPlay();
410
+
411
+ // 添加延迟确保上一个实例完全销毁
412
+ setTimeout(() => {
413
+ this.$nextTick(() => {
414
+ try {
415
+ this.renderPdf();
416
+ // 重置PDF内容的滚动位置
417
+ if (this.$refs.pdfContent) {
418
+ this.$refs.pdfContent.scrollTop = 0;
419
+ }
420
+ // 重新启动计时器
421
+ this.resetTimers();
422
+ } catch (e) {
423
+ console.error('Error during prevPdf:', e);
424
+ this.error = '切换PDF时发生错误';
425
+ }
426
+ });
427
+ }, 150); // 150ms延迟确保清理完成
428
+
429
+ // 确保界面更新
430
+ this.$forceUpdate();
431
+ } else {
432
+ console.log('Already at first PDF');
433
+ }
434
+ },
435
+
436
+ /**
437
+ * 重置计时器
438
+ */
439
+ resetTimers() {
440
+ console.log('Resetting timers');
441
+ this.stopCountdown();
442
+ this.stopAutoPlay();
443
+
444
+ // 设置倒计时初始值
445
+ if (this.pdfList.length === 1) {
446
+ // 单个PDF,使用返回倒计时(默认3秒)
447
+ this.countdown = this.currentPdf.countdownTime || 3;
448
+ } else {
449
+ // 多个PDF,使用下一个倒计时(默认3秒)
450
+ this.countdown = this.currentPdf.countdownTime || 3;
451
+ }
452
+
453
+ console.log('New countdown value:', this.countdown);
454
+
455
+ this.$nextTick(() => {
456
+ if (this.showCountdown && this.countdown > 0) {
457
+ console.log('Starting countdown');
458
+ this.startCountdown();
459
+ }
460
+ });
461
+ },
462
+
463
+ /**
464
+ * 关闭预览
465
+ */
466
+ close() {
467
+ console.log('Closing PDF preview');
468
+ this.visible = false;
469
+
470
+ if (this.pdfh5) {
471
+ try {
472
+ console.log('Destroying PDF instance during close');
473
+ // 先移除所有事件监听器
474
+ if (this.pdfh5.off) {
475
+ this.pdfh5.off("render");
476
+ this.pdfh5.off("complete");
477
+ }
478
+ this.pdfh5.destroy();
479
+ } catch (e) {
480
+ console.warn("Failed to destroy pdfh5 instance:", e);
481
+ }
482
+ this.pdfh5 = null;
483
+ }
484
+
485
+ // 更安全的容器清理方式
486
+ if (this.$refs.pdfContainer) {
487
+ try {
488
+ while (this.$refs.pdfContainer.firstChild) {
489
+ this.$refs.pdfContainer.removeChild(this.$refs.pdfContainer.firstChild);
490
+ }
491
+ } catch (e) {
492
+ console.warn("Error clearing pdf container:", e);
493
+ }
494
+ }
495
+
496
+ this.stopCountdown();
497
+ this.stopAutoPlay();
498
+
499
+ // 清理数据
500
+ this.pdfList = [];
501
+ this.currentIndex = 0;
502
+ this.error = null;
503
+ this.loading = false;
504
+
505
+ // 触发关闭事件
506
+ console.log('Emitting close event');
507
+ this.$emit('close');
508
+ },
509
+
510
+ /**
511
+ * 处理PDF滚动到底部事件
512
+ */
513
+ onPdfScrolledToBottom() {
514
+ console.log('PDF scrolled to bottom event triggered');
515
+ // 发射滚动到底部事件,供外部监听
516
+ // this.$emit('scrolled-to-bottom');
517
+
518
+ // // 用户滚动到底部,开始倒计时
519
+ // if (this.showCountdown) {
520
+ // console.log('Starting countdown as user scrolled to bottom');
521
+ // this.startCountdown();
522
+ // }
523
+ },
524
+
525
+ /**
526
+ * 检查是否滚动到底部
527
+ */
528
+ checkIfScrolledToBottom() {
529
+ if (!this.$refs.pdfContent) return;
530
+
531
+ const { scrollTop, scrollHeight, clientHeight } = this.$refs.pdfContent;
532
+ const isBottom = scrollTop + clientHeight >= scrollHeight - 5; // 5px的容差
533
+
534
+ if (isBottom && !this.userScrolledToBottom) {
535
+ this.userScrolledToBottom = true;
536
+ // 触发滚动到底部事件
537
+ this.onPdfScrolledToBottom();
538
+ }
539
+ }
540
+ },
541
+
542
+ beforeDestroy() {
543
+ this.close();
544
+ }
545
+ };
546
+ </script>
547
+
548
+ <style scoped>
549
+ .back {
550
+ cursor: pointer;
551
+ height: 60px;
552
+ line-height: 60px;
553
+ color: #4a6bbe;
554
+ text-align: center;
555
+ }
556
+
557
+ .pdf-preview-overlay {
558
+ position: fixed;
559
+ top: 0;
560
+ left: 0;
561
+ width: 100%;
562
+ height: 100%;
563
+ background-color: rgba(0, 0, 0, 0.8);
564
+ z-index: 9999;
565
+ display: flex;
566
+ justify-content: center;
567
+ align-items: center;
568
+ }
569
+
570
+ .pdf-preview-container {
571
+ width: 100%;
572
+ height: 100%;
573
+ background: #fff;
574
+ border-radius: 0px;
575
+ display: flex;
576
+ flex-direction: column;
577
+ overflow: hidden;
578
+ }
579
+
580
+ .pdf-header {
581
+ display: flex;
582
+ justify-content: space-between;
583
+ align-items: center;
584
+ padding: 10px 15px;
585
+ background: #f5f5f5;
586
+ border-bottom: 1px solid #ddd;
587
+ }
588
+
589
+ .pdf-title {
590
+ font-size: 16px;
591
+ font-weight: bold;
592
+ color: #333;
593
+ }
594
+
595
+ .pdf-controls {
596
+ display: flex;
597
+ align-items: center;
598
+ gap: 10px;
599
+ }
600
+
601
+ .countdown {
602
+ font-size: 14px;
603
+ color: #ff6b6b;
604
+ }
605
+
606
+ .close-btn {
607
+ width: 30px;
608
+ height: 30px;
609
+ border-radius: 50%;
610
+ background: #ff6b6b;
611
+ color: white;
612
+ border: none;
613
+ cursor: pointer;
614
+ font-size: 16px;
615
+ display: flex;
616
+ align-items: center;
617
+ justify-content: center;
618
+ }
619
+
620
+ .pdf-content {
621
+ flex: 1;
622
+ overflow: hidden;
623
+ }
624
+
625
+ .pdf-container {
626
+ width: 100%;
627
+ height: 100%;
628
+ }
629
+
630
+ .pdf-navigation {
631
+ display: flex;
632
+ justify-content: space-between;
633
+ align-items: center;
634
+ padding: 10px 15px;
635
+ background: #f5f5f5;
636
+ border-top: 1px solid #ddd;
637
+ }
638
+
639
+ .nav-btn {
640
+ padding: 8px 16px;
641
+ background: #4a6bbe;
642
+ color: white;
643
+ border: none;
644
+ border-radius: 4px;
645
+ cursor: pointer;
646
+ font-size: 14px;
647
+ }
648
+
649
+ .nav-btn:disabled {
650
+ background: #ccc;
651
+ cursor: not-allowed;
652
+ }
653
+
654
+ .pdf-counter {
655
+ font-size: 14px;
656
+ color: #666;
657
+ }
658
+
659
+ .prev-btn {
660
+ order: -1;
661
+ }
662
+
663
+ .next-btn {
664
+ order: 1;
665
+ }
666
+
667
+ @media (max-width: 768px) {
668
+ .pdf-preview-container {
669
+ width: 100%;
670
+ height: 100%;
671
+ }
672
+
673
+ .pdf-header {
674
+ flex-direction: column;
675
+ gap: 5px;
676
+ text-align: center;
677
+ }
678
+
679
+ .pdf-title {
680
+ font-size: 14px;
681
+ }
682
+
683
+ .pdf-controls {
684
+ width: 100%;
685
+ justify-content: space-between;
686
+ }
687
+ }
688
+ </style>