Browse Source

一些优化

pull/16/head
xiaoz 7 years ago
parent
commit
9504459709
  1. 53
      static/embed.js
  2. 12
      static/style.css

53
static/embed.js

@ -16,6 +16,15 @@ layui.use(['layer', 'form','element','upload','flow'], function(){
flow.lazyimg({ flow.lazyimg({
elem:'#adminpic img' elem:'#adminpic img'
}); });
//图片查看器
layer.photos({
photos: '#adminpic'
,anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
});
layer.photos({
photos: '#found-img'
,anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
});
//首页拖拽上传 //首页拖拽上传
upload.render({ upload.render({
@ -44,6 +53,15 @@ layui.use(['layer', 'form','element','upload','flow'], function(){
$("#bbcode").val("[img]" + res.url + "[/img]"); $("#bbcode").val("[img]" + res.url + "[/img]");
$("#upok").show(); $("#upok").show();
//请求接口处理图片 //请求接口处理图片
$.get("./dispose.php?id="+res.id,function(data,status){
var obj = eval('(' + data + ')');
if(obj.level == 3){
layer.open({
title: '温馨提示'
,content: '请勿上传违规图片!'
});
}
if(obj.level == null){
$.get("./dispose.php?id="+res.id,function(data,status){ $.get("./dispose.php?id="+res.id,function(data,status){
var obj = eval('(' + data + ')'); var obj = eval('(' + data + ')');
if(obj.level == 3){ if(obj.level == 3){
@ -54,6 +72,8 @@ layui.use(['layer', 'form','element','upload','flow'], function(){
} }
}); });
} }
});
}
} }
}); });
//上传到sm.ms //上传到sm.ms
@ -303,3 +323,36 @@ function about(){
content: "./about.php" content: "./about.php"
}); });
} }
//删除本页所有照片
function delall(){
layer.confirm('确认删除本页所有图片?', {icon: 3, title:'提示'}, function(index){
//do something
layer.close(index);
});
}
//预览图片
function previewimg(id,url){
var imgid = "img" + id;
var upid = id - 1;
var dnid = id + 1;
$("#show" + upid).hide();
$("#show" + dnid).hide();
$("#img" + id).attr('src',url);
$("#show" + id).show();
}
//隐藏图片
function hideimg(id){
var upid = id - 1;
var dnid = id + 1;
$("#show" + id).hide();
$("#show" + upid).hide();
$("#show" + dnid).hide();
}

12
static/style.css

@ -159,3 +159,15 @@
color:#009688; color:#009688;
text-decoration: none; text-decoration: none;
} }
.showimg{
display:none;
position:absolute;
max-width:460px;
top:3em;
z-index:99;
border:1px solid #e2e2e2;
border-radius:5px;
}
.layui-table img {
max-width: 460px;
}
Loading…
Cancel
Save