<%@ page language="C#" autoeventwireup="true" inherits="VipUser_YX_sell_type, App_Web_md9idv7a" %>

<%@ Register Src="YX_proskin.ascx" TagName="YX_proskin" TagPrefix="uc2" %>

<%@ Register Src="shopclass.ascx" TagName="shopclass" TagPrefix="uc1" %>
<%@ Register Src="Top_vip.ascx" TagName="Top_vip" TagPrefix="uc" %>
<%@ Register Src="Foot_vip.ascx" TagName="Foot_vip" TagPrefix="uc" %>
<%@ REGISTER ASSEMBLY="FredCK.FCKeditorV2" NAMESPACE="FredCK.FCKeditorV2" TAGPREFIX="FCKeditorV2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>商品发布管理-<%= SetUrl() %></title>
     <script>
    function inner()
    {
    if(document.getElementById('CheckBox1').checked==true)
    {
        document.getElementById('num').style.display='';
        document.getElementById('lnum').style.display='';
    }
    else
    {
    document.getElementById('num').style.display='none';
    document.getElementById('lnum').style.display='none';
    }
    }
        function loadpay(id)
    {

var oHttpReq = new ActiveXObject("MSXML2.XMLHTTP"); 
var oDoc = new ActiveXObject("MSXML2.DOMDocument"); 
oHttpReq.open("POST", "RetPinpai.aspx?id="+id, false); 
oHttpReq.send(""); 
result = oHttpReq.responseText; 
oDoc.loadXML(result); 

item3 = oDoc.selectNodes("//PinPai/Table/YX_parentpath"); 

var str=item3[0].text;

forload(str,id)
   document.getElementById('yes').style.display='';
　　      document.getElementById('no').style.display='none';
    }
    
    
    function move1(){
        var m1 = document.getElementById('DropDownList2'); 
        var ilength = m1.options.length
        for(var i = 0; i < ilength; i++){
            m1.remove(0);
        } 
    }
        function move2(){
        var m2 = document.getElementById('Select1'); 
        var ilength2 = m2.options.length
        for(var j = 0; j < ilength2;j++){
            m2.remove(0);
        } 
    }
        function move3(){
        var m3= document.getElementById('Select2'); 
        var ilength4 = m3.options.length
        for(var k= 0; k < ilength4; k++){
            m3.remove(0);
        } 
    }

    function forload(str,id)
    {
        
        var a=str.split(',');
        if(a.length==4){   
         
           load(a[1],"DropDownList2",1);
           load(a[2],"Select1",2);
           load(a[3],"Select2",3);
            forcheck(a[1],0)
             forcheck(a[2],1)
              forcheck(a[3],2)
              forcheck(id,3)
        }else if(a.length==3)
        {
           load(a[1],"DropDownList2",1);
           load(a[2],"Select1",2);
           forcheck(a[1],0)
           forcheck(a[2],1)
           forcheck(id,2)
        }else if(a.length==2)
        {
           load(a[1],"DropDownList2",1);
            forcheck(a[1],0)
             forcheck(id,1)
        }
        
        
    }
    function forcheck(typeid,num){
     var va;
    if(num==0)
    {
     va=document.getElementById('classroot');
     }else if(num==1)
     {
      va=document.getElementById('DropDownList2');
     }else if(num==2)
     {
     va=document.getElementById('Select1');
     }else if(num==3)
     {
      va=document.getElementById('Select2');
     }
     var i=va.length;
    
        for(j=0;j<i;j++)
        {  
      
            if(va[j].value==typeid)
            {  
               va[j].selected=typeid;
            
            }
        }
    }
    
     function load(state,id,typeid){ 
     
    if(typeid==1)
    {
        move1();
        move2();
        move3();        
    }
    if(typeid==2)
    {
        move2();
        move3();
    }
      if(typeid==3)
    {
        move3();
    }
    if(typeid==4)
    {
    document.getElementById('yes').style.display='';
    
    }
var drp2=document.getElementById(id); 
var oHttpReq = new ActiveXObject("MSXML2.XMLHTTP"); 
var oDoc = new ActiveXObject("MSXML2.DOMDocument"); 
oHttpReq.open("POST", "RetPinpai.aspx?state="+state, false); 
oHttpReq.send(""); 
result = oHttpReq.responseText; 

oDoc.loadXML(result); 
item1=oDoc.selectNodes("//PinPai/Table/YX_ID")
items = oDoc.selectNodes("//PinPai/Table/YX_ClassName"); 
item2 = oDoc.selectNodes("//PinPai/Table/b"); 
var itemsLength=items.length; 



if(itemsLength<1){

var newOption1 = document.createElement("OPTION"); 

    }
    else{

    var newOption1 = document.createElement("OPTION"); 

var isdis=0;
     for(i=0;i<itemsLength;i++) 
　　        { 
　　        var newOption = document.createElement("OPTION"); 
　　        if(item2[i]!=null){
　　           newOption.text=items[i].text+"-->";
　　           isdis=1; 
　　        }else{
　　            newOption.text=items[i].text; 
　　           
　　        }
　　     
　　        newOption.value=item1[i].text; 
　　         
　　         
　　         drp2.options.add(newOption);  
　　     
　　        
　　        } 
　　}
　　if(itemsLength!=0)
　　{
　　 document.getElementById('yes').style.display='none';
　　 document.getElementById('no').style.display='';
　　}else{
　　     document.getElementById('yes').style.display='';
　　      document.getElementById('no').style.display='none';
　　      
　　}
}
    </script>
    <style type="text/css">
        #newPreview {
                     FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)
                  }
