address_list.html 6.24 KB
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>收货地址-{$tpshop_config['shop_info_store_title']}</title>
    <meta http-equiv="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
    <meta name="description" content="{$tpshop_config['shop_info_store_desc']}" />
    <link rel="stylesheet" href="__STATIC__/css/index.css" type="text/css">
    <script src="__STATIC__/js/jquery-1.10.2.min.js"></script>
    <script src="__STATIC__/js/slider.js"></script>
</head>

<body>
<!--------头部开始-------------->
<include file="public/header" />
<!--------头部结束-------------->
<script src="__PUBLIC__/js/layer/layer.js"></script><!-- 弹窗js 参考文档 http://layer.layui.com/-->

<div class="layout ov-hi">
    <div class="breadcrumb-area">    
	    <foreach name="navigate_user" key="k" item="v">
	        <if condition="$k neq '首页'"> > </if>  
            <a href="{$v}">{$k}</a> 
        </foreach>
    </div>
</div>
<div class="layout pa-to-10 fo-fa-ar">
    <!--菜单-->
    <include file="user/menu" />
    <!--菜单-->
    <div class="fr wi940">
        <div class="he50 wddd">
            <div class="fl ddd-h2">
                <h2><span>收货地址管理</span></h2>
            </div>
            <div class="fr ddd-h2">
            	<h2><a class="co-red" onClick="address_edit({$list['address_id']})"><span>+添加地址</span></a></h2>
            </div>
        </div>

        <div class="wddd-js ov-in">
            <div class="list-group-title">
                <table class="merge-tab" border="0" cellpadding="0" cellspacing="0">
                    <thead>
                    <tr>
                        <th class="col-pro wi137">收货人</th>
                        <th class="">收货地址</th>
                        <th class="wi118">邮编</th>
                        <th class="wi172">手机/电话</th>
                        <th class="col-operate wi199">操作</th>
                    </tr>
                    </thead>
                </table>
            </div>
            <div class="merge-list">
 <if condition="empty($lists)"><!--没查询到数据-->
     <p style="text-align:center"><img src="__STATIC__/images/null_data.jpg" width="400"  /></p>     
 </if>               
                <div class="ma-0--1">
                    <div class="o-pro">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tbody>
                            <volist name="lists" id="list">
                                <tr>
                                    <td class="col-pro wi137">{$list.consignee}</td>
                                    <td class="">
                                        <span>
                                        {$region_list[$list['province']]['name']},{$region_list[$list['city']]['name']},{$region_list[$list['district']]['name']},{$region_list[$list['twon']]['name']} {$list.address}
                                        </span>
                                    </td>
                                    <td class="wi118">{$list.zipcode}</td>
                                    <td rowspan="1" class="wi172"><span>{$list.mobile}</span></td>
                                    <td rowspan="1" class="col-operate wi199">
                                        <p class="p-link  pfc"><a href="javascript:address_edit({$list['address_id']})">编辑</a></p>
                                        <p class="p-link  pfc"><a href="{:U('Home/User/del_address',array('id'=>$list['address_id']))}">删除</a></p>
                                        <p class="p-link  pfc"><a class="red" href="{:U('Home/User/set_default',array('id'=>$list['address_id']))}">默认地址</a></p>
                                    </td>
                                </tr>
                            </volist>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="he80"></div>
<!--------footer-开始-------------->
<include file="public/footer2" />
<!--------footer-结束-------------->


</body>
<script>
    /*$(function () {
     $("#h-s").click(function () {
     $('.ec-ta-x').css('left','124px');
     $('.ec-ta-x').css('width','110px');
     $(this).addClass("cullent");
     $('#q-s').removeClass("cullent");
     });
     });
     */
</script>

<script>
    $(function () {
        $(function () {
            $("#q-s").mouseover(function () {
                $('.ec-ta-x').css('left','0px');
                $(this).addClass("cullent");
            });
            $("#q-s").mouseout(function () {
                $('.ec-ta-x').css('left','0px');
            });
        });
        $("#h-s").mouseover(function () {
            $('.ec-ta-x').css('left','82px');
            $(this).addClass("cullent");
        });
        $("#h-s").mouseout(function () {
            $('.ec-ta-x').css('left','0px');
            $(this).removeClass("cullent");
        });
    });

    $(function () {
        $("#j-s").mouseover(function () {
            $('.ec-ta-x').css('left','164px');
            $(this).addClass("cullent");
        });
        $("#j-s").mouseout(function () {
            $('.ec-ta-x').css('left','0px');
            $(this).removeClass("cullent");
        });
    });
    /**
     * 新增修改收货地址
     * id 为零 则为新增, 否则是修改
     *  使用 公共的 layer 弹窗插件  参考官方手册 http://layer.layui.com/
     */
    function address_edit(id)
    {
        if(id > 0)
            var url = "/index.php?m=Home&c=User&a=edit_address&scene=1&call_back=call_back_fun&id="+id; // 修改地址  '/index.php/Home/User/add_address/scene/1/call_back/call_back_fun/id/id' //iframe的url /index.php/Home/User/add_address
        else
            var url = "/index.php?m=Home&c=User&a=add_address&scene=1&call_back=call_back_fun";	// 新增地址
        layer.open({
            type: 2,
            title: '添加收货地址',
            shadeClose: true,
            shade: 0.8,
            area: ['880px', '580px'],
            content: url,
        });
    }
    // 添加修改收货地址回调函数
    function call_back_fun(v){
        layer.closeAll(); // 关闭窗口
        location.href = location.href;
    }
</script>
</html>