<!--{include file="<!--{$oetplpath}-->block_head.tpl"}-->
<!--{if $a == "run"}-->
<div class="oemarry_layout">
  <div class="oe_top_nav"><i></i>商品管理->商品列表</div>
  <div class="oe_content">
	
	<form id="serform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
	<div class="oe_txtwrap">
	  分类：<!--{hook mod='goodscat' name='scatid' type='select' text='=默认=' value=$scatid}-->&nbsp;
	  标题：<input type="text" name="stitle" id="stitle" class="input-150" value="<!--{$stitle}-->" />&nbsp;
	  店铺：<input type="text" name="sshopname" id="sshopname" class="input-150" value="<!--{$sshopname}-->" />&nbsp;
	  状态：
	  <select name="sflag" id="sflag">
	  <option value=""></option>
	  <option value="1"<!--{if $sflag == '1'}--> selected<!--{/if}-->>待审核</option>
	  <option value="2"<!--{if $sflag == '2'}--> selected<!--{/if}-->>已通过</option>
	  <option value="3"<!--{if $sflag == '3'}--> selected<!--{/if}-->>未通过</option>
	  </select>
	  &nbsp;&nbsp;<input type="submit" name="btn_search" id="btn_search" class="button_2" value="搜索" />
	</div>
	</form>

    <div class="oe_tools_bar clearfix">
      <a class="icon-checkbox-unchecked" href="javascript:;" id="selAll" onclick="oemarrySelectAll(this, 'selall');">全选/反选</a>
      <a class="icon-remove-2" onclick="oemarryDialogFormDel('myform');">删除</a>
      <span class="fr"><a class="icon-plus" href="<!--{$oefile}-->&c=<!--{$c}-->&a=add">添加</a></span>
    </div>
    
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&a=del" method="post">
    <table class="oe_table_list table_cs">
	  <tr>
	    <th width="8%">ID</th>
		<th width="12%">店铺</th>
		<th width="13%">商品</th>
		<th width="8%">分类</th>
		<th width="6%">图片</th>
		<th width="7%">价格</th>
		<th width="10%">添加时间</th>
		<th width="5%">状态</th>
		<th width="5%">推荐</th>
		<th width="5%">浏览</th>
		<th width="5%">预约</th>
		<th width="5%">销量</th>
		<th>操作</th>
	  </tr>
	  <!--{if empty($goods)}-->
	  <tr>
	    <td class="text_center" colspan="13">没有符合条件的信息！</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $goods as $volist}-->
	  <tr>
	    <td class="text_center"><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.goodsid}-->" /><!--{$volist.goodsid}--></td>
		<td><!--{$volist.shopname}--></td>
		<td><a href="<!--{$urlpath}-->index.php?c=goods&a=detail&id=<!--{$volist.goodsid}-->" target="_blank"><!--{$volist.goodsname}--></a></td>
		<td class="text_center"><!--{$volist.catname}--></td>
		<td class="text_center">
		<!--{if !empty($volist.thumbimg)}-->
		<img src="<!--{$volist.thumbimg}-->" width="20px" height="20px" data-img="<!--{$volist.drawimg}-->" f="viewimg" />
		<!--{else}-->
		~~
		<!--{/if}-->
		</td>
		<td>¥<!--{doubleval($volist.price)}--></td>
		<td class="text_center"><!--{$volist.addtime|date_format:"%Y-%m-%d"}--><br /><!--{$volist.addtime|date_format:"%H:%M:%S"}--></td>
		<td class="text_center">
		<!--{if $volist.flag=='1'}-->
			<input type="hidden" id="attr_flag<!--{$volist.goodsid}-->" value="flagclose" />
			<img id="flag<!--{$volist.goodsid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.goodsid}-->');" style="cursor:pointer;">	
		<!--{else}-->
			<input type="hidden" id="attr_flag<!--{$volist.goodsid}-->" value="flagopen" />
			<img id="flag<!--{$volist.goodsid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.goodsid}-->');" style="cursor:pointer;">
		<!--{/if}-->
		</td>
		<td class="text_center">
		<!--{if $volist.elite=='0'}-->
			<input type="hidden" id="attr_elite<!--{$volist.goodsid}-->" value="eliteopen" />
			<img id="elite<!--{$volist.goodsid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('elite', '<!--{$volist.goodsid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_elite<!--{$volist.goodsid}-->" value="eliteclose" />
			<img id="elite<!--{$volist.goodsid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('elite', '<!--{$volist.goodsid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
		</td>
		<td class="text_center"><!--{$volist.hits}--></td>
		<td class="text_center"><!--{$volist.bespokes}--></td>
		<td class="text_center"><!--{$volist.sales}--></td>
		<td class="text_center">
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.goodsid}-->&<!--{$comeurl}-->" class="oe_ico_blue">编辑</a>
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.goodsid}-->&<!--{$comeurl}-->');" class="oe_ico_red">删除</a>
		</td>
	  </tr>
	  <!--{/foreach}-->
	  <!--{/if}-->
	</table>
	</form>

	<div class="oe_page_box"><!--{$showpage}--></div>

  </div>
