fhrons-mobile-next 2.0.0 → 2.0.2

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 (90) hide show
  1. package/.env.poc +8 -0
  2. package/assets/css/colors.js +6 -0
  3. package/assets/css/customVant.less +60 -0
  4. package/assets/css/extra.css +32 -0
  5. package/assets/css/global.css +1 -0
  6. package/assets/css/global.less +1637 -0
  7. package/assets/css/index.js +63 -0
  8. package/assets/css/static.less +607 -0
  9. package/assets/js/func.js +361 -0
  10. package/assets/js/globalData.js +18 -0
  11. package/assets/js/qywxapi.js +484 -0
  12. package/{packages → assets/js}/storage.js +1 -20
  13. package/assets/js/upload.js +269 -0
  14. package/assets/js/validate.js +48 -0
  15. package/assets/js/vant.js +39 -0
  16. package/assets/js/wxapi.js +297 -0
  17. package/assets/vantLang/index.js +172 -0
  18. package/assets/vantLang/lib/en-US.js +95 -0
  19. package/assets/vantLang/lib/es-ES.js +95 -0
  20. package/assets/vantLang/lib/pt-PT.js +96 -0
  21. package/assets/vantLang/lib/zh-CN.js +96 -0
  22. package/assets/vantLang/lib/zh-HK.js +96 -0
  23. package/assets/vantLang/locales/en_US.js +102 -0
  24. package/assets/vantLang/locales/es_ES.js +102 -0
  25. package/assets/vantLang/locales/index.js +12 -0
  26. package/assets/vantLang/locales/pt_PT.js +102 -0
  27. package/assets/vantLang/locales/zh_CN.js +102 -0
  28. package/assets/vantLang/locales/zh_T.js +102 -0
  29. package/babel.config.js +15 -0
  30. package/index.js +68 -33
  31. package/inject-env-plugin.js +29 -0
  32. package/package.json +46 -32
  33. package/packages/areaMobile/index.js +5 -0
  34. package/packages/areaMobile/index.vue +260 -0
  35. package/packages/autoGraph/VueEsign.vue +309 -0
  36. package/packages/autoGraph/index.js +5 -0
  37. package/packages/autoGraph/index.vue +472 -0
  38. package/packages/commonForm/CommonAsyncAreaPicker.vue +223 -0
  39. package/packages/commonForm/CommonDatePicker.vue +152 -0
  40. package/packages/commonForm/CommonForm.vue +786 -0
  41. package/packages/commonForm/CommonFullTimePicker.vue +137 -0
  42. package/packages/commonForm/CommonSinglePicker.vue +121 -0
  43. package/packages/commonForm/CommonYearMonthPicker.vue +127 -0
  44. package/packages/commonForm/index.js +33 -0
  45. package/packages/dialog/index.js +32 -0
  46. package/packages/dialog/index.vue +379 -0
  47. package/packages/index.js +7 -3
  48. package/packages/introduce/index.js +5 -0
  49. package/packages/introduce/index.vue +31 -0
  50. package/packages/loading/Loading.vue +70 -0
  51. package/packages/loading/index.js +43 -0
  52. package/packages/mindMap/index.js +5 -0
  53. package/packages/mindMap/index.vue +437 -0
  54. package/packages/pdfViewer/index.js +12 -0
  55. package/packages/pdfViewer/index.vue +131 -0
  56. package/packages/sharePanel/SheetPanel.vue +316 -0
  57. package/packages/sharePanel/index.js +5 -0
  58. package/packages/sharePanel/index.vue +476 -0
  59. package/packages/sharePanel/props.js +58 -0
  60. package/packages/sharePanel/utils/QyWxShareMixin.js +93 -0
  61. package/packages/sharePanel/utils/shareWay.js +81 -0
  62. package/packages/theme/index copy.js +89 -0
  63. package/packages/theme/index.js +38 -0
  64. package/packages/theme/theme.css +910 -0
  65. package/packages/theme/theme.less +26 -0
  66. package/packages/uploadFile/VanUploadFile.vue +80 -0
  67. package/packages/uploadFile/index.js +5 -0
  68. package/packages/uploadFile/index.vue +725 -0
  69. package/packages/uploadFile/vanUpload.js +5 -0
  70. package/packages/verify/Verify/VerifyPoints.vue +247 -0
  71. package/packages/verify/Verify/VerifySlide.vue +364 -0
  72. package/packages/verify/index.js +5 -0
  73. package/packages/verify/index.vue +416 -0
  74. package/packages/verify/utils/verify.js +53 -0
  75. package/packages/videoPage/index.js +5 -0
  76. package/packages/videoPage/index.vue +440 -0
  77. package/plugins/sensors/fhsensors.js +84 -0
  78. package/plugins/sensors/sensors.js +175 -0
  79. package/plugins/sensors/sensorsFun.js +1387 -0
  80. package/fhrons-mobile-next-2.0.0.tgz +0 -0
  81. package/packages/fhImage/index.js +0 -5
  82. package/packages/fhImage/index.vue +0 -57
  83. package/packages/fhPresetImage/index.js +0 -5
  84. package/packages/fhPresetImage/index.vue +0 -39
  85. package/packages/html2canvas/index.js +0 -29
  86. package/upload copy.js +0 -468
  87. package/utils/tools.js +0 -22
  88. /package/{dist → fhcommon/dist}/fhcommon.min.js +0 -0
  89. /package/{dist → fhcommon/dist}/fhcommon.min.js.LICENSE.txt +0 -0
  90. /package/{upload.js → fhcommon/upload.js} +0 -0
