wpfw_ewei_shopv2/template/web/goods/label/query.html
2023-02-14 19:57:32 +08:00

57 lines
2.1 KiB
HTML

<div style='max-height:500px;overflow:auto;min-width:850px;'>
<div class="active" id="sut_shop">
<span class="help-block" style="font-weight: bold;">您可以直接选择标签组或者选择您需要的标签</span>
{loop $labels $row}
<div class="page-header" style="padding:0;margin-bottom:10px;">
<h4>
<nav class="btn btn-default btn-sm btn-file" data-id="{$row['id']}" style="font-weight:bold;">
<i class="fa fa-folder-open-o"></i> {$row['label']}
</nav>
</h4>
<div style="padding-left:15px;">
{loop $row['labelname'] $item}
<nav onclick='biz.selector.set(this, {php echo json_encode(array("id"=>$item,"labelname"=>$item))})'
data-title="{$item}" class="btn btn-default btn-sm" title="{$item}" style="margin-bottom:10px;">
{$item}
</nav>
{/loop}
</div>
</div>
{/loop}
{if count($labels)<=0}
<tr>
<td colspan='2' align='center'>未找到商品</td>
</tr>
{/if}
</div>
</div>
<script type="text/javascript">
$(function(){
$(".btn-file").on("click",function(){
var id = $(this).attr("data-id");
$.ajax({
url:'{php echo webUrl("goods/label/labelfile")}',
data:"id="+id,
type:'post',
async : true, //默认为true 异步
dataType:'json',
error:function(){
alert('error');
},
success:function(data){
if(data.status>0){
var label = data.result.label;
for(var i in label){
biz.selector.set($("nav[data-title="+label[i]+"]"), {"id":label[i],"labelname":label[i]});
}
}else{
alert(data.result.message)
}
//biz.selector.set(this, {"id":"","labelname":""});
}
});
});
})
</script>