fhrons-mobile-next 2.0.1 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fhrons-mobile-next",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "泛华榕树组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,18 +1,19 @@
1
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
- @fullscreenchange="onDefaultFullScreenchange($event)"
14
- />
15
- </div>
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>
16
17
  </template>
17
18
 
18
19
  <script>
@@ -76,7 +77,9 @@ export default {
76
77
  gklog: '0', // 视频观看时长
77
78
  close_icon: 'https://dop-pro-1251973116.file.myqcloud.com/upload/img/funzg/icon-gaunbi.svg',
78
79
  isFullScreen: false,
79
- clickCount: 0
80
+ clickCount: 0,
81
+ playtime: 0, //时间观看时间
82
+ stertPlayTime: '' //开始播放的时间
80
83
  };
81
84
  },
82
85
  // 计算属性
@@ -187,15 +190,26 @@ export default {
187
190
  }
188
191
  },
189
192
  /* 获取视频播放进度 */
190
- onPlayerTimeupdate(player) {
191
- if (this.gklog === Math.floor(player.cache_.currentTime)) return;
192
- this.gklog = parseInt(player.cache_.currentTime);
193
- if (!this.gklog) return;
194
- const flag = this.gklog % 10;
195
- if (flag === 0) {
196
- this.$emit('videoUpdate', this.gklog);
197
- }
198
- },
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
+ },
199
213
  // 原生退出全屏
200
214
  AppToJSVideoBack(jsonStr) {
201
215
  const obj = JSON.parse(jsonStr);
@@ -204,10 +218,17 @@ export default {
204
218
  this.player.currentTime(duration);
205
219
  },
206
220
  // 保存播放进度
207
- AppToJSSaveVideoDuration(duration) {
208
- this.gklog = duration;
209
- this.$emit('videoUpdate', this.gklog);
210
- },
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
+ },
211
232
  /* 设置视频进度 */
212
233
  playerReadied(player) {
213
234
  if (!this.videoObj.duration) return;
@@ -219,11 +240,25 @@ export default {
219
240
  player.currentTime(this.videoObj.duration);
220
241
  },
221
242
  onPlayerPlay() {
222
- this.$sensors.callTrack('playClick', { model_name: this.$t('aqcomponents.videopage.yhj38i'), viedo_name: this.videoObj?.title || '', viedo_id: this.videoObj?.id || '' });
223
- this.updateVideoProgress('play');
224
- if (this.asked) return;
225
- this.getNetWorkState();
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()
226
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
+ },
227
262
  onPlayerEnded(e) {
228
263
  this.$emit('videoEnded');
229
264
  },
@@ -359,47 +394,47 @@ export default {
359
394
  };
360
395
  </script>
361
396
  <style scoped lang="less">
362
- #VideoPage{
363
- .landScapeY {
364
- position: absolute;
365
- z-index: 100;
366
- top: 0;
367
- left: 100vw;
368
- width: 100vh;
369
- height: 100vw;
370
- transform: rotate(90deg);
371
- transform-origin: 0 0;
372
- }
373
- .dialog-button {
374
- width: 124px;
375
- height: 44px;
376
- box-sizing: border-box;
377
- padding: 14px 46px;
378
- }
379
- .close-icon {
380
- width: 24px;
381
- height: 24px;
382
- left: 50%;
383
- transform: translateX(-50%);
384
- bottom: -40px;
385
- }
386
- .dialog {
387
- overflow: visible;
388
- }
389
- /deep/ .video-js{
390
- .fullscreen-enter:before{
391
- position: absolute;
392
- width: 100%;
393
- display: block;
394
- height: 100%;
395
- content: '';
396
- left: 0;
397
- top: 0;
398
- background-image: url('https://dop-pro-1251973116.file.myqcloud.com/upload/img/funzg/fullscreen.png');
399
- background-size: 20px 20px;
400
- background-repeat: no-repeat;
401
- background-position: center;
402
- }
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;
403
437
  }
438
+ }
404
439
  }
405
440
  </style>
package/fhcommon/index.js DELETED
@@ -1,33 +0,0 @@
1
- // import FHCommon from './dist/fhcommon.min.js'
2
- // if (typeof window !== 'undefined' && window.Vue) {
3
- // window.Vue.use(FHCommon)
4
- // window.FHUpload = FHCommon
5
- // }
6
-
7
- // // expose FHCommon as default export
8
- // export default FHCommon;
9
-
10
- // 由于minio不支持esm模块导入,也就不支持treeshaking来去掉未用到的minio代码,所以只能准备两套代码
11
- import { upload, compressFile, loopCompressFile } from './upload'
12
- import { getDomImage } from './packages/html2canvas'
13
-
14
- import FHImage from "./packages/fhImage";
15
- import FHPresetImage from "./packages/fhPresetImage";
16
- const FHCommon = {
17
- upload: upload,
18
- compressFile: compressFile,
19
- loopCompressFile: loopCompressFile,
20
- getDomImage,
21
- install (Vue) {
22
- window.FHCommon = FHCommon
23
- Vue.component('FHImage',FHImage)
24
- Vue.component('FHPresetImage',FHPresetImage)
25
- }
26
- }
27
- if (typeof window !== 'undefined' && window.Vue) {
28
- window.Vue.use(FHCommon)
29
- window.FHUpload = FHCommon
30
- }
31
-
32
- // expose FHCommon as default export
33
- export default FHCommon;
@@ -1,40 +0,0 @@
1
- {
2
- "name": "fhcommon",
3
- "version": "2.0.0",
4
- "description": "泛华前端的上传方法",
5
- "main": "dist/fhcommon.min.js",
6
- "module": "dist/fhcommon.min.js",
7
- "devDependencies": {
8
- "@babel/core": "^7.25.8",
9
- "@babel/preset-env": "^7.25.8",
10
- "babel-loader": "^9.1.3",
11
- "crypto-browserify": "^3.12.0",
12
- "css-loader": "^6.7.4",
13
- "eslint": "^9.0.0",
14
- "https-browserify": "^1.0.0",
15
- "less-loader": "^11.1.4",
16
- "path-browserify": "^1.0.1",
17
- "stream-browserify": "^3.0.0",
18
- "stream-http": "^3.2.0",
19
- "style-loader": "^3.3.3",
20
- "terser-webpack-plugin": "^5.3.10",
21
- "timers-browserify": "^2.0.12",
22
- "uglify-js": "^3.17.4",
23
- "vm-browserify": "^1.1.2",
24
- "vue-loader": "^15.9.8",
25
- "vue-template-compiler": "^2.7.16",
26
- "webpack": "^5.91.0",
27
- "webpack-cli": "^5.0.0",
28
- "webpack-dev-server": "^5.0.4"
29
- },
30
- "scripts": {
31
- "test": "echo \"Error: no test specified\" && exit 1",
32
- "build": "npx webpack --config webpack.config.js"
33
- },
34
- "author": "",
35
- "license": "ISC",
36
- "dependencies": {
37
- "core-js": "^3.38.1",
38
- "minio": "^7.0.18"
39
- }
40
- }