Skip to content

Commit

Permalink
debug and new function of showing image with layer
Browse files Browse the repository at this point in the history
debug and add function of showing img when after uploading image then
you can preview the image and verify it
  • Loading branch information
taoyu65 committed Sep 13, 2016
1 parent e913edb commit cb10b1b
Show file tree
Hide file tree
Showing 72 changed files with 261 additions and 173 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
Homestead.yaml
Homestead.json
.env

.idea/workspace.xml
.git
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

350 changes: 201 additions & 149 deletions .idea/workspace.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/css/additem.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#skipsomeheight{
margin-top:15px;
}

#layerid{max-width: 48px;max-height: 48px;}
.txt{
width:100%;
float: left;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions public/js/jquery-1.10.2.min.js

This file was deleted.

16 changes: 0 additions & 16 deletions public/js/jquery-1.5.min.js

This file was deleted.

2 changes: 2 additions & 0 deletions public/js/jquery-1.8.3.mini.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/js/uploadimg.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function deleteImg()
showMessage('success', '删除图片成功');
}
}

}

function fileSelected() {
Expand Down
4 changes: 4 additions & 0 deletions public/layer/jquery-3.1.0.slim.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions public/layer/layer.js

Large diffs are not rendered by default.

Binary file added public/layer/skin/default/icon-ext.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/layer/skin/default/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/layer/skin/default/loading-0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/layer/skin/default/loading-1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/layer/skin/default/loading-2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions public/layer/skin/layer.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 32 additions & 4 deletions resources/views/add.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,41 @@
@section('content')

<link href="css/additem.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="layer/layer.js"></script>
<script type="text/javascript" src="js/uploadimg.js"></script>

<script type="text/javascript">
var marked = true;//确保在激活状态不能再点击
function selectPic()
{
document.getElementById('image_file').click();
}
function showerrorinfo()
{
showMessage('warning','更新图片请先删除此图片');
if(marked) {
marked = false;
layer.open({
type: 1,
shade: [0.8, '#393D49'],
//shadeClose: true,
title: false, //不显示标题
time: 5000,
scrollbar: false,
content: $('#preshowimg'), //捕获的元素
success: function(layero, index){
//console.log(layero, index);
showMessage('warning', '更新图片请先删除此图片');
},
cancel: function (index) {
layer.close(index);
this.content.show();
marked = true;
//layer.msg('捕获就是从页面已经存在的元素上,包裹layer的结构', {time: 5000, icon:6});
}
});
}
}
</script>

Expand All @@ -35,11 +61,11 @@ function showerrorinfo()
<div class="twohang"><input type="number" required class="register-input" id="money" placeholder="物品金额" title="金额" value="0.00"></div>
<div class="sanhang">
<form id="upload_form" enctype="multipart/form-data" method="post" action="uploadItemPic">
<input type="file" name="image_file" id="image_file" onchange="fileSelected()" />
<input type="file" name="image_file" id="image_file" onchange="fileSelected()" style="display: none"/>
</form>
<div class="sanhang">
<img src="images/paizhao.png" width="48" height="48" alt="选择图片" onclick="selectPic()" id="selectimg"/>
<img width="48" height="48" id="preshowimg" style="display:none" title="更新图片请先删除此图片" onclick="showerrorinfo()" />
<div id="layerid"><img id="preshowimg" style="display:none" title="更新图片请先删除此图片" onclick="showerrorinfo()" /></div>
</div>
<div class="sanhang"><img src="images/upload.png" width="48" height="48" alt="上传图片" id="addpic" onclick="startUploading()"/></div>
<div class="sanhang"><img src="images/removepic.png" width="48" height="48" alt="删除图片" id="removepic" onclick="deleteImg()"/></div>
Expand All @@ -56,7 +82,7 @@ function showerrorinfo()
<div class="width100">
<div class="txt">
<div class="twohang">物品名称</div>
<div class="sanhang">订单ID <input type="button" value="点击查询订单" class="button small green"></div>
<div class="sanhang">订单ID <input type="button" value="查询订单" class="button small green"></div>
</div>
<div class="twohang"><input type="text" required class="register-input" placeholder="物品名称" ></div>
<div class="sanhang"> <input type="number" class="register-input" placeholder="如果是新订单保留为空"></div>
Expand Down Expand Up @@ -117,6 +143,8 @@ function showerrorinfo()
{{--</form>--}}
</div>
</div>
<script type="text/javascript">
</script>

@endsection
2 changes: 1 addition & 1 deletion resources/views/layouts/foot.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<link rel="stylesheet" href="css/jquery.toastmessage.css">
<!--微网站模板88样式-->
{{--<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>--}}
<script type="text/javascript" src="js/jquery-1.5.min.js"></script>
<script type="text/javascript" src="js/jquery-1.8.3.mini.js"></script>
<script type="text/javascript" src="js/jquery.toastmessage.js"></script>
<script>
$(function(){
Expand Down

0 comments on commit cb10b1b

Please sign in to comment.