</style>

<script language="javascript" type="text/javascript">
    function PreviewImg(imgFile)
{    
     var newPreview = document.getElementById("newPreview");
     newPreview.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgFile.value;
     newPreview.style.width = "80px";
     newPreview.style.height = "60px";
}
</script>

</head>
<body>
<uc:Top_vip ID="top_vip1" runat="server" />
    <form id="form1" action="YX_sell_type.aspx" runat="server" onsubmit="return Validator.Validate(document.getElementById('form1'),2)">
    <div>
       
 <asp:Panel ID="selectype" Visible="false" runat="server" HorizontalAlign="Center">
   <DIV class="main">
<DIV id="menu">
<UL id="menu_head">
  <LI class=li_now><IMG hspace="10" src="../images/upload_btn_will_01.gif" 
  align="absMiddle">选择出售方式 </LI>
  <LI class="li_now"><IMG hspace=10 src="../images/upload_btn_here_02.gif" 
  align="absMiddle">选择商品分类 </LI>
  <LI><IMG hspace="10" src="../images/upload_btn_will_03.gif" 
  align="absMiddle">填写商品详情 </LI></UL>
</DIV></DIV>
<DIV class="mai">
<DIV id="DIV2">发布您的商品请先阅读。</DIV></DIV>
<DIV class="maaains">
<UL style="text-align:center;PADDING-LEFT: 20px; MARGIN-BOTTOM: 5px">
  <LI>选择分类<BR /> <%=ss() %>
  <select style='width:180px;' size="14" id="DropDownList2" runat="server" name="DropDownList2" onchange="load(this.options[this.selectedIndex].value,'Select1',2)">
     </select>
   <select style='width:180px;' size="14" id="Select1" runat="server" name="Select1" onchange="load(this.options[this.selectedIndex].value,'Select2',3)">
     </select>
   <select style='width:180px;' size=14 id="Select2" runat="server" name="Select2" onchange="load(this.options[this.selectedIndex].value,'Select2',4)">
     </select>
  
  </LI>
  </UL>
</DIV>
<DIV class="main">
<DIV id="DIV3" style="display:none"><asp:Label ID="Error" runat="server"></asp:Label></DIV>
<div id="uselist">
曾经使用过的类目：<asp:DropDownList ID="ddl" runat="server" Width="120px" onchange="loadpay(this.options[this.selectedIndex].value)"></asp:DropDownList> 
</div>
</DIV>
    <asp:HiddenField ID="HiddenField1" runat="server" /> 
    <div id=yes style="display:none">
    <asp:Button id="nextID"  runat="server" Text=" 继 续>" OnClick="nextID_Click" /></div>
    <div id=no>
    <asp:Button id="Button2"  runat="server" Enabled=false Text=" 继 续>" OnClick="nextID_Click" />
    </div>
</asp:Panel>


 
        <asp:Panel ID="insertpro" Visible="false" runat="server">
       <asp:Panel ID="fs" runat="server" HorizontalAlign="center">
          <DIV class="main">
            <DIV id="menu">
            <UL id=menu_head>
              <LI><IMG hspace="10" src="../images/upload_btn_will_01.gif" 
              align="absMiddle">选择出售方式 </LI>
              <LI class="li_now"><IMG hspace="10" src="../images/upload_btn_will_02.gif" 
              align="absMiddle">选择商品分类 </LI>
              <LI><IMG hspace="10" src="../images/upload_btn_here_03.gif" 
              align="absMiddle">填写商品详情 </LI></UL>
            </DIV>
        </DIV>