@@ -0,0 +1,440 @@
1
+ <template>
2
+ <div id="VideoPage" ref="videoCom" :class="[radius ? 'br8 over-hidden' : '']">
3
+ <video-player
4
+ ref="videoPlayer"
5
+ class="video-player vjs-custom-skin"
6
+ :playsinline="true"
7
+ :options="playerOptions"
8
+ :webkit-playsinline="true"
9
+ @ended="onPlayerEnded($event)"
10
+ @ready="playerReadied($event)"
11
+ @timeupdate="onPlayerTimeupdate($event)"
12
+ @play="onPlayerPlay($event)"
13
+ @pause="onPlayerPause($event)"
14
+ @fullscreenchange="onDefaultFullScreenchange($event)"
15
+ />
16
+ </div>
17
+ </template>
18
+
19
+ <script>
20
+ import { isAndroid } from '../../assets/js/validate';
21
+ import { mapState } from 'vuex';
22
+ Vue.use(VueVideoPlayer);
23
+ export default {
24
+ // 组件名称
25
+ name: 'VideoPage',
26
+ props: {
27
+ videoObj: {
28
+ type: Object,
29
+ default: () => {}
30
+ },
31
+ auto: {
32
+ type: Boolean,
33
+ default: () => false
34
+ },
35
+ radius: {
36
+ type: Boolean,
37
+ default: () => false
38
+ },
39
+ aspectRatio: {
40
+ type: String,
41
+ default: () => '16:9'
42
+ },
43
+ needRecord: {
44
+ type: Boolean,
45
+ default: () => true
46
+ }
47
+ },
48
+ // 组件状态值
49
+ data() {
50
+ return {
51
+ playerOptions: {
52
+ playbackRates: [0.5, 1.0, 1.25, 1.5, 2.0], // 播放速度
53
+ autoplay: this.auto, // 如果true,浏览器准备好时开始回放。
54
+ muted: false, // 默认情况下将会消除任何音频。
55
+ loop: false, // 导致视频一结束就重新开始。
56
+ preload: 'auto', // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
57
+ language: 'zh-CN',
58
+ aspectRatio: this.aspectRatio, // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
59
+ fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
60
+ sources: [
61
+ {
62
+ type: '', // 这里的种类支持很多种:基本视频格式、直播、流媒体等,具体可以参看git网址项目
63
+ src: '' // url地址
64
+ }
65
+ ],
66
+ poster: '', // 你的封面地址
67
+ notSupportedMessage: this.$t('aqcomponents.videopage.1c7h0m'), // 允许覆盖Video.js无法播放媒体源时显示的默认信息。
68
+ controlBar: {
69
+ timeDivider: true,
70
+ durationDisplay: true,
71
+ remainingTimeDisplay: true,
72
+ fullscreenToggle: false // 全屏按钮
73
+ },
74
+ asked: false
75
+ },
76
+ showTip: false,
77
+ gklog: '0', // 视频观看时长
78
+ close_icon: 'https://dop-pro-1251973116.file.myqcloud.com/upload/img/funzg/icon-gaunbi.svg',
79
+ isFullScreen: false,
80
+ clickCount: 0,
81
+ playtime: 0, //时间观看时间
82
+ stertPlayTime: '' //开始播放的时间
83
+ };
84
+ },
85
+ // 计算属性
86
+ computed: {
87
+ currentUrl() {
88
+ return this.playerOptions.sources[0].src;
89
+ },
90
+ player() {
91
+ return this.$refs.videoPlayer.player;
92
+ },
93
+ playerWidth() {
94
+ const currentVideoDOM = this.$refs.videoPlayer.$el.querySelector('.video-js');
95
+ return {
96
+ playerWidth: currentVideoDOM.clientWidth,
97
+ clickCount: this.clickCount
98
+ };
99
+ },
100
+ ...mapState({
101
+ userInfo: state => state.user.userInfo
102
+ })
103
+ },
104
+ // 侦听器
105
+ watch: {
106
+ videoObj: {
107
+ handler(newVal, oldVal) {
108
+ this.gklog = '';
109
+ if (newVal.type) this.$set(this.playerOptions.sources[0], 'type', newVal.type);
110
+ this.$set(this.playerOptions.sources[0], 'src', newVal.videoUrl);
111
+ this.$set(this.playerOptions, 'poster', newVal.img);
112
+ },
113
+ immediate: true
114
+ },
115
+ currentUrl: {
116
+ handler(newVal, oldVal) {
117
+ setTimeout(_ => {
118
+ if (this.auto) {
119
+ document.querySelector('.vjs-play-control').click();
120
+ }
121
+ }, 100);
122
+ },
123
+ deep: true
124
+ }
125
+ },
126
+ /**
127
+ * 组件实例创建完成,属性已绑定,但DOM还未生成,$ el属性还不存在
128
+ */
129
+ created() {
130
+ // 判断当前是app还是h5
131
+ const { isApp, isIOS, isAndroid } = this.$globalData;
132
+ if (isIOS || isAndroid) {
133
+ window.appToJSNetStatus = this.appToJSNetStatus;
134
+ window.AppToJSSaveVideoDuration = this.AppToJSSaveVideoDuration;
135
+ window.AppToJSVideoBack = this.AppToJSVideoBack;
136
+ }
137
+ if (isApp) {
138
+ // app端,刻意练习,要求全屏
139
+ if (this.$route.name === 'ExerciseTaskDetails' || this.$route.name === 'ExerciseTaskClockInRecord' || this.$route.name === 'ExerciseTaskClockIn') {
140
+ this.$set(this.playerOptions.controlBar, 'fullscreenToggle', true);
141
+ }
142
+ }
143
+ },
144
+ deactivated() {
145
+ this.$refs.videoPlayer.player.pause();
146
+ },
147
+ // 组件方法
148
+ methods: {
149
+ addEvent() {
150
+ },
151
+ allClick(e) {
152
+ this.clickCount++;
153
+ },
154
+ appToJSNetStatus(data) {
155
+ const result = +data === 2 ? 'wifi' : data === 1 ? this.$t('aqcomponents.videopage.2p4g36') : this.$t('aqcomponents.videopage.73c556');
156
+ // 0 无网 2wifi 1移动网络
157
+ if (result === this.$t('aqcomponents.videopage.2p4g36')) {
158
+ this.$toast(this.$t('aqcomponents.videopage.7ikbgu'));
159
+ } else if (result === 'wifi') {
160
+ this.asked = true;
161
+ }
162
+ },
163
+ // 继续
164
+ goAhead() {
165
+ this.$refs.videoPlayer.player.play();
166
+ this.asked = true;
167
+ this.showTip = false;
168
+ },
169
+ // 暂停
170
+ pause() {
171
+ this.$refs.videoPlayer.player.pause();
172
+ this.showTip = false;
173
+ },
174
+ // 查询当前网络状态
175
+ getNetWorkState() {
176
+ if (this.$globalData.isAndroid) {
177
+ if (window.android && typeof window.android.getNetWorkState === 'function') {
178
+ const data = window.android.getNetWorkState() + 1;
179
+ const result = +data === 2 ? 'wifi' : data === 1 ? this.$t('aqcomponents.videopage.2p4g36') : this.$t('aqcomponents.videopage.73c556');
180
+ if (result === this.$t('aqcomponents.videopage.2p4g36')) {
181
+ this.$toast(this.$t('aqcomponents.videopage.7ikbgu'));
182
+ } else if (result === 'wifi') {
183
+ this.asked = true;
184
+ }
185
+ }
186
+ } else if (this.$globalData.isIOS) {
187
+ if (window['webkit'] && window.webkit['messageHandlers'] && window.webkit.messageHandlers.videoCheckNet) {
188
+ window.webkit.messageHandlers.videoCheckNet.postMessage('');
189
+ }
190
+ }
191
+ },
192
+ /* 获取视频播放进度 */
193
+ onPlayerTimeupdate(event) {
194
+ let currentTime = event.currentTime()
195
+ const player = this.$refs.videoPlayer.player
196
+ if (!player.paused() && Math.floor(currentTime) > Math.floor(this.gklog)) {
197
+ this.playtime++
198
+ console.log('当前已经看了多少秒', this.playtime, Math.floor(currentTime), Math.floor(this.gklog))
199
+ if (this.playtime % 10 == 0) {
200
+ this.gklog = currentTime
201
+ this.savePersonalWatchRecord1(10)
202
+ }
203
+ }
204
+ this.gklog = currentTime
205
+ // if (this.gklog === Math.floor(event.cache_.currentTime)) return
206
+ // this.gklog = parseInt(event.cache_.currentTime)
207
+ // if (!this.gklog) return
208
+ // const flag = this.gklog % 10
209
+ // if (flag === 0) {
210
+ // this.$emit('videoUpdate', this.gklog, 10)
211
+ // }
212
+ },
213
+ // 原生退出全屏
214
+ AppToJSVideoBack(jsonStr) {
215
+ const obj = JSON.parse(jsonStr);
216
+ const { duration = '0' } = obj;
217
+ // 设置视频进度
218
+ this.player.currentTime(duration);
219
+ },
220
+ // 保存播放进度
221
+ AppToJSSaveVideoDuration(duration) {
222
+ this.gklog = duration
223
+ // this.$emit('videoUpdate', this.gklog, 10)
224
+ if (this.playtime != 0) {
225
+ this.savePersonalWatchRecord1(Math.floor(this.playtime % 10))
226
+ this.playtime = 0
227
+ this.stertPlayTime = ''
228
+ }else{
229
+ this.savePersonalWatchRecord1(0)
230
+ }
231
+ },
232
+ /* 设置视频进度 */
233
+ playerReadied(player) {
234
+ if (!this.videoObj.duration) return;
235
+ if (this.$globalData.isApp || isAndroid()) {
236
+ this.createFullButton();
237
+ } else {
238
+ this.$set(this.playerOptions.controlBar, 'fullscreenToggle', true);
239
+ }
240
+ player.currentTime(this.videoObj.duration);
241
+ },
242
+ onPlayerPlay() {
243
+ console.log('开始播放 onPlayerPlay')
244
+ if (this.playtime != 0) {
245
+ this.savePersonalWatchRecord1(Math.floor(this.playtime % 10))
246
+ }
247
+ this.stertPlayTime = new Date().getTime()
248
+ this.playtime = 0
249
+ this.$sensors.callTrack('playClick', { model_name: this.$t('aqcomponents.videopage.yhj38i'), viedo_name: this.videoObj?.title || '', viedo_id: this.videoObj?.id || '' })
250
+ this.updateVideoProgress('play')
251
+ if (this.asked) return
252
+ this.getNetWorkState()
253
+ },
254
+ onPlayerPause(e) {
255
+ console.log('点击了暂停播放')
256
+ if (this.playtime != 0) {
257
+ this.savePersonalWatchRecord1(Math.floor(this.playtime % 10))
258
+ this.playtime = 0
259
+ this.stertPlayTime = ''
260
+ }
261
+ },
262
+ onPlayerEnded(e) {
263
+ this.$emit('videoEnded');
264
+ },
265
+ updateVideoProgress() {
266
+ if (!this.needRecord || !this.judgeEmpty(this.videoObj)) return;
267
+ const saasId = this.userInfo.saasId;
268
+ const userId = this.userInfo.id || this.userInfo.userId;
269
+ const { id = '', watchStatus = '', courseId = '', title = '' } = this.videoObj;
270
+ // 如果已观看视频,就不执行保存记录
271
+ if (watchStatus === 1) return;
272
+ axios.post(`/gateway/course/cozCourseWatchRecord/saveWatchRecordCount`,{
273
+ id: '',
274
+ saasId,
275
+ userId,
276
+ duration: '0',
277
+ courseId,
278
+ courseName: title,
279
+ courseDetailId: id
280
+ }).then(res => {
281
+ // 保存成功
282
+ this.$emit('updateVideoStatus');
283
+ }).catch(() => {});
284
+ },
285
+ onPlayerFullScreenchange() {
286
+ if (this.isFullScreen) {
287
+ this.exitFullscreen();
288
+ this.isFullScreen = false;
289
+ return;
290
+ }
291
+
292
+ const { watchStatus = '', videoUrl = '', title = '' } = this.videoObj;
293
+ if (this.$globalData.isApp && !this.$globalData.isQyWeiXin) {
294
+ const fullNeed = {
295
+ courseName: title,
296
+ duration: this.gklog + '',
297
+ currentChapter: {
298
+ chapterName: title,
299
+ chapterNo: '1',
300
+ contentAddress: videoUrl,
301
+ contentName: title,
302
+ contentTime: this.player.duration() + '',
303
+ courseChildChapterList: [],
304
+ courseMainId: '961682110418128896',
305
+ coursePurchaseState: '1',
306
+ createdate: '2022-04-18 15:17:03',
307
+ id: '962734854079512576',
308
+ modifydate: '2022-04-18 15:17:03',
309
+ multiPartFlag: '0',
310
+ num: '1',
311
+ sumContentTime: '8',
312
+ duration: this.gklog + ''
313
+ },
314
+ courseChapterList: [],
315
+ isMultiPart: '0',
316
+ currentRate: this.player.playbackRate() + '',
317
+ creatorMessage: {},
318
+ isFollowed: '0',
319
+ studyCount: '0',
320
+ likeState: '0',
321
+ collectState: '0',
322
+ type: '0',
323
+ courseStudyState: watchStatus
324
+ };
325
+ if (
326
+ this.$globalData.isIOS && window.webkit
327
+ ) {
328
+ window.webkit.messageHandlers.JSToAppFullScreen.postMessage(fullNeed);
329
+ this.player.pause();
330
+ } else if (
331
+ this.$globalData.isAndroid && window.android
332
+ ) {
333
+ window.android.JSToAppFullScreen(JSON.stringify(fullNeed));
334
+ this.player.pause();
335
+ }
336
+ } else {
337
+ const playerDom = this.$refs.videoPlayer.$el.querySelector('.video-js');
338
+ this.launchFullscreen(playerDom);
339
+ this.isFullScreen = true;
340
+ }
341
+ },
342
+
343
+ // 判断各种浏览器,找到正确的方法
344
+ launchFullscreen(element) {
345
+ if (element.requestFullscreen) {
346
+ element.requestFullscreen();
347
+ } else if (element.mozRequestFullScreen) {
348
+ element.mozRequestFullScreen();
349
+ } else if (element.webkitRequestFullscreen) {
350
+ element.webkitRequestFullscreen();
351
+ } else if (element.msRequestFullscreen) {
352
+ element.msRequestFullscreen();
353
+ }
354
+ },
355
+ // 判断浏览器种类
356
+ exitFullscreen() {
357
+ // 退出视频时暂停播放视频
358
+ this.$refs.videoPlayer.player.pause();
359
+ if (document.exitFullscreen) {
360
+ document.exitFullscreen();
361
+ } else if (document.mozCancelFullScreen) {
362
+ document.mozCancelFullScreen();
363
+ } else if (document.webkitExitFullscreen) {
364
+ document.webkitExitFullscreen();
365
+ }
366
+ },
367
+ // 创建全屏按钮
368
+ createFullButton() {
369
+ const Button = videojs.getComponent('Button');
370
+ const fullButton = videojs.extend(Button, {
371
+ constructor: function(player, options) {
372
+ Button.apply(this, arguments);
373
+ this.addClass('fullscreen-enter');
374
+ },
375
+ handleClick: () => {
376
+ // 绑定点击事件
377
+ this.onPlayerFullScreenchange();
378
+ },
379
+ buildCSSClass: function() {
380
+ return 'vjs-icon-custombutton vjs-control vjs-button';
381
+ }
382
+ });
383
+ // 注册
384
+ videojs.registerComponent('fullButton', fullButton);
385
+ this.$nextTick(() => {
386
+ // 添加到controlBar中
387
+ this.player.getChild('controlBar').addChild('fullButton');
388
+ });
389
+ },
390
+ // 自带全屏按钮的点击事件
391
+ onDefaultFullScreenchange() {
392
+ }
393
+ }
394
+ };
395
+ </script>
396
+ <style scoped lang="less">
397
+ #VideoPage {
398
+ .landScapeY {
399
+ position: absolute;
400
+ z-index: 100;
401
+ top: 0;
402
+ left: 100vw;
403
+ width: 100vh;
404
+ height: 100vw;
405
+ transform: rotate(90deg);
406
+ transform-origin: 0 0;
407
+ }
408
+ .dialog-button {
409
+ width: 124px;
410
+ height: 44px;
411
+ box-sizing: border-box;
412
+ padding: 14px 46px;
413
+ }
414
+ .close-icon {
415
+ width: 24px;
416
+ height: 24px;
417
+ left: 50%;
418
+ transform: translateX(-50%);
419
+ bottom: -40px;
420
+ }
421
+ .dialog {
422
+ overflow: visible;
423
+ }
424
+ /deep/ .video-js {
425
+ .fullscreen-enter:before {
426
+ position: absolute;
427
+ width: 100%;
428
+ display: block;
429
+ height: 100%;
430
+ content: "";
431
+ left: 0;
432
+ top: 0;
433
+ background-image: url("https://dop-pro-1251973116.file.myqcloud.com/upload/img/funzg/fullscreen.png");
434
+ background-size: 20px 20px;
435
+ background-repeat: no-repeat;
436
+ background-position: center;
437
+ }
438
+ }
439
+ }
440
+ </style>
@@ -0,0 +1,84 @@
1
+ import { getStorage } from 'assets/js/storage'
2
+ import i18n from 'assets/vantLang';
3
+
4
+ function getPlatFormCode() {
5
+ const userGlobalGist = getStorage({ name: 'userGlobalGist' }) || {};
6
+ const loginResponseDO = userGlobalGist.loginResponseDO || {};
7
+ const platformCode = getStorage({ name: 'platformCode' });
8
+ const isShared = getStorage({ key: 'isTourists', type: 'session' });
9
+ const userHrefPlatformCode = getStorage({ name: 'userHrefPlatformCode' });
10
+ const finalPlatformCode = (isShared || userHrefPlatformCode) ? (platformCode || loginResponseDO?.platformCode || '00') : (loginResponseDO?.platformCode || platformCode || '00');
11
+ return finalPlatformCode; // 00 表示元租户;
12
+ }
13
+
14
+ function getPlatSaasId() {
15
+ const saasId = getStorage({ name: 'saasId' });
16
+ const userInfo = getStorage({ name: 'userInfo' });
17
+ return userInfo?.saasId || saasId || '000000';// 000000 表示元租户;
18
+ }
19
+
20
+ export default {
21
+ initSensorsData() {
22
+ function isWeiXin() {
23
+ var ua = window.navigator.userAgent.toLowerCase();
24
+ if (ua.match(/MicroMessenger/i) == 'micromessenger' && (ua.match(/wxwork/i) != 'wxwork')) {
25
+ return true;
26
+ }
27
+ return false;
28
+ }
29
+ function isQYWeiXin() {
30
+ var ua = window.navigator.userAgent.toLowerCase();
31
+ if ((ua.match(/MicroMessenger/i) == 'micromessenger') && (ua.match(/wxwork/i) == 'wxwork')) {
32
+ return true;
33
+ }
34
+ return false;
35
+ }
36
+
37
+ function isIOS() {
38
+ var ua = window.navigator.userAgent.toLowerCase();
39
+ if (ua.match(/iphone|ipad|ipod/)) {
40
+ return true;
41
+ }
42
+ return false;
43
+ }
44
+
45
+ function isAndroid() {
46
+ var ua = window.navigator.userAgent.toLowerCase();
47
+ if (ua.match(/android/)) {
48
+ return true;
49
+ }
50
+ return false;
51
+ }
52
+ const sensors = window['fhronsSensorsAnalytic202402'];
53
+ const interfaceAddress = `${window.location.origin}/gateway/datareport/behavior/getBehaviorData`;
54
+ const localTerminal = getStorage({ name: 'terminal', type: 'session' });
55
+ const terminal = localTerminal ? (localTerminal === 'normal' ? 'WECHAT' : localTerminal.toLowerCase() === 'pub' ? 'PUB' : localTerminal.toLowerCase() === 'app' ? 'APP' : '') : '';
56
+
57
+ sensors.initFhSensors({
58
+ sensorsUrl: interfaceAddress,
59
+ send_type: 'beacon',
60
+ show_log: false,
61
+ viewDuration: 10000
62
+ });
63
+ sensors.registerPage({
64
+ product_name: (function() {
65
+ if (getPlatFormCode() == '2') {
66
+ return i18n.t('api.sesnsor_request.w9jfj8');
67
+ }
68
+ return getStorage({ name: 'smPlatformInfoDto' })?.smSaasPlatformDO?.platformName;
69
+ })(),
70
+ refer_product_name: (function() {
71
+ if (isWeiXin()) {
72
+ return getStorage({ name: 'smPlatformInfoDto' })?.smSaasPlatformDO?.platformName + i18n.t('applyprocess.examine.qi3cfh');
73
+ } else if (isQYWeiXin()) {
74
+ return getStorage({ name: 'smPlatformInfoDto' })?.smSaasPlatformDO?.platformName + i18n.t('utils.mockdata.unoim4');
75
+ } else if (isAndroid() || isIOS()) {
76
+ return getStorage({ name: 'smPlatformInfoDto' })?.smSaasPlatformDO?.platformName + (terminal || 'APP');
77
+ }
78
+ return getStorage({ name: 'smPlatformInfoDto' })?.smSaasPlatformDO?.platformName + (terminal || 'MOBILE_WEB');
79
+ })(),
80
+ saas_id: getPlatSaasId(),
81
+ terminal: terminal || (isAndroid() ? 'Android' : isIOS() ? 'IOS' : isWeiXin() ? 'PUB' : isQYWeiXin() ? 'WECHAT' : 'MOBILE_WEB')
82
+ });
83
+ }
84
+ };