{{include file="public/header" /}}

<!-- header top nav -->
{{include file="public/header_top_nav" /}}

<!-- search -->
{{include file="public/nav_search" /}}

<!-- header nav -->
{{include file="public/header_nav" /}}

<!-- goods category -->
{{include file="public/goods_category" /}}

<!-- content -->
<div class="am-container user-main">

    <!-- user menu start -->
    {{include file="public/user_menu" /}}
    <!-- user menu end -->

    <!-- content start -->
    <div class="user-content">
        <div class="user-content-body">
            {{if $data['user_is_comments'] eq 0}}
                <form class="am-form form-validation" method="post" action="{{:MyUrl('index/order/commentssave')}}" request-type="ajax-url" request-value="{{$referer_url}}">
                    <!-- 商品列表 -->
                    {{if !empty($data.items)}}
                        <div class="order-goods">
                            <table class="am-table">
                                <thead>
                                    <tr>
                                        <th>商品信息</th>
                                        <th class="am-hide-sm-only">单价</th>
                                        <th>评价内容</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {{foreach $data.items as $goods}}
                                        <tr id="data-list-{{$goods.id}}" data-id="{{$goods.id}}" data-goods-id="{{$goods.goods_id}}">
                                            <td class="base">
                                                <div class="goods-detail">
                                                    <a href="{{$goods.goods_url}}" target="_blank">
                                                        <img src="{{$goods.images}}">
                                                    </a>
                                                    <div class="goods-base">
                                                        <a href="{{$goods.goods_url}}" target="_blank" class="goods-title">{{$goods.title}}</a>
                                                        {{if !empty($goods.attribute)}}
                                                            <ul class="goods-attr">
                                                                {{foreach $goods.attribute as $attr}}
                                                                    <li>{{$attr.attr_type_name}}：{{$attr.attr_name}}</li>
                                                                {{/foreach}}
                                                            </ul>
                                                        {{/if}}
                                                    </div>
                                                </div>
                                                <div class="wap-base am-show-sm-only">
                                                    {{if $goods['original_price'] gt 0}}
                                                        <span class="original-price">￥{{$goods.original_price}}</span>
                                                    {{/if}}
                                                    <strong class="total-price-content">￥{{$goods.price}}</strong>
                                                    <span class="wap-number">x{{$goods.buy_number}}</span>
                                                </div>
                                            </td>
                                            <td class="price am-hide-sm-only">
                                                {{if $goods['original_price'] gt 0}}
                                                    <p class="original-price">￥{{$goods.original_price}}</p>
                                                {{/if}}
                                                <p class="line-price">￥{{$goods.price}} x {{$goods.buy_number}}</p>
                                            </td>
                                            <td>
                                                <div class="am-form-group rating-items">
                                                    <ul class="rating">
                                                        <li><i class="am-icon-star-o am-icon-md"></i></li>
                                                        <li><i class="am-icon-star-o am-icon-md"></i></li>
                                                        <li><i class="am-icon-star-o am-icon-md"></i></li>
                                                        <li><i class="am-icon-star-o am-icon-md"></i></li>
                                                        <li><i class="am-icon-star-o am-icon-md"></i></li>
                                                    </ul>
                                                    <input type="text" name="rating[]" value="" class="input-rating" data-validation-message="请选择评分" required />
                                                </div>
                                                <div class="am-form-group">
                                                    <textarea name="content[]" class="am-radius" rows="4" minlength="6" maxlength="200" data-validation-message="评价内容 6~200 个字符之间" required></textarea>
                                                </div>
                                                <input type="hidden" name="goods_id[]" value="{{$goods.goods_id}}" />
                                            </td>
                                        </tr>
                                    {{/foreach}}
                                </tbody>
                            </table>
                        </div>
                    {{/if}}
                    <div class="am-form-group">
                        <input type="hidden" name="id" value="{{$data.id}}" />
                        <button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm" data-am-loading="{loadingText:'处理中...'}">提交</button>
                    </div>
                </form>
            {{else /}}
                <div class="table-no"><i class="am-icon-warning"></i> 你已进行过评价</div>
            {{/if}}
        </div>
    </div>
    <!-- content end -->
</div>

<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->