作者 潘浩文
1 个管道 的构建 通过 耗费 0 秒

1

... ... @@ -73,7 +73,6 @@ class BrandController extends WeChatBaseController
}else{
$order['b.create_time']='desc';
}
return $order;
$data=Db::name('brand')
->alias('b')
->join('brand_category bc1','b.category_id=bc1.id')
... ...
... ... @@ -233,7 +233,7 @@
<ul class="floorlist">
<foreach name="floor" item="vo">
<li>
<p>{$vo.name}</p>
<p data-id="{$vo.id}" onclick="floor(this)" >{$vo.name}</p>
</li>
</foreach>
</ul>
... ... @@ -243,7 +243,7 @@
<ul class="kindlist">
<foreach name="category" item="vo">
<li>
<p>{$vo.name}</p>
<p data-id="{$vo.id}" onclick="category(this)">{$vo.name}</p>
</li>
</foreach>
</ul>
... ... @@ -273,7 +273,7 @@
<p class="kind_img">
<img src="__TMPL__/public/assets/images/img/classfiy.png" alt="">
</p>
<p class="kind_name">分类</p>
<p class="kind_name" id="category">分类</p>
</div>
<div class="kind_type">
<p class="kind_img">
... ... @@ -496,6 +496,34 @@ $("#order").click(function(){
}
})
});
function category(obj) {
var id=$(obj).data("id");
var content=$(obj).html();
$.ajax({
url: "{:url('portal/brand/brandAjax')}",
type: "post",
data: {
category:id,
},
success: function (data) {
var html = "";
for (var i = 0; i < data.length; i++) {
html += ' <div class="list_item">\n' +
' <div class="item_img">\n' +
' <img src="'+data[i].image+'" alt="">\n' +
' </div>\n' +
' <div class="flooritem">\n' +
' <p class="item_name">'+data[i].name+'</p>\n' +
' <p class="list_name">'+data[i].cname+'</p>\n' +
' <p class="item_floor">'+data[i].fname+'</p>\n' +
' </div>\n' +
' </div>'
}
$(".list").html(html);
$("#category").html(content);
}
})
}
</script>
</body>
</html>
... ...