show.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .lybtn{
  5. position: relative;
  6. }
  7. .lyfile{
  8. opacity: 0;
  9. position: absolute;
  10. z-index: 1000;
  11. left: 0;
  12. top: 0;
  13. width: 200px;
  14. height: 100px;
  15. }
  16. </style>
  17. <div class="ibox">
  18. <div class="ibox-content">
  19. <div class="row">
  20. <div class="col-xs-6">
  21. {if condition="!is_admin(is_login())"}
  22. <button class="btn btn-primary btn-sm" type="button" onClick="parent.I_CheckActiveX()">检查本地驱动是否安装</button>
  23. <!-- <button class="btn btn-success btn-sm" type="button" onClick="parent.openPhone()">弹出电话</button>-->
  24. <button type="button" class="btn btn-sm btn-danger lybtn">
  25. 播放录音
  26. <input type="file" placeholder="播放" id="lyfile" class="lyfile" onchange="onInputFileChange()">
  27. </button>
  28. <br>
  29. <audio id="audio_id" style="margin-top: 10px" controls autoplay loop>Your browser can't support HTML5 Audio</audio>
  30. {/if}
  31. </div>
  32. <div class="col-xs-6" style="text-align: right;">
  33. <form class="form-inline" id="form-search" action="{:url('show')}">
  34. <div class="input-group">
  35. <input type="text" class="form-control" style="width: 150px!important;" name="title" placeholder="电话及订单编号">
  36. </div>
  37. <div class="input-group">
  38. <span class="input-group-btn">
  39. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  40. </span> &nbsp;
  41. <span class="input-group-btn">
  42. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  43. </span>
  44. </div>
  45. </form>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="ibox-content">
  50. <div class="jqGrid_wrapper">
  51. <table id="table" style="border-collapse: collapse"></table>
  52. <div id="pager"></div>
  53. </div>
  54. </div>
  55. </div>
  56. {/block}
  57. {block name="script"}
  58. <script>
  59. function onInputFileChange(){
  60. var file = document.getElementById('lyfile').files[0];
  61. var url = URL.createObjectURL(file);
  62. console.log(file,url);
  63. document.getElementById("audio_id").src = url;
  64. }
  65. $(function () {
  66. $(window).bind("resize",function(){
  67. var width=$(".jqGrid_wrapper").width();
  68. $("#table").setGridWidth(width);
  69. });
  70. $.jgrid.defaults.styleUI="Bootstrap";
  71. $("#table").jqGrid({
  72. url:"{:url('show')}",
  73. datatype: "json",
  74. colModel:[
  75. {label:'编号',name:'id',index:'id', width:40,sortable: false},
  76. {label:'时间',name:'create_time',index:'create_time',width:70,sortable: false},
  77. {label:'手机号',name:'phone',index:'phone',width:60,sortable: false},
  78. {label:'订单编号',name:'order_id',index:'order_id',width:60,sortable: false,formatter: function (a, b, c) {
  79. let btn = '';
  80. if(c.order_id > 0){
  81. var edit_url = "{:url('orders/detail2',[],'')}/type/1/id/"+c.order_id;
  82. btn+= '<a url="'+edit_url+'" href="javascript:;" data-title="订单详情" onclick="layer_open(this,0)">'+c.order_id+'</a>';
  83. }
  84. return btn;
  85. }},
  86. {label:'本地录音',name:'path',index:'path',width:120,formatter: function (a, b, c) {
  87. // let btn = '<audio controls src="'+c.path+'"></audio>';
  88. //
  89. // // btn+= '<a href="javascript:;" onclick="parent.TV_StartPlayFile(100,\''+c.path+'\')"><span class="label label-success" title="播放录音">播放录音</span></a>&nbsp;';
  90. // // btn+= '<a href="javascript:;" onclick="parent.TV_StopPlayFile(0)"><span class="label label-danger" title="停止播放">停止播放</span></a>&nbsp;';
  91. return a;
  92. }},
  93. {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {
  94. let btn = '';
  95. if(c.order_id == 0){
  96. var edit_url = "{:url('orders/phone',[],'')}/id/"+c.id;
  97. btn+= '<a url="'+edit_url+'" href="javascript:;" data-title="处理" onclick="layer_open(this,1)"><span class="label label-primary" title="处理">处理</span></a>&nbsp;';
  98. }
  99. return btn;
  100. }},
  101. ],
  102. rowNum:10,
  103. rowList:[10,20,30,50,100],
  104. pager: '#pager',
  105. sortname: 'id',
  106. viewrecords: true,
  107. autowidth:true,
  108. mtype: 'post',
  109. height: 'auto',
  110. emptyrecords: "暂无数据",
  111. sortorder: "desc",
  112. caption:"电话监控记录",
  113. loadComplete: function (xhr) {
  114. if(xhr.code==0){
  115. layer.msg(xhr.msg);
  116. return false;
  117. }
  118. },
  119. });
  120. });
  121. </script>
  122. {/block}