fstarter 2.11.4 → 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,7 +1,7 @@
1
1
  {
2
2
  "name": "fstarter",
3
3
  "description": "A Vue.js project",
4
- "version": "2.11.4",
4
+ "version": "2.11.5",
5
5
  "author": "han.zhang <zhanghan810810@163.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -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" v-if="currentPdf.title">
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
- justify-content: space-between;
579
+ position: relative;
583
580
  align-items: center;
584
- padding: 10px 15px;
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: 16px;
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-----
@@ -319,10 +319,10 @@ const nativeUtils = {
319
319
 
320
320
  let params = {
321
321
  orderNo: urlParams.get('orderNo'), // 从URL中获取orderNo参数
322
- requestSource: 'WX', // 请求来源
322
+ requestSource: 'YX', // 请求来源
323
323
  meta: { // 元数据
324
- tenantCode: 'WX', // 租户编码
325
- businessCode: 'WX-EDOR', // 业务编码
324
+ tenantCode: 'YX', // 租户编码
325
+ businessCode: 'YX-EDOR', // 业务编码
326
326
  serviceType: 'FACE' // 业务类型
327
327
  }
328
328
  }
@@ -336,20 +336,29 @@ const nativeUtils = {
336
336
  'Accept-Attr4': 'NULL'
337
337
  }
338
338
  }).then(response => {
339
- if (response.data.resultType === 'SUCCESS') {
340
- // console.log('接口调用成功', response)
341
- // if(response.facePhotoUrl && response.facePhotoUrl!=='null' && response.similarity && response.similarity!=='null'){
342
- // resolve(response.data)
343
- // } else {
344
- // Toast('人脸对比未返回图片和相似度,请重试');
345
- // }
346
- Toast.clear()
347
- resolve({
348
- similarity: "99",
349
- liveRate: "99",
350
- facePhotoUrl: "http://testfile.ihasl.com/file/v1/hasl/fileAdmin/fileAdmin/get/z254g0pc55tj11apjge0dun8hvxjdxxs.jpg",
351
- })
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
+ }
352
355
  } else {
356
+ Dialog.alert({
357
+ title: '人脸识别提示',
358
+ message: response.data.failMessage + ',请重试。',
359
+ }).then(() => {
360
+ // on close
361
+ });
353
362
  reject(new Error('接口调用失败'))
354
363
  }
355
364
  }).catch(error => {
@@ -1215,11 +1224,6 @@ nFqBB1zM586NpO+4hua/1Ol5OiqoQJ4iQinyDiA=
1215
1224
  }, 300);
1216
1225
  }
1217
1226
 
1218
- // 在关闭弹窗时也要触发reject,防止Promise悬挂
1219
- if (nativeUtils._takePictureReject) {
1220
- nativeUtils._takePictureReject(new Error('用户取消了操作'));
1221
- }
1222
-
1223
1227
  // 清理全局引用
1224
1228
  delete nativeUtils._takePictureResolve;
1225
1229
  delete nativeUtils._takePictureReject;