{include file="public/mall_top" /}
{include file="public/mall_header" /}
<link rel="stylesheet" href="{$Think.config.url_domain_root}static/home/css/member.css">
<div class="dsm-container">
    {include file="public/member_left" /}
    <div class="right-layout">
        <div class="tabmenu">
            {include file="public/member_items" /}
            <a class="dsm-btn dsm-btn-red" href="javascript:void(0);" nc_type="delbtn" data-param='{"goods_id":"all"}'><i class="icon-trash"></i>清空全部足迹</a>
        </div>

        <div class="dsm-browse">
            <div class="dsm-browse-left">
                {notempty name="browselist"}
                <ul class="dsm-browse-list">
                    {volist name="browselist" id="v"}
                    <li id="browserow_{$v.goods_id}">
                        <div class="browse-timeline">&nbsp;</div>
                        <div class="browse-time">{$v.browsetime_text}</div>
                        <div class="browse-goods">
                            <div class="goods-thumb"><a href="{:url('Goods/index',['goods_id'=>$v.goods_id])}" target="_blank"><img src="{:cthumb($v.goods_image,60)}" /></a> </div>
                            <dl class="goods-info">
                                <dt><a target="_blank" href="{:url('Goods/index',['goods_id'=>$v.goods_id])}">{$v.goods_name}</a></dt>
                                <dd>商城价：
                                    <em class="sale-price">{$Think.lang.currency}{$v.goods_promotion_price}</em>
                                    <em class="market-price" title="市场价">{$Think.lang.currency}{$v.goods_marketprice}</em>
                                </dd>
                            </dl>
                            <a class="dsm-btn dsm-btn-orange" href="javascript:addcart({$v.goods_id},1,'','o');"><i class="icon-shopping-cart"></i>加入购物车</a>
                            <br/><br/>
                            <a class="dsm-btn" href="javascript:void(0);" nc_type="delbtn" data-param='{"goods_id":{$v.goods_id}}'><i class="icon-trash"></i>删除该记录</a>
                        </div>
                    </li>
                    {/volist}
                </ul>
                <div class="pagination">{$show_page}</div>
                {else /}
                <div class="norecord">
                    <div class="warning-option"><i></i><span>{$Think.lang.no_record}</span></div>
                </div>
                {/notempty}
            </div>
            <div class="dsm-browse-class">
                <div class="title"><a href="{:url('Membergoodsbrowse/listinfo')}" class="{$Request.param.gc_id ?'':'selected'}"> 全部浏览历史</a></div>
                <ul id="sidebarMenu">
                    {volist name="browseclass_arr" id="v"}
                    <li class="side-menu"> <a href="{:url('Membergoodsbrowse/listinfo',['gc_id'=>$key])}" class="{if $Request.param.gc_id == $key}selected{/if}"><i></i>{$v.gc_name}</a>
                        <ul style="<?php echo input('param.gc_id') == $k || in_array(input('param.gc_id'),array_keys($v['sonclass']))?'display: block;':'display: none;'; ?>">
                            {volist name="v.sonclass" id="v_son" key="k_son"}
                            <li class="{if $Request.param.gc_id == $k_son}selected{/if}"><a href="{:url('Membergoodsbrowse/listinfo',['gc_id'=>$k_son])}">{$v_son.gc_name}</a></li>
                            {/volist}
                        </ul>
                    </li>
                   {/volist}
                </ul>
            </div>
        </div>
        <form id="buynow_form" method="post" action="{:url('Buy/buy_step1')}" target="_blank">
            <input id="goods_id" name="cart_id[]" type="hidden"/>
        </form>
    </div>
</div>

<script src="{$Think.config.url_domain_root}static/plugins/jquery.poshytip.min.js"></script>
<script src="{$Think.config.url_domain_root}static/plugins/js/jquery.raty/jquery.raty.min.js"></script>
<script src="{$Think.config.url_domain_root}static/plugins/js/jquery.nyroModal/custom.min.js"></script>
<link href="{$Think.config.url_domain_root}static/plugins/js/jquery.nyroModal/styles/nyroModal.css" rel="stylesheet">
<script type="text/javascript">
    $(document).ready(function(){
        $('.raty').raty({
            path: "{$Think.config.url_domain_root}static/plugins/js/jquery.raty/img",
            readOnly: true,
            score: function() {
                return $(this).attr('data-score');
            }
        });

        $('a[nctype="nyroModal"]').nyroModal();
        //清除单条浏览记录
        $("[nc_type='delbtn']").on('click',function(){
            if(confirm("确实要删除吗？")){
                var data_str = $(this).attr('data-param');
                eval( "data_str = "+data_str);
                $.getJSON(SITE_URL+'/index.php/Home/Membergoodsbrowse/del.html?goods_id='+data_str.goods_id,function(data){
                    if(data.done == true){
                        if(data_str.goods_id == 'all'){
                            location.reload(true);
                        } else {
                            $("#browserow_"+data_str.goods_id).hide();
                        }
                    }else{
                        showDialog(data.msg);
                    }
                });
            }
        });

        //立即购买
        $('a[nctype="buy_now"]').click(function(){
            eval('var data_str = ' + $(this).attr('data-param'));
            $("#goods_id").val(data_str.goods_id+'|1');
            $("#buynow_form").submit();
        });
    });
</script>

{include file="public/mall_server" /}
{include file="public/mall_footer" /}
