| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 | {extend name="common/common2" /}{block name="main"}<style>    .lybtn{        position: relative;    }    .lyfile{        opacity: 0;        position: absolute;        z-index: 1000;        left: 0;        top: 0;        width: 200px;        height: 100px;    }</style><div class="ibox">    <div class="ibox-content">        <div class="row">            <div class="col-xs-6">                {if condition="!is_admin(is_login())"}                <button class="btn btn-primary btn-sm" type="button" onClick="parent.I_CheckActiveX()">检查本地驱动是否安装</button><!--                <button class="btn btn-success btn-sm" type="button" onClick="parent.openPhone()">弹出电话</button>-->                <button type="button" class="btn btn-sm btn-danger lybtn">                    播放录音                    <input type="file" placeholder="播放" id="lyfile" class="lyfile" onchange="onInputFileChange()">                </button>                <br>                <audio id="audio_id" style="margin-top: 10px" controls autoplay loop>Your browser can't support HTML5 Audio</audio>                {/if}            </div>            <div class="col-xs-6" style="text-align: right;">                <form class="form-inline" id="form-search" action="{:url('show')}">                    <div class="input-group">                        <input type="text" class="form-control" style="width: 150px!important;" name="title" placeholder="电话及订单编号">                    </div>                    <div class="input-group">                        <span class="input-group-btn">                        <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>                    </span>                          <span class="input-group-btn">                        <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>                    </span>                    </div>                </form>            </div>        </div>    </div>    <div class="ibox-content">        <div class="jqGrid_wrapper">            <table id="table" style="border-collapse: collapse"></table>            <div id="pager"></div>        </div>    </div></div>{/block}{block name="script"}<script>    function onInputFileChange(){        var file = document.getElementById('lyfile').files[0];        var url = URL.createObjectURL(file);        console.log(file,url);        document.getElementById("audio_id").src = url;    }    $(function () {        $(window).bind("resize",function(){            var width=$(".jqGrid_wrapper").width();            $("#table").setGridWidth(width);        });        $.jgrid.defaults.styleUI="Bootstrap";        $("#table").jqGrid({            url:"{:url('show')}",            datatype: "json",            colModel:[                {label:'编号',name:'id',index:'id', width:40,sortable: false},                {label:'时间',name:'create_time',index:'create_time',width:70,sortable: false},                {label:'手机号',name:'phone',index:'phone',width:60,sortable: false},                {label:'订单编号',name:'order_id',index:'order_id',width:60,sortable: false,formatter: function (a, b, c) {                    let btn = '';                    if(c.order_id > 0){                        var edit_url = "{:url('orders/detail2',[],'')}/type/1/id/"+c.order_id;                        btn+= '<a url="'+edit_url+'" href="javascript:;" data-title="订单详情" onclick="layer_open(this,0)">'+c.order_id+'</a>';                    }                    return btn;                }},                {label:'本地录音',name:'path',index:'path',width:120,formatter: function (a, b, c) {                    // let btn = '<audio controls src="'+c.path+'"></audio>';                    //                    // // btn+= '<a href="javascript:;" onclick="parent.TV_StartPlayFile(100,\''+c.path+'\')"><span class="label label-success" title="播放录音">播放录音</span></a> ';                    // // btn+= '<a href="javascript:;" onclick="parent.TV_StopPlayFile(0)"><span class="label label-danger" title="停止播放">停止播放</span></a> ';                    return a;                }},                {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {                    let btn = '';                    if(c.order_id == 0){                        var edit_url = "{:url('orders/phone',[],'')}/id/"+c.id;                        btn+= '<a url="'+edit_url+'" href="javascript:;" data-title="处理" onclick="layer_open(this,1)"><span class="label label-primary" title="处理">处理</span></a> ';                    }                    return btn;                }},            ],            rowNum:10,            rowList:[10,20,30,50,100],            pager: '#pager',            sortname: 'id',            viewrecords: true,            autowidth:true,            mtype: 'post',            height: 'auto',            emptyrecords: "暂无数据",            sortorder: "desc",            caption:"电话监控记录",            loadComplete: function (xhr) {                if(xhr.code==0){                    layer.msg(xhr.msg);                    return false;                }            },        });    });</script>{/block}
 |