7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
87 lines
2.3 KiB
HTML
87 lines
2.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="renderer" content="webkit">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
<title>添加图片-e订通后台</title>
|
|
<link rel="stylesheet" href="layuiadmin/layui/css/layui.css">
|
|
<link rel="stylesheet" href="index.css">
|
|
<script src="layuiadmin/layui/layui.js"></script>
|
|
<script src="js/function.js"></script>
|
|
</head>
|
|
<body>
|
|
<form class="layui-form">
|
|
<input type="hidden" id="zsh" name="zsh" value="">
|
|
<div style="padding:10px;">
|
|
<div class="layui-form-item"></div>
|
|
<div class="layui-form-item" id="div_title" style="font-size:14px;font-weight:bold;" align="center"></div>
|
|
<div class="layui-form-item" align="center">
|
|
<span id="div_pic"></span>
|
|
</div>
|
|
<div class="layui-form-item" align="center">
|
|
<a class="layui-btn" id="up_file"><i class="layui-icon"></i>选择图片</a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<script>
|
|
|
|
layui.use(['form','layer','upload','jquery'],function(){
|
|
var form = layui.form,
|
|
layer = parent.layer === undefined ? layui.layer : top.layer,
|
|
$ = layui.jquery;
|
|
//取得url传递参数
|
|
var zsh=get_url_param("zsh");
|
|
$("#zsh").val(zsh);
|
|
//初始化
|
|
var url="./?_m=kh_ty&_a=add_pic&zsh="+zsh;
|
|
$.ajax(
|
|
{
|
|
url:url,
|
|
contentType: "application/json",
|
|
method: 'POST',
|
|
success: function (res) {
|
|
var json_data=$.parseJSON(res);
|
|
//alert(JSON.stringify(json_data));
|
|
//加载标题
|
|
var html1='推演号:'+json_data.this_title;
|
|
$("#div_title").html(html1);
|
|
//加载图片
|
|
html1='<a href="'+json_data.pic+'" target="_blank"><img src="'+json_data.pic+'" width="'+json_data.pic_w+'" height="'+json_data.pic_h+'" border=0></a>';
|
|
$("#div_pic").html(html1);
|
|
},
|
|
error: function () {
|
|
layui.layer.msg("与服务器通信失败!");
|
|
}
|
|
}
|
|
);
|
|
//上传组件
|
|
var upload = layui.upload;
|
|
upload.render({
|
|
elem: '#up_file',
|
|
field:'up_file',
|
|
accept:'images',
|
|
exts: 'jpg|jpeg',
|
|
url: './?_m=kh_ty&_a=save_add_pic&zsh='+zsh,
|
|
before: function(obj){
|
|
layer.load();
|
|
},
|
|
done: function(res,index,upload){
|
|
//alert(JSON.stringify(res));
|
|
var json_data=res;
|
|
if(json_data.code==1){
|
|
//正确
|
|
parent.location.reload();
|
|
}else{
|
|
//错误
|
|
}
|
|
layer.closeAll('loading');
|
|
},
|
|
error: function(index, upload){
|
|
layer.closeAll('loading');
|
|
}
|
|
});
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |