7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
146 lines
4.6 KiB
HTML
146 lines
4.6 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="shortcut icon" type="image/x-icon" href="../favicon.ico" />
|
|
<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>
|
|
<style>
|
|
.kh_list-container{float:left;width:220px;margin-left:5px;margin-top:5px;background:#fff;border:1px solid #e5e5e5;padding-bottom:0px;border-radius:8px;-moz-border-radius:8px;-webkit-border-radius:8px;overflow:hidden;}
|
|
.kh_list-container:hover{border:1px solid #e8e8e8;}
|
|
.kh_list-container .img{height:250px;line-height:250px;width:188px;z-index:1;overflow:hidden;}
|
|
.divys{color:#333;float:left;font-size:14px;font-weight:bold;height:40px;line-height:40px;margin-left:10px;}
|
|
</style>
|
|
</head>
|
|
<body style="background-color:#ffffff;">
|
|
<div style="width:100%;" id="other"></div>
|
|
</body>
|
|
<script>
|
|
function del_url(id,color){
|
|
layui.use(['form','layer'],function(){
|
|
var form = layui.form;
|
|
var layer = layui.layer;
|
|
var $=layui.jquery;
|
|
|
|
layer.confirm('确认删除图片吗?', function(index){
|
|
var url="./?_m=admin&_a=save_add_image&id="+id+"&c="+color+"&del_pic=y";
|
|
$.ajax({
|
|
url:url,
|
|
contentType: "application/json",
|
|
method: 'POST',
|
|
success: function (res) {
|
|
var res=$.parseJSON(res);
|
|
if(res.code=="100"){
|
|
parent.location.reload();
|
|
}
|
|
layer.close(index);
|
|
},
|
|
error: function () {
|
|
layer.close(index);
|
|
layui.layer.msg("与服务器通信失败!");
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
});
|
|
}
|
|
function set_main(id,color){
|
|
layui.use(['form','layer'],function(){
|
|
var form = layui.form;
|
|
var layer = layui.layer;
|
|
var $=layui.jquery;
|
|
|
|
layer.confirm('确认设置为主预览图片吗?', function(index){
|
|
var url="./?_m=admin&_a=set_main_pic&id="+id+"&c="+color;
|
|
$.ajax({
|
|
url:url,
|
|
contentType: "application/json",
|
|
method: 'POST',
|
|
success: function (res) {
|
|
var res=$.parseJSON(res);
|
|
layui.layer.msg("设置成功!");
|
|
if(res.code=="100"){
|
|
parent.location.reload();
|
|
}
|
|
layer.close(index);
|
|
},
|
|
error: function () {
|
|
layer.close(index);
|
|
layui.layer.msg("与服务器通信失败!");
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
});
|
|
}
|
|
layui.use(['form','layer'],function(){
|
|
var form = layui.form;
|
|
var layer = layui.layer;
|
|
var $=layui.jquery;
|
|
|
|
//取得url传递参数
|
|
var query_str=location.search.substring(1);
|
|
if(query_str)
|
|
query_str="&"+query_str;
|
|
var url1="./?_m=admin&_a=add"+query_str;
|
|
|
|
$.ajax({
|
|
url:url1,
|
|
contentType: "application/json",
|
|
method: 'POST',
|
|
success: function (res) {
|
|
var res=$.parseJSON(res);
|
|
var json_data=res;
|
|
//console.log(res);
|
|
if(json_data.code==0){
|
|
//------------------本页返回的错误信息
|
|
layer.msg(json_data.msg);
|
|
}else if(json_data.code==1){
|
|
//------------------系统错误
|
|
var msg=json_data.msg;
|
|
var url1="error.htm?msg="+json_data.msg+"&btn_title="+json_data.btn_title+"&btn_url="+json_data.btn_url;
|
|
var obj1=window.parent.parent;
|
|
obj1.location.href=url1;
|
|
}else if(json_data.code==2){
|
|
//------------------重新登录
|
|
url1="login.htm?error_msg="+json_data.msg;
|
|
var obj1=window.parent.parent;
|
|
obj1.location.href=url1;
|
|
}else if(json_data.code==101){
|
|
layui.layer.alert(res.msg);
|
|
}else{
|
|
var html1='';
|
|
for(var i=0;i<res.data.length;i++){
|
|
html1+='<div class="kh_list-container">';
|
|
//图片
|
|
html1+='<div class="img"><a href="protocol://camera?&_m=admin&_a=save_add_image&id='+res.data[i].id+'&c='+res.data[i].color+'&url='+res.urls+'"><img src="'+res.data[i].pic_src+'" width="'+res.data[i].pic_w+'" height="'+res.data[i].pic_h+'"></a></div><hr>';
|
|
html1+='<div class="kh_info">';
|
|
//颜色
|
|
html1+='<div class="divys" style="width:100px;">#'+res.data[i].color+' '+res.data[i].colortitle+'</div>';
|
|
if(res.data[i].sign=="y"){
|
|
html1+='<div class="divys" style="width:40px;"><input type="button" value="删" class="layui-btn layui-btn-danger layui-btn-sm" onclick="del_url(\''+res.data[i].id+'\',\''+res.data[i].color+'\')"/></div>';
|
|
}
|
|
if(res.data[i].sign_z=="y"){
|
|
html1+='<div class="divys" style="width:40px;"><input type="button" value="主" class="layui-btn layui-btn-normal layui-btn-sm" onclick="set_main(\''+res.data[i].id+'\',\''+res.data[i].color+'\')"/></div>';
|
|
}
|
|
html1+='</div>';
|
|
html1+='</div>';
|
|
}
|
|
$("#other").html(html1);
|
|
}
|
|
|
|
},
|
|
error: function () {
|
|
layui.layer.msg("与服务器通信失败!");
|
|
}
|
|
});
|
|
})
|
|
</script>
|
|
</html> |