<{import file="index/header_shop.html" title="产品编辑"}> 
<link href="<{$__APP__}>public/css/goods_edit.css" rel="stylesheet" type="text/css">  
<form id="form" method="post"> 
	<{if $row.id}><input type="hidden" name="id" value="<{$row.id}>" id="goods_id"/><{/if}>
	<{if $smarty.get.cid}>	
		<input type="hidden" name="cid" value="<{$smarty.get.cid}>"/>
	<{else}>
		<input type="hidden" name="cid" value="<{$row.cid}>"/>
	<{/if}>
	<table width="100%" class="etable"> 
		<tr>
			<td width="80">产品分类：</td>
			<td style="text-align:left;">
			<div class="cats_box">
				<{foreach item=c key=ck from=$cats}>
					<{$c}> >>
				<{/foreach}>
				<a href="?m=goods&a=chose_cats&gid=<{$row.id}>&cid=<{if $row.cid == ''}><{$smarty.get.cid}><{else}><{$row.cid}><{/if}>" onClick="returns edit_cats();">编辑</a></td>
			</div>
		</tr>
		<tr>
			<td>商品名：</td>
			<td><input type="text" name="title" class="edit" size="78" id="title" value="<{$row.title}>"/> <i>*</i></td>
		</tr>
		<tr>
			<td style="padding-top:10px;" valign="top">卖点介绍：</td>
			<td><textarea name="intro" class="edit" cols="80" rows="3" class="h5_round" id="intro"><{$row.intro}></textarea></td>
		</tr> 
		<tr>
			<td>店铺分类：</td>
			<td>
				<select name="group_cid">
					<option value="0">店铺产品分类</option>
					<{if $goods_group}>
						<{foreach item=i from=$goods_group}>
							<option value="<{$i.id}>" <{if $row.group_cid == $i.id}>selected="selected"<{/if}>><{$i.name}></option> 
						<{/foreach}>
					<{/if}>
				</select>
			</td>
		</tr> 
		<tr>
			<td>所属品牌：</td>
			<td>
				<select name="brand">
					<option value="0">选择品牌</option> 
					<{section name=b loop=$brand}>
						<option value="<{$brand[b].id}>" <{if $row.brand == $brand[b].id}>selected="selected"<{/if}>><{$brand[b].name}></option> 
					<{/section}>
				</select>
			</td>
		</tr> 
	<{if $attr}>		
		<tr>
			<td style=" padding-top:10px;" valign="top">产品属性：</td>
			<td> 
				<div class="attr">
				<{section name=a loop=$attr}>
					<div class="attr_box">
						<span><{$attr[a].name}></span> 
						<select name="attr[]">
							<option value="0">请选择</option> 
							<{section name=p loop=$attr[a].p_attr}>
								<option value="<{$attr[a].p_attr[p].id}>"<{if $row.id}><{if $attr[a].p_attr[p].id|in_array:$selected_attr}> selected="selected"<{/if}><{/if}>><{$attr[a].p_attr[p].name}></option> 
							<{/section}>
						</select>
					</div>
				<{/section}>
				</div>
			</td>
		</tr>
	<{/if}>
		<tr>
			<td style="padding-top:10px;" valign="top">展示主图：</td>
			<td class="upload_hd_img">
				<div class="show_hd_img">
					<{if $img_data}>	
						<{foreach item=img from=$img_data}>		 
							<div class="show_img">  
								<img src="<{$__IMG__}><{$img.url|img_size:80x80}>"/> 
								<span><img src="<{$__PUBLIC__}>images/icon/del.png" /></span>
								<input type="hidden" value="<{$img.url}>" id="goods_img" name="goods_img[]">
								<input type="hidden" value="<{$img.px}>" name="goods_img_px[]" class="goods_img_px">
							</div>
						<{/foreach}>
					<{else}>
						<div class="no_img"></div>
					<{/if}>	
				</div>
				<div class="upload_album"><a href="javascript:;" onclick="upload_manage('head_img','',true)">上传图片</a></div>
				<div class="prompt">建议尺寸：640 x 640 像素；最多可以上传5张图片；</div>
			</td>
		</tr>
	
		<!---------SKU--------->  
		<tr>
			<td style="padding-top:10px;" valign="top">库存/规格：</td>
			<td>
				<div class="skuBig">	
					<div id="sku_checkbox">
						<{section name=s loop=$sku}> 
							<div class="sku_con">
								<div class="sku_name"><span><{$sku[s].name}></span></div>
								<div class="sku_detail">
							<{section name=p loop=$sku[s].p_sku}> 
								<label><input class="sku_checkbox" type="checkbox" name="sku_val" value="<{$sku[s].p_sku[p].id}>"  <{if $row.id}><{if $sku[s].p_sku[p].id|@in_array:$checked_sku}>checked="checked"<{/if}><{/if}>><{$sku[s].p_sku[p].name}></label>
							<{/section}>
								</div>
							</div> 
						<{/section}>
					</div>
					<div id="sku_color_img"><{$goods_sku_images}></div>
					<div id="sku_list"><{$goods_sku_list}></div>
				</div>
			</td> 
		</tr>
		
		<!----------SKU---------->   
		<tr>
			<td>一口价：</td>
			<td class="td_price">
				<input type="text" name="price" class="edit" size="8" id="price" value="<{$row.price}>"/>  
				<div class="price_market">
					<span>总库存：</span>
					<input type="text" name="stock" class="edit" size="8" id="stock" value="<{$row.stock}>"/><i>*</i> 
				</div>  
				<div class="price_market">
					<span>条形码：</span>
					<input type="text" name="code" class="edit" size="15" id="code" value="<{$row.code}>"/><i>*</i> 
				</div> 
			</td>
		</tr> 
		<tr>
			<td>市场价：</td>
			<td><input type="text" name="market_price" class="edit" size="8" id="market_price" value="<{$row.market_price}>"/><i>*</i></td>
		</tr> 
		<tr> 
			<td valign="top" style="padding-top:10px;">产品详情：</td>
			<td><textarea name="content" rows="30" style="width:820px;"><{$row.content}></textarea> </td>
		</tr>
		<tr>
			<td>运费：</td>
			<td> 
				<select name="express">
				<{foreach item=i from=$express}>
				 	<option value="<{$i.id}>" <{if $i.id == $row.express}>selected="selected"<{/if}>><{$i.name}></option>
				<{/foreach}>	
				</select>
			</td>
		</tr>
		<tr>
			<td>二手：</td>
			<td> 
				<label><input type="radio" name="secondhand" value="1" <{if $row.status == '1' || $smarty.get.id == ''}>checked="checked"<{/if}>>是</label>
				<label><input type="radio" name="secondhand" value="0" <{if $row.status == '0'}>checked="checked"<{/if}>>否</label>
			</td>
		</tr>
		<tr>
			<td>状态：</td>
			<td> 
				<label><input type="radio" name="status" value="1" <{if $row.status == '1' || $smarty.get.id == ''}>checked="checked"<{/if}>>售卖</label>
				<label><input type="radio" name="status" value="0" <{if $row.status == '0'}>checked="checked"<{/if}>>下架</label>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td><input type="submit" name="submit" class="add_goods_submit" value="保 存"/></td>
		</tr>  
	</table> 
</form> 
<{include file="index/footer.html"}>  
<script type="text/javascript" src="<{$__APP__}>public/js/uqcmsupload.js"></script>
<script type="text/javascript" src="<{$__APP__}>public/js/goods_edit.js"></script>
