注:这里的原型是展示效果,让大家有个感性的认识,编码不在这里进行,项目开发过程会在后面的章节从零开始。
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<html>
<head>
<script src="https://how2j.cn/study/js/jquery/2.0.0/jquery.min.js"></script>
<link href="https://how2j.cn/study/css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="https://how2j.cn/study/js/bootstrap/3.3.6/bootstrap.min.js"></script>
<link href="https://how2j.cn/tmall/css/back/style.css" rel="stylesheet">
<script>
function checkEmpty(id, name){
var value = $("#"+id).val();
if(value.length==0){
alert(name+ "不能为空");
$("#"+id)[0].focus();
return false;
}
return true;
}
function checkNumber(id, name){
var value = $("#"+id).val();
if(value.length==0){
alert(name+ "不能为空");
$("#"+id)[0].focus();
return false;
}
if(isNaN(value)){
alert(name+ "必须是数字");
$("#"+id)[0].focus();
return false;
}
return true;
}
function checkInt(id, name){
var value = $("#"+id).val();
if(value.length==0){
alert(name+ "不能为空");
$("#"+id)[0].focus();
return false;
}
if(parseInt(value)!=value){
alert(name+ "必须是整数");
$("#"+id)[0].focus();
return false;
}
return true;
}
$(function(){
$("a").click(function(){
var deleteLink = $(this).attr("deleteLink");
console.log(deleteLink);
if("true"==deleteLink){
var confirmDelete = confirm("确认要删除");
if(confirmDelete)
return true;
return false;
}
});
})
</script>
</head>
<body>
<div class="navitagorDiv">
<nav class="navbar navbar-default navbar-fixed-top navbar-inverse">
<img style="margin-left:10px;margin-right:0px" class="pull-left" src="https://how2j.cn/tmall/img/site/tmallbuy.png" height="45px">
<a class="navbar-brand" href="#nowhere">天猫后台</a>
<a class="navbar-brand" href="#nowhere">分类管理</a>
<a class="navbar-brand" href="#nowhere">用户管理</a>
<a class="navbar-brand" href="#nowhere">订单管理</a>
</nav>
</div>
<script>
$(function(){
$("#addForm").submit(function(){
if(checkEmpty("name","分类名称"))
return true;
return false;
});
});
</script>
<title>分类管理</title>
<div class="workingArea">
<h1 class="label label-info" >分类管理</h1>
<br>
<br>
<div class="listDataTableDiv">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr class="success">
<th>ID</th>
<th>图片</th>
<th>分类名称</th>
<th>属性管理</th>
<th>产品管理</th>
<th>编辑</th>
<th>删除</th>
</tr>
</thead>
<tbody>
<tr>
<td>83</td>
<td><img height="40px" src="https://how2j.cn/tmall/img/category/83.jpg"></td>
<td>平板电视</td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-th-list"></span></a></td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-shopping-cart"></span></a></td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-edit"></span></a></td>
<td><a deleteLink="true" href="#nowhere"><span class=" glyphicon glyphicon-trash"></span></a></td>
</tr>
<tr>
<td>82</td>
<td><img height="40px" src="https://how2j.cn/tmall/img/category/82.jpg"></td>
<td>马桶</td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-th-list"></span></a></td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-shopping-cart"></span></a></td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-edit"></span></a></td>
<td><a deleteLink="true" href="#nowhere"><span class=" glyphicon glyphicon-trash"></span></a></td>
</tr>
<tr>
<td>81</td>
<td><img height="40px" src="https://how2j.cn/tmall/img/category/81.jpg"></td>
<td>沙发</td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-th-list"></span></a></td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-shopping-cart"></span></a></td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-edit"></span></a></td>
<td><a deleteLink="true" href="#nowhere"><span class=" glyphicon glyphicon-trash"></span></a></td>
</tr>
<tr>
<td>80</td>
<td><img height="40px" src="https://how2j.cn/tmall/img/category/80.jpg"></td>
<td>电热水器</td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-th-list"></span></a></td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-shopping-cart"></span></a></td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-edit"></span></a></td>
<td><a deleteLink="true" href="#nowhere"><span class=" glyphicon glyphicon-trash"></span></a></td>
</tr>
<tr>
<td>79</td>
<td><img height="40px" src="https://how2j.cn/tmall/img/category/79.jpg"></td>
<td>平衡车</td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-th-list"></span></a></td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-shopping-cart"></span></a></td>
<td><a href="#nowhere"><span class="glyphicon glyphicon-edit"></span></a></td>
<td><a deleteLink="true" href="#nowhere"><span class=" glyphicon glyphicon-trash"></span></a></td>
</tr>
</tbody>
</table>
</div>
<div class="pageDiv">
<script>
$(function(){
$("ul.pagination li.disabled a").click(function(){
return false;
});
});
</script>
<nav>
<ul class="pagination">
<li class="disabled">
<a href="#nowhere" aria-label="Previous" >
<span aria-hidden="true">«</span>
</a>
</li>
<li class="disabled">
<a href="#nowhere" aria-label="Previous" >
<span aria-hidden="true">‹</span>
</a>
</li>
<li class="disabled">
<a
href="#nowhere"
class="current"
>1</a>
</li>
<li >
<a
href="#nowhere"
>2</a>
</li>
<li >
<a
href="#nowhere"
>3</a>
</li>
<li >
<a
href="#nowhere"
>4</a>
</li>
<li >
<a href="#nowhere" aria-label="Next">
<span aria-hidden="true">›</span>
</a>
</li>
<li >
<a href="#nowhere" aria-label="Next">
<span aria-hidden="true">»</span>
</a>
</li>
</ul>
</nav>
</div>
<div class="panel panel-warning addDiv">
<div class="panel-heading">新增分类</div>
<div class="panel-body">
<form method="post" id="addForm" enctype="multipart/form-data1">
<table class="addTable">
<tr>
<td>分类名称</td>
<td><input id="name" name="name" type="text" class="form-control"></td>
</tr>
<tr>
<td>分类圖片</td>
<td>
<input id="categoryPic" type="file" name="filepath" />
</td>
</tr>
<tr class="submitTR">
<td colspan="2" align="center">
<button type="button" class="btn btn-success">提 交</button>
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
<div class="footer">
</div>
</body>
</html>
复制代码代码高亮插件双击即可选中,不过部分同学反应,通过代码高亮插件复制的代码无法在IDEA里正常显示,这里提供TEXTAREA的方式,方便复制,谢谢 分享连接分享如下连接可增加积分,获取50%佣金 推
如果不方便发连接(如贴吧),可以使用如下由连接转换为的二维码. 鼠标在图片上右键,然后另存为即可
警告: 请勿使用挂机软件刷积分,刷积分不会导致任何注册量,很容易被识别。 一旦发现刷积分,即封号处理,请勿做吃力不讨好之事。
做练习的正确姿势1. 自行完成练习
根据练习目标尽量自己实现代码效果,期间会碰到疑问,难题,和自己不懂的地方,这些都是必要的过程
2. 带着疑问查看答案
完成过程中,碰到无法解决的问题,带着疑问,查看答案,分析答案的解决思路
3. 查看答案讲解视频
依然有不明白的地方,点开视频讲解,带着疑问,听视频讲解有问题的部分
4. 再做一遍
理解后,再从头做一遍,把有疑问的地方都捋清楚
5. 总结
最后再总结一遍,总结思路,总结解决办法,以后遇到类似的问题,怎么处理
错误纠正专用站长比较马虎,难免出现错别字,如果发现哪里文字有误,请提交错误,站长会尽快修改,谢谢
HOW2J公众号,关注后实时获知最新的教程和优惠活动,谢谢。
![]()
提问之前请登陆
提问已经提交成功,正在审核。 请于 我的提问 处查看提问记录,谢谢
|
分享如下连接可增加积分,获取50%佣金