</div>
<!--{/if}-->

<!--{if $a == 'add'}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
	<i></i>商品管理->添加商品
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->">&lt;&lt;返回列表</a></span>
  </div>
  <div class="oe_content">
    <h6>基本信息</h6>
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post" />
	<input type="hidden" name="a" id="a" value="saveadd" />
    <table class="oe_table_wrap">
	  <tr>
	    <th width="15%">分类：<span class="f_red"></span></th>
		<td width="35%"><!--{hook mod='goodscat' type='select' name='catid' text='=请选择='}--></td>
		<th width="15%">所属店铺：<span class="f_red">*</span></th>
		<td width="35%">
		  <input type="text" name="shopid" id="shopid" readonly="only" class="input-100" /> 
		  <span id="shopid_tips"></span>
		  <a href="###" onclick="oemarry_varpop_shop('shopid');" style="color:blue;">选择店铺</a>
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
	    <th>商品标题：<span class="f_red">*</span></th>
		<td>
		  <input type="text" name="goodsname" id="goodsname" class="input-b" />
		  <span class="oe_trap">（30个字以内）</span>
		</td>
		<th>商品类型：<span class="f_red"></span></th>
		<td>
		  <select name="type" id="type">
		  <option value="1">实物</option>
		  <option value="2">虚拟物品</option>
		  </select>
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
	    <th>原价：<span class="f_red"></span> </th>
		<td><input type="text" name="oldprice" id="oldprice" class="input-100" /> 元 （填写数字）</td>
		<th>物流费用：<span class="f_red"></span></th>
		<td><input type="text" name="logistfee" id="logistfee" class="input-100" /> 元（0表示商家包邮）</td>
	  </tr>
	  <tr>
		<th>现价(优惠价)：<span class="f_red"></span></th>
		<td><input type="text" name="price" id="price" class="input-100" /> 元（填写数字）</td>
	    <th>销售状态：<span class="f_red"></span> </th>
		<td>
		  <input type="radio" name="onsale" id="onsale" value="1" checked />上架，
		  <input type="radio" name="onsale" id="onsale" value="0" />下架
		</td>
	  </tr>
	  <tr>
	    <th>允许购买：<span class="f_red"></span> </th>
		<td>
		<input type="radio" name="canbuy" id="canbuy" value="1" checked />开启，
		<input type="radio" name="canbuy" id="canbuy" value="0" />关闭 &nbsp;
		已卖数量：<input type="text" name="sales" id="sales" class="input-80" />
		</td>
		<th>允许预约：</th>
		<td>
		<input type="radio" name="canbespoke" id="canbespoke" value="1" checked />开启，
		<input type="radio" name="canbespoke" id="canbespoke" value="0" />关闭 &nbsp;
		已预约人数：<input type="text" name="bespokes" id="bespokes" class="input-80" />
		</td>
	  </tr>
	  <tr>
	    <th>审核状态：<span class="f_red"></span> </th>
		<td>
		<input type="radio" name="flag" id="flag" value="1" checked />正常，
		<input type="radio" name="flag" id="flag" value="0" />锁定
		</td>
		<th>推荐：</th>
		<td>
		<input type="radio" name="elite" id="elite" value="1" />是，
		<input type="radio" name="elite" id="elite" value="0" checked />否
		</td>
	  </tr>
	  <tr>
	    <th>排序：<span class="f_red"></span> </th>
		<td><input type="text" name="orders" id="orders" class="input-100" /> （店铺主页按排序显示商品）</td>
		<th>浏览次数：</th>
		<td><input type="text" name="hits" id="hits" class="input-100" />次</td>
	  </tr>

	  <tr>
		<th>
		  商品图片：<span class="f_red"></span>
		  <br />第一张为主图，除了主图可以再上传8张图
		</th>
		<td colspan="3">
		  <div class="oe_gallery_list">

		    <dl>
			  <dt><img id="img_preview" src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" f="viewimg" /></dt>
			  <dd>
			    <label>上传图片<input type="file" name="img" id="img" value="" /></label>
				<span style="cursor:pointer;" f="removeimg" data-preview="img_preview" data-thumb="img_thumb" data-draw="img_url">移除</span>
				<i id="img_loading" class="_loadimg_img"><img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" /></i>
				<input type="hidden" id="img_thumb" name="thumbimg" value="" />
				<input type="hidden" id="img_url" name="drawimg" value="" />
				<script type="text/javascript">
				$(function(){
				  $("#img").live("change", function(){
					oemarryUploadImg("img", "<!--{$oefile}-->&c=index&a=uploadimg&module=goods&thumbfiles=1");
				  });
				});
				</script>
			  </dd>
			</dl>
			<!--{foreach $listnum as $volist}-->
			<dl>
			  <dt><img id="img<!--{$volist.i}-->_preview" src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" f="viewimg" /></dt>
			  <dd>
			    <label>上传图片<input type="file" name="img<!--{$volist.i}-->" id="img<!--{$volist.i}-->" value="" /></label>
				<span style="cursor:pointer;" f="removeimg" data-preview="img<!--{$volist.i}-->_preview" data-thumb="img<!--{$volist.i}-->_thumb" data-draw="img<!--{$volist.i}-->_url">移除</span>
				<i id="img<!--{$volist.i}-->_loading" class="_loadimg_img"><img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" /></i>
				<input type="hidden" id="img<!--{$volist.i}-->_thumb" name="img<!--{$volist.i}-->_thumb" value="" />
				<input type="hidden" id="img<!--{$volist.i}-->_url" name="img<!--{$volist.i}-->_url" value="" />
				<script type="text/javascript">
				$(function(){
				  $("#img<!--{$volist.i}-->").live("change", function(){
					oemarryUploadImg("img<!--{$volist.i}-->", "<!--{$oefile}-->&c=index&a=uploadimg&module=goods&thumbfiles=1");
				  });
				});
				</script>
			  </dd>
			</dl>
			<!--{/foreach}-->


			<div class="clear"></div>
		  </div>
		</td>
	  </tr>

	</table>
	<h6>其他信息</h6>
	<table class="oe_table_wrap">
	  <tr>
		<th>其他价格：<span class="f_red"></span> </th>
		<td colspan="3">
		  <table class="oe_table_wrap">
		    <tr>
			  <td>
			    显示名称：<input type="text" name="pricename" id="pricename" class="input-150" /> 
				（如：套餐，颜色等，没有其他价格，请留空）
			  </td>
			</tr>
		  </table>
		  <input type="hidden" name="pricenum" id="pricenum" value="3" />
		  <table class="oe_table_wrap" id="price_list" style="width:600px;">
		    <tr>
			  <th width="20%" class="text_center">排序</th>
			  <th align="center" class="text_center">名称</th>
			  <th width="30%" class="text_center">价格(元)</th>
			  <th width="10%" class="text_center">操作</th>
			</tr>

			<tr>
			  <td><input type="text" name="priceid_1" id="priceid_1" class="input-s" /></td>
			  <td><input type="text" name="name_1" id="name_1" class="input-150" /></td>
			  <td><input type="text" name="price_1" id="price_1" class="input-100" /></td>
			  <td><a href="javascript:;" onclick="oemarryDelTrItem(this);">移除</a></td>
			</tr>
			<tr>
			  <td><input type="text" name="priceid_2" id="priceid_2" class="input-s" /></td>
			  <td><input type="text" name="name_2" id="name_2" class="input-150" /></td>
			  <td><input type="text" name="price_2" id="price_2" class="input-100" /></td>
			  <td><a href="javascript:;" onclick="oemarryDelTrItem(this);">移除</a></td>
			</tr>
			<tr>
			  <td><input type="text" name="priceid_3" id="priceid_3" class="input-s" /></td>
			  <td><input type="text" name="name_3" id="name_3" class="input-150" /></td>
			  <td><input type="text" name="price_3" id="price_3" class="input-100" /></td>
			  <td><a href="javascript:;" onclick="oemarryDelTrItem(this);">移除</a></td>
			</tr>
		  </table>
		  <table class="oe_table_wrap">
		    <tr>
			  <td>
			    <span style="color:blue;cursor:pointer;" id="btn_addmore_price">添加更多价格</span>
			  </td>
			</tr>
		  </table>
		  <script type="text/javascript">
		  $(function(){
			$("#btn_addmore_price").bind("click", function(){
				oemarryAddGoodsPriceItem("price_list", "pricenum");
			});
		  });
		  </script>

		</td>
	  </tr>
	  <tr>
		<th>其他属性：<span class="f_red"></span> </th>
		<td colspan="3">
		  <table class="oe_table_wrap">
		    <tr>
			  <td>
			    显示名称：<input type="text" name="attrname" id="attrname" class="input-150" />  
				（如：尺码、型号等没有其他属性，请留空）
			  </td>
			</tr>
		  </table>
		  <input type="hidden" name="attrnum" id="attrnum" value="3" />
		  <table class="oe_table_wrap" id="attr_list" style="width:400px;">
		    <tr>
			  <th width="25%" class="text_center">排序</th>
			  <th align="center" class="text_center">名称</th>
			  <th width="15%" class="text_center">操作</th>
			</tr>
			<tr>
			  <td><input type="text" name="attrid_1" id="attrid_1" class="input-s" /></td>
			  <td><input type="text" name="attrvalue_1" id="attrvalue_1" class="input-150" /></td>
			  <td><a href="javascript:;" onclick="oemarryDelTrItem(this);">移除</a></td>
			</tr>
			<tr>
			  <td><input type="text" name="attrid_2" id="attrid_2" class="input-s" /></td>
			  <td><input type="text" name="attrvalue_2" id="attrvalue_2" class="input-150" /></td>
			  <td><a href="javascript:;" onclick="oemarryDelTrItem(this);">移除</a></td>
			</tr>
			<tr>
			  <td><input type="text" name="attrid_3" id="attrid_3" class="input-s" /></td>
			  <td><input type="text" name="attrvalue_3" id="attrvalue_3" class="input-150" /></td>
			  <td><a href="javascript:;" onclick="oemarryDelTrItem(this);">移除</a></td>
			</tr>
		  </table>
		  <table class="oe_table_wrap">
		    <tr>
			  <td>
			    <span style="color:blue;cursor:pointer" id="btn_addmore_attr">添加更多属性</span>
			  </td>
			</tr>
		  </table>
		  <script type="text/javascript">
		  $(function(){
			$("#btn_addmore_attr").bind("click", function(){
				oemarryAddGoodsAttrItem("attr_list", "attrnum");
			});
		  });
		  </script>
		</td>
	  </tr>

	  <tr>
	    <th width="15%">详情说明：</th>
		<td colspan="3">
		<textarea name="content" id="content" style="width:90%;height:350px;display:none;"></textarea>
		</td>
	  </tr>
	  <tr>
		<th>meta标题：<span class="f_red"></span> </th>
		<td colspan="3"><input type="text" name="metatitle" id="metatitle" class="input-b" /></td>
	  </tr>
	  <tr>
		<th>meta描述：<span class="f_red"></span> </th>
		<td colspan="3"><textarea name="metadesc" id="metadesc" style="width:50%;height:40px;"></textarea></td>
	  </tr>
	  <tr>
		<th>meta关键词：<span class="f_red"></span> </th>
		<td colspan="3">
		  <textarea name="metakeyword" id="metakeyword" style="width:50%;height:40px;"></textarea><br />
		  （多个关键词请使用英文逗号“,”隔开）
		</td>
	  </tr>
	  <tr>
	    <td></td>
		<td colspan="3"> <input type="button" id="btn_save" class="button_2" value="添加保存" /> </td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){
	var myeditor;
	KindEditor.ready(function(K) {myeditor = K.create("#content");});

	$("#btn_save").bind("click", function(){
		if ($("#goodsname").val().length == 0) {
			ToastShow("请填写商品标题", "title");
			return false;
		}
		$("#content").text(myeditor.html());
		$("#myform").submit();
	});
});
</script>
<!--{/if}-->


