goods_hot.html
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li ><a href="{:url('Goods/goods_list')}">商品列表</a></li>
<li class="active"><a href="#">推荐热门</a></li>
</ul>
<table class="table table-bordered" style="margin-top: 10px;">
<thead>
<tr>
<th>选择</th>
<th>序号</th>
<th>商品名称</th>
<th>分类</th>
<th>价钱</th>
<th>销量</th>
<th>创建时间</th>
</tr>
</thead>
<tbody>
<volist name="data" id="vo">
<tr>
<td>
<if condition="$vo.recommend_hot eq 1">
<input type="checkbox" name="choice" class="choice" checked value="{$vo.id}">
<else/>
<input type="checkbox" name="choice" class="choice" value="{$vo.id}">
</if>
</td>
<td>{$vo.id}</td>
<td>{$vo.book_name}</td>
<td>{$vo.classify_name|default='为空'}</td>
<td>{$vo.price}</td>
<td>{$vo.sales}</td>
<td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
</tr>
</volist>
</tbody>
</table>
<button type="button" class="btn btn-default" onclick="baocun()">保存</button>
<script>
function baocun(){
num = $(".choice:checked");
arr = [];
for(i=0;i<num.length;i++){
arr[i] = num.eq(i).val();
}
ids = arr.join(',');
$.post("{:url('Goods/goods_hot')}",{ids:ids},function(data){
alert('推荐成功');
});
}
</script>
</div>
</body>
</html>