<!--{include file="<!--{$oetplpath}-->widget_header.tpl"}-->

<div class="oe_content_layout">
  <!--{include file="<!--{$oetplpath}-->widget_menu.tpl"}-->

  <div class="oe_cont_rt">
    
	<div class="oe_content_widget">
	
	  <div class="oe_tab_list">
        <ul>
		  <li><a href="<!--{$oefile}-->&c=goodscustcat">商品分类</a></li>
          <li class="current"><a href="<!--{$oefile}-->&c=goods">商品管理</a></li>
		  <li><a href="<!--{$oefile}-->&c=goodsbespoke">商品预约</a></li>
        </ul>
      </div>

	  <h3 class="oe_f_title _bottom_border _margin_bottom">
	    商品<span>（商家发布商品、服务信息，可以开启和关闭在线购买和在线预约）</span>
		<strong><a href="<!--{$oefile}-->&c=<!--{$c}-->&a=add">发布商品+</a></strong>
	  </h3>

	  <!--{if $a == "run"}-->
	  <form id="search_form" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
	  <div class="oe_mer_search">
		类目：<!--{hook mod='goodscat' name='scatid' type='select' text='=不限=' value=$scatid}-->
		&nbsp;&nbsp;
	    商品名称：
		<input type="text" name="stitle" id="stitle"  class="input-150" value="<!--{$stitle}-->" />
		&nbsp;&nbsp;
		状态：
		<select name="sonsale" id="sonsale">
		<option value="">==</option>
		<option value="1"<!--{if $sonsale == '1'}--> selected<!--{/if}-->>上架</option>
		<option value="2"<!--{if $sonsale == '2'}--> selected<!--{/if}-->>下架</option>
		</select>	
		&nbsp;&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;
		<span class="_search_btn" id="btn_ser">搜索</span>
	  </div>
	  </form>
	  <script type="text/javascript">
	  $(function(){
		$("#btn_ser").bind("click", function(){
			$("#search_form").submit();
		});
	  });

	  function oeUpdate(type) { //更新
		$value = document.getElementsByName("id[]");;
		$valueArr = $value.length;
		$str = "";
		$num = 0;
		for (i=0; i<$valueArr; i++) {
			if($value[i].checked == true) {
				$str+=$value[i].value+",";
				$num++;
		   }
		}
		if ($num < 1) {
			ToastShow("请选择要操作的商品");
			return false;
		}
		$("#a").val("update");
		$("#type").val(type);
		$("#myform").submit();
	  }

	  function oeDel() { //删除
		$value = document.getElementsByName("id[]");;
		$valueArr = $value.length;
		$str = "";
		$num = 0;
		for (i=0; i<$valueArr; i++) {
			if($value[i].checked == true) {
				$str+=$value[i].value+",";
				$num++;
		   }
		}
		if ($num < 1) {
			ToastShow("请选择要删除的商品");
			return false;
		}
		$("#a").val("del");
		$("#myform").submit();
		return true;
	  }
	  </script>
	  <!--{if $total > 0}-->
	  <div class="oe_manage_but">
	    <span><a href="javascript:;" onclick="oeUpdate('eliteopen');">设置推荐</a></span>
		<span><a href="javascript:;" onclick="oeUpdate('eliteclose');">取消推荐</a></span>
		<span><a href="javascript:;" onclick="oeUpdate('saleopen');">上架</a></span>
		<span><a href="javascript:;" onclick="oeUpdate('saleclose');">下架</a></span>
		<span><a href="javascript:;" onclick="oePopConfirm('确定要删除吗？', 'oeDel');">删除</a></span>
	  </div>
	  <!--{/if}-->
	  
	  <form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post" />
	  <input type="hidden" name="a" id="a" id="update" />
	  <input type="hidden" name="type" id="type" value="" />
	  <table class="oe_table_list_3">
		<tr>
		  <th width="3%"><input type="checkbox" id="selAll" onclick="oemarrySelectAll(this, 'selall');" class="icon-checkbox-unchecked" /></th>
		  <th width="8%"></th>
	      <th>商品</th>
		  <th width="12%">类目</th>
		  <th width="7%">价格</th>
		  <th width="7%">销量</th>
		  <th width="7%">状态</th>
		  <th width="7%">审核</th>
		  <th width="7%">推荐</th>
		  <th width="8%">操作</th>
	    </tr>
		<!--{if empty($goods)}-->
		<tr>
		  <td class="text_center" colspan="10">对不起，没有找到匹配的信息！</td>
		</tr>
		<!--{else}-->
		<!--{foreach $goods as $volist}-->
		<tr>
		  <td><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.goodsid}-->" /></td>
		  <td>
		  <!--{if !empty($volist.drawimg)}-->
		  <img f="view" src="<!--{$volist.drawimg}-->" width="80px" height="80px" />
		  <!--{else}-->
		  <img src="tpl/static/images/waitimg.jpg" width="80px" height="80px" />
		  <!--{/if}-->
		  </td>
		  <td valign="top">
		    <!--{if $volist.flag == '1'}-->
		    <a href="javascript:;" f="detail" data-mod="goods" data-id="<!--{$volist.goodsid}-->"><!--{$volist.goodsname}--></a>
			<!--{else}-->
			<!--{$volist.goodsname}-->
			<!--{/if}-->
			<br />
			<!--{$volist.addtime|date_format:"%Y-%m-%d %H:%M:%S"}-->
		  </td>
		  <td class="text_center">
		  <!--{if $volist.catid == '0'}-->
		  ~~
		  <!--{else}-->
		  <!--{$volist.catname}-->
		  <!--{/if}-->
		  </td>
		  <td class="text_center">¥<!--{doubleval($volist.price)}--></td>
		  <td class="text_center"><!--{$volist.sales}--></td>
		  <td class="text_center">
		  <!--{if $volist.onsale=='1'}-->
		  <font color="green">上架</font>
		  <!--{else}-->
		  <font color="red">下架</font>
		  <!--{/if}-->
		  </td>
		  <td class="text_center">
			  <!--{if $volist.flag == '0'}-->
			  <font color="gray">待审</font>
			  <!--{elseif $volist.flag == '1'}-->
			  <font color="green">通过</font>
			  <!--{else}-->
			  <font color="red">未通过</font>
			  <!--{/if}-->
		  </td>
		  <td class="text_center">
			  <!--{if $volist.elite == '1'}-->
			  <font color="green">是</font>
			  <!--{else}-->
			  <font color="gray">否</font>
			  <!--{/if}-->
		  </td>
		  <td class="text_center">
		    <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.goodsid}-->&<!--{$comeurl}-->">编辑</a>
		  </td>
		</tr>
		<!--{/foreach}-->
		<!--{/if}-->
	  </table>
	  </form>
	  <!--{if $total > 0}-->
	  <div class="oe_manage_but">
	    <span><a href="javascript:;" onclick="oeUpdate('eliteopen');">设置推荐</a></span>
		<span><a href="javascript:;" onclick="oeUpdate('eliteclose');">取消推荐</a></span>
		<span><a href="javascript:;" onclick="oeUpdate('saleopen');">上架</a></span>
		<span><a href="javascript:;" onclick="oeUpdate('saleclose');">下架</a></span>
		<span><a href="javascript:;" onclick="oePopConfirm('确定要删除吗？', 'oeDel');">删除</a></span>
	  </div>
	  <!--{/if}-->
	  <div class="oe_page_layout">
	    <!--{$showpage}-->
	  </div>
	  <!--{/if}-->


	  <!--{if $a == "add"}-->
	  <!--{include file="<!--{$oetplpath}-->widget_editor.tpl"}-->
	  <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%"><font color="red">*</font> 商品类目：</th>
		  <td width="35%">
		    <!--{hook mod='goodscat' type='select' name='catid' text='=请选择='}-->
		  </td>
	      <th width="15%">店铺商品分类：</th>
		  <td width="35%"><!--{hook mod='goodscustcat' type='select' name='custid' text='=请选择='}--></td>
	    </tr>
		<tr>
		  <th><font color="red">*</font> 商品名称：</th>
		  <td colspan="3">
		    <input type="text" name="goodsname" id="goodsname" class="input-b" f="checktitle" data-tips="tips_title" />
			<span id="tips_title">（30个字以内）</span>

		  </td>
		</tr>

		<tr>
		  <th><font color="red">*</font> 价格设置：</th>
		  <td colspan="3">
		    原价：<input type="text" name="oldprice" id="oldprice" class="input-80" /> 元&nbsp;&nbsp;
		    现价：<input type="text" name="price" id="price" class="input-80" /> 元&nbsp;&nbsp;
			物流费用：<input type="text" name="logistfee" id="logistfee" class="input-80" /> 元（0表示包邮）
		  </td>
		</tr>

		<tr>
		  <th>允许购买：</th>
		  <td>
		    <input type="radio" name="canbuy" id="canbuy" value="1" checked />开启，
			<input type="radio" name="canbuy" id="canbuy" value="0" />关闭 &nbsp;<br />
			&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;<br />
			&nbsp;已预约人数：<input type="text" name="bespokes" id="bespokes" class="input-80" />
		  </td>
		</tr>

		<tr>
	      <th>设置推荐：</th>
		  <td>
			<input type="radio" name="elite" id="elite" value="1" />是，
			<input type="radio" name="elite" id="elite" value="0" checked />否
		  </td>
		  <th>销售状态：</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>浏览次数：</th>
		  <td colspan="3">
		    <input type="text" name="hits" id="hits" class="input-100" />
		  </td>
		</tr>
	    <tr>
		  <th>
		    <font color="red">*</font> 商品图片：<br />
			（第一张为主图）
		  </th>
		  <td colspan="3">
		  
		  <div class="oe_gallery_list">

			<dl>
			  <dt><img id="img_preview" src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" /></dt>
			  <dd>
				<label>点击上传<input type="file" name="img" id="img" value="" /></label>
				<span f="removeimg" data-target="img">移除</span>
				<i id="img_loading" class="_loadimg_img"><img src="<!--{$urlpath}-->tpl/static/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" /></dt>
			  <dd>
				<label>点击上传<input type="file" name="img<!--{$volist.i}-->" id="img<!--{$volist.i}-->" value="" /></label>
				<span f="removeimg" data-target="img<!--{$volist.i}-->">移除</span>
				<i id="img<!--{$volist.i}-->_loading" class="_loadimg_img"><img src="<!--{$urlpath}-->tpl/static/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>

		<tr>
	      <th>其他价格：</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>其他属性：</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><font color="red">*</font> 商品详情：</th>
		  <td colspan="3">
		    <textarea name="content" id="content" style="width:98%;height:400px;"></textarea>
		  </td>
	    </tr>
		<tr>
	      <th>meta标题：</th>
		  <td colspan="3">
		    <input type="text" name="metatitle" id="metatitle" class="input-b" />
		  </td>
	    </tr>

		<tr>
	      <th>meta描述：</th>
		  <td colspan="3">
		    <textarea name="metadesc" id="metadesc" style="width:60%;height:40px;"></textarea>
		  </td>
	    </tr>
		<tr>
	      <th>meta关键字：</th>
		  <td colspan="3">
		    <textarea name="metakeyword" id="metakeyword" style="width:60%;height:40px;"></textarea><br />
		  （多个关键词请使用英文逗号“,”隔开）
		  </td>
	    </tr>
		<tr>
		  <td></td>
		  <td colspan="3">
			<input type="button" id="btn_post" class="submit_btn1" value="添加保存" /> 
		  </td>
		</tr>
	  </table>
	  </form>
	  <script type="text/javascript">
	  $(function(){

		$("#btn_post").bind("click", function(){ //提交

			if ($("#catid").val().length == 0) {
				ToastShow("请选择类目", "catid");
				return false;
			}
			if ($("#goodsname").val().length == 0) {
				ToastShow("请填写商品名称", "goodsname");
				return false;
			}

			if ($("input[name='drawimg']").val().length == 0) {
				ToastShow("请上传主图");
				return false;
			}

			if ($("#oldprice").val().length == 0 || $("#price").val().length == 0) {
				ToastShow("请设置价格", "oldprice");
				return false;
			}
			if (OEeditor.html().length == 0) {
				ToastShow("请填写内容详情");
				return false;
			}
			$("#content").text(OEeditor.html());

			$("form").submit();
		});
	  });
	  </script>
	  <!--{/if}-->

	  <!--{if $a == "edit"}-->
	  <!--{include file="<!--{$oetplpath}-->widget_editor.tpl"}-->
	  <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%"><font color="red">*</font> 商品类目：</th>
		  <td width="35%">
		    <!--{hook mod='goodscat' type='select' name='catid' text='=请选择=' value=$goods.catid}-->
		  </td>
	      <th width="15%">店铺商品分类：</th>
		  <td width="35%"><!--{hook mod='goodscustcat' type='select' name='custid' text='=请选择=' value=$goods.custid}--></td>
	    </tr>
		<tr>
		  <th><font color="red">*</font> 商品名称：</th>
		  <td colspan="3">
		    <input type="text" name="goodsname" id="goodsname" class="input-b" value="<!--{$goods.goodsname}-->" f="checktitle" data-tips="tips_title" />
			<span id="tips_title">（30个字以内）</span>
		  </td>
		</tr>

		<tr>
		  <th><font color="red">*</font> 价格设置：</th>
		  <td colspan="3">
		    原价：<input type="text" name="oldprice" id="oldprice" class="input-80" value="<!--{doubleval($goods.oldprice)}-->" /> 元&nbsp;&nbsp;
		    现价：<input type="text" name="price" id="price" class="input-80" value="<!--{doubleval($goods.price)}-->" /> 元&nbsp;&nbsp;
			物流费用：<input type="text" name="logistfee" id="logistfee" class="input-80" value="<!--{doubleval($goods.logistfee)}-->" /> 元（0表示包邮）
		  </td>
		</tr>

		<tr>
		  <th>允许购买：</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;<br />
			&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;<br />
			&nbsp;已预约人数：<input type="text" name="bespokes" id="bespokes" class="input-80" value="<!--{$goods.bespokes}-->" />
		  </td>
		</tr>

		<tr>
	      <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>
		  <th>销售状态：</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>浏览次数：</th>
		  <td colspan="3">
		    <input type="text" name="hits" id="hits" class="input-100" value="<!--{$goods.hits}-->" />
		  </td>
		</tr>
	    <tr>
		  <th>
		    <font color="red">*</font> 商品图片：<br />
			（第一张为主图）
		  </th>
		  <td colspan="3">
		  
		  <div class="oe_gallery_list">

		    <dl>
			  <dt>
			    <!--{if !empty($goods.thumbimg)}-->
			    <img id="img_preview" src="<!--{$urlpath}--><!--{$goods.thumbimg}-->" />
				<!--{else}-->
				<img id="img_preview" src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" />
				<!--{/if}-->
			  </dt>
			  <dd>
			    <label>点击上传<input type="file" name="img" id="img" value="" /></label>
				<span f="removeimg" data-target="img">移除</span>
				<i id="img_loading" class="_loadimg_img"><img src="<!--{$urlpath}-->tpl/static/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}-->" />
				<!--{else}-->
				<img id="img<!--{$val.i}-->_preview" src="<!--{$urlpath}-->tpl/static/images/waitimg.jpg" />
				<!--{/if}-->
			  </dt>
			  <dd>
			    <label>上传图片<input type="file" name="img<!--{$val.i}-->" id="img<!--{$val.i}-->" value="" /></label>
				<span f="removeimg" data-target="img<!--{$val.i}-->">移除</span>
				<i id="img<!--{$val.i}-->_loading" class="_loadimg_img"><img src="<!--{$urlpath}-->tpl/static/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>

		<tr>
	      <th>其他价格：</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>其他属性：</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><font color="red">*</font> 商品详情：</th>
		  <td colspan="3">
		    <textarea name="content" id="content" style="width:98%;height:400px;"><!--{$goods.content}--></textarea>
		  </td>
	    </tr>
		<tr>
	      <th>meta标题：</th>
		  <td colspan="3">
		    <input type="text" name="metatitle" id="metatitle" class="input-b" value="<!--{$goods.metatitle}-->" />
		  </td>
	    </tr>

		<tr>
	      <th>meta描述：</th>
		  <td colspan="3">
		    <textarea name="metadesc" id="metadesc" style="width:60%;height:40px;"><!--{$goods.metadesc}--></textarea>
		  </td>
	    </tr>
		<tr>
	      <th>meta关键字：</th>
		  <td colspan="3">
		    <textarea name="metakeyword" id="metakeyword" style="width:60%;height:40px;"><!--{$goods.metakeyword}--></textarea><br />
		  （多个关键词请使用英文逗号“,”隔开）
		  </td>
	    </tr>
		<tr>
		  <td></td>
		  <td colspan="3">
			<input type="button" id="btn_post" class="submit_btn1" value="编辑保存" /> 
		  </td>
		</tr>
	  </table>
	  </form>
	  <script type="text/javascript">
	  $(function(){

		$("#btn_post").bind("click", function(){ //提交
			if ($("#catid").val().length == 0) {
				ToastShow("请选择类目", "catid");
				return false;
			}
			if ($("#goodsname").val().length == 0) {
				ToastShow("请填写商品名称", "goodsname");
				return false;
			}

			if ($("input[name='drawimg']").val().length == 0) {
				ToastShow("请上传主图");
				return false;
			}

			if ($("#oldprice").val().length == 0 || $("#price").val().length == 0) {
				ToastShow("请设置价格", "oldprice");
				return false;
			}
			if (OEeditor.html().length == 0) {
				ToastShow("请填写内容详情");
				return false;
			}
			$("#content").text(OEeditor.html());

			$("form").submit();
		});
	  });
	  </script>
	  <!--{/if}-->


	</div>
	<!--//oe_content_widget End-->

  </div>
  <div class="clear"></div>
  <!--//oe_cont_rt Enc-->
</div>
<!--{include file="<!--{$oetplpath}-->widget_footer.tpl"}-->
</body>
</html>