<script src="{url:#vendors/raphael-min.js}" type="text/javascript"></script>
<script src="{url:#vendors/jquery.ratemate.js}" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="{url:#css/ucenter.css}" />
<style type="text/css"> meter { display: none; }</style>
<div class="container list blank">
    <div class="row-5">
        <div class="col-1">
            {widget:name=sub_navs action=ucsidebar sidebar=$sidebar act=$actionId}
        </div>
        <div class="col-4">
            <h1 class="title"><span>商品评价：</span></h1>
            <div class="tab">
                <ul class="tab-head">
                    <li>待评价商品<i></i></li>
                    <li>已评价商品<i></i></li>
                </ul>
                <div class="tab-body">
                    <div id="review-n" class="js-template">
                        <table class="table table-list">
                            <tr>
                                <th width="160">订单编号</th>
                                <th>商品名称</th>
                                <th width="140">购买时间</th>
                                <th width="80">评价</th>
                            </tr>
                            <tbody class="page-content">
                                <tr class="{odd-even}">
                                    <td>{order_no}</td>
                                    <td><a href="{url:/index/product/id/}{gid}" target="_blank">{name}</a></td>
                                    <td>{buy_time}</td>
                                    <td><a class="btn btn-main btn-mini" href="{url:/index/review/id/}{id}" target="_blank">评价</a></td>
                                </tr>
                            </tbody>
                        </table>
                        <div class="page-nav"></div>
                    </div>
                    <div id="review-y" class="js-template">
                        <table class="table table-list">
                            <tr>
                                <th width="160">订单编号</th>
                                <th>商品名称</th>
                                <th width="100">评价时间</th>
                                <th width="80">我的评分</th>
                            </tr>
                            <tbody class="page-content">
                                <tr class="{odd-even}">
                                    <td>{order_no}</td>
                                    <td><a href="{url:/index/product/id/}{gid}" target="_blank">{name}</a></td>
                                    <td>{comment_time}</td>
                                    <td><meter max="5" min="0" data-dimensions="[100,30]" value="0" point="{point}"></meter></td>
                                </tr>
                            </tbody>
                        </table>
                        <div class="page-nav"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
	$("#review-n").Paging({
		url:'{url:/ucenter/get_review}',
		params:{status:'n'}
	});
	$("#review-y").Paging({
		url:'{url:/ucenter/get_review}',
		params:{status:'y'},
        callback:start
	});
    function start()
    {
        $('meter').each(function () {
          var rating = $(this);
          var val = parseInt($(this).attr('point')) / 20;
          $(this).val(val);
          dimensions = rating.data('dimensions');
          rating.ratemate({ width: dimensions[0], height: dimensions[1] });
        });
    }
</script>
