1
0

index.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779
  1. {extend name="public/layout" /} {block name="title"}视频列表{/block} {block name="body"}
  2. <style type="text/css">
  3. html,
  4. body {
  5. display: block;
  6. min-width: 1100px;
  7. height: 100%;
  8. overflow: hidden;
  9. }
  10. .layui-table thead tr,
  11. .layui-table-header {
  12. background-color: #D8E6F1 !important;
  13. }
  14. .layui-table-sort {
  15. display: inline-block !important;
  16. }
  17. .layui-fluid {
  18. display: block;
  19. box-shadow: 0 0 4px 0 #B6CADE;
  20. border-radius: 5px;
  21. margin: 15px;
  22. background-color: #ffffff;
  23. height: 96%;
  24. box-sizing: border-box;
  25. }
  26. .layui-card {
  27. box-shadow: none !important;
  28. height: 100%;
  29. }
  30. .layui-form-label {
  31. width: auto;
  32. }
  33. .layui-btn-primary {
  34. color: #249EFB;
  35. border: 1px solid #249EFB;
  36. }
  37. .layui-btn-primary:hover {
  38. background-color: #E3F7FF;
  39. color: #249EFB;
  40. }
  41. .layui-btn-xs,
  42. .layui-btn-xs:hover {
  43. border: 1px solid #249EFB;
  44. background-color: #fff;
  45. color: #249EFB;
  46. padding: 0px 10px;
  47. }
  48. .layui-btn-danger,
  49. .layui-btn-danger:hover {
  50. color: #FF5722;
  51. background-color: #fff;
  52. border: 1px solid #FF5722;
  53. padding: 0px 10px;
  54. }
  55. .flexBox {
  56. display: flex;
  57. align-items: center;
  58. justify-content: space-between;
  59. }
  60. .flex,
  61. .layui-inline {
  62. display: flex;
  63. }
  64. .layui-input-inline {
  65. flex: 1;
  66. }
  67. .flex-sub {
  68. flex: 1;
  69. display: flex;
  70. align-items: center;
  71. justify-content: flex-end;
  72. }
  73. .layui-form-item .layui-input-inline {
  74. width: auto !important;
  75. max-width: 200px;
  76. }
  77. /* 视频预览 */
  78. .page_video_mask {
  79. width: 100%;
  80. height: 100%;
  81. position: fixed;
  82. top: 0px;
  83. left: 0px;
  84. background-color: rgba(0, 0, 0, 0.5);
  85. z-index: 99999;
  86. display: flex;
  87. justify-content: center;
  88. align-items: center;
  89. }
  90. .page_phone {
  91. width: 410px;
  92. height: 95vh;
  93. max-height: 820px !important;
  94. background: url('__STATIC__/img/phoneModel.png');
  95. background-size: 100% 100%;
  96. display: flex;
  97. justify-content: center;
  98. align-items: center;
  99. }
  100. .page_box {
  101. width: 375px;
  102. height: 96%;
  103. background-color: #000;
  104. border-radius: 30px;
  105. margin-right: 4px;
  106. position: relative;
  107. overflow: hidden;
  108. }
  109. .video_show_msg {
  110. width: 270px;
  111. position: absolute;
  112. bottom: 80px;
  113. left: 20px;
  114. color: #fff;
  115. font-size: 14px;
  116. z-index: 9999999;
  117. }
  118. .video_msg_title {
  119. white-space: nowrap;
  120. overflow: hidden;
  121. text-overflow: ellipsis;
  122. font-size: 14px;
  123. }
  124. .video_msg_content {
  125. margin-top: 3px;
  126. word-break: break-all;
  127. text-overflow: ellipsis;
  128. display: -webkit-box;
  129. -webkit-box-orient: vertical;
  130. -webkit-line-clamp: 2;
  131. /* 这里是超出几行省略 */
  132. overflow: hidden;
  133. font-size: 14px;
  134. }
  135. .video_msg_type {
  136. font-size: 14px;
  137. margin-top: 3px;
  138. }
  139. .video_right_box {
  140. position: absolute;
  141. right: 10px;
  142. bottom: 180px;
  143. font-size: 12px;
  144. color: #fff;
  145. z-index: 9999999;
  146. }
  147. .video_right_item {
  148. width: 50px;
  149. height: 52px;
  150. display: flex;
  151. flex-direction: column;
  152. justify-content: center;
  153. align-items: center;
  154. margin-bottom: 10px;
  155. }
  156. .video_right_avatar {
  157. width: 32px;
  158. height: 32px;
  159. background-color: #ccc;
  160. border-radius: 50%;
  161. }
  162. .video_right_img>img {
  163. width: 23px;
  164. height: 21px;
  165. }
  166. .video_right_name {
  167. margin-top: 5px;
  168. }
  169. .videoDiv {
  170. display: block;
  171. width: 100%;
  172. height: auto;
  173. min-height: 100%;
  174. overflow: hidden;
  175. position: absolute;
  176. top: 50%;
  177. transform: translate(0, -50%);
  178. -webkit-transform: translate(0, -50%);
  179. -moz-transform: translate(0, -50%);
  180. -ms-transform: translate(0, -50%);
  181. }
  182. .videoMsg .videoDiv video {
  183. display: block;
  184. width: 100%;
  185. position: absolute;
  186. max-height: 100%;
  187. height: auto;
  188. top: 50%;
  189. left: 50%;
  190. transform: translate(-50%, -50%);
  191. object-fit: fill;
  192. z-index: 8;
  193. }
  194. .lay-close {
  195. position: absolute;
  196. top: 30px;
  197. right: 25%;
  198. color: #fff;
  199. font-size: 38px !important;
  200. font-weight: 700;
  201. cursor: pointer;
  202. }
  203. .layui-tab-title .layui-this {
  204. color: #249EFB;
  205. }
  206. .layui-tab-title .layui-this:after {
  207. width: 50px;
  208. height: 4px !important;
  209. background-color: #249EFB;
  210. top: 38px !important;
  211. left: 50%;
  212. transform: translateX(-50%);
  213. border: none;
  214. border: 1px solid #249EFB !important;
  215. }
  216. .layadmin-iframe {
  217. position: absolute;
  218. width: 100%;
  219. height: 100% !important;
  220. left: 0;
  221. top: 0;
  222. right: 0;
  223. bottom: 0;
  224. }
  225. </style>
  226. <body>
  227. <div class="layui-fluid">
  228. <div class="layui-card">
  229. <div class="layui-tab layui-tab-brief height100_">
  230. <ul class="layui-tab-title rst_box_top">
  231. <!-- <li data-index="1" class="font16 layui_video_list layui-this">视频列表</li>
  232. <li data-index="2" class="font16 layui_video_tjss">数据统计</li> -->
  233. <li data-index="1" class="font16 layui_video_list layui-this"><a
  234. href="{:url('video/index')}">视频列表</a></li>
  235. <li data-index="2" class="font16 layui_video_tjss"><a
  236. href="{:url('video/statistics_data_list')}">数据统计</a></li>
  237. </ul>
  238. <div class="layui-tab-content pd0 mdt20" style="padding: 0;">
  239. <div class="layui-tab-item layui-show">
  240. <div class="layui-form layui-card-header layuiadmin-card-header-auto">
  241. <div class="layui-form-item flexBox">
  242. {auth:check name="video/add"}
  243. <div class="layui-inline">
  244. <button class="layui-btn layuiadmin-btn-list layui-btn-primary"
  245. data-type="add">添加视频</button>
  246. <a type="button" class="layui-btn layui-btn-primary"
  247. id="cate_administration">分类管理</a>
  248. <a type="button" class="layui-btn layui-btn-primary"
  249. id="cate_administration_labels">标签管理</a>
  250. <!-- <a class="layui-btn layui-btn-primary" href="{:url('Video/statistics_data_list')}" class="lanse lpjdbtn">统计数据</a> -->
  251. </div>
  252. {/auth:check}
  253. <div class="flex-sub">
  254. <div class="layui-inline" style="margin-right: 0px;">
  255. <label class="layui-form-label">标题</label>
  256. <div class="layui-input-inline">
  257. <input type="text" name="title" placeholder="请输入标题" autocomplete="off"
  258. class="layui-input">
  259. </div>
  260. </div>
  261. <div class="layui-inline" style="margin-right: 0px;">
  262. <label class="layui-form-label">分类</label>
  263. <div class="layui-input-inline">
  264. <select name="type" lay-filter="type" id="type" lay-search>
  265. <option value="">请选择分类</option>
  266. {volist name="type" id="t"}
  267. <option value="{$t.id}">{$t.name}</option>
  268. {/volist}
  269. </select>
  270. </div>
  271. </div>
  272. <div class="layui-inline" style="margin-right: 0px;">
  273. <label class="layui-form-label">标签</label>
  274. <div class="layui-input-inline">
  275. <select name="label" id="label">
  276. <option value="">请选择标签</option>
  277. </select>
  278. </div>
  279. </div>
  280. <div class="layui-inline" style="margin-right: 0px;">
  281. <label class="layui-form-label">上传人</label>
  282. <div class="layui-input-inline">
  283. <select name="employee_id" id="employee" lay-search>
  284. <option value="">请选择人员</option>
  285. {volist name="employee" id="e"}
  286. <option value="{$e.id}">{$e.name}</option>
  287. {/volist}
  288. </select>
  289. </div>
  290. </div>
  291. <div class="layui-inline">
  292. <label class="layui-form-label">上传时间</label>
  293. <div class="layui-input-inline select-date">
  294. <input type="text" name="add_time" id="select_date"
  295. placeholder="开始时间 - 结束时间" autocomplete="off" class="layui-input">
  296. </div>
  297. </div>
  298. <div class="layui-inline" style="margin-right: 0;">
  299. <button class="layui-btn layuiadmin-btn-list submitbtn" id="searchBbtns"
  300. lay-submit lay-filter="LAY-app-contlist-search">
  301. <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
  302. </button>
  303. </div>
  304. </div>
  305. </div>
  306. </div>
  307. <div class="layui-card-body">
  308. <table id="layui-table-video" lay-filter="layui-table-video"></table>
  309. <script type="text/html" id="layui-tagsbar">
  310. {auth:check name="video/edit"}
  311. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</a>
  312. {/auth:check}
  313. {auth:check name="data/cluedata"}
  314. <a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="evidence-clue-list">线索记录</a>
  315. {/auth:check}
  316. {auth:check name="video/del"}
  317. <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
  318. {/auth:check}
  319. {auth:check name="dailyTasks/assign_org"}
  320. <a class="layui-btn layui-btn-xs" lay-event="daily-tasks">设置任务</a>
  321. {/auth:check}
  322. <a class="layui-btn layui-btn-xs" lay-event="preview">预览</a>
  323. </script>
  324. <script type="text/html" id="show">
  325. <input type="checkbox" name="show" value="{{d.id}}" lay-skin="switch" lay-text="上架|下架" lay-filter="show" {{ d.publish == 1 ? 'checked' : '' }}>
  326. </script>
  327. </div>
  328. </div>
  329. <div class="layui-tab-item">
  330. <iframe class="data_lists layadmin-iframe" src="" style="width: 100%;height:100%;" scrolling="0"
  331. frameborder="0"></iframe>
  332. </div>
  333. </div>
  334. </div>
  335. </div>
  336. </div>
  337. <!-- 手机端效果预览 -->
  338. <div class="page_video_mask layui-hide">
  339. <div class="page_phone">
  340. </div>
  341. <i class="layui-icon layui-icon-close lay-close"></i>
  342. </div>
  343. {/block} {block name="js"}
  344. <script type="text/html" id="employee_name">
  345. {{# if(d.employee){ }}
  346. <span>{{d.employee.opt_name}}</span>
  347. {{# }else{ }}
  348. <span style="color: #cccccc;">无</span>
  349. {{# } }}
  350. </script>
  351. <script type="text/html" id="video_label">
  352. {{# if(d.label){ }}
  353. <span>{{d.label}}</span>
  354. {{# }else{ }}
  355. <span style="color: #cccccc;">无</span>
  356. {{# } }}
  357. </script>
  358. <script type="text/html" id="description">
  359. {{# if(d.description){ }}
  360. <span>{{d.description}}</span>
  361. {{# }else{ }}
  362. <span style="color: #cccccc;">无</span>
  363. {{# } }}
  364. </script>
  365. <script src="__STATIC__/js/xgplayer.js" type="text/javascript"></script>
  366. <script src="__STATIC__/js/jquery.min.js" type="text/javascript"></script>
  367. <script src="__STATIC__/js/keydown.js" type="text/javascript"></script>
  368. <script>
  369. layui.config({
  370. base: '__LAYUI__/',
  371. urlbase: '/sys'
  372. }).extend({
  373. index: 'lib/index' //主入口模块
  374. }).use(['index', 'table', 'form', 'laydate'], function () {
  375. var $ = layui.$,
  376. table = layui.table,
  377. form = layui.form,
  378. laydate = layui.laydate,
  379. scrollTopNum = 0;
  380. //日期范围
  381. laydate.render({
  382. elem: '#select_date'
  383. , type: 'date'
  384. , range: true
  385. , trigger: 'click'//呼出事件改成click
  386. });
  387. document.onkeydown = function (event) {
  388. var e = event || window.event || arguments.callee.caller.arguments[0];
  389. if (e && e.keyCode == 13) {
  390. $(".submitbtn").trigger("click");
  391. }
  392. };
  393. $('.layui_video_tjss').on('click', function () {
  394. // $('.layui-fluid').css({'height':'100%'})
  395. $('.data_lists').attr('src', "{:url('Video/statistics_data_list')}");
  396. })
  397. $('.layui_video_list').on('click', function () {
  398. // $('.layui-fluid').css({'height':'auto'})
  399. })
  400. keydowns("#searchBbtns");
  401. //监听搜索
  402. form.on('submit(LAY-app-contlist-search)', function (data) {
  403. var field = data.field;
  404. //执行重载
  405. table.reload('layui-table-video', {
  406. where: field
  407. , page: { curr: 1 }
  408. });
  409. });
  410. //分类管理
  411. $("#cate_administration").click(function () {
  412. layer.open({
  413. type: 2,
  414. title: ['分类管理', 'color:#333333;background-color:#D8E6F1;'],
  415. content: '{:url("video/cate_video")}',
  416. resize: false,
  417. area: ['80%', '80%'],
  418. end: function () {
  419. location.reload();
  420. }
  421. });
  422. })
  423. //标签管理
  424. $("#cate_administration_labels").click(function () {
  425. layer.open({
  426. type: 2,
  427. title: ['标签管理', 'color:#333333;background-color:#D8E6F1;'],
  428. content: '{:url("video/cate_video_labels")}',
  429. resize: false,
  430. area: ['80%', '80%'],
  431. end: function () {
  432. location.reload();
  433. }
  434. });
  435. })
  436. //下拉框关联
  437. var typeData = JSON.parse('{$label|raw}');
  438. form.on('select(type)', function (data) {
  439. var typeJson = typeData[data.value];
  440. var typeLabel = $('#label');
  441. typeLabel.empty().append('<option value="">请选择标签</option>');
  442. for (r in typeJson) {
  443. typeLabel.append('<option value=' + r + '>' + typeJson[r] + '</option>');
  444. }
  445. form.render();
  446. });
  447. var $ = layui.$,
  448. active = {
  449. add: function () {
  450. layer.open({
  451. type: 2,
  452. title: ['添加视频', 'color:#333333;background-color:#D8E6F1;'],
  453. content: '{:url("video/add")}',
  454. resize: false,
  455. area: ['80%', '80%'],
  456. // btn: ['确定', '取消'],
  457. yes: function (index, layero) {
  458. //点击确认触发 iframe 内容中的按钮提交
  459. var submit = layero.find('iframe').contents().find(
  460. "#layuiadmin-app-form-submit");
  461. submit.click();
  462. }
  463. });
  464. }
  465. };
  466. $('.layui-btn.layuiadmin-btn-list').on('click', function () {
  467. var type = $(this).data('type');
  468. active[type] ? active[type].call(this) : '';
  469. });
  470. table.render({
  471. elem: '#layui-table-video',
  472. url: '{:url("video/index")}',
  473. page: true,
  474. limit: 50,
  475. height: 'full-200',
  476. cols: [
  477. [{
  478. type: 'numbers',
  479. field: 'id',
  480. fixed: 'left',
  481. title: '序号',
  482. }, {
  483. align: 'center',
  484. field: 'title',
  485. title: '标题',
  486. minWidth: 150
  487. }, {
  488. align: 'center',
  489. // field: 'description',
  490. templet: '#description',
  491. title: '描述',
  492. maxWidth: 100
  493. }, {
  494. align: 'center',
  495. field: 'type',
  496. title: '分类',
  497. maxWidth: 100
  498. }, {
  499. align: 'center',
  500. templet: '#video_label',
  501. title: '标签',
  502. maxWidth: 100
  503. }, {
  504. align: 'center',
  505. field: 'view_times',
  506. title: '浏览次数',
  507. sort: true,
  508. minWidth: 110
  509. }, {
  510. align: 'center',
  511. title: '转发次数',
  512. sort: true,
  513. field: 'shared_times',
  514. minWidth: 110
  515. }, {
  516. align: 'center',
  517. title: '浏览时长',
  518. sort: true,
  519. field: 'visit_due_time',
  520. minWidth: 110
  521. }, {
  522. align: 'center',
  523. title: '展示',
  524. minWidth: 100,
  525. templet: '#show'
  526. }, {
  527. align: 'center',
  528. field: 'uploadtime',
  529. title: '上传时间',
  530. sort: true,
  531. minWidth: 110
  532. }, {
  533. align: 'center',
  534. title: '上传人',
  535. minWidth: 100,
  536. templet: '#employee_name'
  537. }, {
  538. title: '操作',
  539. width: 380,
  540. align: 'center',
  541. fixed: 'right',
  542. toolbar: '#layui-tagsbar'
  543. }]
  544. ],
  545. text: '对不起,加载出现异常!'
  546. });
  547. table.on('sort(layui-table-video)', function (obj) {
  548. table.reload('layui-table-video', {
  549. initSort: obj
  550. , where: {
  551. order: obj.field + ' ' + obj.type
  552. }
  553. });
  554. });
  555. //监听工具条
  556. table.on('tool(layui-table-video)', function (obj) {
  557. var data = obj.data;
  558. if (obj.event === 'del') {
  559. layer.confirm('确定删除此视频?', { title: ['信息', 'color:#333333;background-color:#D8E6F1;'], }, function (index) {
  560. $.ajax({
  561. url: "{:url('video/del')}",
  562. data: {
  563. id: data.id
  564. },
  565. type: 'post'
  566. });
  567. obj.del();
  568. layer.close(index);
  569. });
  570. } else if (obj.event === 'edit') {
  571. layer.open({
  572. type: 2,
  573. title: ['编辑标签', 'color:#333333;background-color:#D8E6F1;'],
  574. content: '{:url("video/edit")}?id=' + data.id,
  575. resize: false,
  576. area: ['80%', '80%'],
  577. btn: ['确定', '取消'],
  578. yes: function (index, layero) {
  579. var submit = layero.find('iframe').contents().find(
  580. "#layuiadmin-app-form-submit");
  581. submit.click();
  582. },
  583. end: function () {
  584. scrollPostion(scrollTopNum);
  585. setTimeout(() => {
  586. $('.layui-table-main').scroll(function (e) {
  587. scrollTopNum = $(this).scrollTop();
  588. console.log(scrollTopNum, '<<<记录位置');
  589. })
  590. }, 800)
  591. }
  592. });
  593. } else if (obj.event === 'evidence-clue-list') {
  594. layer.open({
  595. type: 2,
  596. title: ['素材线索数据', 'color:#333333;background-color:#D8E6F1;'],
  597. content: "{:url('data/cluedata')}?type=video&id=" + data.id,
  598. resize: false,
  599. area: ['80%', '80%']
  600. });
  601. } else if (obj.event === 'daily-tasks') {
  602. layer.open({
  603. type: 2,
  604. title: ['设置任务', 'color:#333333;background-color:#D8E6F1;'],
  605. content: "{:url('dailyTasks/assign_org')}?type=video&id=" + data.id,
  606. resize: false,
  607. area: ['80%', '80%']
  608. });
  609. } else if (obj.event === 'preview') {
  610. requestVideoDetail(data.id);
  611. }
  612. });
  613. setTimeout(() => {
  614. $('.layui-table-main').scroll(function (e) {
  615. scrollTopNum = $(this).scrollTop();
  616. // console.log(scrollTopNum, '<<<记录位置');
  617. })
  618. }, 800)
  619. function scrollPostion(num) {
  620. $('.layui-table-main').scrollTop(num)
  621. }
  622. $('.lay-close').click(function () {
  623. $('.page_phone').html('');
  624. $('.page_video_mask').addClass('layui-hide');
  625. })
  626. function requestVideoDetail(id) {
  627. $.ajax({
  628. type: 'post',
  629. url: '{:url("video/preview_read")}',
  630. data: {
  631. id: id
  632. },
  633. success: function (res) {
  634. if (res.code == 0) {
  635. $('.page_video_mask').removeClass('layui-hide');
  636. setVideoDetailHtml(res.data)
  637. }
  638. }
  639. })
  640. }
  641. function setVideoDetailHtml(data) {
  642. let htmls = `<div class="page_box">
  643. <div class="videoDiv" id="mse"></div>
  644. <div class="video_right_box">
  645. <div class="video_right_item">
  646. <div class="video_right_avatar">
  647. <img src="__STATIC__/img/default.png" width="100%" height="100%" />
  648. </div>
  649. <span class="video_right_name">分享人</span>
  650. </div>
  651. <div class="video_right_item">
  652. <div class="video_right_img">
  653. <img src="__STATIC__/img/addedwx.png" alt="">
  654. </div>
  655. <span class="video_right_name">微信咨询</span>
  656. </div>
  657. <div class="video_right_item">
  658. <div class="video_right_img">
  659. <img src="__STATIC__/img/whitemobile.png" alt="">
  660. </div>
  661. <span class="video_right_name">电话预约</span>
  662. </div>
  663. <div class="video_right_item">
  664. <div class="video_right_img">
  665. <img src="__STATIC__/img/wcollect.png" alt="">
  666. </div>
  667. <span class="video_right_name">收藏</span>
  668. </div>
  669. <div class="video_right_item">
  670. <div class="video_right_img">
  671. <img src="__STATIC__/img/zhuanfaicon.png" alt="">
  672. </div>
  673. <span class="video_right_name">转发</span>
  674. </div>
  675. </div>
  676. <div class="video_show_msg">
  677. <div class="video_msg_title">${data.title}</div>
  678. <div class="video_msg_content">${data.description}</div>
  679. <div class="video_msg_type">#${data.type}</div>
  680. </div>
  681. </div>`;
  682. $('.page_phone').html(htmls);
  683. setTimeout(() => {
  684. var posters = data.cover;
  685. if (posters == null || posters == '') {
  686. posters = `${data.video_url}?x-oss-process=video/snapshot,t_100,f_jpg`;
  687. }
  688. let player = new Player({
  689. id: 'mse',
  690. autoplay: false,
  691. volume: 0.3,
  692. url: data.video_url,
  693. poster: posters,
  694. 'x5-video-player-type': 'h5',
  695. playsinline: true,
  696. thumbnail: {
  697. pic_num: 44,
  698. width: 160,
  699. height: 90,
  700. col: 10,
  701. row: 10,
  702. },
  703. lang: 'zh-cn',
  704. fitVideoSize: 'fixWidth',
  705. width: 375,
  706. whitelist: ['']
  707. });
  708. }, 300)
  709. }
  710. form.on('switch(show)', function (obj) {
  711. var id = obj.value;
  712. $.ajax({
  713. type: "post",
  714. url: '{:url("video/publish")}',
  715. data: {
  716. id: id
  717. },
  718. success: function (res) {
  719. layer.msg(res.msg);
  720. }
  721. });
  722. });
  723. // $(window).resize(function(){
  724. // $('.data_lists').height($('.layui-fluid').height()-50)
  725. // }).resize();
  726. // $('.data_lists').height($('.layui-fluid').height()-50)
  727. });
  728. </script>
  729. </body>
  730. {/block}