<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="store_product_add2.aspx.cs" Inherits="XpShop.Supplier.store_product_add2" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="SupplierMenu" Src="Modules/SupplierMenu.ascx" %>
<!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>
    <!--#include file="inc/head.inc"-->
	<title>商家中心 <%=config.SiteTitle%></title>
	<link rel="stylesheet" type="text/css" media="screen" href="style/cmxform.css" />
	<script src="inc/uploadPreview.js" type="text/javascript"></script>
	<script src="inc/store_product_add2.js" type="text/javascript"></script>
	<script src="inc/spec.js" type="text/javascript"></script>
	<script src="inc/jquery.validate.js" type="text/javascript"></script>
	<script src="inc/jquery.metadata.js" type="text/javascript"></script>
	<script src="inc/jquery.form.js" type="text/javascript"></script>
	<script src="inc/messages_cn.js" type="text/javascript"></script>
	<script type="text/javascript">
	//var props=<%=strProps%>;
	//var paras=<%=strParas%>;
	//alert(paras["paras"][0]["options"][1]["name"]);
	var cid="<%=product.ProductID==0 ? (Request.Form["catid"] == null ? "0" : Request.Form["catid"]) : product.CategoryNo %>";
	var pid="<%=Request.QueryString["pid"] == null ? "0" : Request.QueryString["pid"] %>";
	var propertes=<%=product.ProductID==0 ? "{}" : product.Properties%>;
	var specInfo = "<%=product.ProductID==0 ? "" : product.Spec%>";
	var skuMap=<%=product.ProductID==0 ? "{}" : product.SkuMap%>;
	</script>	
