comment.hbs 12.6 KB
<div class="comment-me-page me-page yoho-page clearfix">
    {{> path}}
    {{> navigation}}
    <div class="me-main">
        <div class="comment block">
        <h2 class="title {{#if isFromOrder}}comment-order{{/if}}"></h2>

            {{#with comment}}
                <div class="me-comment">
                    {{#unless ../isFromOrder}}
                        <div class="main-tip">
                            {{#if isComment}}
                                您己对<span id="goodsNum">{{goodsNum}}</span>件商品发表评论,感谢您优质的评论和分享!
                                <select class="right" onchange="javascript:location.href='/home/comment?isComment='+this.value;">
                                    <option value="N">未发表评论的商品</option>
                                    <option value="Y" selected="">己发表评论的商品</option>
                                </select>
                            {{else}}
                                您还有<span id="goodsNum">{{goodsNum}}</span>件商品未发表评论,欢迎您发表原创、与商品质量相关、对其他用户有参考价值的商品评论。
                                <select class="right" onchange="javascript:location.href='/home/comment?isComment='+this.value;">
                                    <option value="N" selected="">未发表评论的商品</option>
                                    <option value="Y">己发表评论的商品</option>
                                </select>
                            {{/if}}
                        </div>
                    {{/unless}}
                    <p class="comment-table-header table-header clearfix">
                        <span class="info">商品信息</span>
                        <span class="type">操作</span>
                    </p>

                    {{#if orders.length }}
                        <table class="comment-table">
                            {{#each orders}}
                                <!--<tr>
                                    <th colspan="4">
                                        订单编号:{{orderNum}}
                                        <span class="right">下单时间:{{orderTime}}</span>
                                    </th>
                                </tr>-->
                                {{#each goods}}
                                    <tr>
                                        <td width="70">
                                            <a href="{{href}}" class="goods-img"><img src="{{image2 thumb}}"></a>
                                        </td>
                                        <td>
                                            <a href="{{href}}" class="name">{{name}}</a>
                                            <div>下单时间:{{orderTime}}</div>
                                        </td>
                                        <td style="width:50%" class="center">
                                            <button class="btn active radius" data-role="showCommentForm">评价商品</button>
                                        </td>
                                    </tr>
                                    <tr data-role="commentAddForm" class="m-hide">
                                        <td colspan="3" class="comment-add">
                                            <div class="arrow"><i></i><em></em></div>
                                            <input type="hidden" name="productSkn" value="{{productSkn}}"  />
                                            <input type="hidden" name="productId" value="{{productId}}" />
                                            <input type="hidden" name="goodsId" value="{{goodsId}}" />
                                            <input type="hidden" name="orderCode" value="{{orderCode}}" />
                                            <input type="hidden" name="orderId" value="{{orderId}}" />
                                            <input type="hidden" name="erpSkuId" value="{{erpSkuId}}" />

                                            <div class="row">
                                                <label class="fl-left"><i class="color-warn require-sign">*</i> 商品满意度:</label>
                                                <span class="comment-star editable"data-role="star">
                                                    <span class="star-5" data-star="5"></span>
                                                    <span class="star-4" data-star="4"></span>
                                                    <span class="star-3" data-star="3"></span>
                                                    <span class="star-2" data-star="2"></span>
                                                    <span class="star-1" data-star="1"></span>
                                                </span>
                                            </div>
                                            <div class="row">
                                                <span class="col btn-group" data-role="size">
                                                    <label><i class="color-warn require-sign">*</i> 尺码符合度:</label>
                                                    <a href="javascript:void(0);" class="btn btn-outline" data-size="SMALL">偏小</a>
                                                    <a href="javascript:void(0);" class="btn btn-outline" data-size="MIDDLE">合身</a>
                                                    <a href="javascript:void(0);" class="btn btn-outline" data-size="BIG">偏大</a>
                                                </span>
                                                <span class="col">
                                                    <label>身高:</label>
                                                     <span class="color-gray">
                                                         <input class="btn btn-outline disabled s-input" name="height" value="" maxlength="3" /> 厘米
                                                     </span>
                                                </span>
                                                <span class="col">
                                                    <label>体重:</label>
                                                    <span class="color-gray">
                                                        <input class="btn btn-outline disabled s-input" name="weight" value="" maxlength="3" /> 公斤
                                                    </span>
                                                </span>
                                            </div>
                                            <div class="row textarea" data-role="goodsCommentWrap">
                                                <label for="goodsComment" class="text-tip">晒单有奖,<i>100有货币</i>等你来拿!</label>
                                                <label for="goodsComment" class="text-tip-limit">限制200字</label>
                                                <textarea name="goodsComment"></textarea>
                                            </div>
                                            <div class="row img-list clearfix">
                                                <div class="img-preview">
                                                    <img src="" />
                                                    <input type="file" name="file" accept="image/*" id="upload-{{../orderId}}-{{goodsId}}" />
                                                    <input type="hidden" name="imgUrl" />
                                                    <i class="view">查看</i>
                                                    <i class="del">删除</i>
                                                </div>
                                                <span class="color-warn"><i class="iconfont">&#xe671;</i> 最多上传1张图片</span>
                                            </div>
                                            <div class="btns">
                                                <a href="javascript:void(0);"
                                                   class="btn btn-submit active radius"
                                                   data-iid="{{orderId}}-{{goodsId}}">提交评价</a>
                                                <span class="color-warn">带*为必填选项</span>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr class="commented-list {{#unless comments}}m-hide{{/unless}}" data-role="commentList" data-lid="{{orderId}}-{{goodsId}}">
                                        <td class="vtop right">购买评价:</td>
                                        <td colspan="2" data-role="clist">
                                            {{#each comments}}
                                                <div class="item">
                                                    <div class="comment-info clearfix color-gray">
                                                        <span class="comment-star fl-left">
                                                            <span class="star-{{satisfied}} active"></span>
                                                        </span>
                                                        <span>{{sizeLabel}}</span>
                                                        {{#if height}}<span>身高:{{height}} 厘米</span>{{/if}}
                                                        {{#if weight}}<span>体重:{{weight}} 公斤</span>{{/if}}
                                                    </div>
                                                    <p>{{content}}</p>
                                                    {{#if url}}
                                                        <div class="clearfix">
                                                            <div class="img-preview selected">
                                                                <img src="{{image2 url}}" source-url="{{image2 sourceUrl}}" />
                                                                <i class="view view-only">查看</i>
                                                            </div>
                                                        </div>
                                                    {{/if}}
                                                    <p class="color-gray">评论时间:{{createTime}}</p>
                                                </div>
                                            {{/each}}
                                        </td>
                                    </tr>
                                {{/each}}
                            {{/each}}
                        </table>
                        {{#with ../pager}}
                            {{> common/foot-pager footPager=this}}
                        {{/with}}
                    {{else}}
                        {{> empty this}}
                    {{/if}}
                </div>
            {{/with}}
        </div>

        <script type="text/x-handlebars" id="comment-list-item-tpl">
            <div class="item">
                <div class="comment-info clearfix color-gray">
                    <span class="comment-star fl-left">
                        <span class="star-\{{satisfied}} active"></span>
                    </span>
                    <span>\{{sizeLabel}}</span>
                    <span>身高:\{{height}} 厘米</span>
                    <span>体重:\{{weight}} 公斤</span>
                </div>
                <p>\{{content}}</p>
                <div class="clearfix">
                    <div class="img-preview selected">
                        <img src="\{{image2 url}}" />
                        <i class="view view-only">查看</i>
                    </div>
                </div>
                <p class="color-gray">评论时间:\{{createTime}}</p>
            </div>
        </script>

        {{> help-us}}
    </div>
    <div id="comment-dialog-widget" class="comment-dialog-widget hide">
        <div class="dialog-titlebar">
            <span class="dialog-close-btn"></span>
        </div>
        <div class="dialog-content">
            <dl>
                <dd>商品评论:</dd>
                <dd>
                    <textarea id="comment-content"></textarea>
                </dd>
            </dl>
        </div>
        <div class="dialog-buttons">
            <button class="dialog-close-btn">取消</button>
            <button class="dialog-save-btn">提交评论</button>
        </div>
    </div>
</div>