{{:ModuleInclude('public/header')}}

<!-- header top nav -->
{{:ModuleInclude('public/header_top_nav')}}

<!-- header simple nav -->
{{:ModuleInclude('public/header_nav_simple', [
    'search' => '1',
])}}

<!-- content -->
<div class="am-container user-main">
    <!-- user menu start -->
    {{:ModuleInclude('public/user_menu')}}
    <!-- user menu end -->

    <!-- content start -->
    <div class="user-content">
        <div class="user-content-body">
            <!-- user center title -->
            {{:ModuleInclude('public/user_center_main_title')}}
            
            <div class="control">
                <button type="button" class="am-btn am-btn-primary am-btn-xs am-radius submit-popup" data-url="{{:MyUrl('index/useraddress/saveinfo')}}" data-title="{{:MyLang('address_title')}}{{:MyLang('add_title')}}">
                    <i class="iconfont icon-add am-show-sm-only"></i>
                    <span>{{:MyLang('add_title')}}</span>
                </button>
            </div>
            {{if !empty($user_address_list)}}
                <ul class="address-list">
                    {{foreach $user_address_list as $address}}
                        <li class="{{if isset($address['is_default']) and $address['is_default'] eq 1}}address-default{{/if}}" id="data-list-{{$address.id}}" data-value="{{$address.id}}">
                            <div class="address-content am-background-white">
                                <div class="address-left">
                                    <div class="user-base">
                                        {{if !empty($address.alias)}}
                                            <span class="am-badge am-badge-secondary-plain am-radius">{{$address.alias}}</span>
                                        {{/if}}
                                        {{if isset($address['is_default']) and $address['is_default'] eq 1}}
                                            <span class="am-badge am-badge-success-plain am-radius">{{:MyLang('default_title')}}</span>
                                        {{/if}}
                                        <span class="address-detail">   
                                            <span class="user">{{$address.name}}</span>
                                            <span class="phone">{{$address.tel}}</span>
                                        </span>
                                    </div>
                                    <div>
                                        <span class="province">{{$address.province_name}}</span>
                                        <span class="city">{{$address.city_name}}</span>
                                        <span class="dist">{{$address.county_name}}</span>
                                        <span class="street">{{$address.address}}</span>
                                    </div>
                                </div>
                                <div class="address-operation-btn">
                                    {{if isset($address['is_default']) and $address['is_default'] neq 1}}
                                        <a href="javascript:;" class="am-icon-check-circle-o address-default-submit" data-url="{{:MyUrl('index/useraddress/setdefault')}}" data-id="{{$address.id}}" data-view="reload"> {{:MyLang('setup_default_title')}}</a>
                                        <span class="cut">|</span>
                                    {{/if}}
                                    <a href="javascript:;" class="am-icon-edit submit-popup" data-url="{{:MyUrl('index/useraddress/saveinfo', ['id'=>$address['id']])}}" data-title="{{:MyLang('address_title')}}{{:MyLang('edit_title')}}"> {{:MyLang('edit_title')}}</a>
                                    <span class="cut">|</span>
                                    <a href="javascript:;" class="iconfont icon-delete address-submit-delete" data-url="{{:MyUrl('index/useraddress/delete')}}" data-id="{{$address.id}}"> {{:MyLang('delete_title')}}</a>
                                </div>
                            </div>
                        </li>
                    {{/foreach}}
                </ul>
            {{else /}}
                {{:ModuleInclude('public/not_data')}}
            {{/if}}
        </div>
    </div>
    <!-- content end -->
</div>

<!-- footer start -->
{{:ModuleInclude('public/footer')}}