Compare commits
2 Commits
07d518fea9
...
874c814188
Author | SHA1 | Date |
---|---|---|
duxp | 874c814188 | |
duxp | 8e8a494798 |
|
@ -147,6 +147,20 @@
|
|||
})
|
||||
});
|
||||
|
||||
//图片预览
|
||||
$(".pre_view_list").on("click",'.pre_img',function () {
|
||||
let _url = $(this).attr('data-img');
|
||||
layer.open({
|
||||
title:'预览图片',
|
||||
area:['80%','80%'],
|
||||
type:1,
|
||||
content:'<div style="width: 100%;height: 100%"><img style="width: 100%;height: 100%" src="'+window.location.origin+_url+'" /></div>',
|
||||
success(res){
|
||||
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
//文件下载
|
||||
$(".pre_view_list").on("click",'.down_load_file',function () {
|
||||
let _url = $(this).attr('data-url');
|
||||
|
@ -215,7 +229,7 @@
|
|||
let _nameFile = item.name.substr(item.name.lastIndexOf('/')+1,item.name.length-1);
|
||||
if(item.name.indexOf('png') > -1 || item.name.indexOf('jpg')>-1){
|
||||
_file_list_str += '<div class="pre_view_item">' +
|
||||
'<div class="item_left"><img src="'+window.location.origin+item.name+'" /><span>('+(index+1)+') '+_nameFile+'</span></div>' +
|
||||
'<div class="item_left pre_img" data-img="'+item.name+'" style="cursor: pointer"><img src="'+window.location.origin+item.name+'" /><span>('+(index+1)+') '+_nameFile+'</span></div>' +
|
||||
'<div class="item_right"><span data-url="'+item.name+'" class="btn btn-primary btn-xs down_load_file">下载</span><span data-index="'+item.index+'" class="btn btn-danger btn-xs del_file">删除</span></div></div>';
|
||||
}else if(item.name.indexOf('pdf') > -1){
|
||||
_file_list_str += '<div class="pre_view_item">' +
|
||||
|
|
Loading…
Reference in New Issue