<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <input type="hidden" name="updatetime" value="{$row.updatetime}" />

    <ul class="list-group">
        <li class="list-group-item">
            订单金额：￥{$row.order_price}
        </li>
        <li class="list-group-item">
            实付金额：￥{$row.total_price}元 (包含:<!--优惠￥{$row.discount_price}，-->物流费用￥{$row.delivery_price})
        </li>
        {if $row.had_refund}
        <li class="list-group-item">
            退款时间：{:date('Y-m-d H:i:s', $row.had_refund)}
        </li>
        <li class="list-group-item">
            已退款：{:__('Yes')}
        </li>
        {else/}
        <li class="list-group-item">
            已退款：{:__('No')}
        </li>
        {/if}
        <!--{if $refund.service_type > 0}
        <li class="list-group-item">
            客户退货物流单号：{$refund.express_number}
        </li>
        {/if}-->
    </ul>

    <style>
        .media {
            border-bottom: 1px solid #f1f1f1;
        }

        .media-left img {
            width: 100px;
            height: 100px;
        }

        .total-price {
            color: #ff5f17;
        }
    </style>
    {foreach $product as $key => $item}
    <div class="media">
        <div class="media-left media-middle">
            <a href="#">
                <img class="media-object" src="{$config.upload.cdnurl . $item.image}" alt="...">
            </a>
        </div>
        <div class="media-body">
            <div>商品ID:{$item.product_id}</div>
            <h4 class="media-heading">{$item.title}</h4>
            <div>规格：{$item.spec}</div>
            <div>{$item.number} ✖ {$item.price}</div>
            <div class="total-price">总共：{$item.price * $item.number} 元</div>
        </div>
        <div class="media-body">
            <h4 class="media-heading"><!--{$item.choose == 1?'参与售后':'不参与售后'}--></h4>
        </div>
    </div>
    {/foreach}

    <ul class="list-group" style="margin-top: 20px; margin-bottom: 50px">
        <!--<li class="list-group-item">
            货物状态：{$refund.receiving_status_text[$refund.receiving_status]}
        </li>
        <li class="list-group-item">
            服务类型：{$refund.service_type_text[$refund.service_type]}
        </li>-->

        <li class="list-group-item">
            换货原因：{$refund.reason_type}
        </li>
        <li class="list-group-item">
            退货说明：{$refund.refund_explain}
        </li>
        <li class="list-group-item">
            退货图片：
            <div class="form-group">
                <div class="col-xs-12 col-sm-8">
                    <ul class="row list-inline faupload-preview" data-listidx="0">


            <?php
            if(!empty($refund['images']))
            {
                $images = explode(',',$refund['images']);
                if(!empty($images)){
                    foreach($images as $key => $val){
            ?>
                        <li class="col-xs-3">
                            <a href="{$val}" data-url="{$val}" target="_blank" class="thumbnail">
                                <img src="{$val}" style="width:100px;" onerror="this.src='/admin.php/ajax/icon?suffix=jpg';this.onerror=null;" class="img-responsive">
                            </a>
                        </li>
            <?php
                    }
                }
            }
            ?>
                    </ul>
                </div>
            </div>
        </li>
    </ul>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">退款金额:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-remark" class="form-control" name="refund_amount" type="text" value="{$refund.amount}">
            <font color="red">选择【同意】后：如果是余额支付，将退款到余额；如果是在线支付的，将原路退回。选择【同意】或【拒绝】之后即退款结束，无法再次退款</font>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Refund status')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                {foreach name="refundStatusList" item="vo"}
                {if $key > 0}
                <label for="row[refund_status]-{$key}"><input id="row[refund_status]-{$key}" name="refund_status" type="radio" value="{$key}" {in name="key" value="$row.refund_status"}checked{/in} /> {$vo}</label>
                {/if}
                {/foreach}
            </div>

        </div>
    </div>

    <?php if($row['refund_status'] != 3 && $row['refund_status'] != 4){ ?>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
    <?php } ?>


</form>

