Files
orico-official-website-old/app/us/view/customer/my_collection.phtml
2024-10-29 14:04:59 +08:00

234 lines
6.8 KiB
PHTML
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Favorite</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__/customer/personal"><li>Manage Your Account</li></a>
<a href="__ORICOROOT__/customer/my_collection"><li class="people_blue">Favorite</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>User<?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'>Batch Management</i></div>
<div class="u_admin02" style="display: none">
<i class="cursor_p"><input type="checkbox" class="check" name="check" value="">Select All</i>
<i class='delete cursor_p'>Delete</i>
<i class='cancel cursor_p'>Cancel</i>
</div>
</div>
<div class="test-r">
<div class="u_cate">
Classify<a class="<?php if ($cid == 0): ?> f_blue <?php endif; ?>" href="__ORICOROOT__/customer/my_collection">All</a>
<?php if (!empty($productCategory)): ?>
<?php foreach($productCategory as $key => $value): ?>
<a class="<?php if ($cid == $value['id']): ?> f_blue <?php endif; ?>" href="__ORICOROOT__/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="__ORICOROOT__/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>Confirm Delete</p>
<span class="bg_red cursor_p">Confirm</span>
<span class="bg_gray cursor_p">Cancel</span>
</div>
</div>
<a href="__ORICOROOT__/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;" > You haven't collected any products yet. </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>Confirm Delete</p>
<span class="bg_red cursor_p">Confirm</span>
<span class="bg_gray cursor_p">Cancel</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/bottom" /}
<!-- bottom e -->
</body>
</html>
<script type="text/javascript">
function cancel_collection(product_id, type=0)
{
if (product_id == '')
{
alert(' Please choose the product first. ');
$(".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>