option-video-detail.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>操作视频-创业帮</title>
  6. <meta name="keywords" content="操作视频-创业帮">
  7. <meta name="description" content="操作视频-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="操作视频-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <meta name="referrer" content="no-referrer">
  16. <link rel="stylesheet" href="./static/css/main.css">
  17. </head>
  18. <body class="pb0 ovh">
  19. <div class="option-video-detail" id="app" v-cloak>
  20. <van-nav-bar class="user_rank_explan_title user_title_normal titlef16" left-arrow title="创业帮视频介绍" v-if="toptitleisshow" @click-left="goback">
  21. <template #left> <img src="./static/images/left.png" alt=""></template>
  22. </van-nav-bar>
  23. <div class="tips cm">建议在wifi环境下观看</div>
  24. <div class="strong_colorroll">
  25. <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
  26. <van-list v-model="loading" :finished="finished" @load="onLoad" :immediate-check="false">
  27. <div class="video pl16 pr16 mt8" v-for="(item,index) in videolist" :key="item.id">
  28. <div class="title c333 f16">{{item.Title}}</div>
  29. <video muted :src="item.VideoUrl" webkit-playsinline playsinline x5-playsinline x-webkit-airplay="allow" :poster="item.BgPic" controls @play="handlePlay(index)"></video>
  30. </div>
  31. </van-list>
  32. </van-pull-refresh>
  33. </div>
  34. </div>
  35. <script src="./static/js/klm-vv.min.js"></script>
  36. <script src="./static/js/appfunc.min.js"></script>
  37. <script src="./static/js/klm-axios-config.js"></script>
  38. <script src="./static/js/publicfn.js"></script>
  39. <script>
  40. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  41. // 可以通过下面的方式手动注册
  42. Vue.use(vant.Lazyload);
  43. PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
  44. // 在 #app 标签下渲染一个按钮组件
  45. let app = new Vue({
  46. el: '#app',
  47. data() {
  48. return {
  49. toptitleisshow:false,
  50. videolist:[
  51. ],
  52. loading: false,
  53. finished: false,
  54. refreshing: false,
  55. pageinfo:{
  56. PageSize:10,
  57. PageNum:1
  58. },
  59. videoElement: [],
  60. }
  61. },
  62. created() {
  63. this.toptitleisshow = toptitleisshow;
  64. this.getvideodetaillist();
  65. },
  66. mounted(){
  67. this.videoElement = document.getElementsByTagName('video');
  68. },
  69. methods: {
  70. onLoad() {
  71. if (this.refreshing) {
  72. this.videolist = [];
  73. this.refreshing = false;
  74. this.pageinfo.PageNum = 0;
  75. };
  76. this.pageinfo.PageNum++;
  77. this.getvideodetaillist();
  78. },
  79. onRefresh() {
  80. this.finished = false;
  81. this.loading = true;
  82. this.onLoad();
  83. },
  84. goback(){
  85. PublicLib.GoBack({Level:1});
  86. },
  87. async getvideodetaillist(){
  88. //- PublicLib.ShowLoading({Message:''});
  89. const VideoId = PublicLib.getCookieInfo('videoId');
  90. const UserId = PublicLib.getCookieInfo('userId');
  91. const res = await getRequest('api/v1/appvideolist/list?t='+Math.random(6),JSON.stringify({...this.pageinfo,VideoId}));
  92. if(res.status !== '1')return tips('操作视频列表获取失败!');
  93. //- PublicLib.HideLoading();
  94. if(res.data.length < this.pageinfo.PageSize) {
  95. this.finished = true;
  96. };
  97. //- res.data.forEach(item=>item.VideoUrl = 'https://vd2.bdstatic.com/mda-jkucv7q3k8xxc2mu/sc/mda-jkucv7q3k8xxc2mu.mp4?playlist=%5B%22hd%22%2C%22sc%22%5D&v_from_s=hkapp-haokan-hna&auth_key=1638352463-0-0-0fcec2ab539a242b66cceb320340f352&bcevod_channel=searchbox_feed&pd=1&pt=3&abtest=&klogid=1463101573')
  98. this.videolist.push(...res.data);
  99. this.loading = false;
  100. },
  101. handlePlay(index) {
  102. const videoElement = this.videoElement;
  103. if (videoElement && videoElement.length) {
  104. for(i=0;i<videoElement.length;i++){
  105. i === index ? this.videoElement[i].play() : this.videoElement[i].pause();
  106. };
  107. };
  108. },
  109. }
  110. });
  111. </script>
  112. </body>
  113. </html>