<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<%@ Register TagPrefix="alicmsUC" TagName="Ime" Src="../../ime.dwt.ascx"%>
<%@ Register TagPrefix="alicmsUC" TagName="LanguageMenu" Src="../../language_menu.dwt.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>
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<ali:Get ID="Config" Object="InstanceConfig" Operation="GetBasicSettings()" />
<ali:List ID="MaxNo" Object="Goods" Page="1" PageSize="1" Sort="InnerID DESC" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加商品</title>
<link rel="stylesheet" type="text/css" href="<%=CommonPath%>jquery/themes/lightness/all.css" />
<ali:Comment><link rel="stylesheet" type="text/css" href="../../S01/CHS/css/common.css" /></ali:Comment>
<link rel="stylesheet" href="<%=CssPath%>common.css" />
<alicmsUC:Ime Ime="true" Eot="true" runat="server" />
<style>
#property-table td{text-align:left}
#property-table th input{margin:0 5px}
#more-picture-table{width:750px;background:#fff}
#more-picture-table th{text-align:center}
#more-picture-table p{display:none;margin:0}
.sub-table{width:auto;background:#fff}
.sub-table thead th,.sub-table td{padding:5px;text-align:center}
.sub-table tbody th{width:120px}
.price-table td{text-align:left}
#user-price-container{display:none}
#user-price-container td{text-align:center}
#user-price-container th input{margin:0 5px}
#spec-table td{text-align:left}
#spec-table label,#spec-table label input{margin:0 5px}
.spec-color{margin:0 5px 0 0 !important;border:0;padding:0;width:20px;height:20px}
table.spec-upload-table{margin:5px 0;width:600px}
#spec-price-table{margin:5px 0;width:auto}
#spec-price-table thead th{min-width:80px;_width:80px}
</style>
<script type="text/javascript">
var _page = 'goods_add',
	_lang = '<%=ContentLang%>',
	_webPath = '<%=WebPath%>',
	_imagePath = '<%=ImagePath%>',
	_adminPath = '<%=AdminPath%>',
	_pictureRoot = '<%=Config[GoodsPictureFolder]%>',
	_thumbnailRoot = '<%=Config[GoodsThumbnailFolder]%>',
	_typeNoDigit = '<%=Config[TypeNoDigit]%>',
	_goodsNoDigit = '<%=Config[GoodsNoDigit]%>',
	<%If MaxNo[Count] == 0%>
		_maxNo = 1,
	<%Else%>
		_maxNo = <%=MaxNo[InnerID]%> + 1,
	<%EndIf%>
	_lang_working = '正在操作...',
	_lang_operation_fail = '操作失败',
	_lang_operation_success = '操作成功！',
	_lang_delete = '删除',
	_lang_browse = '浏览...',
	_lang_picture = '大图：',
	_lang_thumbnail = '小图：',
	_lang_select = '选择',
	_lang_generate_thumbnail = '生成小图',
	_lang_water_print = '水印',
	_lang_price = '价格',
	_lang_stock = '库存',
	_lang_name_empty = '名称不能空！',
	_lang_stock_incorrect = '库存格式不正确！',
	_lang_market_price_incorrect = '市场价格是不正确！',
	_lang_sale_price_incorrect = '销售价格是不正确！',
	_lang_picture_type_must_be = '图片类型应为：',
	_lang_promote_price_incorrect = '促销价格是不正确！',
	_lang_promote_start_incorrect = '促销开始日期格式不正确！',
	_lang_promote_end_incorrect = '促销结束日期格式不正确！',
	_lang_user_price_incorrect = '会员价格式不正确！',
	_lang_promote_price = '促销价格',
	_lang_uploading_picture = '正在上传大图...',
	_lang_uploading_thumbnail = '正在上传小图...',
	_lang_uploading_more_picture = '正在上传更多图片...',
	_lang_uploading_spec_picture = '正在上传规格图片...',
	_lang_bar_code = '条形码',
	_lang_no = '货号',
	_lang_digit_not_enough = '货号位数不够！',
	_lang_no_exist = '货号已存在！',
	_lang_digit_incorrect = '货号位数必须是{Digit}！',
	_lang_weight_incorrect = '重量格式不正确！',
	_lang_volume_incorrect = '体积格式不正确！';
</script>
</head>
<body>
<div class="WhiteHeader">
	<div class="Left"><img src="<%=ImagePath%>close_frame.gif" /></div>
	<div class="Title">添加商品</div>
	<div class="Right">
		<alicmsUC:LanguageMenu runat="server" />
		<img height="15" src="<%=ImagePath%>dropdown.gif" /> 语言：<%=CurrentLanguage%>
	</div>
</div>
<div class="Block">
	<ul class="TabMenu">
		<li class="Left"></li>
		<li class="Middle"><a href="../goods/list.aspx?Lang=<%=ContentLang%>">商品列表</a></li>
		<li class="Right"></li>
		<li class="Left Selected"></li>
		<li class="Middle Selected">添加商品</li>
		<li class="Right Selected"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../goods/replace.aspx?Lang=<%=ContentLang%>">批量替换</a></li>
		<li class="Right"></li>
	</ul>
	<ul class="Title">
		<li class="Left"></li>
		<li class="Middle"></li>
		<li class="Right"></li>
	</ul>
	<form>
		<table border="0" cellpadding="4" cellspacing="1">
			<tfoot>
				<tr><td colspan="2">
					<input type="submit" value="添加" />
					<input type="hidden" name="PictureAllowedType" value="gif|jpg|jpeg|png|bmp" />
				</td></tr>
			</tfoot>
			<tbody>
				<tr>
					<th width="120">名称：</th>
					<td><input type="text" name="Name" size="50" maxlength="50" class="Text <%=ContentLang%>Font" />，货号：<input type="text" name="No" size="20" maxlength="20" class="Text" />，条形码：<input type="text" name="BarCode" size="20" maxlength="30" class="Text" /></td>
				</tr>
				<tr>
					<th>类别：</th>
					<td>
						<select name="CategoryID" class="<%=ContentLang%>Font">
							<option value="" data-type-id="" data-type-no="" data-name="" data-page-generate="" data-page-template="" data-page-id="" data-page-extension="">未指定</option>
							<ali:Tree Object="GoodsCategory">
								<ali:Control>
									<ali:Space>&nbsp;&nbsp;</ali:Space>
									<ali:Line>│</ali:Line>
									<ali:TopOpen>┌</ali:TopOpen>
									<ali:Top>┌</ali:Top>
									<ali:MiddleOpen>├</ali:MiddleOpen>
									<ali:Middle>├</ali:Middle>
									<ali:BottomOpen>└</ali:BottomOpen>
									<ali:Bottom>└</ali:Bottom>
								</ali:Control>
								<ali:Record>
									<option value="<%=ID%>" data-type-id="<%=TypeID%>" data-type-no="" data-name="<%=Name%>" data-page-generate="<%=PageGenerate%>" data-page-template="<%=PageTemplate%>" data-page-id="<%=PageID%>" data-page-extension="<%=PageExtension%>"><%=Control%><%=Name%></option>
									<%=ChildRecords%>
								</ali:Record>
							</ali:Tree>
						</select>
					</td>
				</tr>
				<tr>
					<th>库存：</th>
					<td><input type="text" name="Stock" value="0" size="10" maxlength="10" class="Text" /></td>
				</tr>
				<tr>
					<th>品牌：</th>
					<td>
						<select name="BrandID" class="<%=ContentLang%>Font">
							<option value="" data-name="" data-page-generate="" data-page-template="" data-page-id="" data-page-extension="">未指定</option>
							<ali:List Object="Brand">
								<ali:Record>
									<option value="<%=ID%>" data-name="<%=Name%>" data-page-generate="<%=PageGenerate%>" data-page-template="<%=PageTemplate%>" data-page-id="<%=PageID%>" data-page-extension="<%=PageExtension%>"><%=Name%></option>
								</ali:Record>
							</ali:List>
						</select>
					</td>
				</tr>
				<tr id="property-row" style="display:none">
					<th>属性：</th>
					<td></td>
				</tr>
				<tr>
					<th>价格：</th>
					<td>
						<table cellspacing="1" cellpadding="4" border="0" class="sub-table price-table">
							<tr>
								<td>
									销售价：<input type="text" name="SalePrice" value="0.00" size="10" maxlength="10" class="Text" />
									市场价：<input type="text" name="MarketPrice" value="0.00" size="10" maxlength="10" class="Text" />
								</td>
							</tr>
							<tr>
								<td>
									<input type="checkbox" id="Promote" /><label for="Promote">是否促销</label>
									<label id="PromotePriceLabel">促销价：<input type="text" name="PromotePrice" value="0.00" size="10" maxlength="10" class="Text" disabled="disabled" /></label>
									促销开始时间：<input type="text" name="PromoteStart" class="Text" disabled="disabled" />
									促销结束时间：<input type="text" name="PromoteEnd" class="Text" disabled="disabled" />
								</td>
							</tr>
							<%If UserChannel != null%>
								<tr>
									<td>
										<label for="UserPrice" id="UserPriceLabel"><input type="checkbox" name="UserPrice" id="UserPrice" />会员价</label>
										<div id="user-price-container">
											<table class="sub-table" border="0" cellpadding="4" cellspacing="1" style="width:400px">
												<thead>
													<tr>
														<th>角色</th>
														<th>价格</th>
													</tr>
												</thead>
												<tbody>
													<ali:List Mark="User" Object="Role">
														<ali:Record>
															<tr>
																<th class="<%=ContentLang%>Font"><label><input type="checkbox" value="<%=ID%>" /><%=Name%> : </label></th>
																<td><input type="text" value="0.00" size="10" maxlength="10" class="Text" /></td>
															</tr>
														</ali:Record>
													</ali:List>
												</tbody>
											</table>
										</div>
									</td>
								</tr>
							<%EndIf%>
						</table>
					</td>
				</tr>
				<tr>
					<th>运费：</th>
					<td>
						<select name="FreightTemplateID">
							<option value="">-- 运费模板 --</option>
							<ali:List Object="FreightTemplate">
								<ali:Record>
									<option value="<%=ID%>"><%=Name%></option>
								</ali:Record>
							</ali:List>
						</select>
						，
						重量：<input type="text" name="Weight" value="0" size="6" />kg，体积：<input type="text" name="Volume" value="0" size="6" />m³
					</td>
				</tr>
				<tr>
					<th>大图：</th>
					<td>
						<input id="PictureTextbox" type="text" name="Picture" size="55" class="Text" />
						<input id="PictureBrowse" type="button" value="浏览..." />
						<input id="PictureSelect" type="button" value="选择..." />
						<img height="22" id="PictureView" alt="" style="vertical-align:bottom" />
						<input type="checkbox" id="MakeThumbnail" /><label for="MakeThumbnail">生成小图</label>
						<input type="checkbox" id="AddWaterMarkToPicture" /><label for="AddWaterMarkToPicture">水印</label>
					</td>
				</tr>
				<tr id="ThumbnailRow" style="display:none">
					<th>小图：</th>
					<td>
						<input id="ThumbnailTextbox" type="text" name="Thumbnail" size="55" class="Text" />
						<input id="ThumbnailBrowse" type="button" value="浏览..." />
						<input id="ThumbnailSelect" type="button" value="选择..." />
						<img height="22" id="ThumbnailView" alt="" style="vertical-align:bottom" />
						<input type="checkbox" id="AddWaterMarkToThumbnail" /><label for="AddWaterMarkToThumbnail">水印</label>
					</td>
				</tr>
				<tr>
					<th>更多图片：</th>
					<td>
						<input type="button" id="MorePicture" value="增加..." class="Button" />
						<div id="more-picture-div"></div>
					</td>
				</tr>
				<tr id="spec-row" style="display:none">
					<th>规格：</th>
					<td></td>
				</tr>
				<tr>
					<th>详细介绍：</th>
					<td>
						<textarea name="Description" data-lang="<%=PageLang%>" data-content-lang="<%=ContentLang%>" data-browse-url="<%=AdminBrowserURL%>?Root=<%=InstanceID%>" class="editor"></textarea>
					</td>
				</tr>
				<tr>
					<th>选项：</th>
					<td>
						<input type="checkbox" name="IsReleased" id="IsReleased" checked="checked" /><label for="IsReleased">上架</label>
						<input type="checkbox" name="IsRecommended" id="IsRecommended" /><label for="IsRecommended">推荐</label>
						<input type="checkbox" name="IsHeld" id="IsHeld" /><label for="IsHeld">置顶</label>
					</td>
				</tr>
				<tr>
					<th>模板：</th>
					<td>
						是否生成：
						<input type="radio" name="PageGenerate" id="PageGenerateAuto" value="" checked="checked" /><label for="PageGenerateAuto">自动</label>
						<input type="radio" name="PageGenerate" id="PageGenerateYes" value="1" /><label for="PageGenerateYes">是</label>
						<input type="radio" name="PageGenerate" id="PageGenerateNo" value="0" /><label for="PageGenerateNo">否</label>
						<br />
						
						自定模板：<input type="text" name="PageTemplate" class="Text" />可以空<br />
						页面标识：<input type="text" name="PageID" class="Text" />
						<select id="PageIDCandidate">
							<option value="">预定义</option>
							<option value="{ID}">ID</option>
							<option value="{Guid}">Guid</option>
							<option value="{YYYYMMDDhhmmss}">YYYYMMDDhhmmss</option>
							<option value="{YYYY-MM-DD/hhmmss}">YYYY-MM-DD/hhmmss</option>
							<option value="{YYYY/MM/DD/hhmmss}">YYYY/MM/DD/hhmmss</option>
							<option value="{YYYY/MM-DD/hhmmss}">YYYY/MM-DD/hhmmss</option>
						</select>可以空<br />
						扩展名称：<input type="text" name="PageExtension" class="Text" />可以空
					</td>
				</tr>
				<tr>
					<th>搜索引擎优化：</th>
					<td>
						页面关键词：<input type="text" name="MetaKeywords" size="20" maxlength="255" class="Text <%=ContentLang%>Font" />
						页面描述：<input type="text" name="MetaDescription" size="20" maxlength="255" class="Text <%=ContentLang%>Font" />
					</td>
				</tr>
			</tbody>
		</table>
	</form>
	<div class="Footer"></div>
</div>
<script type="text/javascript" src="<%=CommonPath%>jquery/core.js"></script>
<script type="text/javascript" src="<%=CommonPath%>jquery/ui.js"></script>
<script type="text/javascript" src="<%=CommonPath%>json2.js"></script>
<script type="text/javascript" src="<%=Manager.GetModulePath(null)%><%=Instance[AliCMS.SystemModule.Alias.Module.Namespace]%>/alias.js"></script>
<script type="text/javascript" src="<%=CommonPath%>uploader.js"></script>
<script type="text/javascript" src="<%=CommonPath%>xmldom.js"></script>
<script type="text/javascript" src="<%=CommonPath%>utility.js"></script>
<script type="text/javascript" src="<%=JsPath%>global.js"></script>
<script type="text/javascript" src="<%=ModuleJsPath%>module.js"></script>
</body>
</html>