</head>
<body>
    <uc1:Header id="Header1" runat="server"></uc1:Header>
    <!--位置导航开始-->
	 <div class="ws path"><a href="<%=webSite %>supplier/default.<%=config.html%>">商家桌面</a> > 商品管理 > 上传商品</div>
	<!--位置导航结束-->
	<div id="content" class="ws xp-clear">
		<div class="content-left">
			<!--会员中心导航开始-->
			<uc1:SupplierMenu id="SupplierMenu1" runat="server"></uc1:SupplierMenu>
			<!--会员中心导航结束-->
		</div>
		<div class="content-middle">
        <form class="cmxform" id="form1" enctype="multipart/form-data" runat="server">
			<%if(product.ProductID==0){%>
			<input type="hidden" name="catid" value="<%=XpShop.Common.Utils.ReqStrParams("catid","1")%> "/>
			<%}else{%>
			<input type="hidden" name="catid" value="<%=product.CategoryNo%> "/>
			<%}%>
			<input type="hidden" name="unit" value="<%=product.ProductID==0 ? "" : product.Unit%>"/>
			<input type="hidden" name="paras" value=""/>
			<input type="hidden" name="isDiscount" value="<%=product.ProductID==0 ? 1 : product.IsDiscount%>"/>
			<input type="hidden" name="canReview" value="<%=product.ProductID==0 ? 1 : product.CanReview%>"/>
			<input type="hidden" name="aranNum" value="<%=product.ProductID==0 ? 1 : product.AarnNum%>"/>
			<input type="hidden" name="keyword" value="<%=product.ProductID==0 ? "" : product.Keyword%>"/>
			<input type="hidden" name="title" value="<%=product.ProductID==0 ? "" : product.Title%>"/>
			<input type="hidden" name="metaKeyword" value="<%=product.ProductID==0 ? "" : product.MetaKeywords%>"/>
			<input type="hidden" name="metaDescription" value="<%=product.ProductID==0 ? "" : product.MetaDescription%>"/>
			<input type="hidden" name="action"  id="action" value="<%=(product.ProductID==0 ? "add" : "update")%>"  />
			<div class="frame tab">
				<div class="frame_title">商品基本信息</div>
				<div class="frame_content">
					<table cellspacing="0" cellpadding="0" class="ptable">
						<tr>
							<th class="tl"><em>*</em>商品分类：</th>
							<td class="tr"><%=XpShop.Common.Utils.ReqStrParams("name_string","")%> <a href="store_product_add1.aspx">修改</a></td>
						</tr>
						<tr>
							<th class="tl"><em>*</em>商品名称：</th>
							<td class="tr">
								<asp:TextBox ID="tbName" style="width:400px;float:left;margin-right:10px;" runat="server"></asp:TextBox>
								<span class="input-remark">30个汉字（60个字符）内</span>
							</td>
						</tr>
						<tr>
							<th class="tl">副 标 题：</th>
							<td class="tr"><asp:TextBox ID="tbSubName" width="400px" runat="server"></asp:TextBox><br/><span class="input-remark1">请填写商品特色、卖点等信息。 25个汉字（50个字符）内</span></td>
						</tr>
						<tr>
							<th class="tl">商家编码：</th>
							<td class="tr">
                                <asp:TextBox ID="tbStoreNo" runat="server"></asp:TextBox></td>
						</tr>
						<tr>
							<th class="tl">品  牌：</th>
							<td class="tr"><asp:DropDownList ID="ddlBrand" runat="server"></asp:DropDownList>
                            </td>
						</tr>
						<tr>
							<th class="tl"><em>*</em>重量：</th>
							<td class="tr"><asp:TextBox ID="tbWeight" runat="server"></asp:TextBox>
                            </td>
						</tr>
						<tr>
							<th class="tl">商品属性：</th>
							<td class="tr"><asp:Label ID="lbProps" runat="server" Text=""></asp:Label></td>
						</tr>
						<tr>
							<th class="tl">商品参数：</th>
							<td class="tr"><asp:Label ID="lbParas" runat="server" Text=""></asp:Label></td>
						</tr>						
						<tr>
							<th class="tl">商品图片：</th>
							<td class="tr">
								<div class="pic-manager xp-clear">
									<ul>
									<%for(int i=1;i<7;i++){%>
										<%if(dtPdtImg != null && dtPdtImg.Rows.Count>=i){%>
											<%if(i==1){%>
											<li class="first support">
											<%}else if(i==6){%>
											<li class="last support">
											<%}else{%>
											<li class="support">
											<%}%>
											<input class="picUrl" type="hidden" value="<%=XpShop.Common.Utils.Parse<string>(dtPdtImg.Rows[i-1]["img"],"")%>" name="picUrl" />
										<%}else{%>
											<%if(i==1){%>
											<li class="first">
											<%}else if(i==6){%>
											<li class="last">
											<%}else{%>
											<li>
											<%}%>
											<input class="picUrl" type="hidden" value="" name="picUrl" />
										<%}%>
											<input type="hidden" value="0" name="isDel">
											<%if(dtPdtImg != null && dtPdtImg.Rows.Count>=i){%>
											<input type="hidden" value="<%=XpShop.Common.Utils.Parse<byte>(dtPdtImg.Rows[i-1]["sort"],1)%>" name="imgPos">
											<div class="preview"><img src="<%=webSite%>Upload/ProductImg/<%=XpShop.Common.Utils.Parse<string>(dtPdtImg.Rows[i-1]["imgfolder"],"")%><%=XpShop.Common.Utils.Parse<string>(dtPdtImg.Rows[i-1]["img"],"")%>" /></div>
											<%}else{%>
											<input type="hidden" value="<%=i%>" name="imgPos">
											<div class="preview"></div>
											<%}%>
											<div class="upload"><a href="javascript:;"><input class="upic" type="file" name="upic" /></a></div>
											<div class="act"><span class="moveleft">左移</span><span class="moveright">右移</span><span class="del">删除</span></div>
										</li>								
									<%}%>
									</ul>
								</div>
								<hr/>
								<span class="input-remark1">图片大小请限定在120k(建议800px*800px)以内，jpg或gif格式（不支持中文档名）</span></br>
								<span style="color:#CC3300">图片上不能加店名、网址、邮箱或与商品无关的信息。</span>
							</td>
						</tr>
						<tr>
							<th class="tl"><em>*</em>详细描述：</th>
							<td class="tr">
								<FTB:FREETEXTBOX id="ftbContent" runat="Server" Width="600" ButtonOverImage="True" ButtonDownImage="True" ButtonPath="../images/ftb/officeXP/" ToolbarType="OfficeXP" AutoConfigure="XpShopUI"></FTB:FREETEXTBOX>
							</td>
						</tr>
                        <tr>
							<th class="tl">包装清单：</th>
							<td class="tr">
							    <FTB:FREETEXTBOX id=ftbPackingList runat="server"  Width="600" height="150"  ButtonOverImage="True" ButtonDownImage="True" ButtonPath="../images/ftb/officeXP/" ToolbarType="OfficeXP" AutoConfigure="XpShopUI"></FTB:FREETEXTBOX>
							    <span class="input-remark1">最多允许输入250个汉字（500个字符）内</span>
							</td>
						</tr>
                        <tr>
                            <th class="tl">售后服务：</th>
                            <td class="tr">
	                            <FTB:FREETEXTBOX id="ftbAfterService" runat="Server" Width="600" height="150"   ButtonOverImage="True" ButtonDownImage="True" ButtonPath="../images/ftb/officeXP/" ToolbarType="OfficeXP" AutoConfigure="XpShopUI"></FTB:FREETEXTBOX>
                                <span class="input-remark1">最多允许输入500个汉字（1000个字符）内</span>
                            </td>
                        </tr>
					</table>
				</div>
			</div>
			<div class="frame tab">
				<div class="frame_title">商品销售信息</div>
				<div class="frame_content">
					<table cellspacing="0" cellpadding="0" class="ptable">
					    <tr>
							<th class="tl"><em>*</em>市 场 价：</th>
							<td class="tr"><asp:TextBox ID="tbMarketPrice" runat="server"></asp:TextBox> 元</td>
						</tr>
						<tr>
							<th class="tl"><em>*</em>销 售 价：</th>
							<td class="tr"><asp:TextBox ID="tbMemberPrice" runat="server"></asp:TextBox> 元</td>
						</tr>
						<%if(dtProp1.Rows.Count>0){%>
						<tr>
							<th class="tl"><input type="hidden" id="spec1" name="spec1" value="<%=dtProp1.Rows[0]["pname"]%>" /><%=dtProp1.Rows[0]["pname"]%>：</th>
							<td class="tr">
								<%for(int i=0;i<dtProp1.Rows.Count;i++){%>
									<input type="checkbox" class="spec1 checkbox" id="prop_<%=dtProp1.Rows[i]["pid"]%>_<%=dtProp1.Rows[i]["vid"]%>" value="<%=dtProp1.Rows[i]["pid"]%>:<%=dtProp1.Rows[i]["vid"]%>" imageurl="" viewimageurl="" name="cp_<%=dtProp1.Rows[i]["pid"]%>">
									<label title="<%=dtProp1.Rows[i]["vname"]%>" colorname="" for="prop_<%=dtProp1.Rows[i]["pid"]%>_<%=dtProp1.Rows[i]["vid"]%>"><%=dtProp1.Rows[i]["vname"]%></label>
								<%}%>
							<td>
						</tr>
						<%}%>
						<%if(dtProp2.Rows.Count>0){%>
						<tr>
							<th class="tl"><input type="hidden" id="spec2" name="spec2" value="<%=dtProp2.Rows[0]["pname"]%>" /><%=dtProp2.Rows[0]["pname"]%>：</th>
							<td class="tr">
								<%for(int i=0;i<dtProp2.Rows.Count;i++){%>
									<input type="checkbox" class="spec2 checkbox" id="prop_<%=dtProp2.Rows[i]["pid"]%>_<%=dtProp2.Rows[i]["vid"]%>" value="<%=dtProp2.Rows[i]["pid"]%>:<%=dtProp2.Rows[i]["vid"]%>" name="cp_<%=dtProp2.Rows[i]["pid"]%>">
									<label title="<%=dtProp2.Rows[i]["vname"]%>" for="prop_<%=dtProp2.Rows[i]["pid"]%>_<%=dtProp2.Rows[i]["vid"]%>"><%=dtProp2.Rows[i]["vname"]%></label>
									<%--<input type="text" id="" maxlength="15" data-sku="<%=dtProp2.Rows[i]["pid"]%>:<%=dtProp2.Rows[i]["vid"]%>" value="<%=dtProp2.Rows[i]["vname"]%>" class="text text-short pure-text" name="cpva_<%=dtProp2.Rows[i]["pid"]%>:<%=dtProp2.Rows[i]["vid"]%>" disabled="disabled"> --%>
								<%}%>
								<div id="J_sell-table" style="margin-top:10px;display:none;">
									<table cellspacing="0" cellpadding="0" border="0" class="tb-color">
										<thead>
											<tr>
												<th><%=dtProp1.Rows[0]["pname"]%></th>
												<th><%=dtProp2.Rows[0]["pname"]%></th>
												<th><em>*</em>价格</th>
												<th><em>*</em>数量 </th>
												<th>商家编码</th>
											</tr>
										</thead>
										<tbody id="sell-body">
										    <!--
											<tr data-value="1627207_3232483_20509_28381" class="">
												<td data-sku="1627207:3232483"> <span class="tb-color-lump c-5d762a" title="军绿色">军绿色</span></td>
												<td data-sku="20509:28381"> XXS</td>
												<td>
													<input type="hidden" value="" name="1627207:3232483;20509:28381:id">
													<input type="text" value="" class="text align-right K-sale" id="sale_p_1" name="1627207:3232483;20509:28381:p"> 元
												</td>
												<td>
													<input type="text" value="" onblur="calQ()" class="text align-right J-sale" id="sale_q_1" name="1627207:3232483;20509:28381:q"> 件
												</td>
												<td>
													<input type="text" maxlength="30" value="" class="text text-code" name="1627207:3232483;20509:28381:tsc">
												</td>
											</tr>
											<tr data-value="1627207_3232483_20509_28313" class="">
												<td data-sku="1627207:3232483"> <span class="tb-color-lump c-5d762a" title="军绿色">军绿色</span></td>
												<td data-sku="20509:28313"> XS</td>
												<td>
													<input type="hidden" value="" name="1627207:3232483;20509:28313:id">
													<input type="text" value="" class="text align-right K-sale" id="sale_p_2" name="1627207:3232483;20509:28313:p"> 元
												</td>
												<td>
													<input type="text" value="" onblur="calQ()" class="text align-right J-sale" id="sale_q_2" name="1627207:3232483;20509:28313:q"> 件
												</td>
												<td>
													<input type="text" maxlength="30" value="" class="text text-code" name="1627207:3232483;20509:28313:tsc">
												</td>
											</tr>
											-->
										</tbody>
									</table>
								</div>
							<td>
						</tr>
						<%}%>
						<%if(dtProp1.Rows.Count>0 || dtProp2.Rows.Count>0){%>
		                <tr>
			                <th class="tl">SKU设置：</th>
			                <td class="tr">
				                <div id="Div1" style="margin-top:10px;display:none;">
					                <table cellspacing="0" cellpadding="0" border="0" class="tb-color">
						                <thead>
							                <tr>
							                    <%if(dtProp1.Rows.Count>0){%>
								                <th><%=dtProp1.Rows[0]["pname"]%></th>
								                <%} %>
								                <%if(dtProp2.Rows.Count>0){%>
								                <th><%=dtProp2.Rows[0]["pname"]%></th>
								                <%} %>
								                <th><em>*</em>价格</th>
								                <th><em>*</em>数量 </th>
								                <th>商家编码</th>
							                </tr>
						                </thead>
						                <tbody id="Tbody1">
						                </tbody>
					                </table>
				                </div>
			                </td>
			            </tr>
		                <%} %>
						<tr>
							<th class="tl"><em>*</em>商品状态：</th>
							<td class="tr">
                                <asp:DropDownList ID="ddlStatus" runat="server">
                                <asp:ListItem Value="1">上架</asp:ListItem>
                                <asp:ListItem Value="0">下架</asp:ListItem>
                                </asp:DropDownList>
                            </td>
						</tr>
						<tr>
							<th class="tl"><em>*</em>库存数量：</th>
							<td class="tr"><asp:TextBox ID="tbStorage" runat="server"></asp:TextBox></td>
						</tr>
					</table>
				</div>
			</div>
			<div class="frame tab">
				<div class="frame_title">商品店内信息</div>
				<div class="frame_content">
					<table cellspacing="0" cellpadding="0" class="ptable">
					    <tr>
							<th class="tl"><em>*</em>店内分类：</th>
							<td class="tr">
								<asp:DropDownList ID="ddlSubCategory" runat="server"></asp:DropDownList>
							</td>
						</tr>
					</table>
				</div>
			</div>
			<div style="text-align:center">
                <asp:Button ID="btnSave" runat="server" Text="保存" onclick="btnSave_Click" />
            </div>
        </form>
        </div>
    </div>
</body>
</html>
