111 lines
5.5 KiB
HTML
Executable File
111 lines
5.5 KiB
HTML
Executable File
<!-- Select2 -->
|
|
<link rel="stylesheet" href="__PUBLIC__/adminlte/bower_components/select2/dist/css/select2.min.css">
|
|
<style>
|
|
.select2-container--default .select2-selection--single {
|
|
background-color: #fff;
|
|
border: 1px solid #d2d6de;
|
|
border-radius: 0;
|
|
}
|
|
.select2-container .select2-selection--single{height:34px;}
|
|
</style>
|
|
<!-- Select2 -->
|
|
<script src="__PUBLIC__/adminlte/bower_components/select2/dist/js/select2.full.min.js"></script>
|
|
<div class="modal-dialog modal-lg" xmlns="http://www.w3.org/1999/html">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
|
|
<h4 class="modal-title">产品(个数共计<?php echo $total;?>)</h4>
|
|
</div>
|
|
<form action="<?php echo url('/admin/Product/cont');?>" method="post">
|
|
<div class="modal-body">
|
|
<div class="row">
|
|
<!-- <div class="col-sm-5"></div>-->
|
|
<div class="col-sm-12">
|
|
<div class="input-group">
|
|
<input type="text" name="search" value="<?php echo $filter_name;?>" placeholder="检索中....." class="form-control">
|
|
<span class="input-group-btn">
|
|
<button type="button" data-toggle="tooltip" title="检索" id="modal-button-search" class="btn btn-primary"><i class="glyphicon glyphicon-search"></i></button>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr />
|
|
<?php if(!empty($list)):?>
|
|
<div class="row">
|
|
<?php foreach($list as $k=>$product):?>
|
|
<div class="col-sm-3 col-xs-6 text-center">
|
|
<a href="<?php //echo url('/admin/product/edit',['id'=>$product['id']]);?>" class="producter thumbnail" title="<?php echo $product['name'];?>">
|
|
<img src="<?php echo getImage($product['picture'],110,110,1,'smallimg');?>" data-toggle="product-toggle"
|
|
alt="<?php echo $product['name'];?>"
|
|
data-content="
|
|
<p>编号:<?php echo $product['item_number'];?></p>
|
|
<p>标签:<?php echo $product['tags'];?></p>"
|
|
/>
|
|
</a>
|
|
<label>
|
|
<input type="checkbox" name="product[]" value="<?php echo $product['id'];?>" />
|
|
<?php echo $product['name'];?>
|
|
</label>
|
|
</div>
|
|
<?php endforeach;?>
|
|
</div>
|
|
<?php endif;?>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<div class="col-sm-12 col-xs-12">
|
|
<div class="pull-left">
|
|
<?php if($page):?>
|
|
<?php echo $page;?>
|
|
<?php endif;?>
|
|
</div>
|
|
<button id='add' type="submit">提交</button>
|
|
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">取消</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div><!-- /.modal-content -->
|
|
</div><!-- /.modal-dialog -->
|
|
<style>
|
|
#modal-product .pagination{margin:0;}
|
|
</style>
|
|
|
|
<script type="text/javascript">
|
|
$('#modal-product input[name=\'search\']').on('keydown', function(e) {
|
|
if (e.which == 13) {
|
|
$('#modal-button-search').trigger('click');
|
|
}
|
|
});
|
|
$('#modal-button-search').on('click', function(e) {
|
|
var url = '<?php echo url("admin/product/modallists",array_filter(["inputid"=>urlencode($inputid),"titleid"=>urlencode($titleid),"callback"=>urlencode($callback),])); ?>';
|
|
//var url = '<?php echo url("admin/product/modallists"); ?>?inputid=' + encodeURIComponent('<?php echo $inputid; ?>') + '&titleid=' + encodeURIComponent('<?php echo $titleid; ?>') + '&callback=' + encodeURIComponent('<?php echo $callback; ?>');
|
|
var filter_name = $('#modal-product input[name=\'search\']').val();
|
|
if (filter_name) {
|
|
url += '&filter_name=' + encodeURIComponent(filter_name);
|
|
$('#modal-product').load(url);
|
|
}
|
|
});
|
|
$('#modal-product [data-toggle="product-toggle"]').popover({placement: 'auto top', trigger: 'hover', html: true, delay: {show: 5, hide: 10}});
|
|
$('#modal-product .modal-footer .pagination a').on('click', function(e) {
|
|
e.preventDefault();
|
|
$('#modal-product').load($(this).attr('href'));
|
|
});
|
|
$('#modal-product a.producter').on('click', function(e) {
|
|
e.preventDefault();
|
|
var titleid = "<?php echo $titleid; ?>";
|
|
var inputid = "<?php echo $inputid; ?>";
|
|
var callback = "<?php echo $callback;?>";
|
|
if (callback != "undefined" && callback) {
|
|
eval('window.parent.' + callback + '("' + $(this).parent().find('input').val() + '","' + $(this).prop('title') + '");');
|
|
$('#modal-product').modal('hide');
|
|
return;
|
|
}
|
|
if (titleid) {
|
|
$('#' + titleid).val($(this).prop('title'));
|
|
}
|
|
if (inputid) {
|
|
$('#' + inputid).val($(this).parent().find('input').val());
|
|
}
|
|
$('#modal-product').modal('hide');
|
|
});
|
|
</script>
|