fstarter 2.11.3 → 2.11.5
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.
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="visible" class="pdf-preview-overlay">
|
|
3
3
|
<div class="pdf-preview-container" @click.stop>
|
|
4
|
-
<div class="pdf-header"
|
|
4
|
+
<div class="pdf-header">
|
|
5
5
|
<div class="pdf-title">
|
|
6
|
-
{{ currentPdf.title }}
|
|
6
|
+
{{ currentPdf.title || currentPdf.url.split('/').pop() }}
|
|
7
7
|
</div>
|
|
8
|
+
<div class="share-button" @click="sharePdf()" v-if="currentPdf.share">分享</div>
|
|
8
9
|
</div>
|
|
9
10
|
<div class="pdf-content" ref="pdfContent" @scroll="checkIfScrolledToBottom">
|
|
10
11
|
<div ref="pdfContainer" class="pdf-container" role="region" aria-label="PDF内容">
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
|
|
38
39
|
<script>
|
|
39
40
|
let Pdfh5;
|
|
40
|
-
|
|
41
|
+
import nativeUtils from '../nativeUtils'
|
|
41
42
|
// 动态导入pdfh5以避免构建时错误
|
|
42
43
|
try {
|
|
43
44
|
Pdfh5 = require("pdfh5").default || require("pdfh5");
|
|
@@ -95,6 +96,23 @@ export default {
|
|
|
95
96
|
}
|
|
96
97
|
},
|
|
97
98
|
methods: {
|
|
99
|
+
sharePdf(){
|
|
100
|
+
const shareConfig = {
|
|
101
|
+
type: 'file',
|
|
102
|
+
scene: 'session',
|
|
103
|
+
content: {
|
|
104
|
+
fileType: 'pdf', // 替换为实际的文件类型
|
|
105
|
+
fileName: this.currentPdf.title, // 替换为实际的PDF文件标题
|
|
106
|
+
fileUrl: this.currentPdf.url
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
nativeUtils.share(shareConfig)
|
|
111
|
+
.then(res => {
|
|
112
|
+
})
|
|
113
|
+
.catch(err => {
|
|
114
|
+
});
|
|
115
|
+
},
|
|
98
116
|
handleCountdownClick() {
|
|
99
117
|
// 如果还在倒计时中,不允许点击
|
|
100
118
|
if (this.countdown > 0) {
|
|
@@ -295,27 +313,6 @@ export default {
|
|
|
295
313
|
} else {
|
|
296
314
|
// 倒计时结束
|
|
297
315
|
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
316
|
}
|
|
320
317
|
}, 1000);
|
|
321
318
|
},
|
|
@@ -579,17 +576,25 @@ export default {
|
|
|
579
576
|
|
|
580
577
|
.pdf-header {
|
|
581
578
|
display: flex;
|
|
582
|
-
|
|
579
|
+
position: relative;
|
|
583
580
|
align-items: center;
|
|
584
|
-
padding:
|
|
581
|
+
padding: 15px 15px;
|
|
585
582
|
background: #f5f5f5;
|
|
586
583
|
border-bottom: 1px solid #ddd;
|
|
587
584
|
}
|
|
588
585
|
|
|
589
586
|
.pdf-title {
|
|
590
|
-
font-size:
|
|
587
|
+
font-size: 14px;
|
|
591
588
|
font-weight: bold;
|
|
592
589
|
color: #333;
|
|
590
|
+
position: absolute;
|
|
591
|
+
left: 50%;
|
|
592
|
+
transform: translateX(-50%);
|
|
593
|
+
white-space: nowrap;
|
|
594
|
+
overflow: hidden;
|
|
595
|
+
text-overflow: ellipsis;
|
|
596
|
+
max-width: 70%;
|
|
597
|
+
text-align: center;
|
|
593
598
|
}
|
|
594
599
|
|
|
595
600
|
.pdf-controls {
|
|
@@ -656,6 +661,11 @@ export default {
|
|
|
656
661
|
color: #666;
|
|
657
662
|
}
|
|
658
663
|
|
|
664
|
+
.share-button {
|
|
665
|
+
margin-left: auto;
|
|
666
|
+
color: #4a6bbe;
|
|
667
|
+
}
|
|
668
|
+
|
|
659
669
|
.prev-btn {
|
|
660
670
|
order: -1;
|
|
661
671
|
}
|
|
@@ -663,26 +673,4 @@ export default {
|
|
|
663
673
|
.next-btn {
|
|
664
674
|
order: 1;
|
|
665
675
|
}
|
|
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
676
|
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import native from './native-js-sdk.js'
|
|
2
2
|
import ImageCropper from './components/imageCropper.vue';
|
|
3
|
-
import { Toast } from "vant"
|
|
3
|
+
import { Toast, Dialog } from "vant"
|
|
4
4
|
import axios from 'axios'
|
|
5
5
|
import { JSEncrypt } from 'jsencrypt'
|
|
6
6
|
const publicKey = `-----BEGIN PUBLIC KEY-----
|
|
@@ -46,7 +46,7 @@ if(isProductionEnvironment()){
|
|
|
46
46
|
faceResultUrl = 'https://bcs.ihasl.com/api/v1/bcs/face/faceResultQuery'
|
|
47
47
|
appid = 'wx751d925fbededc73' // 回调安全域名 wx.ihasl
|
|
48
48
|
tokenKey = '6297391dca6d4090ae60959acb73cda1'
|
|
49
|
-
loginUrl = 'https://www.ihasl.com/pages/
|
|
49
|
+
loginUrl = 'https://www.ihasl.com/pages/app2-hasl/#/login'
|
|
50
50
|
} else {
|
|
51
51
|
console.log('测试环境')
|
|
52
52
|
auth = 0
|
|
@@ -55,9 +55,7 @@ if(isProductionEnvironment()){
|
|
|
55
55
|
faceResultUrl = 'https://testbcs.ihasl.com/api/v1/bcs/face/faceResultQuery'
|
|
56
56
|
appid = 'wx38c646900b5b7ec0' // 回调安全域名 teststatic.com
|
|
57
57
|
tokenKey = '814a0b7eb0f82e02246da5e098b6e2b5'
|
|
58
|
-
loginUrl = 'https://teststatic.ihasl.com/pages/
|
|
59
|
-
// 本地的
|
|
60
|
-
// loginUrl = 'http://172.20.10.2:8080/#/login'
|
|
58
|
+
loginUrl = 'https://teststatic.ihasl.com/pages/app2-hasl/#/login'
|
|
61
59
|
}
|
|
62
60
|
console.log(appid, 'appid')
|
|
63
61
|
|
|
@@ -321,10 +319,10 @@ const nativeUtils = {
|
|
|
321
319
|
|
|
322
320
|
let params = {
|
|
323
321
|
orderNo: urlParams.get('orderNo'), // 从URL中获取orderNo参数
|
|
324
|
-
requestSource: '
|
|
322
|
+
requestSource: 'YX', // 请求来源
|
|
325
323
|
meta: { // 元数据
|
|
326
|
-
tenantCode: '
|
|
327
|
-
businessCode: '
|
|
324
|
+
tenantCode: 'YX', // 租户编码
|
|
325
|
+
businessCode: 'YX-EDOR', // 业务编码
|
|
328
326
|
serviceType: 'FACE' // 业务类型
|
|
329
327
|
}
|
|
330
328
|
}
|
|
@@ -338,20 +336,29 @@ const nativeUtils = {
|
|
|
338
336
|
'Accept-Attr4': 'NULL'
|
|
339
337
|
}
|
|
340
338
|
}).then(response => {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
339
|
+
Toast.clear()
|
|
340
|
+
console.log('人脸查询接口调用成功', response)
|
|
341
|
+
if (response.data.resultType == 'SUCCESS') {
|
|
342
|
+
if(isProductionEnvironment()){
|
|
343
|
+
// 生产环境正常返回
|
|
344
|
+
resolve({
|
|
345
|
+
similarity: response.data.similarity,
|
|
346
|
+
facePhotoUrl: response.data.facePhotoUrl
|
|
347
|
+
})
|
|
348
|
+
} else {
|
|
349
|
+
// 测试环境写死一个相似度
|
|
350
|
+
resolve({
|
|
351
|
+
similarity: 99,
|
|
352
|
+
facePhotoUrl: response.data.facePhotoUrl
|
|
353
|
+
})
|
|
354
|
+
}
|
|
354
355
|
} else {
|
|
356
|
+
Dialog.alert({
|
|
357
|
+
title: '人脸识别提示',
|
|
358
|
+
message: response.data.failMessage + ',请重试。',
|
|
359
|
+
}).then(() => {
|
|
360
|
+
// on close
|
|
361
|
+
});
|
|
355
362
|
reject(new Error('接口调用失败'))
|
|
356
363
|
}
|
|
357
364
|
}).catch(error => {
|
|
@@ -1175,19 +1182,26 @@ nFqBB1zM586NpO+4hua/1Ol5OiqoQJ4iQinyDiA=
|
|
|
1175
1182
|
});
|
|
1176
1183
|
document.getElementById('cancelBtn').addEventListener('click', () => {
|
|
1177
1184
|
nativeUtils.closeDialog();
|
|
1178
|
-
nativeUtils._takePictureReject
|
|
1185
|
+
if (nativeUtils._takePictureReject) {
|
|
1186
|
+
nativeUtils._takePictureReject(new Error('用户取消了操作'));
|
|
1187
|
+
}
|
|
1188
|
+
});
|
|
1189
|
+
|
|
1190
|
+
// 添加点击背景关闭弹窗的功能
|
|
1191
|
+
const cameraDialog = dialog.querySelector('.camera-dialog');
|
|
1192
|
+
cameraDialog.addEventListener('click', function (e) {
|
|
1193
|
+
if (e.target === cameraDialog) {
|
|
1194
|
+
// 点击背景时也视为取消操作
|
|
1195
|
+
nativeUtils.closeDialog();
|
|
1196
|
+
if (nativeUtils._takePictureReject) {
|
|
1197
|
+
nativeUtils._takePictureReject(new Error('用户取消了操作'));
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1179
1200
|
});
|
|
1180
1201
|
}, 0);
|
|
1181
1202
|
|
|
1182
1203
|
// 添加到文档
|
|
1183
1204
|
document.body.appendChild(dialog);
|
|
1184
|
-
|
|
1185
|
-
// 添加事件监听器,点击背景关闭弹窗
|
|
1186
|
-
dialog.addEventListener('click', function (e) {
|
|
1187
|
-
if (e.target.classList.contains('camera-dialog')) {
|
|
1188
|
-
this.closeDialog();
|
|
1189
|
-
}
|
|
1190
|
-
});
|
|
1191
1205
|
},
|
|
1192
1206
|
// 关闭弹窗
|
|
1193
1207
|
closeDialog() {
|
|
@@ -1209,6 +1223,8 @@ nFqBB1zM586NpO+4hua/1Ol5OiqoQJ4iQinyDiA=
|
|
|
1209
1223
|
document.body.removeChild(dialog);
|
|
1210
1224
|
}, 300);
|
|
1211
1225
|
}
|
|
1226
|
+
|
|
1227
|
+
// 清理全局引用
|
|
1212
1228
|
delete nativeUtils._takePictureResolve;
|
|
1213
1229
|
delete nativeUtils._takePictureReject;
|
|
1214
1230
|
},
|