From 950445970995318d6ea0980300b90ec148fdef91 Mon Sep 17 00:00:00 2001 From: xiaoz Date: Sat, 30 Jun 2018 22:22:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/embed.js | 57 ++++++++++++++++++++++++++++++++++++++++++++++-- static/style.css | 12 ++++++++++ 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/static/embed.js b/static/embed.js index 0a70140..9fc841c 100644 --- a/static/embed.js +++ b/static/embed.js @@ -15,7 +15,16 @@ layui.use(['layer', 'form','element','upload','flow'], function(){ }); flow.lazyimg({ 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({ @@ -52,6 +61,17 @@ layui.use(['layer', 'form','element','upload','flow'], function(){ ,content: '请勿上传违规图片!' }); } + if(obj.level == null){ + $.get("./dispose.php?id="+res.id,function(data,status){ + var obj = eval('(' + data + ')'); + if(obj.level == 3){ + layer.open({ + title: '温馨提示' + ,content: '请勿上传违规图片!' + }); + } + }); + } }); } } @@ -302,4 +322,37 @@ function about(){ area: ['240px', '100px'], content: "./about.php" }); -} \ No newline at end of file +} + +//删除本页所有照片 +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(); +} diff --git a/static/style.css b/static/style.css index 3f63e53..e720373 100644 --- a/static/style.css +++ b/static/style.css @@ -158,4 +158,16 @@ border-color: #78C3F3; */ color:#009688; 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; } \ No newline at end of file