<table class="main" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="20%">
        <asp:Image ID="Image1" runat="server"  /></td>
    <td><DIV id=warn>发布您的商品请先阅读禁止交易和限制交易的物品规则，重复发布商品处理规则。</DIV></td>
  </tr>
</table>
</asp:Panel>
<br>
<script language="javascript" src="../include/yz.js"></script>
<table class=main border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="140" class="td_01">商品信息编辑</td>
    <td colspan="2" class="td_01">　</td>
  </tr>
  <tr>
    <td class="td_02"><span class="fontOrange font14">*</span> 商品类目：</td>
    <td class="td_03" colspan="2" >
        <asp:Label ID="classroot" runat="server"></asp:Label>
        <asp:HiddenField ID="yx_classid" runat="server" />
        <asp:HiddenField ID="action" runat="server" Value="savepro" />
        <asp:HiddenField ID="yx_gmfs" runat="server" />
        <asp:HyperLink ID="HyperLink1" runat="server">[更改类目]</asp:HyperLink>
	</td>
  </tr>
  <asp:Panel ID="sx" Visible="false" runat="server">
  <tr id = "tr_classattr">
     <td valign="top" class="td_02" style="padding-top:20px"><span class="fontOrange font14">*</span> 商品属性：
	 </td>
     <td colspan="2" class="td_03 goodDesc" style="line-height:25px">
         <%=product_sx() %>
     </td>
  </tr>
   </asp:Panel>
  <asp:Panel ID="pp" Visible="false" runat="server">
    <tr id = "tr1">
     <td valign="top" class="td_02" style="padding-top:20px"><span class="fontOrange font14">*</span> 商品品牌：
	 </td>
     <td colspan="2" class="td_03 goodDesc" style="line-height:25px">
         <%=product_pp()%>
     </td>
  </tr> 
  </asp:Panel>
  <tr>
    <td class="td_02" ><span class="fontOrange font14">*</span> 商品名称：</td>
    <td class="td_03" style="height: 65px"><input name="sTitle" id="sTitle" dataType="Require" min="3" max="10"  msg="请填写商品名称" type="text" maxlength="60" size="60"><br>
    商品标题请限定在30个汉字内（60个字符）。怎样给商品拟个好标题？ </td>
   	<td rowspan="2" align="center" class="td_03"><div id="previewImage"></div></td>
  </tr>  
  <tr>
    <td class="td_02">图片上传：</td>
    <td class="td_03" style="height:100px;" >
    <ul style="width:100%;">
     <li style="float:left"> <asp:FileUpload ID="photo" name="photo"  runat="server" require="false" datatype="Filter" msg="请选择要上传的商品图片，现暂时只支持jpg\gif图片文件" accept="jpg, gif" onchange="PreviewImg(this)"  Width="300px" /></li>
      <li style="float:left" ><div  id="newPreview" style="width:100px"></div></li> 
       
        </ul>
        <ul style="width:100%;">
        <br>有图片的商品最受欢迎！图片限定120k内，jpg或gif格式，请确保图片在 浏览器中可以正常打开。如何在商品描述里插入图片，需要注意些什么<br></br>
       
      </ul> </td>
    <tr>
        <td class="td_02">
            商品说明：</td>
        <td class="td_03" colspan="2">

            <script charset="gb2312" src="Edit/editor.js" type="text/javascript">
</script>
<FCKeditorV2:FCKeditor runat="server" ID="fck_content" Width="600px" Height="400px"></FCKeditorV2:FCKeditor>
          <%--  <textarea ID="content" name="content" style="width:100%;height:250px;"></textarea>

            <script type="text/javascript">

	var oEditor = new PPEditor('content') ;
	oEditor.Create() ;
</script>

            在线编辑器仅支持IE5.5及以上版本，如果看不到在线编辑器，<a 
                href="http://www.microsoft.com/downloads/details.aspx?FamilyID=1e1550cb-5e5d-48f5-b02b-20b602228de6&amp;displaylang=zh-cn" 
                target="_blank">请点击升级浏览器。</a>--%>
        </td>
    </tr>
            <table align="center" border="0" cellpadding="0" cellspacing="0" class="main">
                <tr ID="chosestyle">
                    <td class="td_02" width="143">
                        皮肤风格选择：</td>
                    <td class="td_03">
                        <uc2:YX_proskin ID="YX_proskin1" runat="server" />
                    </td>
                </tr>
            </table>
            <table align="center" border="0" cellpadding="0" cellspacing="0" class="main">
                <tr>
                    <td class="td_01" width="140">
                        商品基本信息</td>
                    <td class="td_01" colspan="3">
                        　</td>
                </tr>
                <tr>
                    <td class="td_02">
                        <span class="fontOrange font14">*</span> 商品数量：</td>
                    <td class="td_03" width="225">
                        <asp:TextBox ID="dwNum" runat="server" datatype="Number" msg="商品数量必须是数字" 
                            require="true" Text="1"></asp:TextBox>
                        件</td>
                    <td class="td_02">
                        有效期：</td>
                    <td class="td_03">
                        <select class="select_span" name="dwValidDuration">
                            <option checked value="7">7</option>
                            <option value="14">14</option>
                            <option value="21">21</option>
                            <option value="30">30</option>
                            <option value="60">60</option>
                            <option value="120">120</option>
                            <option value="360">360</option>
                        </select>天 
                    </td>
                </tr>

                <script language="javascript" src="../Include/area.js">
