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,560 @@
1
+ # 新壳对接文档
2
+
3
+ ## 1. 简介
4
+
5
+ 本文档为 e行平台各项目对接新壳的统一标准规范,确保各项目在调用壳功能时遵循一致的接口标准。
6
+
7
+ ## 2. 文档说明
8
+
9
+ ### 适用范围
10
+
11
+ 此文档适用于 e行平台所有项目,修改时请各项目同步更新。
12
+
13
+ ### e行项目列表
14
+ vue2
15
+ - **sales-front-project** - 建议书、投保、回执、产品tab yes
16
+ - **app-hasl** - 服务tab、团队tab、客户tab、我的tab(内勤)、入司、荣誉体系、保全项
17
+ - **app2-hasl** - 我的tab(营销员) fstarter
18
+ - **recruit** - 招募系统 yes
19
+ - **oneleinsure** - 线上转保(飞签) fstarter
20
+ - **flysign-h5** - 保全项目(退保等) fstarter
21
+ - **support-analysis-web** - 客户营销分析 node版本12.10.0 yes
22
+ - **wechatsecur** 企微-云账户
23
+
24
+ vue3
25
+ - **public-h5-editor** - 公共编辑器(客户-生日祝福) node版本20.16.0
26
+ 这个项目公共服务,nativeUtils.js auth写成0 上传不需要token 注意:在e家中如果auth1 图片无法显示
27
+
28
+ - **saleslite** 签到
29
+ - **fatarter** 新框架-张晗
30
+
31
+ - **pc-hasl** - PC端系统
32
+
33
+ ## 3. 快速开始
34
+
35
+ ### 3.1 环境配置
36
+
37
+ #### 安装依赖
38
+
39
+ 在项目的 package.json 中添加以下依赖:
40
+
41
+ ```json
42
+ {
43
+ "dependencies": {
44
+ "vant": "^2.12.0",
45
+ "axios": "^0.21.0",
46
+ "pdfh5": "^1.4.7",
47
+ "jsencrypt": "^3.5.4",
48
+ "vue-cropper": "^0.5.6"
49
+ "canvas": "^3.2.0",
50
+ }
51
+ }
52
+ ```
53
+
54
+ #### 初始化配置
55
+
56
+ 在项目的 main.js 中引入并初始化:
57
+
58
+ ```javascript
59
+ // 引入 Native Bridge
60
+ import NativeBridge from './util/plugins/native-js-sdk.js'
61
+ NativeBridge.init()
62
+
63
+ // 引入 Native Utils
64
+ import nativeUtils from './util/plugins/nativeUtils'
65
+ Vue.prototype.$native = nativeUtils
66
+
67
+ 如果之后
68
+ import browserUtils from './util/plugins/browserUtils'
69
+ // 获取环境
70
+ // if (utils.getEnv() === 'app') {
71
+ // } else {
72
+ // 非壳运行此项目的页面,暂时用不到.项目中页面几乎都是app内打开
73
+ // Vue.prototype.$native = browserUtils
74
+ // }
75
+ ```
76
+
77
+ ### 3.2 基础使用示例
78
+
79
+ ```javascript
80
+ // PDF 阅读示例
81
+ this.$native.pdfRead([
82
+ {
83
+ url: "https://teststatic.ihasl.com/pages/salessupport/app/iamges/pdf/hastar.pdf",
84
+ title: "测试文件1"
85
+ }
86
+ ]).then(res => {
87
+ console.log(res, '------返回-------')
88
+ })
89
+ ```
90
+
91
+ ## 4. API 参考
92
+
93
+ ### 4.1 用户信息管理
94
+
95
+ #### setUserInfo
96
+
97
+ 设置用户信息(登录后调用)
98
+
99
+ ```javascript
100
+ /**
101
+ * @param {Object} params - 用户信息参数
102
+ */
103
+ this.$native.setUserInfo(params)
104
+ ```
105
+
106
+ #### getUserInfo
107
+
108
+ 获取用户信息
109
+
110
+ ```javascript
111
+ /**
112
+ * @returns {Promise<Object>} 用户信息
113
+ */
114
+ this.$native.getUserInfo().then(userInfo => {
115
+ console.log(userInfo)
116
+ })
117
+ ```
118
+
119
+ #### clearUserInfo
120
+
121
+ 清空用户信息(退出登录时调用)
122
+
123
+ ```javascript
124
+ this.$native.clearUserInfo()
125
+ ```
126
+
127
+ ### 4.2 分享功能
128
+
129
+ #### share
130
+
131
+ 分享内容
132
+
133
+ ```javascript
134
+ /**
135
+ * @param {Object} config - 分享配置
136
+ * @param {string} config.type - 分享类型: webpage|text|image|miniProgram|file
137
+ * @param {string} config.scene - 分享场景: session|timeline|wxwork|copyurl 需要几个场景传几个 |分割
138
+ * @param {Object} config.content - 分享内容
139
+ * @param {string} config.content.title - 标题
140
+ * @param {string} config.content.description - 描述
141
+ * @param {string} config.content.webpageUrl - 分享链接
142
+ * @param {string} config.content.thumb - 缩略图URL
143
+ */
144
+ this.$native.share({
145
+ type: 'webpage',
146
+ scene: 'session',
147
+ content: {
148
+ title: '恒安标准人寿',
149
+ description: '恒安标准人寿官网描述',
150
+ webpageUrl: 'https://www.hengansl.com/',
151
+ thumb: ''
152
+ }
153
+ }).then(res => {
154
+ console.log(res, '-----分享结果------')
155
+ })
156
+ ```
157
+
158
+ ### 4.3 登录认证
159
+
160
+ #### wechatLogin
161
+
162
+ 微信登录 返回:appid code
163
+
164
+ ```javascript
165
+ this.$native.wechatLogin().then(result => {
166
+ console.log('微信登录结果:', result)
167
+ })
168
+ ```
169
+
170
+ ### 4.4 系统功能
171
+
172
+ #### openSystemBrowser
173
+
174
+ 打开系统浏览器
175
+
176
+ ```javascript
177
+ /**
178
+ * @param {string} url - 要打开的URL
179
+ */
180
+ this.$native.openSystemBrowser(url)
181
+ ```
182
+
183
+ #### screenshot
184
+
185
+ 截屏功能
186
+
187
+ ```javascript
188
+ this.$native.screenshot().then(imageData => {
189
+ console.log('截屏数据:', imageData)
190
+ })
191
+ ```
192
+
193
+ #### setScreenOrientation
194
+
195
+ 设置屏幕方向
196
+
197
+ ```javascript
198
+ /**
199
+ * @param {string} orientation - 屏幕方向
200
+ */
201
+ this.$native.setScreenOrientation(orientation)
202
+ ```
203
+
204
+ ### 4.5 应用间交互
205
+
206
+ #### launchApp
207
+
208
+ 唤起其他APP
209
+
210
+ ```javascript
211
+ /**
212
+ * @param {Object} config - 唤起配置
213
+ */
214
+ this.$native.launchApp(config)
215
+ ```
216
+
217
+ #### setBackInterceptor
218
+
219
+ 返回拦截
220
+
221
+ ```javascript
222
+ /**
223
+ * @param {Function} interceptor - 拦截器函数
224
+ */
225
+ this.$native.setBackInterceptor(interceptor)
226
+ ```
227
+
228
+ ### 4.6 页面导航
229
+
230
+ #### redirectTo
231
+
232
+ 页面重定向(壳中跳转人脸识别使用)
233
+
234
+ ```javascript
235
+ /**
236
+ * @param {string} url - 目标URL
237
+ */
238
+ this.$native.redirectTo(url)
239
+ ```
240
+
241
+ #### openPage
242
+
243
+ 打开新的 Webview
244
+
245
+ ```javascript
246
+ /**
247
+ * @param {string} url - 页面URL
248
+ */
249
+ this.$native.openPage(url)
250
+ ```
251
+
252
+ #### openPageWithShare
253
+
254
+ 跳转页面带分享功能
255
+
256
+ ```javascript
257
+ /**
258
+ * @param {Object} config - 页面和分享配置
259
+ */
260
+ this.$native.openPageWithShare(config)
261
+ ```
262
+
263
+ #### closePage
264
+
265
+ 关闭当前 Webview
266
+
267
+ ```javascript
268
+ this.$native.closePage()
269
+ ```
270
+
271
+ #### setNavigationBarVisible
272
+
273
+ 隐藏原生标题栏
274
+
275
+ ```javascript
276
+ /**
277
+ * @param {boolean} visible - 是否可见
278
+ */
279
+ this.$native.setNavigationBarVisible(false)
280
+ ```
281
+
282
+ ### 4.7 人脸识别
283
+
284
+ #### goCheckFace
285
+
286
+ 前往人脸识别页面
287
+
288
+ ```javascript
289
+ this.$native.goCheckFace().then(() => {
290
+ console.log('进入人脸识别')
291
+ })
292
+ ```
293
+
294
+ #### checkFace
295
+
296
+ 检测人脸识别结果
297
+
298
+ ```javascript
299
+ this.$native.checkFace().then(result => {
300
+ console.log('人脸识别结果:', result)
301
+ })
302
+ ```
303
+
304
+ ### 4.8 设备功能
305
+
306
+ #### scanQRCode
307
+
308
+ 扫码功能
309
+
310
+ ```javascript
311
+ this.$native.scanQRCode().then(result => {
312
+ console.log('扫码结果:', result)
313
+ })
314
+ ```
315
+
316
+ #### callphone
317
+
318
+ 拨打电话
319
+
320
+ ```javascript
321
+ /**
322
+ * @param {string} phone - 电话号码
323
+ */
324
+ this.$native.callphone(phone)
325
+ ```
326
+
327
+ #### sendSMS
328
+
329
+ 发送短信
330
+
331
+ ```javascript
332
+ /**
333
+ * @param {string} phone - 电话号码
334
+ * @param {string} content - 短信内容
335
+ */
336
+ this.$native.sendSMS(phone, content)
337
+ ```
338
+
339
+ #### readContacts
340
+
341
+ 唤起通讯录 返回的是数组 name phone:是数组 取第0个
342
+
343
+ ```javascript
344
+ this.$native.readContacts().then(contact => {
345
+ console.log('选择的联系人:', contact)
346
+ // 返回格式: {name: '', phone: ''}
347
+ })
348
+ ```
349
+
350
+ ### 4.9 媒体功能
351
+
352
+ #### takePhoto
353
+
354
+ 调起壳拍照
355
+
356
+ ```javascript
357
+ this.$native.takePhoto().then(photo => {
358
+ console.log('拍摄的照片:', photo)
359
+ })
360
+ ```
361
+
362
+ #### chooseImage
363
+
364
+ 调起壳相册
365
+
366
+ ```javascript
367
+ this.$native.chooseImage().then(images => {
368
+ console.log('选择的图片:', images)
369
+ })
370
+ ```
371
+
372
+ #### takePicture
373
+
374
+ 调起相机和相册
375
+
376
+ ```javascript
377
+ this.$native.takePicture().then(result => {
378
+ console.log('拍摄/选择结果:', result)
379
+ })
380
+ ```
381
+
382
+ ### 4.10 文件处理
383
+
384
+ #### pdfRead
385
+
386
+ PDF 阅读(基于 pdfh5)
387
+
388
+ ```javascript
389
+ /**
390
+ * @param {Array} files - PDF文件列表
391
+ * @param {string} files[].url - 文件URL
392
+ * @param {string} files[].title - 文件标题
393
+ */
394
+ this.$native.pdfRead([
395
+ {
396
+ url: "https://example.com/document.pdf",
397
+ title: "文档标题"
398
+ }
399
+ ]).then(res => {
400
+ console.log('PDF阅读结果:', res)
401
+ })
402
+ ```
403
+
404
+ ### 4.11 数据存储
405
+
406
+ #### setItem
407
+
408
+ 持久化存储
409
+
410
+ ```javascript
411
+ /**
412
+ * @param {string} key - 键名
413
+ * @param {any} value - 值
414
+ */
415
+ this.$native.setItem('user_token', 'abc123')
416
+ ```
417
+
418
+ #### getItem
419
+
420
+ 获取持久化存储
421
+
422
+ ```javascript
423
+ /**
424
+ * @param {string} key - 键名
425
+ * @returns {Promise<any>} 存储的值
426
+ */
427
+ this.$native.getItem('user_token').then(value => {
428
+ console.log('获取的值:', value)
429
+ })
430
+ ```
431
+
432
+ #### removeItem
433
+
434
+ 删除持久化存储
435
+
436
+ ```javascript
437
+ /**
438
+ * @param {string} key - 键名
439
+ */
440
+ this.$native.removeItem('user_token')
441
+ ```
442
+
443
+ ### 4.12 工具功能
444
+
445
+ #### Toast
446
+
447
+ Toast 提示(基于 Vant)
448
+
449
+ ```javascript
450
+ /**
451
+ * @param {string} message - 提示消息
452
+ */
453
+ this.$native.Toast('操作成功')
454
+ ```
455
+
456
+ #### addCalendarEvent
457
+
458
+ 添加日历事件
459
+
460
+ ```javascript
461
+ /**
462
+ * @param {Object} event - 事件信息
463
+ */
464
+ this.$native.addCalendarEvent({
465
+ title: '会议',
466
+ startTime: '2024-01-01 10:00',
467
+ endTime: '2024-01-01 11:00'
468
+ })
469
+ ```
470
+
471
+ #### encrypt
472
+
473
+ 数据加密(基于 jsencrypt)
474
+
475
+ ```javascript
476
+ /**
477
+ * @param {string} str - 要加密的字符串
478
+ * @returns {Promise<string>} 加密结果
479
+ */
480
+ this.$native.encrypt('敏感数据').then(encrypted => {
481
+ console.log('加密结果:', encrypted)
482
+ })
483
+ ```
484
+
485
+ ### 4.13 位置服务
486
+
487
+ #### getLocation
488
+
489
+ 获取位置信息
490
+
491
+ ```javascript
492
+ /**
493
+ * 使用腾讯地图服务
494
+ * Key: 2WKBZ-DGUWW-MUPR4-3B3F5-ZZJ57-EEBZV
495
+ * 说明: 曲畅个人账号,已完成恒安企业认证
496
+ */
497
+ this.$native.getLocation().then(location => {
498
+ console.log('位置信息:', location)
499
+ })
500
+ ```
501
+
502
+ ### 4.14 缓存管理
503
+
504
+ #### getCacheSize
505
+
506
+ 获取缓存大小
507
+
508
+ ```javascript
509
+ this.$native.getCacheSize().then(size => {
510
+ console.log('缓存大小:', size)
511
+ })
512
+ ```
513
+
514
+ #### clearCache
515
+
516
+ 清除缓存
517
+
518
+ ```javascript
519
+ this.$native.clearCache().then(() => {
520
+ console.log('缓存清除成功')
521
+ })
522
+ ```
523
+
524
+ #### getDeviceInfo
525
+
526
+ 获取设备信息
527
+
528
+ ```javascript
529
+ this.$native.getDeviceInfo().then(deviceInfo => {
530
+ console.log('设备信息:', deviceInfo)
531
+ {"osName":"iOS",
532
+ "StartTime":"2025-10-22 15:05:39",
533
+ "packageInfo":"com.hasl.chome--1.2.0",
534
+ "brand":"Apple",
535
+ "osVersion":"15.6",
536
+ "screen":{"width":375,"orientation":"portrait","statusBarHeight":44,"height":812},"deviceId":"BDCBB513-DF26-4DD2-B36E-03C2C228F4D4",
537
+ "networkType":"wifi",
538
+ "isp":"wifi",
539
+ "ip":"10.14.100.102",
540
+ "timezone":"Asia\/Shanghai",
541
+ "appVersion":"1.2.0",
542
+ "model":"iPhone X"}}}
543
+ })
544
+ ```
545
+
546
+ ## 5. 注意事项
547
+
548
+ - **统一标准**: 所有项目必须遵循此文档规范进行壳功能调用
549
+ - **同步更新**: 文档修改时,各项目需要同步更新对应实现
550
+ - **错误处理**: 所有 API 调用都需要添加适当的错误处理
551
+ - **权限申请**: 部分功能需要用户授权,请确保在调用前处理权限逻辑
552
+
553
+ ## 6. 技术支持
554
+
555
+ 如遇问题,请联系技术团队或参考各项目的具体实现示例。
556
+
557
+ ---
558
+
559
+ **文档版本**: v1.0
560
+ **最后更新**: 2025年10月 项语晴