<%@ page title="" language="C#" masterpagefile="~/Member/MyShopMasterPage.master" autoeventwireup="true" inherits="Member_Credit, WebApp_deploy" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <link href="CSS/user.css" rel="stylesheet" type="text/css" />
    <script src="../Skin/Index/js/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function ChangeRadio(obj) {
            var getRadio1 = document.getElementById('<%=RadioOk.ClientID %>');
            var getRadio2 = document.getElementById('<%=Radionormal.ClientID %>');
            var getRadio3 = document.getElementById('<%=Radiobad.ClientID %>');
            var getPrompt = document.getElementById('Prompt');
            var getCommentBox = document.getElementById('<%=txtCommentBox.ClientID %>');
            getCommentBox.style.color = "#CCCCCC";
            if (obj == "Ok") {
                getRadio2.checked = false;
                getRadio3.checked = false;
                getPrompt.style.backgroundColor = "#FF9900";
                getPrompt.style.color = "#FFFFFF";
                getPrompt.innerHTML = "+1分";

                getCommentBox.value = "写点评价吧！你评价对对方有很大的帮助哦";
            }
            else if (obj == "normal") {
                getRadio1.checked = false;
                getRadio3.checked = false;
                getPrompt.style.backgroundColor = "#FFCC00";
                getPrompt.style.color = "#FFFFFF";
                getPrompt.innerHTML = "不加分";
                getCommentBox.value = "咳咳！你给对方中评，需要说明理由哦";
            }
            else {
                getRadio1.checked = false;
                getRadio2.checked = false;
                getPrompt.style.backgroundColor = "#CCCCCC";
                getPrompt.style.color = "#FFFFFF";
                getPrompt.innerHTML = "-1分";
                getCommentBox.value = "咳咳！你给对方差评，需要说明理由哦";
            }
        }

        function ClearCommentBox() {
            var getCommentBox = document.getElementById('<%=txtCommentBox.ClientID %>');
            getCommentBox.style.color = "#000000";
            if (getCommentBox.value == "写点评价吧！你评价对对方有很大的帮助哦" || getCommentBox.value == "咳咳！你给对方中评，需要说明理由哦" || getCommentBox.value == "咳咳！你给对方差评，需要说明理由哦") {
                getCommentBox.value = "";
            }
        }
        function try_video_fun() {
            $("#videocomment").attr("src", $("#try_video").text());
        }
        $(function () {
            $('#<%=txtCommentVideo.ClientID %>').change(function () {
                var flashaddr = $('#<%=txtCommentVideo.ClientID %>').val();
                if (flashaddr != "") $("#videocomment").attr("src", flashaddr);
                else $("#videocomment").attr("src", "/js/flashplayer.swf");
            });
            $('#<%=txtCommentVideo.ClientID %>').trigger("change");
            $('#<%=RBLCommentType.ClientID %>').change(function () {
                showHideDiv();
            });
            showHideDiv();
        })
        function showHideDiv() {
            var checkval = $(":checked", $('#<%=RBLCommentType.ClientID %>')).val();
            if (checkval == 'txt') {
                $("#txt_dd").show(); $("#picture_dd,#video_dd").hide();
            }
            else if (checkval == 'picture') {
                $("#picture_dd").show(); $("#txt_dd,#video_dd").hide();
                //修改
                var actioninfo1 = "<%=actioninfo %>";
                if (actioninfo1 == "editinfo") {
                    var showPicture = document.getElementById("showPic");
                    var hfCommentPicture = $('#<%=hfCommentPicture.ClientID %>').val();
                    if (hfCommentPicture.length > 0) {
                        $("#showPic").show();
                        showPicture.innerHTML = "原来的图片预览<br />" +
                "<img id=\"imgCommentPicture1\" style=\"width: 480px; height: 400px\" src=\"/UpLoadFile/CommentPicture/" + hfCommentPicture + "\" />";

                    }
                }
            }
            else if (checkval == 'video') {
                $("#video_dd").show(); $("#txt_dd,#picture_dd").hide();
            }
        }
    </script>
    <style type="text/css">
        .shopinfo th
        {
            text-align: center;
            width: 70px;
        }
        body
        {
            font-family: Arial,Helvetica, "宋体";
            font-size: 12px;
        }
        
        .shopinfo td em
        {
            display: inline-block;
            font-style: normal;
            line-height: 24px;
            padding-right: 4px;
            text-align: right;
            width: 80px;
        }
        .my_evaluate dd label
        {
            color: #999999;
            float: right;
            line-height: 20px;
            width: 300px;
        }
    </style>
    <div id="member_layout">
        <div class="content">
            <div class="particular">
                <div class="particular_wrap">
                    <h2>
                        对商品进行评价</h2>
                    <h3>
                        会员信息
                    </h3>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="shopinfo">
                        <tr>
                            <th rowspan="4">
                                <div class="thumb size60">
                                    <i></i><a>
                                        <img alt="店铺图标" width="80" height="80" src="../Images/nopicture.gif" id="headImg"
                                            runat="server" /></a></div>
                            </th>
                            <td class="width11" style="width: auto;">
                                <em>店铺名称：</em><asp:Literal ID="ltrshop" runat="server"></asp:Literal>
                            </td>
                            <td rowspan="3">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <em>
                                    <asp:Literal ID="ltrBuy" runat="server"></asp:Literal>
                                </em>
                                <asp:Label ID="lbWho" runat="server" Text=""></asp:Label>
                            </td>
                        </tr>
                    </table>
                    <div class="evaluate_obj">
                        <div class="ware_line">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="order-con">
                                <tr>
                                    <th colspan="2" style="text-align: left; text-indent: 90px;">
                                        商品名称
                                    </th>
                                    <th>
                                        数量
                                    </th>
                                    <th>
                                        价格
                                    </th>
                                </tr>
                                <asp:Repeater ID="Repeater1" runat="server">
                                    <ItemTemplate>
                                        <tr>
                                            <td class="width2">
                                                <div class="picture">
                                                    <a href="../ShowProduct.aspx?ProductID=<%#Eval("PID") %>" class="thumb size60" target="_blank">
                                                        <i></i>
                                                        <%--<img alt="" src='<%#Eval("ProductSmallImageUrl") %>'  onerror="this.src='upload/common/default_goods_image.gif_tiny.gif'"
                                                            onload="javascript:DrawImage(this,60,60);" />--%>
                                                        <img alt="" src='<%# (Convert.ToString(Eval("ProductSmallImageUrl"))==""?"../Images/show_nopic.gif":"../"+Eval("ProductSmallImageUrl").ToString()) %>'
                                                            onload="javascript:DrawImage(this,60,60);" /></a></div>
                                            </td>
                                            <td>
                                                <p>
                                                    <a target="_blank" href="../ShowProduct.aspx?ProductID=<%#Eval("PID") %>">
                                                        <%#Eval("ProName") %></a></p>
                                                <p>
                                                    &nbsp;</p>
                                            </td>
                                            <td class="width13" align="center">
                                                <%#Eval("Quantity")%>
                                            </td>
                                            <td class="width13" align="center">
                                                &yen;<%#Eval("Price")%>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </table>
                        </div>
                        <div class="my_evaluate">
                            <h3>
                                我的评价 <span id="Prompt"></span>
                            </h3>
                            <dl class="fill_in">
                                <dt><span>
                                    <label for="g11_op1">
                                        <asp:RadioButton ID="RadioOk" runat="server" onclick="ChangeRadio('Ok')" />
                                        <strong style="color: red;">好评</strong><img alt="" src="../Images/CreditImage/rate-ok.gif" /></label>
                                </span><span>
                                    <label for="g11_op2">
                                        <asp:RadioButton ID="Radionormal" runat="server" onclick="ChangeRadio('normal')" />
                                        <strong style="color: green;">中评</strong><img alt="" src="../Images/CreditImage/rate-normal.gif" /></label>
                                </span><span>
                                    <label for="g11_op3">
                                        <asp:RadioButton ID="Radiobad" runat="server" onclick="ChangeRadio('bad')" />
                                        <strong style="color: #555;">差评</strong><img alt="" src="../Images/CreditImage/rate-bad.gif" /></label>
                                </span><span style="margin-left: 120px;">
                                    <asp:CheckBox ID="CheckNotName" runat="server" /><em>匿名评价</em></span></dt>
                                <dt>
                                    <asp:RadioButtonList ID="RBLCommentType" runat="server" RepeatDirection="Horizontal"
                                        ToolTip="选择评论类型">
                                        <asp:ListItem Text="文字评论" Value="txt" Selected="True"></asp:ListItem>
                                        <asp:ListItem Text="图片评论" Value="picture"></asp:ListItem>
                                        <asp:ListItem Text="视频评论" Value="video"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </dt>
                                <dd id="txt_dd" class="textarea">
                                    <asp:TextBox ID="txtCommentBox" runat="server" Height="100px" Width=" 500px" TextMode="MultiLine"
                                        onclick="ClearCommentBox()">
                                    </asp:TextBox>
                                    <label style="float: left; width: auto;">
                                        评价信息最多填写150字，请您根据本次交易，给予真实、客观地评价。<br />
                                        您的评价将是其他会员的参考，也将影响卖家的信用。</label>
                                </dd>
                                <dd id="picture_dd" class="textarea" style="display: none;">
                                    <asp:FileUpload ID="FileUpload1" runat="server" /><br />
                                    <asp:HiddenField ID="hfCommentPicture" runat="server" Value="" />
                                    <div id="showPic" style="display: none">
                                    </div>
                                    <asp:TextBox ID="txtCommentPicture" runat="server" Height="100px" Width=" 500px"
                                        TextMode="MultiLine" onclick="ClearCommentBox()">
                                    </asp:TextBox><br />
                                    <label style="float: left; width: auto;">
                                        请选择宽480px、长400px以内图片，文字不多于150字<br />
                                        您的评价将是其他会员的参考，也将影响卖家的信用。</label>
                                </dd>
                                <dd id="video_dd" style="display: none; position: relative;">
                                    视频地址：<asp:TextBox ID="txtCommentVideo" runat="server" Height="20px" Width=" 500px">
                                    </asp:TextBox>
                                    <br />
                                    视频预览：<br />
                                    <div>
                                        <embed id="videocomment" src="" quality="high" width="480" height="400" align="middle"
                                            allowscriptaccess="always" allowfullscreen="true" mode="transparent" type="application/x-shockwave-flash"></embed>
                                    </div>
                                    <label style="float: left; width: auto;">
                                        视频地址如：<span id="try_video">http://player.youku.com/player.php/sid/XMzczNTY1OTky/v.swf</span>
                                        <span style="cursor: pointer; background-color: #FF9900" onclick="try_video_fun();">
                                            试看</span>
                                        <br />
                                        如果视频地址能播放，会自动加载预览</label>
                                </dd>
                                <dd>
                                    &nbsp;
                                </dd>
                            </dl>
                        </div>
                    </div>
                    <div class="evaluate_footer">
                        <asp:Button ID="butOK" runat="server" Text="确认评价" OnClick="butOK_Click" CssClass="btn1" />
                    </div>
                </div>
            </div>
            <div class="clear">
            </div>
            <div class="clear">
            </div>
        </div>
    </div>
    <asp:HiddenField ID="HiProductName" runat="server" Value="" />
    <asp:PlaceHolder ID="PlaceHolder1" runat="server">
        <table class="SearchTableStyle">
            <tr>
                <td>
                </td>
            </tr>
        </table>
    </asp:PlaceHolder>
</asp:Content>
