地铁二期项目正式开始

VoicePlay.cshtml 4.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>听取录音</title>
  6. <link href="/Content/layui/css/layui.css" rel="stylesheet" />
  7. <link href="/Content/css/public.css" rel="stylesheet" />
  8. <link href="/Content/layui/css/modules/layui-icon-extend/iconfont.css" type="text/css" rel=" stylesheet" />
  9. <link href="/Content/css/font-awesome/css/font-awesome.min.css" type="text/css" rel=" stylesheet" />
  10. <script src="/Content/js/jquery-1.8.3.min.js"></script>
  11. <script type="text/javascript" src="/Content/layui/layui.js"></script>
  12. <script type="text/javascript" src="/Content/js/download.js"></script>
  13. <script type="text/javascript">
  14. function LoadList() {
  15. var audioUrl = "@Model.downpath"
  16. var strFileName = audioUrl.substring((audioUrl.lastIndexOf('/') + 1));
  17. downloadUrl(audioUrl, strFileName);
  18. }
  19. function downloadUrl(audioUrl, strFileName) {
  20. var x = new XMLHttpRequest();
  21. x.open("GET", audioUrl, true);
  22. x.responseType = 'blob';
  23. x.onload = function(e) {
  24. download(x.response, strFileName);
  25. }
  26. x.send();
  27. }
  28. function PlayUrl(url) {
  29. document.getElementById("divPlist").innerHTML = "<embed id=\"embedPlay\" type=\"audio/mp3\" src=\"" + url + "\" autostart=\"true\" loop=\"false\" />";
  30. }
  31. function OpenPlayUrl(url) {
  32. window.open(url, "_blank", "scrollbars=yes,resizable=1,modal=false,alwaysRaised=yes");
  33. }
  34. function Init() {
  35. var strpath = document.getElementById("txtPath").value;
  36. if(strpath){
  37. var arr = strpath.split('^');
  38. var html = "点击播放<br />";
  39. for (var i = 0; i < arr.length; i++) {
  40. var c = i + 1;
  41. if (i == 0) {
  42. PlayUrl(arr[i]);
  43. }
  44. html += "<span onclick='OpenPlayUrl(\"" + arr[i]+"\")'>"+c + "、" + arr[i]+"</span><br />";
  45. }
  46. } else{
  47. html = "暂无留言"
  48. $("#embedText").show()
  49. $("#embedPlay").hide()
  50. }
  51. document.getElementById("divFileList").innerHTML = html;
  52. }
  53. </script>
  54. </head>
  55. <body onload="Init();" class="childrenBody">
  56. <div class="layui-fluid">
  57. <div class=" layui-col-space15">
  58. <div class="layui-card">
  59. <div class="layui-card-body">
  60. <div class="layui-row layui-col-space15 searchfilter">
  61. <div id="divPlist" class="layui-col-md12">
  62. <embed id="embedPlay" type="audio/mp3" src="" autostart="true" loop="false" />
  63. <div id="embedText" style="display: none; height:120px; padding:20px">无留言</div>
  64. </div>
  65. <div class="layui-col-md12">
  66. <input id="txtPath" value="@Model.downpath" style="display:none;" />
  67. <div id="divFileList">@Model.downpath</div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="layui-card layui-form">
  73. <div class="layui-card-body layui-row layui-col-space10" style="text-align:center;">
  74. @*<a class="layui-btn" href="http://121.196.219.217:9009/20201127/1012/45136_1_183808.wav" download="w3logo">
  75. <a class="layui-btn" href="http://121.196.219.217:9009/20201127/1012/54949_1012_152225.mp3" download="w3logo">
  76. <i class="layui-icon">&#xe601; 下载</i>
  77. </a>*@
  78. <button class="layui-btn" data-type="reload" onclick="LoadList();">
  79. <i class="layui-icon">&#xe601; 下载</i>
  80. </button>
  81. <iframe id="frameTelList" src="" width="0" height="0" style="display:none;" frameborder="0"></iframe>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </body>
  87. </html>