<%@ page language="C#" autoeventwireup="true" inherits="Web_EditProduct, mallz" viewstateencryptionmode="Never" enableviewstatemac="false" validaterequest="false" enableEventValidation="false" %>
<html xmlns="http://www.w3.org/1999/xhtml" runat="server" visible="false">
<head>
    <title></title>
</head>
<body>
    <!-- 对应模板中的 {form1/} 标签 开始-->
    <form id="form1" runat="server">
        <script type="text/javascript" language="javascript" src="/Js/ShopSaleProduct.js"></script>
        <script type="text/javascript" language="javascript" src="/Js/SaleProduct.js"></script>
        <script type="text/javascript" language="javascript" src="/Js/getdate.js" ></script>

        <div id="ShopSaleContent" style="font-size: 12px;">
            <table class="SellProductTable">
                <tr>
                    <td class="HeadLeft">
                        <img src="Images/pen.gif" width="44" height="27" align="absmiddle" />
                        <span class="priceText" style="color: #999999">1</span> <a title="隐藏" id="aaa1" class="HidenmeStyle" onclick="Hidden('1')">商品信息</a></td>
                    <td class="HeadRight">
                        &nbsp;</td>
                </tr>
            </table>
            <table class="SellProductDetail" id="table1">
                <tr>
                    <th>
                        <span style="color: Red;">*</span>类 型：</th>
                    <td colspan="2">
                        <asp:RadioButtonList ID="RadioButtonList_ProductType" Enabled="false" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Text="一口价" Value="1" Selected="True" />
                            <asp:ListItem Text="拍卖" Value="2" />
                            <asp:ListItem Text="团购" Value="3" />
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red;">*</span>类 目：</th>
                    <td colspan="2">
                        <asp:DropDownList ID="ClassID" runat="server" DataTextField="ClassName" DataValueField="ClassID" DataSourceID="ObjectDataSource1" />
                        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="MallZ.Data.Shop_Class" SelectMethod="GetAllClassNameFillDropDown"></asp:ObjectDataSource>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red;">*</span>商品名称：</th>
                    <td colspan="2">
                        <asp:TextBox MaxLength="100" ID="ProductName" runat="server" Width="350px" />
                    </td>
                </tr>
                <tr>
                    <th>
                        关 键 字：</th>
                    <td colspan="2">
                        <asp:TextBox ID="KeyWord" runat="server" Width="250px" />
                    </td>
                </tr>
                <tr>
                    <th>
                        上传图片：</th>
                    <td bgcolor="#F9F9F9" valign="top">
                        <asp:TextBox runat="server" ID="ImgPath" Width="500" /><br />
                        <asp:FileUpload ID="FileUpload1" runat="server" Width="300" /><br />
                        图片限定在 <%=Convert.ToInt32(config["UploadPicmaxSize"])/1024%> KB 内，格式为：(<%=config["UploadType"].ToString()%>)，请确保图片在浏览器中可以正常打开。<br/>一张好图胜千言，建议最低像素<%= config["SamllPic_DefaultWidth"] + "×" + config["SamllPic_DefaultHieght"]%>，推荐象素<%= config["MidPic_DefaultWidth"] + "×" + config["MidPic_DefaultHieght"]%>，主体突出。
                    </td>
                    <td bgcolor="#F9F9F9">
                        <div id="previewImage" style="text-align: center; width: 100px; height: 100px; border: solid 1px gray;">
                            <asp:Image ID="ProductImg" runat="server" ImageUrl="/images/nopicture.gif" Height="100px"  Width="100px"/> 
                        </div>
                    </td>
                </tr>
          <tr id="upload_video_tr" runat="server">
                    <th>上传视频：</th>
                    <td colspan="2">
                      <asp:RadioButtonList ID="proudct_video_type" runat="server" RepeatLayout="Flow" onclick="return selectVideoType('')" RepeatDirection="Horizontal">
                          <asp:ListItem Selected="True" Text="输入网络视频地址" Value="url"/>
                          <asp:ListItem Text="上传视频文件" Value="file" />
                      </asp:RadioButtonList>
                       <div id="proudct_video_type_url_div">
                         <asp:TextBox ID="Product_VideoUrl" runat="server" Width="500"/><br />
                         <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="格式不对" Display="Dynamic"  ControlToValidate="Product_VideoUrl" ValidationExpression="http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"></asp:RegularExpressionValidator>格式如：http://www.abc.com/video/product.flv 
                       </div>
                       <div id="proudct_video_type_upload_div" style="display:none;">
                       <asp:FileUpload ID="FileUploadVideo" runat="server"  Width="300px" ToolTip="上传视频文件，flv格式" /><br />
                       </div>
                    </td>
                </tr>
                <tr>
                    <th>
                        商品描述：</th>
                    <td colspan="2">
                        <asp:TextBox ID="ProductDescripe" runat="server" Style="display: none;" />
                        <iframe src="Editor/Editor.aspx?id=ProductDescripe" frameborder="0" scrolling="auto" width="100%" height="250"></iframe>
                    </td>
                </tr>
            </table>
            <table class="SellProductTable">
                <tr>
                    <td class="HeadLeft">
                        <img src="../Images/pen.gif" width="44" height="27" align="absmiddle" />
                        <span class="priceText" style="color: #999999">3</span> <a title="隐藏" id="aaa3" class="HidenmeStyle"
                            onclick="Hidden('3')">交易条件</a></td>
                    <td class="HeadRight">&nbsp;</td>
                </tr>
            </table>
            <table class="SellProductDetail">
                <tr>
                    <th>
                        参 考 价：</th>
                    <td>
                        <asp:TextBox ID="MarketPrice" Text="" runat="server" /></td>
                </tr>
            </table>
            <table id="table3" class="SellProductDetail">
                <tr>
                    <td colspan="2">
                        <table class="SellProductDetail" runat="server" id="display_productType_1">
                            <tr>
                                <th>
                                    <span style="color: Red;">*</span>一 口 价：</th>
                                <td>
                                    <asp:TextBox ID="StandPrice" runat="server" Width="50px" />&nbsp;元
                                    <asp:RegularExpressionValidator ID="revStandPrice" runat="server" ControlToValidate="StandPrice" ValidationExpression="\d+(\.\d\d)?" ErrorMessage="输入金额格式不正确" Display="Dynamic" />
                                    <span style="color: Blue">(只保留小数点2位)</span></td>
                            </tr>
                            <tr valign="middle" id="auctionMemberCard2" style="display:none;">
                                <th>
                                    会员卡打折：</th>
                                <td height="50" bgcolor="#E1E1E1">
                                    <asp:RadioButtonList ID="userMemberCard" runat="server" RepeatDirection="Horizontal">
                                        <asp:ListItem Text="参与会员卡打折" Value="1" />
                                        <asp:ListItem Text="不参与会员卡打折" Value="0" />
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                        </table>
                        <table class="SellProductDetail" runat="server" id="display_productType_2">
                            <tr>
                                <th>
                                    <span style="color: Red;">*</span>起 拍 价：</th>
                                <td>
                                    <asp:TextBox ID="AuctionPrice" runat="server" Width="50px" />&nbsp;元
                                    <asp:RegularExpressionValidator ID="revAuctionPrice" runat="server" ControlToValidate="AuctionPrice" ValidationExpression="\d+(\.\d\d)" ErrorMessage="输入金额格式不正确" Display="Dynamic" />
                                    <span style="color: Blue">(只保留小数点1位)</span></td>
                            </tr>
                            <tr>
                                <th>
                                    <span style="color: Red;">*</span>加价幅度：</th>
                                <td>
                                    <asp:TextBox ID="AuctionAddPrice" runat="server" Width="50px" />&nbsp;元
                                    <asp:RegularExpressionValidator ID="revAuctionAddPrice" runat="server" ControlToValidate="AuctionAddPrice" ValidationExpression="\d+(\.\d\d)?" ErrorMessage="输入金额格式不正确" Display="Dynamic" /></td>
                            </tr>
                        </table>
                        <div id="display_productType_3" runat="server">
                            <table class="SellProductDetail">
                                <tr>
                                    <th>
                                        <span style="color: Red;">*</span>原始价：</th>
                                    <td>
                                        <asp:TextBox ID="OriginallyPrice" runat="server" />
                                        <asp:RegularExpressionValidator ID="revOriginallyPrice" runat="server" ControlToValidate="OriginallyPrice" ValidationExpression="\d+(\.\d\d)?" ErrorMessage="输入金额格式不正确" Display="Dynamic" />
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        价格档次：</th>
                                    <td>
                                    <asp:DropDownList ID="DropTeamNum" runat="server" onchange="return changeTeam('')" /> 档次 &nbsp;&nbsp;<span style="color: Gray;">说明：团购档次从上至下，数量递 <span style="color:Red">增</span>，价格递 <span style="color: Blue;">减</span>。人数越多，价格越低。</span>
                                    </td>
                                </tr>
                                <tr id="team_1">
                                    <th>
                                        档次1：</th>
                                    <td>
                                        <span class="team_name">
                                            <asp:Literal ID="TeamName1" runat="server" /></span> 最低商品数：<asp:TextBox ID="TeamNumber1" Text="0" runat="server" Width="50px" />
                                        <asp:TextBox ID="TeamPrice1" Text="0" runat="server" Width="50px" />&nbsp;元 &nbsp;
                                    </td>
                                </tr>
                                <tr id="team_2" style="display: none">
                                    <th>
                                        档次2：</th>
                                    <td>
                                        <span class="team_name">
                                            <asp:Literal ID="TeamName2" runat="server" /></span> 最低商品数：<asp:TextBox ID="TeamNumber2" Text="0" runat="server" Width="50px" />
                                        <asp:TextBox ID="TeamPrice2" Text="0" runat="server" Width="50px" />&nbsp;元&nbsp;
                                    </td>
                                </tr>
                                <tr id="team_3" style="display: none">
                                    <th>
                                        档次3：</th>
                                    <td>
                                        <span class="team_name">
                                            <asp:Literal ID="TeamName3" runat="server" /></span> 最低商品数：<asp:TextBox Text="0" ID="TeamNumber3" runat="server" Width="50px" />
                                        <asp:TextBox ID="TeamPrice3" Text="0" runat="server" Width="50px" />&nbsp;元&nbsp;
                                    </td>
                                </tr>
                                <tr id="team_4" style="display: none">
                                    <th>
                                        档次4：</th>
                                    <td>
                                        <span class="team_name">
                                            <asp:Literal ID="TeamName4" runat="server" /></span> 最低商品数：<asp:TextBox Text="0" ID="TeamNumber4" runat="server" Width="50px" />
                                        <asp:TextBox ID="TeamPrice4" Text="0" runat="server" Width="50px" />&nbsp;元&nbsp;
                                    </td>
                                </tr>
                                <tr id="team_5" style="display: none">
                                    <th>
                                        档次5：</th>
                                    <td>
                                        <span class="team_name">
                                            <asp:Literal ID="TeamName5" runat="server" /></span> 最低商品数：<asp:TextBox Text="0" ID="TeamNumber5" runat="server" Width="50px" />
                                        <asp:TextBox ID="TeamPrice5" Text="0" runat="server" Width="50px" />&nbsp;元&nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        预付诚意金：</th>
                                    <td>
                                        &nbsp;原始价的<asp:TextBox ID="OrderMoneyPercent" Text="0" MaxLength="5" runat="server" Width="30px" /> %&nbsp;请填写1-100的数字，0表示不需预付诚意金
                                        &nbsp;(若设置预付诚意金为0，则风险由卖家承担)
                                    </td>
                                </tr>
                            </table><script language="javascript" type="text/javascript">changeTeam('ctl00_ContentPlaceHolder1_');</script>
                            <asp:Label ID="TeamCount_Error" runat="server" CssClass="error_text" Width="163px" />
                        </div>
                    </td>
                </tr>
            </table>
            <table class="SellProductTable">
                <tr>
                    <td class="HeadLeft">
                        <img src="../Images/pen.gif" width="44" height="27" align="absmiddle" />
                        <span class="priceText" style="color: #999999">2</span> <a title="隐藏" id="aaa2" class="HidenmeStyle"
                            onclick="Hidden('2')">商品基本信息</a></td>
                    <td class="HeadRight">
                        &nbsp;</td>
                </tr>
            </table>
            <table class="SellProductDetail" id="table2">
                <tr>
                    <th>
                        商品单位：</th>
                    <td>
                        <asp:TextBox ID="TxtPuint" runat="server" Width="40px" Text="件" MaxLength="2" />
                        <select onchange='document.getElementById("TxtPuint").value=this.value' name="selectmsg">
                            <option value="件" selected="selected">件</option>
                            <option value="个">个</option>
                            <option value="台">台</option>
                            <option value="批">批</option>
                            <option value="箱">箱</option>
                            <option value="本">本</option>
                            <option value="双">双</option>
                            <option value="瓶">瓶</option>
                            <option value="">其它</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th>
                        商品数量：</th>
                    <td>
                        <asp:TextBox ID="ProductStock" runat="server" Width="50px" Text="1" />
                        <asp:RequiredFieldValidator ID="rfv3" runat="server" ErrorMessage="请输入商品数量" ControlToValidate="ProductStock"
                            Display="Dynamic" />
                        <asp:RangeValidator ID="rav_2" runat="server" ErrorMessage="输入数量必须为整数" Type="Integer"
                            ControlToValidate="ProductStock" MaximumValue="99999999" MinimumValue="1" Display="Dynamic" />
                    </td>
                </tr>
                <tr>
                    <th>
                        新旧程度：</th>
                    <td>
                        <asp:RadioButtonList ID="NewDegree" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
                            <asp:ListItem Value="0" Text=" 全新" Selected="True" />
                            <asp:ListItem Value="1" Text=" 二手" />
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <th>
                        所 在 地：</th>
                    <td>
                        <MZ:ProvinceCity ID="ProvinceCity" runat="server" />
                    </td>
                </tr>
                <tr>
                    <th>
                        发 票：</th>
                    <td>
                        <asp:CheckBox runat="server" ID="NeedInvoice" Text="有" onclick="javascript:{if(this.checked)document.getElementById('TaxRateTr').style.display='';else document.getElementById('TaxRateTr').style.display='none'}"  />
                    </td>
                </tr>
                <tr id="TaxRateTr" style="display:none;">
                    <th>
                        发票税率：</th>
                    <td>
                        <asp:TextBox ID="TxtTaxRate" runat="server" MaxLength="3" Width="53px" Text="7"/> %
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtTaxRate" ErrorMessage="发票税率不能空" Display="Dynamic" />
                        <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="TxtTaxRate" ErrorMessage="必须为非负数" MaximumValue="100" MinimumValue="0" Type="Integer" Display="Dynamic" /></td>
                </tr>
                <script>if(document.getElementById("NeedInvoice").checked){document.getElementById("TaxRateTr").style.display="";}</script>
                <tr>
                    <th>
                        保 修：</th>
                    <td>
                        <asp:CheckBox runat="server" ID="Guarantee" Text="有" />
                    </td>
                </tr>
            </table>
            <table class="SellProductTable">
                <tr>
                    <td class="HeadLeft">
                        <img src="../Images/pen.gif" width="44" height="27" align="absmiddle" />
                        4 <a title="隐藏" id="aaa6" class="HidenmeStyle" onclick="Hidden('6')">销售设置</a></td>
                    <td class="HeadRight">
                        &nbsp;</td>
                </tr>
            </table>
            <table class="SellProductDetail" style="display: block" id="table6">
                <tr>
                    <th>
                        <span style="color: Red;">*</span>支付方式：</th>
                    <td id="pay_type_obj">
                        <asp:CheckBoxList ID="CheckBoxList_OnlinePayType" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Value="0" Selected="True" Enabled="false">商城帐户支付</asp:ListItem>
                        </asp:CheckBoxList>
                        <asp:label runat="server" text="" id = "paytypeText" style="color:red"/>
                    </td>
                    <td><a href="javascript:void(0)" onclick="OpennewWindow('member/Index.aspx?mainurl=Shop_PaymentType.aspx?GoUrl=/SaleProduct.aspx');" >设置支付方式</a>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red;">*</span>送货方式：</th>
                    <td id="deliver_type_obj">
                        <asp:RadioButtonList ID="Radio_DeliverPayType" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" >
			               <asp:ListItem Text="买家承担运费" Value="1" onclick="javascript:{if(this.checked)document.getElementById('deliver_template').style.display='';}" />
			               <asp:ListItem Text="卖家承担运费" Value="0" Selected="True" onclick="javascript:{if(this.checked)document.getElementById('deliver_template').style.display='none';}" />
			               <asp:ListItem Text="货到买家承担" Value="2" onclick="javascript:{if(this.checked)document.getElementById('deliver_template').style.display='';}" />
			            </asp:RadioButtonList>
			            <div id="deliver_template" style="width:80%; border:solid 1px gray; background:#eeeeee; clear:both; padding:5px; display:none;">
			               选择运费模板：<br />
			               <asp:RadioButtonList ID="CheckBoxList_DeliverType" runat="server"  RepeatLayout="Flow"/>
                           <asp:label runat="server" text="" id="deliverText" style="color:red"/>
			            </div>
                    </td>
                    <td><a href="javascript:void(0)" onclick="OpennewWindow('member/Index.aspx?mainurl=Shop_AddDeliver.aspx?action=add&from=publish');">设置送货方式</a></td>
                </tr>

                <script type="text/javascript">
                function OpennewWindow(url)
                {
                   var win = window.open(url,"mywin", "menubar=no,width=960,height=700,resizeable=yes");
                }
                </script>

                <tr style="display:none;">
                    <th>
                        促销设置：</th>
                    <td>
                        <asp:RadioButtonList ID="PromoteSet" runat="server" RepeatDirection="Horizontal"
                            RepeatLayout="Flow">
                            <asp:ListItem Text="无" Value="-1" Selected="True" />
                            <asp:ListItem Text="会员卡默认优惠" Value="0" />
                            <asp:ListItem Text="自定义优惠" Value="1" />
                        </asp:RadioButtonList></td>
                    <td>
                    </td>
                </tr>
            </table>

            <table class="SellProductTable">
                <tr>
                    <td class="HeadLeft">
                        <img src="../Images/pen.gif" width="44" height="27" align="absmiddle" />
                        5 <a title="隐藏" id="aaa4" class="HidenmeStyle" onclick="Hidden('4')">其它信息</a></td>
                    <td class="HeadRight">
                        &nbsp;</td>
                </tr>
            </table>
            <table class="SellProductDetail" id="table4">
                <tr>
                    <th>
                        有 效 期：</th>
                    <td>
                        <asp:DropDownList ID="ValidDay" runat="server" />&nbsp;天</td>
                </tr>
                <tr>
                    <th>发布选项：</th>
                    <td>
                    <asp:CheckBox ID="isReSend" runat="server" Text="重新发布" onclick="javascript:{if(this.checked)document.getElementById('timesettr').style.display='';else document.getElementById('timesettr').style.display='none'}" />
                    </td>
                </tr>
                <tr id="timesettr" style="display:none;">
                    <th>
                        开始时间：</th>
                    <td>
                        <asp:RadioButtonList ID="ProductPublishTime" onclick="return selectProductPublishTime()"
                            runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Text="立即" Value="1" Selected="True" />
                            <asp:ListItem Text="设定时间" Value="2" />
                            <asp:ListItem Text="放入仓库" Value="0" />
                        </asp:RadioButtonList><br />
                        <div id="PublishStartTr" style="display: none;">
                            <asp:TextBox ID="PublishStartDay" runat="server" Width="100px"  Height="16px" /> 日
                            <asp:DropDownList ID="PublishStartHour" runat="server">
                                <asp:ListItem Text="0" Value="0" />
                                <asp:ListItem Text="1" Value="1" />
                                <asp:ListItem Text="2" Value="2" />
                                <asp:ListItem Text="3" Value="3" />
                                <asp:ListItem Text="4" Value="4" />
                                <asp:ListItem Text="5" Value="5" />
                                <asp:ListItem Text="6" Value="6" />
                                <asp:ListItem Text="7" Value="7" />
                                <asp:ListItem Text="8" Value="8" />
                                <asp:ListItem Text="9" Value="9" />
                                <asp:ListItem Text="10" Value="10" />
                                <asp:ListItem Text="11" Value="11" />
                                <asp:ListItem Text="12" Value="12" />
                                <asp:ListItem Text="13" Value="13" />
                                <asp:ListItem Text="14" Value="14" />
                                <asp:ListItem Text="15" Value="15" />
                                <asp:ListItem Text="16" Value="16" />
                                <asp:ListItem Text="17" Value="17" />
                                <asp:ListItem Text="18" Value="18" />
                                <asp:ListItem Text="19" Value="19" />
                                <asp:ListItem Text="20" Value="20" />
                                <asp:ListItem Text="21" Value="21" />
                                <asp:ListItem Text="22" Value="22" />
                                <asp:ListItem Text="23" Value="23" />
                            </asp:DropDownList> 时
                            <asp:DropDownList ID="PublishStartMin" runat="server">
                                <asp:ListItem Text="0" Value="0" />
                                <asp:ListItem Text="5" Value="5" />
                                <asp:ListItem Text="10" Value="10" />
                                <asp:ListItem Text="15" Value="15" />
                                <asp:ListItem Text="20" Value="20" />
                                <asp:ListItem Text="25" Value="25" />
                                <asp:ListItem Text="30" Value="30" />
                                <asp:ListItem Text="35" Value="35" />
                                <asp:ListItem Text="40" Value="40" />
                                <asp:ListItem Text="45" Value="45" />
                                <asp:ListItem Text="50" Value="50" />
                                <asp:ListItem Text="55" Value="55" />
                            </asp:DropDownList> 分
                        </div>
                    </td>
                </tr>
                <tr>
                    <th>
                        自动重发：</th>
                    <td>
                        <asp:CheckBox ID="AutoPostBack" runat="server" Text="是" Checked="true" /> （系统会帮您自动重发1次，到期未卖出的商品，您可以在仓库里找到并重新发布）
                    </td>
                </tr>
                <tr style="display: none;">
                    <th>
                        显示模板：</th>
                    <td>
                        <asp:DropDownList ID="TemplateID" runat="server" AppendDataBoundItems="True" />
                    </td>
                </tr>
                <tr style="display: none;">
                    <th>
                        显示风格：</th>
                    <td>
                        <asp:DropDownList ID="SkinID" runat="server" AppendDataBoundItems="True" />
                    </td>
                </tr>
                <tr>
                    <th>
                        橱窗推荐：</th>
                    <td>
                        <asp:CheckBox ID="IsShopElite" runat="server" Text="是" />
                    </td>
                </tr>
                <tr>
                    <th>
                        心情故事：</th>
                    <td>
                        <asp:TextBox ID="UserRemark" runat="server" TextMode="MultiLine" Height="131px" Width="70%" />
                    </td>
                </tr>
            </table>
        </div>

<div>
<script type="text/javascript" language="javascript">
selectType('');
selectVideoType('');
selectProductPublishTime('');
setClassName();
</script>
</div>

        <div id="submit_button" align="center">
            <p>
                <asp:Button ID="Button_Submit" runat="server" Text=" 更新商品 " OnClick="Button_Submit_Click" OnClientClick="return CheckSubmit();" />
            </p>
        </div>
        
    </form>
    <!-- 对应模板中的 {form1/} 标签 结束-->
</body>
</html>