<!--{if $a == 'edit'}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
	<i></i>商品管理->编辑商品
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->">&lt;&lt;返回列表</a></span>
  </div>
  <div class="oe_content">

    <h6>基本资料</h6>
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->" method="post" />
	<input type="hidden" name="a" id="a" value="saveedit" />
	<input type="hidden" name="id" id="id" value="<!--{$id}-->" />
    <table class="oe_table_wrap">
	  <tr>
	    <th width="15%">分类：<span class="f_red"></span></th>
		<td width="35%"><!--{hook mod='goodscat' type='select' name='catid' text='=请选择=' value=$goods.catid}--></td>
		<th width="15%">所属店铺：<span class="f_red">*</span></th>
		<td width="35%">
		  <input type="text" name="shopid" id="shopid" readonly="only" class="input-100" value="<!--{$goods.shopid}-->" /> 
		  <span id="shopid_tips"><!--{$goods.shopname}--></span>
		  <a href="###" onclick="oemarry_varpop_shop('shopid');" style="color:blue;">选择店铺</a>
		  <span class="oe_trap"></span>
		</td>
	  </tr>
	  <tr>
	    <th>商品标题：<span class="f_red">*</span></th>
		<td>
		  <input type="text" name="goodsname" id="goodsname" class="input-b" value="<!--{$goods.goodsname}-->" />
		  <span class="oe_trap">（30个字以内）</span>
		</td>
		<th>商品类型：<span class="f_red"></span></th>
		<td>
		  <select name="type" id="type">
		  <option value="1"<!--{if $goods.type == '1'}--> selected<!--{/if}-->>实物</option>
		  <option value="2"<!--{if $goods.type == '2'}--> selected<!--{/if}-->>虚拟物品</option>
		  </select>
		  <span class="oe_trap"></span>
		</td>
	  </tr>

	  <tr>
	    <th>原价：<span class="f_red"></span> </th>
		<td><input type="text" name="oldprice" id="oldprice" class="input-100" value="<!--{doubleval($goods.oldprice)}-->" /> 元 （填写数字）</td>
		<th>物流费用：<span class="f_red"></span></th>
		<td><input type="text" name="logistfee" id="logistfee" class="input-100" value="<!--{doubleval($goods.logistfee)}-->" /> 元（0表示商家包邮）</td>
	  </tr>
	  <tr>
		<th>现价(优惠价)：<span class="f_red"></span></th>
		<td><input type="text" name="price" id="price" class="input-100" value="<!--{doubleval($goods.price)}-->" /> 元（填写数字）</td>
	    <th>销售状态：<span class="f_red"></span> </th>
		<td>
		  <input type="radio" name="onsale" id="onsale" value="1"<!--{if $goods.onsale == '1'}--> checked<!--{/if}--> />上架，
		  <input type="radio" name="onsale" id="onsale" value="0"<!--{if $goods.onsale == '0'}--> checked<!--{/if}--> />下架
		</td>
	  </tr>
	  <tr>
	    <th>允许购买：<span class="f_red"></span> </th>
		<td>
		<input type="radio" name="canbuy" id="canbuy" value="1"<!--{if $goods.canbuy == '1'}--> checked<!--{/if}--> />开启，
		<input type="radio" name="canbuy" id="canbuy" value="0"<!--{if $goods.canbuy == '0'}--> checked<!--{/if}--> />关闭 &nbsp;
		已卖数量：<input type="text" name="sales" id="sales" class="input-80" value="<!--{$goods.sales}-->" />
		</td>
		<th>允许预约：</th>
		<td>
		<input type="radio" name="canbespoke" id="canbespoke" value="1"<!--{if $goods.canbespoke == '1'}--> checked<!--{/if}--> />开启，
		<input type="radio" name="canbespoke" id="canbespoke" value="0"<!--{if $goods.canbespoke == '0'}--> checked<!--{/if}--> />关闭 &nbsp;
		已预约人数：<input type="text" name="bespokes" id="bespokes" class="input-80" value="<!--{$goods.bespokes}-->" />
		</td>
	  </tr>
	  <tr>
	    <th>审核状态：<span class="f_red"></span> </th>
		<td>
		<input type="radio" name="flag" id="flag" value="1"<!--{if $goods.flag == '1'}--> checked<!--{/if}--> />正常，
		<input type="radio" name="flag" id="flag" value="0"<!--{if $goods.flag == '0'}--> checked<!--{/if}--> />锁定
		</td>
		<th>推荐：</th>
		<td>
		<input type="radio" name="elite" id="elite" value="1"<!--{if $goods.elite == '1'}--> checked<!--{/if}--> />是，
		<input type="radio" name="elite" id="elite" value="0"<!--{if $goods.elite == '0'}--> checked<!--{/if}--> />否
		</td>
	  </tr>
	  <tr>
	    <th>排序：<span class="f_red"></span> </th>
		<td><input type="text" name="orders" id="orders" class="input-100" value="<!--{$goods.orders}-->" /> （店铺主页按排序显示商品）</td>
		<th>浏览次数：</th>
		<td><input type="text" name="hits" id="hits" class="input-100" value="<!--{$goods.hits}-->" />次</td>
	  </tr>

	  <tr>
		<th>
		  商品图片：<span class="f_red"></span>
		  <br />第一张为主图，除了主图可以再上传8张图
		</th>
		<td colspan="3">
		  <div class="oe_gallery_list">

		    <dl>
			  <dt>
			    <!--{if !empty($goods.thumbimg)}-->
			    <img id="img_preview" src="<!--{$urlpath}--><!--{$goods.thumbimg}-->" f="viewimg" data-img="<!--{$goods.drawimg}-->" />
				<!--{else}-->
				<img id="img_preview" src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" f="viewimg" />
				<!--{/if}-->
			  </dt>
			  <dd>
			    <label>上传图片<input type="file" name="img" id="img" value="" /></label>
				<span style="cursor:pointer;" f="removeimg" data-preview="img_preview" data-thumb="img_thumb" data-draw="img_url">移除</span>
				<i id="img_loading" class="_loadimg_img"><img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" /></i>
				<input type="hidden" id="img_thumb" name="thumbimg" value="<!--{$goods.thumbimg}-->" />
				<input type="hidden" id="img_url" name="drawimg" value="<!--{$goods.drawimg}-->" />
				<script type="text/javascript">
				$(function(){
				  $("#img").live("change", function(){
					oemarryUploadImg("img", "<!--{$oefile}-->&c=index&a=uploadimg&module=goods&thumbfiles=1");
				  });
				});
				</script>
			  </dd>
			</dl>

			<!--{foreach $goods.gallerylist as $val}-->
			<dl>
			  <dt>
			    <!--{if !empty($val.imgthumb)}-->
			    <img id="img<!--{$val.i}-->_preview" src="<!--{$urlpath}--><!--{$val.imgthumb}-->" f="viewimg" data-img="<!--{$val.imgurl}-->" />
				<!--{else}-->
				<img id="img<!--{$val.i}-->_preview" src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" f="viewimg" />
				<!--{/if}-->
			  </dt>
			  <dd>
			    <label>上传图片<input type="file" name="img<!--{$val.i}-->" id="img<!--{$val.i}-->" value="" /></label>
				<span style="cursor:pointer;" f="removeimg" data-preview="img<!--{$val.i}-->_preview" data-thumb="img<!--{$val.i}-->_thumb" data-draw="img<!--{$val.i}-->_url">移除</span>
				<i id="img<!--{$val.i}-->_loading" class="_loadimg_img"><img src="<!--{$urlpath}-->tpl/admin/images/loading.gif" /></i>
				<input type="hidden" id="img<!--{$val.i}-->_thumb" name="img<!--{$val.i}-->_thumb" value="<!--{$val.imgthumb}-->" />
				<input type="hidden" id="img<!--{$val.i}-->_url" name="img<!--{$val.i}-->_url" value="<!--{$val.imgurl}-->" />
				<script type="text/javascript">
				$(function(){
				  $("#img<!--{$val.i}-->").live("change", function(){
					oemarryUploadImg("img<!--{$val.i}-->", "<!--{$oefile}-->&c=index&a=uploadimg&module=goods&thumbfiles=1");
				  });
				});
				</script>
			  </dd>
			</dl>
			<!--{/foreach}-->


			<div class="clear"></div>
		  </div>
		</td>
	  </tr>

	</table>
	<h6>其他信息</h6>
	<table class="oe_table_wrap">
	  <tr>
		<th>其他价格：<span class="f_red"></span> </th>
		<td colspan="3">
		  <table class="oe_table_wrap">
		    <tr>
			  <td>
			    显示名称：<input type="text" name="pricename" id="pricename" class="input-150" value="<!--{$goods.pricename}-->" /> 
				（如：套餐，颜色等，没有其他价格，请留空）
			  </td>
			</tr>
		  </table>
		  <input type="hidden" name="pricenum" id="pricenum" value="<!--{count($goods.pricelist)}-->" />
		  <table class="oe_table_wrap" id="price_list" style="width:600px;">
		    <tr>
			  <th width="20%" class="text_center">排序</th>
			  <th align="center" class="text_center">名称</th>
			  <th width="30%" class="text_center">价格(元)</th>
			  <th width="10%" class="text_center">操作</th>
			</tr>
			<!--{foreach $goods.pricelist as $val}-->
			<tr>
			  <td><input type="text" name="priceid_<!--{$val.i}-->" id="priceid_<!--{$val.i}-->" class="input-s" value="<!--{$val.priceid}-->" /></td>
			  <td><input type="text" name="name_<!--{$val.i}-->" id="name_<!--{$val.i}-->" class="input-150"  value="<!--{$val.name}-->" /></td>
			  <td><input type="text" name="price_<!--{$val.i}-->" id="price_<!--{$val.i}-->" class="input-100"  value="<!--{$val.price}-->" /></td>
			  <td><a href="javascript:;" onclick="oemarryDelTrItem(this);">移除</a></td>
			</tr>
			<!--{/foreach}-->
		  </table>
		  <table class="oe_table_wrap">
		    <tr>
			  <td>
			    <span style="color:blue;cursor:pointer;" id="btn_addmore_price">添加更多价格</span>
			  </td>
			</tr>
		  </table>
		  <script type="text/javascript">
		  $(function(){
			$("#btn_addmore_price").bind("click", function(){
				oemarryAddGoodsPriceItem("price_list", "pricenum");
			});
		  });
		  </script>

		</td>
	  </tr>
	  <tr>
		<th>其他属性：<span class="f_red"></span> </th>
		<td colspan="3">
		  <table class="oe_table_wrap">
		    <tr>
			  <td>
			    显示名称：<input type="text" name="attrname" id="attrname" class="input-150" value="<!--{$goods.attrname}-->" />  
				（如：尺码、型号等没有其他属性，请留空）
			  </td>
			</tr>
		  </table>
		  <input type="hidden" name="attrnum" id="attrnum" value="<!--{count($goods.attrlist)}-->" />
		  <table class="oe_table_wrap" id="attr_list" style="width:400px;">
		    <tr>
			  <th width="25%" class="text_center">排序</th>
			  <th align="center" class="text_center">名称</th>
			  <th width="15%" class="text_center">操作</th>
			</tr>
			<!--{foreach $goods.attrlist as $val}-->
			<tr>
			  <td>
			    <input type="text" name="attrid_<!--{$val.i}-->" id="attrid_<!--{$val.i}-->" class="input-s" value="<!--{$val.attrid}-->" />
			  </td>
			  <td>
			    <input type="text" name="attrvalue_<!--{$val.i}-->" id="attrvalue_<!--{$val.i}-->" class="input-150" value="<!--{$val.attrvalue}-->" />
			  </td>
			  <td><a href="javascript:;" onclick="oemarryDelTrItem(this);">移除</a></td>
			</tr>
			<!--{/foreach}-->
		  </table>
		  <table class="oe_table_wrap">
		    <tr>
			  <td>
			    <span style="color:blue;cursor:pointer" id="btn_addmore_attr">添加更多属性</span>
			  </td>
			</tr>
		  </table>
		  <script type="text/javascript">
		  $(function(){
			$("#btn_addmore_attr").bind("click", function(){
				oemarryAddGoodsAttrItem("attr_list", "attrnum");
			});
		  });
		  </script>
		</td>
	  </tr>

	  <tr>
	    <th width="15%">详情说明：</th>
		<td colspan="3">
		  <textarea name="content" id="content" style="width:90%;height:350px;display:none;"><!--{$goods.content}--></textarea>
		</td>
	  </tr>
	  <tr>
		<th>meta标题：<span class="f_red"></span> </th>
		<td colspan="3"><input type="text" name="metatitle" id="metatitle" class="input-b" value="<!--{$goods.metatitle}-->" /></td>
	  </tr>
	  <tr>
		<th>meta描述：<span class="f_red"></span> </th>
		<td colspan="3"><textarea name="metadesc" id="metadesc" style="width:50%;height:40px;"><!--{$goods.metadesc}--></textarea></td>
	  </tr>
	  <tr>
		<th>meta关键词：<span class="f_red"></span> </th>
		<td colspan="3">
		  <textarea name="metakeyword" id="metakeyword" style="width:50%;height:40px;"><!--{$goods.metakeyword}--></textarea><br />
		  （多个关键词请使用英文逗号“,”隔开）
		</td>
	  </tr>
	  <tr>
	    <td></td>
		<td colspan="3"> <input type="button" id="btn_save" class="button_2" value="编辑保存" /> </td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){
	var myeditor;
	KindEditor.ready(function(K) {myeditor = K.create("#content");});

	$("#btn_save").bind("click", function(){
		if ($("#goodsname").val().length == 0) {
			ToastShow("请填写商品标题", "goodsname");
			return false;
		}
		$("#content").text(myeditor.html());
		$("#myform").submit();
	});
});
</script>
<!--{/if}-->
</body>
</html>