search_audio.html
6.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<include file="public/layout"/>
<style>
.te_le .dataTables_paginate{float: left;}
.bot{float: right;padding: 15px 0;}
.vdisib{display: inline-block;*display: inline;*zoom: 1;vertical-align: middle;}
.item-title ul {
font-size: 0;
}
.item-title ul li {
font-size: 14px;
vertical-align: middle;
display: inline-block;
*display: inline;
*zoom: 1;
margin-right: 10px;
padding: 5px;
}
.item-title ul li.on,
.item-title ul li:hover {
background-color: #d4d5d5;
}
.flexigrid .bDiv{overflow: auto;height: 300px;}
.inp_upfile{ opacity: 0; position: absolute; top: 0; left: 0; width: 100%; height: 100%;}
</style>
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div class="page" style="padding: 0px 1% 0 1%;">
<div class="flexigrid">
<div class="mDiv">
<div class="ftitle vdisib">
<h3 class="vdisib">音频列表</h3>
<h5 class="vdisib">(共{$pager->totalRows}条记录)</h5>
</div>
<div title="刷新数据" class="pReload vdisib" onclick="reload_page()"><i class="fa fa-refresh"></i></div>
</div>
<div class="mDiv">
<div class="fbutton" style="border-right: none">
<input id="tupfile" name="tupfile" type="file" onchange="upfile(this)" class="inp_upfile" />
<div class="add" title="添加音乐">
<span><i class="fa fa-plus"></i>添加音乐</span>
</div>
</div>
<span style="line-height:25px;">最大支持 2 MB 以内的语音 (wav, mp3 格式)</span>
</div>
<div class="hDiv">
<div class="hDivBox">
<table cellspacing="0" cellpadding="0">
<thead>
<tr>
<th abbr="article_time" axis="col6" class="w400" align="left">
<div style="text-align: left; " class="">音频名称</div>
</th>
<th abbr="ac_id" axis="col4" class="w100" align="left">
<div style="text-align: center; " class="">音频大小</div>
</th>
<th axis="col1" class="w100" align="center">
<div style="text-align: center;">操作</div>
</th>
</tr>
</thead>
</table>
</div>
</div>
<div class="bDiv" style="height: auto;">
<div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
<table style="width: 100%">
<tbody id="goos_table">
<volist name="data" id="list">
<tr>
<td class="w400" align="left">
<div style="text-align: left; ">{$list.name}</div>
</td>
<td class="w100" align="left">
<div style="text-align: center;">{$list.size}KB</div>
</td>
<td class='w100' style='text-align:center'><a href="javascript:void(0);" class='btn red' url="https://mshopimg.yolipai.net{$list.url}" onclick="seleaudio(this);">选择</a></td>
</tr>
</volist>
</table>
</div>
<div class="iDiv" style="display: none;"></div>
</div>
<!--分页位置-->
<div class="te_le">
{$page}
</div>
</div>
</div>
<input id="stoid" value="{:I('stoid/d',1)}" type="hidden"/>
<script type="text/javascript" src="__PUBLIC__/js/ajaxfileupload.js"></script>
<script>
//确认菜单内容
function seleaudio(obj) {
var url=$(obj).attr("url");
javascript:window.parent.audioupcallback(url);
}
function reload_page() { window.location.href=window.location.href; }
/*--上传音频--*/
function upload_audio(){
var stoid=$("#stoid").val();
javascript:window.parent.GetUploadify_audio(1,'audio',stoid,"audioupcallback");
}
function upfile(ob) {
/*--上传判断文件类型和大小--*/
var filePath = ob.value;
var fileExt = filePath.substring(filePath.lastIndexOf(".")).toLowerCase();
if (fileExt!=".mp3" && fileExt!=".wav"){
layer.msg('请上传音频文件',{icon:2,time:2000});
return false;
}
if (ob.files && ob.files[0]) {
if(ob.files[0].size/1024>2014){
layer.msg('请上传音频文件不能大于2M',{icon:2,time:2000});
return false;
}
} else {
ob.select();
var url = document.selection.createRange().text;
try {
var fso = new ActiveXObject("Scripting.FileSystemObject");
} catch (e) {
alert('如果你用的是ie8以下 请将安全级别调低!');
return false;
}
if(fso.GetFile(url).size/1024>2014){
layer.msg('请上传音频文件不能大于2M',{icon:2,time:2000});
return false;
}
}
var ai=layer.msg('上传中..',{icon:16,time:0});
$.ajaxFileUpload({
url: '/index.php/Admin/Ueditor/audio/savepath/audio/savepath1/'+$("#stoid").val(),
secureuri: false, //一般设置为false
fileElementId:'tupfile', //文件上传空间的id属性 <input type="file" id="file" name="file" />
dataType: "json", //返回值类型 一般设置为json
success: function (data, status) //服务器成功响应处理函数
{
layer.close(ai);
if (data.state == "SUCCESS") {
//删除文件
$.ajax({
type: 'POST',
url: "{:U('Admin/Ueditor/delfile')}",
data: {"file": data.path},
dataType: 'json',
success: function (data) {},
});
reload_page();
} else {
layer.msg('上传失败',{icon:2,time:2000});
}
},
error: function (data, status, e)//服务器响应失败处理函数
{
layer.close(ai);
layer.msg('上传失败',{icon:2,time:2000});
return;
}
})
}
</script>
</body>
</html>