<!-- 继承公共的 form -->
{{extend name="public/module/detail" /}}

<!-- 重写数据模块 -->
{{block name="detail_data"}}
    <!-- 父级内容 -->
    {__block__}

    <!-- 订单商品 -->
    <div class="am-panel am-panel-default">
        <div class="am-panel-hd">订单商品</div>
        <div class="am-panel-bd">
            {{if !empty($data['items'])}}
                {{:ModuleInclude('order/module/goods', $data)}}
            {{else /}}
                {{include file="public/not_data" /}}
            {{/if}}
        </div>
    </div>

    <!-- 销售订单 - 收货地址 -->
    {{if $data['order_model'] eq 0}}
        <div class="am-panel am-panel-default">
            <div class="am-panel-hd">收货地址</div>
            <div class="am-panel-bd">
                {{if !empty($data['address_data'])}}
                    <p>
                        <span>收件人：</span>
                        <span>{{$data.address_data.name}}</span>
                    </p>
                    <p>
                        <span>收件电话：</span>
                        <span>{{$data.address_data.tel}}</span>
                    </p>
                    <p>
                        <span>详细地址：</span>
                        <span>{{$data.address_data.province_name}}</span>
                        <span>{{$data.address_data.city_name}}</span>
                        <span>{{$data.address_data.county_name}}</span>
                        <span>{{$data.address_data.address}}</span>
                    </p>
                    {{if !empty($data['address_data']['idcard_name']) or !empty($data['address_data']['idcard_number']) or !empty($data['address_data']['idcard_front']) or !empty($data['address_data']['idcard_back'])}}
                        <div class="am-alert am-alert-secondary">
                            <p class="am-margin-bottom-xs"><strong>身份证信息</strong></p>
                            <hr data-am-widget="divider" style="" class="am-divider am-divider-dashed am-margin-vertical-0" />
                            <div class="am-margin-top-xs">
                                <p>姓名：{{$data.address_data.idcard_name}}</p>
                                <p>号码：{{$data.address_data.idcard_number}}</p>
                                {{if !empty($data['address_data']['idcard_front']) or !empty($module_data['address_data']['idcard_back'])}}
                                    <p class="am-nbfc"><span class="am-fl">照片：</span>{{if !empty($data['address_data']['idcard_front'])}}<a href="{{$data.address_data.idcard_front}}" target="_blank" class="am-fl"><img width="100" height="68" src="{{$data.address_data.idcard_front}}" alt="身份证人像面" class="am-img-thumbnail am-radius am-block" /></a>{{/if}} {{if !empty($data['address_data']['idcard_back'])}}<a href="{{$data.address_data.idcard_back}}" target="_blank" class="am-fl am-margin-left-xs"><img width="100" height="68" src="{{$data.address_data.idcard_back}}" alt="身份证人像面" class="am-img-thumbnail am-radius am-block" /></a>{{/if}}</p>
                                {{/if}}
                            </div>
                        </div>
                    {{/if}}
                    {{if !empty($data['address_data']['lng']) and !empty($data['address_data']['lat']) and $data['address_data']['lng'] neq 0 and $data['address_data']['lat'] neq 0}}
                        <div class="am-margin-top-xs">
                            <button type="button" class="am-btn am-btn-success am-btn-xs am-radius am-icon-map-marker am-padding-xs submit-map-popup" data-lng="{{$data.address_data.lng}}" data-lat="{{$data.address_data.lat}}"> 查看位置</button>
                        </div>
                    {{/if}}
                {{else /}}
                    {{include file="public/not_data" /}}
                {{/if}}
            </div>
        </div>
    {{/if}}

    <!-- 自提订单 - 取货信息 -->
    {{if $data['order_model'] eq 2}}
        <div class="am-panel am-panel-default">
            <div class="am-panel-hd">取货信息</div>
            <div class="am-panel-bd">
                {{if !empty($data['address_data'])}}
                    <!-- 取货地址 -->
                    <div class="am-alert am-alert-warning">
                        <p>
                            <span>联系信息：</span>
                            <span>{{$data.address_data.name}}</span>
                            <span> / </span>
                            <span>{{$data.address_data.tel}}</span>
                        </p>
                        <p>
                            <span>详细地址：</span>
                            <span>{{$data.address_data.province_name}}</span>
                            <span>{{$data.address_data.city_name}}</span>
                            <span>{{$data.address_data.county_name}}</span>
                            <span>{{$data.address_data.address}}</span>
                        </p>
                        {{if !empty($data['address_data']['lng']) and !empty($data['address_data']['lat']) and $data['address_data']['lng'] neq 0 and $data['address_data']['lat'] neq 0}}
                            <div class="am-margin-top-xs">
                                <button type="button" class="am-btn am-btn-success am-btn-xs am-radius am-icon-map-marker am-padding-xs submit-map-popup" data-lng="{{$data.address_data.lng}}" data-lat="{{$data.address_data.lat}}"> 查看位置</button>
                            </div>
                        {{/if}}
                    </div>
                    <!-- 取货码 -->
                    {{:ModuleInclude('order/module/take', $data)}}
                {{else /}}
                    {{include file="public/not_data" /}}
                {{/if}}
            </div>
        </div>
    {{/if}}

    <!-- 虚拟订单 - 密钥信息 -->
    {{if $data['order_model'] eq 3}}
        <div class="am-panel am-panel-default">
            <div class="am-panel-hd">密钥信息</div>
            <div class="am-panel-bd">
                {{if !empty($data['items'])}}
                    <ul class="am-list am-margin-bottom-0 fictitious-container">
                        {{foreach $data.items as $goods}}
                            <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">
                                <div class="am-u-sm-2 am-list-thumb">
                                    <img src="{{$goods.images}}" alt="{{$goods.title}}" class="am-img-thumbnail am-radius" />
                                </div>
                                <div class="am-u-sm-10 am-list-item-text">
                                    {{if empty($goods['fictitious_goods_value'])}}
                                        <span>未配置数据</span>
                                    {{else /}}
                                        {{$goods.fictitious_goods_value|raw}}
                                    {{/if}}
                                </div>
                            </li>
                        {{/foreach}}
                    </ul>
                {{else /}}
                    {{include file="public/not_data" /}}
                {{/if}}
            </div>
        </div>
    {{/if}}
{{/block}}