</script>

                <script language="javascript">

function window.onload()
{
   province(0);
   cityName(document.form1.prov.value,0);//设置初始值
}
</script>

                <tr>
                    <td class="td_02">
                        <span class="fontOrange font14">*</span> 所 在 地：</td>
                    <td class="td_03">
                        <select ID="prov" datatype="Range" max="30000000" min="1" msg="请选择商品所在地" 
                            name="prov" 
                            onChange="cityName(document.form1.prov.options[document.form1.prov.selectedIndex].value)" 
                            require="true">
                            <option value="0">请选择</option>
                        </select>
                        <select ID="city" name="city">
                        </select></td>
                    <td class="td_02">
                        发 票：</td>
                    <td class="td_03">
                        <input name="cInvoiceType" type="radio" value="1"> 有 
                        <input checked name="cInvoiceType" type="radio" value="2"> 无 </input></input></td>
                </tr>
                <tr>
                    <td class="td_02">
                        <span class="fontOrange font14">*</span> 新旧程度：</td>
                    <td class="td_03">
                        <input checked name="cNewType" type="radio" value="1">全新 
                        <input name="cNewType" type="radio" value="2"> 二手 
                        <input name="cNewType" type="radio" value="3"> 陈列品 </input></input></input></td>
                    <td class="td_02">
                        保 修： 
                    </td>
                    <td class="td_03">
                        <input name="cRepairType" type="radio" value="1" />有 
                        <input checked name="cRepairType" type="radio" value="2" />无 
                    </td>
                </tr>
                <tr>
                    <td class="td_02">
                        <span class="fontOrange font14">*</span> 自定义分类：</td>
                    <td class="td_03" colspan="3">
                        <uc1:shopclass ID="Shopclass1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="td_02">
                        <span class="fontOrange font14">*</span> 上架时间：</td>
                    <td class="td_03" colspan="3">
                        <input checked name="pro_sjsj" type="radio" value="0" />立即上架 
                        <input name="pro_sjsj" type="radio" value="1" />放入仓库 
                    </td>
                </tr>
            </table>
            <table align="center" border="0" cellpadding="0" cellspacing="0" class="main">
                <tr>
                    <td class="td_01" width="140">
                        交易条件</td>
                    <td class="td_01">
                        　</td>
                </tr>
                <tr>
                    <td class="td_02">
                        <span class="fontOrange font14">*</span> 交易方式：</td>
                    <td class="td_03">
                        <%=Transactions()%>
                    </td>
                </tr>
                <tr>
                    <td class="td_02">
                        <span class="fontOrange font14">*</span> 运费承担：</td>
                    <td class="td_03">
                        <input name="cTransportType" 
                            onclick="document.getElementById('cdcf').innerText=''" type="radio" value="1"> 
                        卖家承担运费 
                        <input checked name="cTransportType" 
                            onclick="document.getElementById('cdcf').innerHTML='平邮：&lt;input name=dwNormalMailPrice type=text require = true datatype=Range min=0.01 max=1000000 msg=[平邮费]金额必须是0.01～1000000之间的数字 size=10 value=0.00&gt; 元 	快递：&lt;input name=dwExpressMailPrice type=text require = true datatype=Range min=0.01 max=1000000 msg=[快递费]金额必须是0.01～1000000之间的数字  size=10 value=0.00&gt;EMS：&lt;input name=dwEMSMailPrice type=text require =true datatype=Range min=0.01 max=1000000 msg=[EMS费] 金额必须是0.01～1000000之间的数字;   size=10 value=0.00&gt; 元 '" 
                            type="radio" value="2"> 买家承担运费<br>
                        <div ID="cdcf">
                            平邮：<input datatype="Range" max="1000000" min="0.01" 
                                msg="[平邮费] 金额必须是0.01～1000000之间的数字;" name="dwNormalMailPrice" require="true" 
                                size="10" type="text" value="0.00"> 元 快递：<input datatype="Range" 
                                max="1000000" min="0.01" msg="[快递费] 金额必须是0.01～1000000之间的数字;" 
                                name="dwExpressMailPrice" require="true" size="10" type="text" value="0.00"> 
                            元 EMS：<input datatype="Range" max="1000000" min="0.01" 
                                msg="[EMS费] 金额必须是0.01～1000000之间的数字;" name="dwEMSMailPrice" require="true" 
                                size="10" type="text" value="0.00"> 元 </input></input></input></div>
                        <br></br>
                        </br>
                        </input></input></td>
                </tr>
                <asp:Panel ID="aprice" runat="server" Visible="false">
                    <tr>
                        <td class="td_02">
                            <span class="fontOrange font14">*</span> 一 口 价：</td>
                        <td class="td_03">
                            现价(必填)：<input ID="dwPrice_bin" datatype="Range" max="1000000" min="0.01" 
                                msg="[一 口 价] 金额必须是0.01～1000000之间的数字；" name="dwPrice_bin" require="true" 
                                size="10" type="text"> 元　 
                            <asp:CheckBox ID="CheckBox1" runat="server" onclick="inner()" />
                            是否团购 &nbsp;&nbsp;&nbsp;<asp:Label ID="lnum" runat="server" style="display:none" 
                                Text="团购数量限制" />
                            <input ID="num" name="num" size="2" style="display:none" type="text" /></input></td>
                    </tr>
                    <tr>
                        <td class="td_02">
                            购买权限设置：</td>
                        <td class="td_03">
                            购买件数限制： 
                            <input ID="dwOpNum" datatype="Number" msg="商品数量必须是数字" name="dwOpNum" 
                                require="true" size="8" type="text" value="0"> 件<span ID="buyerLimitErr" 
                                style="color:red"></span>&nbsp;&nbsp;&nbsp;&nbsp;同一买家购买该商品的数量上限（0件表示不限制） </input></td>
                    </tr>
                </asp:Panel>
                <asp:Panel ID="Auction" runat="server" Visible="false">
                    <tr ID="Auction">
                        <td class="td_02">
                            <span class="fontOrange font14">*</span> 起 拍 价：</td>
                        <td class="td_03">
                            <input ID="dwPrice_auc" datatype="Range" max="1000000" min="0.01" 
                                msg="[起 拍 价] 金额必须是0.01～1000000之间的数字；" name="dwPrice_auc" require="true" 
                                size="10" type="text"> 元&nbsp;&nbsp;&nbsp;&nbsp; 起拍价就是您可以接受的最低价格，请谨慎设置。</input></td>
                    </tr>
                    <tr ID="Rate">
                        <td class="td_02">
                            <span class="fontOrange font14">*</span> 最低加价幅度：</td>
                        <td class="td_03">
                            <input datatype="Range" max="1000000" min="0.01" 
                                msg="[最低加价幅度] 金额必须是0.01～1000000之间的数字；" name="dwPriceToAdd" require="true" 
                                size="10" type="text" value=""> 元<br></br>
                            </input></td>
                    </tr>
                </asp:Panel>
            </table>
            <div class="main" style="text-align:center">
                <br>
                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" 
                    Text="确认无误，提交 &gt;&gt;" />
                <br>
                <br>
                <br></br>
                <br></br>
                <br></br>
                </br>
                </br>
                </br>
            </div>
      <br></br>
      </br>

   
        </asp:Panel>
<asp:panel runat="server"  ID="panel3" Visible="false" width="100%" HorizontalAlign="Center"> 
<table width="60%" border="0" >
  <tr>
    <td align="center"><img src="../images/success.gif" width="41" align="center" height="39" />&nbsp;&nbsp;<div class=divfont14>恭喜您，商品发布成功！</div></td>
  </tr>
  <tr>
    <td align="center" style="line-height:20px">
    <b>你可以进行的操作</b><br>    
        <asp:HyperLink ID="HyperLink2" runat="server">查看商品详情>></asp:HyperLink><br>
        <a href="YX_sell.aspx">继续发布新商品>></a><br>
         <a href="selling_commodity.aspx"> 出售中的商品列表 >></a></td>
  </tr>
  <tr>
    <td><table width="100%" height="62px" border="0" align="center">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

</asp:panel>
<%--<script language=javascript>
  forload()
</script>--%>
<!--</div>-->
    </form>
   <uc:Foot_vip ID="foot_vip" runat="server" /> 
</body>
</html>

