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

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

<!-- 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-center">
    <!-- user menu start -->
    {{:ModuleInclude('public/user_menu')}}
    <!-- user menu end -->

    <!-- content start -->
    <div class="user-content">
        <div class="user-content-body">
            <!-- 用户中心顶部钩子 -->
            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                <div class="plugins-tag">
                    <span>plugins_view_user_center_top</span>
                </div>
            {{/if}}
            {{if !empty($plugins_view_user_center_top_data) and is_array($plugins_view_user_center_top_data)}}
                {{foreach $plugins_view_user_center_top_data as $hook}}
                    {{if is_string($hook) or is_int($hook)}}
                        {{$hook|raw}}
                    {{/if}}
                {{/foreach}}
            {{/if}}

            <!-- 基础信息 -->
            <div class="user-base am-radius" style="--background-image: url({{:StaticAttachmentUrl('user-member-top-bg.png')}})">
                <div class="user-base-left">
                    <div class="user-avatar">
                        {{if !empty($user['avatar'])}}
                            <img src="{{$user.avatar}}" class="avatar" />
                        {{/if}}
                        <div class="user-name">
                            {{if !empty($user['icon'])}}
                                <img src="{{$user.icon}}" class="common-user-icon" {{if !empty($user['icon_title'])}}title="{{$user.icon_title}}"{{/if}} />
                            {{/if}}
                            {{if !empty($user['user_name_view'])}}
                                <span>{{$user.user_name_view}}</span>
                            {{/if}}
                        </div>
                    </div>
                    <div class="items">
                        <a href="javascript:;" data-am-modal="{target:'#user-avatar-popup'}">
                            <i class="iconfont icon-user-circle"></i>
                            <span>{{:MyLang('user.base_avatar_title')}}</span>
                        </a>
                        <a href="{{:MyUrl('index/personal/index')}}">
                            <i class="iconfont icon-edit"></i>
                            <span>{{:MyLang('user.base_personal_title')}}</span>
                        </a>
                        <a href="{{:MyUrl('index/useraddress/index')}}">
                            <i class="iconfont icon-map-position"></i>
                            <span>{{:MyLang('user.base_address_title')}}</span>
                        </a>
                    </div>
                </div>
                <div class="user-base-right">
                    <a href="{{:MyUrl('index/message/index')}}" class="am-icon-bell-o message"> {{:MyLang('user.base_message_title')}} {{if $common_message_total gt 0}}{{$common_message_total}}{{/if}}</a>
                </div>
                {{if !empty($mini_navigation)}}
                    <ul class="user-base-icon am-radius">
                        {{foreach $mini_navigation as $nav}}
                            <li>
                                <a href="{{$nav.url}}">
                                    <p>{{$nav.value}}</p>
                                    <p>{{$nav.name}}</p>
                                </a>
                            </li>
                        {{/foreach}}
                    </ul>
                {{/if}}
            </div>

            <!-- 基础信息底部钩子 -->
            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                <div class="plugins-tag">
                    <span>plugins_view_user_base_bottom</span>
                </div>
            {{/if}}
            {{if !empty($plugins_view_user_base_bottom_data) and is_array($plugins_view_user_base_bottom_data)}}
                {{foreach $plugins_view_user_base_bottom_data as $hook}}
                    {{if is_string($hook) or is_int($hook)}}
                        {{$hook|raw}}
                    {{/if}}
                {{/foreach}}
            {{/if}}
            <div class="center-content am-padding-lg am-padding-top-0">
                <!-- 订单信息 -->
                <div class="order-nav">
                    <a href="{{:MyUrl('index/order/index')}}">
                        <span class="am-title-left-border">{{:MyLang('user.order_nav_title')}}</span>
                    </a>
                    <a href="{{:MyUrl('index/order/index')}}" class="am-fr am-text-grey">
                        <span>{{:MyLang('user.order_nav_angle_title')}}</span>
                        <i class="iconfont icon-angle-right"></i>
                    </a>
                </div>
                {{if !empty($user_order_status)}}
                    <ul class="order-base">
                        {{foreach $user_order_status as $v}}
                            {{if in_array($v['status'], [1,2,3])}}
                                <li>
                                    <a href="{{:MyUrl('index/order/index', [$form_search_order_status_form_key=>$v['status']])}}">
                                        {{switch $v.status}}
                                            {{case 1}}
                                                <i class="iconfont icon-wait-payment"></i>
                                            {{/case}}
                                            {{case 2}}
                                                <i class="iconfont icon-wait-delivery"></i>
                                            {{/case}}
                                            {{case 3}}
                                                <i class="iconfont icon-wait-receive-delivery"></i>
                                            {{/case}}
                                        {{/switch}}
                                        <i class="icon-{{$v.status}}"></i>
                                        <p>{{$v.name}}</p>
                                        {{if !empty($v.count)}}
                                            <span class="am-badge am-badge-danger am-round">{{$v.count}}</span>
                                        {{/if}}
                                    </a>
                                </li>
                            {{elseif in_array($v['status'], [100]) /}}
                                <li>
                                    <a href="{{:MyUrl('index/order/index', [$form_search_order_status_form_key=>4, $form_search_order_user_is_comments_form_key=>0])}}">
                                        <i class="iconfont icon-wait-comment"></i>
                                        <p>{{$v.name}}</p>
                                        {{if !empty($v.count)}}
                                            <span class="am-badge am-badge-danger am-round">{{$v.count}}</span>
                                        {{/if}}
                                    </a>
                                </li>
                            {{elseif in_array($v['status'], [101]) /}}
                                <li>
                                    <a href="{{:MyUrl('index/orderaftersale/index')}}">
                                        <i class="iconfont icon-refund-aftersales"></i>
                                        <p>{{$v.name}}</p>
                                        {{if !empty($v.count)}}
                                            <span class="am-badge am-badge-danger am-round">{{$v.count}}</span>
                                        {{/if}}
                                    </a>
                                </li>
                            {{/if}}
                        {{/foreach}}
                    </ul>
                {{/if}}

                <!-- 聚合内容顶部钩子 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                    <div class="plugins-tag">
                        <span>plugins_view_user_various_top</span>
                    </div>
                {{/if}}
                {{if !empty($plugins_view_user_various_top_data) and is_array($plugins_view_user_various_top_data)}}
                    {{foreach $plugins_view_user_various_top_data as $hook}}
                        {{if is_string($hook) or is_int($hook)}}
                            {{$hook|raw}}
                        {{/if}}
                    {{/foreach}}
                {{/if}}

                <!-- 聚合内容 -->
                <div class="am-g various">
                    <!-- 聚合内容里面顶部钩子 -->
                    {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                        <div class="plugins-tag">
                            <span>plugins_view_user_various_inside_top</span>
                        </div>
                    {{/if}}
                    {{if !empty($plugins_view_user_various_inside_top_data) and is_array($plugins_view_user_various_inside_top_data)}}
                        {{foreach $plugins_view_user_various_inside_top_data as $hook}}
                            {{if is_string($hook) or is_int($hook)}}
                                {{$hook|raw}}
                            {{/if}}
                        {{/foreach}}
                    {{/if}}

                    <!-- 进行中的订单 -->
                    <div class="am-u-md-8">
                        <div class="am-panel am-panel-default am-radius am-nbfc">
                            <div class="am-panel-hd">
                                <span class="am-title-left-border">{{:MyLang('user.various_transaction_title')}}</span>
                                {{if !empty($order_list)}}
                                    <a class="am-fr am-text-grey" href="{{:MyUrl('index/order/index')}}" target="_blank">
                                        <span>{{:MyLang('more_title')}}</span>
                                        <span class="iconfont icon-angle-right"></span>
                                    </a>
                                {{/if}}
                            </div>
                            <div class="am-panel-bd order-list">
                                {{if !empty($order_list)}}
                                    {{foreach $order_list as $order}}
                                        {{foreach $order.items as $key=>$goods}}
                                            {{if $key eq 0}}
                                                <div class="goods-detail">
                                                    <a href="{{:MyUrl('index/order/detail', ['id'=>$order['id']])}}" target="_blank">
                                                        <img src="{{$goods.images}}" alt="{{$goods.title}}" class="am-img-thumbnail am-radius" />
                                                    </a>
                                                    <div class="goods-base">
                                                        <a href="{{:MyUrl('index/order/detail', ['id'=>$order['id']])}}" target="_blank" class="goods-title am-text-truncate">{{$goods.title}}</a>
                                                        <ul>
                                                            <li>
                                                                <span>{{$order.add_time_time}}</span>
                                                                <span class="line-price">{{$order.currency_data.currency_symbol}}{{$order.price}}</span>
                                                            </li>
                                                            <li>
                                                                <span>{{$order.status_name}}</span>
                                                                <span class="items-count">{{:MyLang('goods_more_total_tips', ['total'=>$order['items_count']])}}</span>
                                                            </li>
                                                        </ul>
                                                    </div>
                                                    {{if in_array($order['status'], [1])}}
                                                        <a class="am-btn am-btn-primary am-btn-xs am-radius am-fr order-submit" href="{{:MyUrl('index/order/detail', ['id'=>$order['id'], 'ids'=>$order['id'], 'is_pay_auto'=>1])}}" target="_blank">{{:MyLang('payment_title')}}</a>
                                                    {{/if}}
                                                    {{if in_array($order['status'], [3])}}
                                                        <button type="button" class="am-btn am-btn-secondary am-btn-xs am-radius am-fr order-submit submit-ajax submit-confirm" data-url="{{:MyUrl('index/order/collect')}}" data-id="{{$order.id}}" data-view="reload" data-msg="{{:MyLang('collect_confirm_tips')}}">{{:MyLang('collect_title')}}</button>
                                                    {{/if}}
                                                    {{if in_array($order['status'], [4]) and $order['user_is_comments'] eq 0}}
                                                        <a href="{{:MyUrl('index/order/comments', ['id'=>$order['id']])}}" target="_blank" class="am-btn am-btn-warning am-btn-xs am-radius am-fr order-submit">{{:MyLang('comment_title')}}</a>
                                                    {{/if}}
                                                </div>
                                            {{/if}}
                                        {{/foreach}}
                                    {{/foreach}}
                                {{/if}}
                                {{if empty($order_list)}}
                                    <div class="table-no">
                                        <i class="am-icon-cube am-icon-lg block"></i>
                                        <p class="tips-name">{{:MyLang('user.order_nav_angle_title')}}</p>
                                        <p class="tips-msg">{{:MyLang('user.various_transaction_tips')}}</p>
                                    </div>
                                {{/if}}
                            </div>
                        </div>
                    </div>

                    <!-- 购物车 -->
                    <div class="am-u-md-4">
                        <div class="am-panel am-panel-default am-radius am-nbfc">
                            <div class="am-panel-hd">
                                <span class="am-title-left-border">{{:MyLang('user.various_cart_title')}}</span>
                                {{if !empty($cart_list)}}
                                    <a class="am-fr am-text-grey" href="{{:MyUrl('index/cart/index')}}" target="_blank">
                                        <span>{{:MyLang('more_title')}}</span>
                                        <span class="iconfont icon-angle-right"></span>
                                    </a>
                                {{/if}}
                            </div>
                            <div class="am-panel-bd cart-list">
                                {{if !empty($cart_list)}}
                                    {{foreach $cart_list as $key=>$goods}}
                                        {{if $key lt 3}}
                                            <div class="goods-detail">
                                                <a href="{{:MyUrl('index/goods/index', ['id'=>$goods['goods_id']])}}" target="_blank">
                                                    <img src="{{$goods.images}}" alt="{{$goods.title}}" class="am-img-thumbnail am-radius" />
                                                </a>
                                                <div class="goods-base">
                                                    <a href="{{:MyUrl('index/goods/index', ['id'=>$goods['goods_id']])}}" target="_blank" class="goods-title am-text-truncate">{{$goods.title}}</a>
                                                    <ul>
                                                        <li>
                                                            <span class="line-price">{{$currency_symbol}}{{$goods.price}}</span>
                                                            <span>x{{$goods.stock}}</span>
                                                        </li>
                                                    </ul>
                                                </div>
                                            </div>
                                        {{/if}}
                                    {{/foreach}}
                                {{/if}}
                                {{if empty($cart_list)}}
                                    <div class="table-no">
                                        <i class="am-icon-opencart am-icon-lg block"></i>
                                        <p class="tips-name">{{:MyLang('user.various_cart_empty_title')}}</p>
                                        <p class="tips-msg">{{:MyLang('user.various_cart_tips')}}</p>
                                    </div>
                                {{/if}}
                            </div>
                        </div>
                    </div>

                    <!-- 收藏商品 -->
                    <div class="am-u-md-8">
                        <div class="am-panel am-panel-default am-radius am-nbfc">
                            <div class="am-panel-hd">
                                <span class="am-title-left-border">{{:MyLang('user.various_favor_title')}}</span>
                                {{if !empty($goods_favor_list)}}
                                    <a class="am-fr am-text-grey" href="{{:MyUrl('index/usergoodsfavor/index')}}" target="_blank">
                                        <span>{{:MyLang('more_title')}}</span>
                                        <span class="iconfont icon-angle-right"></span>
                                    </a>
                                {{/if}}
                            </div>
                            <div class="am-panel-bd goods-favor-list">
                                {{if !empty($goods_favor_list)}}
                                    <ul data-am-widget="gallery" class="am-gallery am-avg-sm-2 am-avg-md-4 am-gallery-overlay" data-am-gallery="{}">
                                        {{foreach $goods_favor_list as $goods}}
                                            <li>
                                                <div class="am-gallery-item">
                                                    <a href="{{:MyUrl('index/goods/index', ['id'=>$goods['goods_id']])}}" target="_blank">
                                                        <img src="{{$goods.images}}" alt="{{$goods.title}}" class="am-img-thumbnail am-radius am-padding-0" />
                                                        <h3 class="am-gallery-title">{{$goods.title}}</h3>
                                                        <div class="am-gallery-desc line-price">{{$currency_symbol}}{{$goods.min_price}}</div>
                                                    </a>
                                                </div>
                                            </li>
                                        {{/foreach}}
                                    </ul>
                                {{/if}}
                                {{if empty($goods_favor_list)}}
                                    <div class="table-no">
                                        <i class="am-icon-heart-o am-icon-lg block"></i>
                                        <p class="tips-name">{{:MyLang('user.various_favor_empty_title')}}</p>
                                        <p class="tips-msg">{{:MyLang('user.various_favor_tips')}}</p>
                                    </div>
                                {{/if}}
                            </div>
                        </div>
                    </div>

                    <!-- 浏览足迹 -->
                    <div class="am-u-md-4">
                        <div class="am-panel am-panel-default am-radius am-nbfc">
                            <div class="am-panel-hd">
                                <span class="am-title-left-border">{{:MyLang('user.various_browse_title')}}</span>
                                {{if !empty($goods_browse_list)}}
                                    <a class="am-fr am-text-grey" href="{{:MyUrl('index/usergoodsbrowse/index')}}" target="_blank">
                                        <span>{{:MyLang('more_title')}}</span>
                                        <span class="iconfont icon-angle-right"></span>
                                    </a>
                                {{/if}}
                            </div>
                            <div class="am-panel-bd goods-browse-list">
                                {{if !empty($goods_browse_list)}}
                                    <ul data-am-widget="gallery" class="am-gallery am-avg-sm-3 am-avg-md-3 am-avg-lg-3 am-gallery-default data-am-gallery="{}">
                                        {{foreach $goods_browse_list as $goods}}
                                            <li>
                                                <div class="am-gallery-item">
                                                    <a href="{{:MyUrl('index/goods/index', ['id'=>$goods['goods_id']])}}" target="_blank">
                                                        <img src="{{$goods.images}}" alt="{{$goods.title}}" class="am-img-thumbnail am-circle" />
                                                        <h3 class="am-gallery-title">{{$goods.title}}</h3>
                                                    </a>
                                                    <div class="am-gallery-desc line-price">{{$currency_symbol}}{{$goods.min_price}}</div>
                                                </div>
                                            </li>
                                        {{/foreach}}
                                    </ul>
                                {{/if}}
                                {{if empty($goods_browse_list)}}
                                    <div class="table-no">
                                        <i class="am-icon-lastfm am-icon-lg block"></i>
                                        <p class="tips-name">{{:MyLang('user.various_browse_empty_title')}}</p>
                                        <p class="tips-msg">{{:MyLang('user.various_browse_tips')}}</p>
                                    </div>
                                {{/if}}
                            </div>
                        </div>
                    </div>

                    <!-- 聚合内容里面底部钩子 -->
                    {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                        <div class="plugins-tag">
                            <span>plugins_view_user_various_inside_bottom</span>
                        </div>
                    {{/if}}
                    {{if !empty($plugins_view_user_various_inside_bottom_data) and is_array($plugins_view_user_various_inside_bottom_data)}}
                        {{foreach $plugins_view_user_various_inside_bottom_data as $hook}}
                            {{if is_string($hook) or is_int($hook)}}
                                {{$hook|raw}}
                            {{/if}}
                        {{/foreach}}
                    {{/if}}
                </div>

                <!-- 聚合内容底部钩子 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                    <div class="plugins-tag">
                        <span>plugins_view_user_various_bottom</span>
                    </div>
                {{/if}}
                {{if !empty($plugins_view_user_various_bottom_data) and is_array($plugins_view_user_various_bottom_data)}}
                    {{foreach $plugins_view_user_various_bottom_data as $hook}}
                        {{if is_string($hook) or is_int($hook)}}
                            {{$hook|raw}}
                        {{/if}}
                    {{/foreach}}
                {{/if}}
            </div>
        </div>
    </div>
    <!-- content end -->
</div>

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