| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <script src="../../Script/Common/huayi.load.js"></script>
- <script src="../../Script/Common/huayi.config.js"></script>
- <link rel="stylesheet" href="../../css/init.css" />
- <link rel="stylesheet" href="../css/seeDetail.css" />
- <link href="//vjs.zencdn.net/7.3.0/video-js.min.css" rel="stylesheet">
- <title>知识库查询</title>
- </head>
- <body>
- <!--查看弹出内容-->
- <table class="table-bordered table">
- <tbody>
- <tr>
- <th>标题:</th>
- <td colspan="3" class="addTitle"></td>
- </tr>
- <tr>
- <th>关键字:</th>
- <td colspan="3" class="addKey"></td>
- </tr>
- <tr>
- <th>内容:</th>
- <td colspan="3" class="addCon"></td>
- </tr>
- <tr>
- <th>附件:</th>
- <td colspan="3">
- <ul id="fileList" class="clearfix">
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- </body>
- <script src="../../js/download/download.js"></script>
- <script>
- var token = $.cookie("token");
- var changeGetid = helper.request.queryString("changeGetid");
- $(function() {
- if (changeGetid) {
- getChangeBox();
- }
- });
- function getChangeBox() {
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "Knowledge/GetInfo",
- async: true,
- dataType: 'json',
- data: {
- infoid: changeGetid,
- token: token
- },
- success: function(data) {
- var con = data.data;
- if (con) {
- $('.addTitle').html(con.F_Title);
- $('.addKey').html(con.F_KeyWords);
- $('.addCon').html(helper.filter.content(con.F_Content));
- var proimglist = con.FileUrls;
- if (proimglist && proimglist.length > 0) {
- $(proimglist).each(function(i, n) {
- var fileType = n.F_FileType.split("\/")[0];
- if (fileType === 'image') {
- $('<div class="img-box">' +
- '<span class="img_mask"><span onclick=downloadFile("'+ n.F_FileUrl + '","' + n.F_FileName + '","' + n.F_FileType +
- '") title="点击下载"><i class="fa fa-download" aria-hidden="true"></i></span></span>' +
- '<img layer-src="' + n.F_FileUrl + '" src="' + n.F_FileUrl + '" alt="' + n.F_FileName +
- '" class="image-item" /><div>').appendTo("#fileList");
- }else if(fileType === 'video'){
- $('<div class="img-box">' +
- '<span class="img_mask"><span href="javascript:;" onclick=downloadFile("' + n.F_FileUrl + '","' + n.F_FileName +
- '","' + n.F_FileType +
- '") title="点击下载"><i class="fa fa-download" aria-hidden="true"></i></span></span>' +
- '<span class="img_filename" onclick="playVideo(\''+ n.F_FileUrl + '\' , \'' + n.F_FileType + '\')">' + n.F_FileName.split(".")[1] + '</span><div>').appendTo("#fileList");
- } else {
- $('<div class="img-box">' +
- '<span class="img_mask"><span href="javascript:;" onclick=downloadFile("' + n.F_FileUrl + '","' + n.F_FileName +
- '","' + n.F_FileType +
- '") title="点击下载"><i class="fa fa-download" aria-hidden="true"></i></span></span>' +
- '<span class="img_filename">' + n.F_FileName.split(".")[1] + '</span><div>').appendTo("#fileList");
- }
- });
- layer.photos({
- photos: '#fileList',
- anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
- });
- }
- }
- }
- });
- }
- //下载
- function downloadFile(data, strFileName, strMimeType) {
- event.preventDefault();
- //详细见文档 http://danml.com/download.html
- var x = new XMLHttpRequest();
- x.open("GET", data, true);
- x.responseType = 'blob';
- x.onload = function(e) {
- download(x.response, strFileName, strMimeType);
- }
- x.send();
- }
-
- /**
- * 播放视频
- * @playUrl 视频地址
- * @fileType 视屏类型
- * */
- function playVideo(playUrl, fileType){
- layer.open({
- maxmin: true, //开启最大化最小化按钮
- type: 2,
- content: "./playVideo.html?playUrl=" + encodeURIComponent(playUrl) + "&fileType=" + encodeURIComponent(fileType), //iframe的url,no代表不显示滚动条
- title: ' ',
- area: ['90%', '90%'], //宽高
- });
- }
- </script>
- </html>
|