232 lines
6.7 KiB
PHTML
Executable File
232 lines
6.7 KiB
PHTML
Executable File
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
<title>我的收藏</title>
|
|
{include file="include/head-product" /}
|
|
</head>
|
|
|
|
<body>
|
|
<!--top-->
|
|
<header class="header-PC header-Product">
|
|
<div id="header" class="theme-black">
|
|
{include file="include/top" /}
|
|
{include file="include/top-header" /}
|
|
</div>
|
|
</header>
|
|
|
|
<div class="swt-Container">
|
|
<div class="people">
|
|
<div class="people_title">
|
|
<ul>
|
|
<a href="__ORICOROOT__/index/customer/personal"><li>账号管理</li></a>
|
|
<a href="__ORICOROOT__/index/customer/my_collection"><li class="people_blue">我的收藏</li></a>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="content02">
|
|
<?php if (!empty($customer_info)): ?>
|
|
<?php
|
|
$head_img = $head_img = $customer_info['picture'] != '' ? $customer_info['picture'] : '__PUBLIC__/web/images/customer/logo_small_03.png';
|
|
?>
|
|
<div class="people_logo">
|
|
<div class="left"><img style="border-radius: 50%;" src="<?php echo $head_img; ?>"></div>
|
|
<div class="right">
|
|
<div>用户:<?php echo $customer_info['firstname']; ?></div>
|
|
<!-- <div class="">修改个人信息</div>-->
|
|
</div>
|
|
</div>
|
|
<div class="people_AC">
|
|
<div class="title link_a">
|
|
<div class="text-r">
|
|
<div class="u_admin01 cursor_p"><i class='Batch'>批量管理</i></div>
|
|
<div class="u_admin02" style="display: none">
|
|
<i class="cursor_p"><input type="checkbox" class="check" name="check" value="">全选</i>
|
|
<i class='delete cursor_p'>删除</i>
|
|
<i class='cancel cursor_p'>取消管理</i>
|
|
</div>
|
|
<div class="u_cate">
|
|
分类:<a class="<?php if ($cid == 0): ?> f_blue <?php endif; ?>" href="/index/customer/my_collection">全部</a>
|
|
<?php if (!empty($productCategory)): ?>
|
|
<?php foreach($productCategory as $key => $value): ?>
|
|
<a class="<?php if ($cid == $value['id']): ?> f_blue <?php endif; ?>" href="/index/customer/my_collection/cid/<?php echo $value['id']; ?>"><?php echo $value['name']; ?> </a>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="u_product">
|
|
<?php if (!empty($list)): ?>
|
|
|
|
<?php foreach($list as $key => $value): ?>
|
|
<ul>
|
|
<li class="d_product">
|
|
<div class="position-r" >
|
|
<div class="check_B position-a" style="display: none;"><input id="" name="check_box" type="checkbox" class="check_box" value="<?php echo $value['id']; ?>"><label></label></div>
|
|
<a href="/product/detail/<?php echo $value['id']; ?>.html">
|
|
<img src="<?php echo $value['product_two_img']; ?>">
|
|
</a>
|
|
<div product_id="<?php echo $value['id']; ?>" class="delete_product u_del s_del" style="display: none"><img src="__PUBLIC__/web/images/customer/del.jpg" class="cursor_p"></div>
|
|
<div class="del_alert" style="display: none;">
|
|
<p>确定删除?</p>
|
|
<span class="bg_red cursor_p">确定</span>
|
|
<span class="bg_gray cursor_p">取消</span>
|
|
</div>
|
|
|
|
</div>
|
|
<a href="/product/detail/<?php echo $value['id']; ?>.html">
|
|
<p><?php echo $value['name']?></p>
|
|
<p><?php echo $value['brand_id']; ?></p>
|
|
</a>
|
|
</li>
|
|
|
|
</ul>
|
|
<?php endforeach; ?>
|
|
<?php else: ?>
|
|
<div class="u_product text-c" style="line-height: 300px;" >您还未收藏任何产品</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php
|
|
if ($page)
|
|
{
|
|
echo $page;
|
|
}
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="all_del" style="display: none">
|
|
<div class="all_delect">
|
|
<p>确定删除?</p>
|
|
<span class="bg_red cursor_p">确定</span>
|
|
<span class="bg_gray cursor_p">取消</span>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="application/javascript">
|
|
|
|
/*修改*/
|
|
$(document).ready(function(){
|
|
$(".u_before .right").click(function(){
|
|
$(this).parents(".u_before").hide();
|
|
$(this).parents(".u_before").next().show();
|
|
})
|
|
$(".u_after .u_button_gray").click(function(){
|
|
$(this).parents(".u_after").hide();
|
|
$(this).parents(".u_after").prev().show();
|
|
})
|
|
})
|
|
/*批量管理*/
|
|
$(document).ready(function(){
|
|
$(".u_admin01 .Batch").click(function(){
|
|
$(".u_admin01").hide();
|
|
$(".u_admin02").show();
|
|
$(".u_product .check_B").show();
|
|
$(".u_product .s_del").removeClass('u_del');
|
|
});
|
|
$(".u_admin02 .cancel").click(function(){
|
|
$(".u_admin02").hide();
|
|
$(".u_admin01").show();
|
|
$(".u_product .check_B").hide();
|
|
$(".u_product .s_del").addClass('u_del');
|
|
});
|
|
})
|
|
|
|
/*全选*/
|
|
$(document).ready(function(){
|
|
$(".u_admin02 input[name='check']").click(function(){
|
|
if($(this).is(":checked")){
|
|
$(".u_product input[type='checkbox']").prop("checked",true);
|
|
}else{
|
|
$(".u_product input[type='checkbox']").prop("checked",false);
|
|
}
|
|
})
|
|
});
|
|
/*删除*/
|
|
$(document).ready(function(){
|
|
$(".d_product").mouseover(function(){
|
|
$(this).find(".u_del").show();
|
|
})
|
|
$(".d_product").mouseleave(function(){
|
|
$(this).find(".u_del").hide();
|
|
})
|
|
|
|
});
|
|
/*删除*/
|
|
$(document).ready(function(){
|
|
$(".u_del").click(function(){
|
|
$(this).next(".del_alert").show();
|
|
})
|
|
$(".del_alert .bg_gray").click(function(){
|
|
|
|
$(this).parent(".del_alert").hide();
|
|
})
|
|
$(".del_alert .bg_red").click(function(){
|
|
var product_id = $(this).parents('.del_alert').prev('.delete_product').attr('product_id');
|
|
cancel_collection(product_id);
|
|
$(this).parents(".d_product").remove();
|
|
})
|
|
});
|
|
|
|
/*批量管量*/
|
|
var checked = [];
|
|
$(document).ready(function(){
|
|
$(".delete").click(function(){
|
|
$('input[name="check_box"]:checked').each(function() {
|
|
checked.push($(this).val());
|
|
});
|
|
$(".all_del").show();
|
|
});
|
|
$(".all_delect .bg_gray").click(function(){
|
|
$(".all_del").hide();
|
|
checked = [];
|
|
});
|
|
$(".all_delect .bg_red").click(function(){
|
|
var product_ids = checked;
|
|
cancel_collection(product_ids, 1);
|
|
})
|
|
});
|
|
</script>
|
|
<!-- bottom s -->
|
|
{include file="include/bottom2023" /}
|
|
<!-- bottom e -->
|
|
</body>
|
|
</html>
|
|
<script type="text/javascript">
|
|
function cancel_collection(product_id, type=0)
|
|
{
|
|
if (product_id == '')
|
|
{
|
|
alert('请先选择产品');
|
|
$(".all_del").hide();
|
|
return;
|
|
}
|
|
|
|
var data = {
|
|
type: 1,
|
|
coll_id: product_id
|
|
};
|
|
|
|
$.ajax({
|
|
url: '/index/collection/cancel_collection',
|
|
type: 'post',
|
|
dataType: 'json',
|
|
data: data,
|
|
success: function (res) {
|
|
if (type == 1)
|
|
{
|
|
location.reload();
|
|
}
|
|
}
|
|
|
|
})
|
|
}
|
|
</script>
|
|
|