<html lang="zh-cn">
|
|
<head>
|
<meta charset="utf-8">
|
<meta name="referrer" content="never">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<title>发现-商城</title>
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
<link href="css/maincontent.css" rel="stylesheet">
|
<style>
|
#editdialog {
|
padding: 20px;
|
height: 220px;
|
display: none;
|
}
|
|
#editdialog div {
|
margin-bottom: 30px;
|
}
|
</style>
|
|
<!--[if lt IE 9]>
|
<script src="js/html5shiv.js"></script>
|
<script src="js/respond.min.js"></script>
|
<![endif]-->
|
</head>
|
|
<div id="editdialog">
|
<input type="hidden" class="goodsid" />
|
|
<div>
|
<label>标题</label>
|
<input class="form-control title col-lg-8" type="text" />
|
</div>
|
|
<div>
|
<label>排序值</label>
|
<input class="form-control orderby col-lg-8" type="number" />
|
</div>
|
|
<div style="float: right;padding-top: 20px;">
|
<button class="btn btn-primary sure">确定</button>
|
<button class="btn btn-default cancel">取消</button>
|
</div>
|
</div>
|
|
<body>
|
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
|
|
</nav>
|
<div id="mainbody">
|
<div id="sidebar">
|
<dl>
|
<dd>
|
</dd>
|
</dl>
|
</div>
|
<div id="neirong">
|
<div class="erjidh">
|
<table class="table">
|
<tbody>
|
<tr>
|
<td class="xiala">
|
<select name="select" class="form-control" id="show">
|
<option value="-1">全部</option>
|
<option value="1">已编辑</option>
|
<option value="0">未编辑</option>
|
</select>
|
</td>
|
|
<td style="width: 200px;">
|
<input type="text" class="form-control" placeholder="请输入商品名称" id="kw" />
|
</td>
|
|
<td>
|
<button type="submit" class="btn btn-default">搜索</button>
|
</td>
|
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
<div class="bottom">
|
<div class="qx">
|
<div class="checkbox">
|
<label>
|
<input type="checkbox" value="#" onclick="if(this.checked==true) { checkAll('movedata'); } else { clearAll('movedata'); }">
|
全选</label>
|
</div>
|
</div>
|
<button class="btn btn-warning" type="button">批量删除</button>
|
|
<div class="page">
|
<ul class="pagination">
|
<li class="disabled pre">
|
<a href="#">«</a>
|
</li>
|
<li class="active">
|
<a href="#">1</a>
|
</li>
|
<li>
|
<a href="#">2</a>
|
</li>
|
<li>
|
<a href="#" class="next">»</a>
|
</li>
|
</ul>
|
<div class="form-group">
|
<div class="tzan">
|
<button type="button" class="btn btn-primary">跳转</button>
|
</div>
|
<div class="tz">
|
<input class="form-control" type="text" placeholder="页数">
|
</div>
|
</div>
|
</div>
|
|
</div>
|
<div class="zhuti">
|
<div class="liebiao">
|
<table class="table">
|
|
<thead>
|
<th width="7%">选择</th>
|
<th width="7%">编号</th>
|
<th width="15%">商品名称</th>
|
<th width="15%">图片</th>
|
<th width="4%">价格</th>
|
<th width="4%">销量</th>
|
<th width="15%">标题</th>
|
<th width="5%">排序值</th>
|
<th width="8%">是否已编辑</th>
|
<th width="4%">删除</th>
|
<th width="4%">编辑</th>
|
|
</thead>
|
<tbody>
|
<tr style="display: none;">
|
<td>
|
<div class="xuanze">
|
<label>
|
<input type="checkbox" value="#">
|
</label>
|
</div>
|
</td>
|
<td>
|
<div class="bianhao goodsid">623</div>
|
</td>
|
<td>
|
|
<div class="bianhao">
|
<a href="" target="_blank" class="goodsname"></a>
|
</div>
|
</td>
|
<td>
|
<div class="tupian-banner"><img alt src="image/banner/贴身校花.jpg" class="goodsimg" style="width:200px;"></div>
|
</td>
|
|
<td>
|
|
<div class="bianhao price">
|
价格
|
</div>
|
|
</td>
|
|
<td>
|
|
<div class="bianhao volume">
|
销量
|
</div>
|
|
</td>
|
<td>
|
|
<div class="bianhao title">
|
标题
|
</div>
|
|
</td>
|
|
<td>
|
<div class="bianhao orderby">
|
排序值
|
</div>
|
|
</td>
|
<td style="text-align:center; line-height:105px;" class="goodsedit">否</td>
|
<td>
|
<div class="anniu"><img class="delete" key="" src="image/dustbin.png">
|
</div>
|
</td>
|
<td>
|
<div class="anniu">
|
<a key="370" href="#" class="edit"><img src="image/bianji.png"></a>
|
</div>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
</div>
|
<div class="bottom">
|
<div class="qx">
|
<div class="checkbox">
|
<label>
|
<input type="checkbox" value="#" onclick="if(this.checked==true) { checkAll('movedata'); } else { clearAll('movedata'); }">
|
全选</label>
|
</div>
|
</div>
|
<button class="btn btn-warning" type="button">批量删除</button>
|
|
<div class="page">
|
<ul class="pagination">
|
<li class="disabled pre">
|
<a href="#">«</a>
|
</li>
|
<li class="active">
|
<a href="#">1</a>
|
</li>
|
<li>
|
<a href="#">2</a>
|
</li>
|
<li>
|
<a href="#" class="next">»</a>
|
</li>
|
</ul>
|
<div class="form-group">
|
<div class="tzan">
|
<button type="button" class="btn btn-primary">跳转</button>
|
</div>
|
<div class="tz">
|
<input class="form-control" type="text" placeholder="页数">
|
</div>
|
</div>
|
</div>
|
|
</div>
|
</div>
|
</div>
|
|
|
<script src="js/jquery.min.js"></script>
|
<script src="js/bootstrap.min.js"></script>
|
<script src="js/page.js"></script>
|
<script src="js/nav.js"></script>
|
<script src="js/common.js"></script>
|
<script src="layer/layer.js"></script>
|
<script>
|
$(function() {
|
var htmlSrc = "<tr>" + $(".zhuti .table tbody tr").eq(0).html() + "</tr>";
|
|
function getData(page) {
|
$.post('/BuWan/admin/new/api/found/shop/itemlist', {
|
"show": $("#show").val(),
|
"page": page,
|
"key": $("#kw").val()
|
}, function(data) {
|
if(data.code != 0)
|
return;
|
|
fillPage(data.data.pageEntity, function(pageIndex) {
|
getData(pageIndex);
|
});
|
//填充数据
|
|
$(".zhuti .table tbody").empty();
|
for(var i = 0; i < data.data.data.length; i++) {
|
var da = data.data.data[i];
|
$(".zhuti .table tbody").append(htmlSrc);
|
var fk = $(".zhuti .table tbody tr").eq(i);
|
fk.find(".goodsid").html(da.id);
|
fk.find(".goodsname").html(da.item.title);
|
fk.find(".goodsname").attr("href", da.item.item_url);
|
fk.find(".goodsimg").attr("src", da.item.pict_url);
|
fk.find(".price").html(da.item.zk_final_price);
|
fk.find(".volume").html(da.item.volume);
|
fk.find(".title").html(da.title);
|
fk.find(".orderby").html(da.orderby);
|
fk.find(".goodsedit").html(da.show == 1 ? '是' : '否');
|
fk.find(".edit").attr("key", da.id);
|
fk.find(".delete").attr("key", da.id);
|
fk.css("display", "table-row");
|
}
|
|
$(".table .anniu .delete").bind("click", function() {
|
var id = $(this).attr("key");
|
var $deleteElement = $(this);
|
var index = layer.confirm('是否删除该条目?', {
|
btn: ['是', '否'] //按钮
|
}, function() {
|
$.post('/BuWan/admin/new/api/found/shop/deleteitem', {
|
'id': id
|
}, function(data) {
|
layer.msg(data.msg);
|
layer.close(index);
|
if(data.code == 0) {
|
$deleteElement.parent().parent().parent().remove();
|
}
|
}, 'json');
|
}, function() {
|
|
});
|
|
});
|
|
$(".table .anniu .edit").bind("click", function() {
|
var da = $(this).parent().parent().parent();
|
$("#editdialog .title").val(da.find(".title").html());
|
$("#editdialog .orderby").val(da.find(".orderby").html());
|
$("#editdialog .goodsid").val(da.find(".goodsid").html());
|
var index = layer.open({
|
type: 1,
|
skin: 'layui-layer-demo', //样式类名
|
closeBtn: 1, //不显示关闭按钮
|
anim: 2,
|
shadeClose: true, //开启遮罩关闭
|
content: $("#editdialog")
|
});
|
|
$("#editdialog .sure").click(function() {
|
var title = $("#editdialog .title").val();
|
var orderby = $("#editdialog .orderby").val();
|
var id = $("#editdialog .goodsid").val();
|
console.log("点击响应");
|
$.post('/BuWan/admin/new/api/found/shop/updateitem', {
|
'id': id,
|
'title': title,
|
'show': -1,
|
'orderby': orderby
|
}, function(data) {
|
if(data.code == 0)
|
layer.msg("更改成功");
|
}, 'json');
|
|
layer.close(index);
|
});
|
|
$("#editdialog .cancel").click(function() {
|
layer.close(index);
|
});
|
|
});
|
|
}, 'json');
|
}
|
getData(1);
|
|
$(".erjidh button").click(function() {
|
getData(1);
|
});
|
|
});
|
</script>
|
</body>
|
|
</html>
|