<hi:Common_WapHeader runat="server" />
<div class="pbox">
    <asp:hyperlink id="productLink" runat="server">
      
            <div class="well goods-box">
                <img runat="server" id="productImage" />
                <div class="info">
                    <div class="name font-xl"> <asp:literal runat="server" id="litProdcutName" /></div>
                    <div class="intro font-m text-muted"><asp:literal runat="server" id="litShortDescription" /></div>
                    <div class="price text-danger">
                        ¥<asp:literal runat="server" id="litSalePrice" />
                        <span class="sales font-s text-muted">已售<asp:literal runat="server" id="litSoldCount" />件</span>
                    </div>
                </div>
            </div>
        </asp:hyperlink>
    <textarea id="review" class="form-control" rows="3" placeholder="请填写您对该商品的评价"></textarea>
    <button type="button" onclick="Submit()" class="btn btn-warning btn-block">
        提交评价</button>
    <div id="reviews">
        <hr />
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">
                    全部评价</h3>
            </div>
            <div class="panel-body" id="reviewsList">
                <hi:WapTemplatedRepeater id="rptProducts" templatefile="/Tags/skin-Common_ProductReview.ascx"
                    runat="server" />
            </div>
        </div>
        <div id="pager">
</div>
    </div>
</div>

< clientidmode="Static" value="" runat="server" id="txtTotal" />
<hi:Common_WapFooter runat="server" />
<script src="/Utility/common.js" type="text/javascript"></script>
<script src="/Utility/pager.js" type="text/javascript"></script>
<script type="text/javascript">
    function Submit() {
        var reviewText = $("#review").val();
        if (!$.trim(reviewText)) {
            alert_h('请输入评论内容!');
        }
        else {
            var id = getParam("ProductId");
            var skuId = getParam("SkuId");
            var data = {};
            data.ProductId = id;
            data.OrderId = getParam("OrderId");
            data.ReviewText = reviewText;
            data.SkuId = skuId;
            $.post("/api/VshopProcess.ashx?action=AddProductReview", data, function (json) {
                if (json.success === true) {
                    alert_h("提交成功", function () {
                        location.reload();
                    });
                   
                }
                else {
                    alert_h(json.msg);
                }
            });
           

         
        }
    }

    $(function () {
        if (!$.trim($('#reviewsList').html()))
            $('#reviews').hide();
        vshopPager('pager', $('#txtTotal').val(), 1, 20);
    });

</script>
