<%@ page language="C#" autoeventwireup="true" inherits="wap_user_photoEdit, kfenlei" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-control" content="no-cache" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<title><%=sWebName %> - 修改商家相册</title>
<link href="/js/css/layui.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css.css" />
<%=tools.sUserHtmlEdit("content")%>
</head>
<body>
<%=qTemplate.Ac("wapUserTop.html") %>
<script type="text/javascript" src="/js/jquery.form.js"></script>
<script type="text/javascript" language="javascript" src="/js/layui.js"></script>
<script type="text/javascript">
layui.use(['form','laydate'], function(){
var form = layui.form();
    form.render();
});
</script>
<div align="left">
<div class="wapPageTitle"><a href="/wap/user/index1.aspx" class="infoback">返回</a>修改商家相册</div>
<div class="clear10"></div>
<div class="infowrap" align="left">
<div class="userRight">
<div class="userRightContent">
<form action="/inc/kfUpload.aspx?s=nowatermark" style="display:none;" id="upFileForm" name="upFileForm" method="post" enctype="multipart/form-data">
<input type="file" id="upFile" name="upFile" />
<input type="submit" value="上传">
</form>
<form action="action.aspx?s=photoEdit" class="layui-form" method="post" name="edit">
<input type="hidden" name="id" value="<%=id%>" />
<input type="hidden" name="pic_path" id="inputpic1" value="<%=pic_path%>" />
<table width="100%" class="userMessTable" border="0" cellspacing="0" cellpadding="5">
<tr>
<td class="head" width="80">标题：</td>
<td><input class="inputText"  value="<%=title%>" name="title" type="text" size="20" /></td>
</tr>
<tr>
<td class="head">分类：</td>
<td><div class="selectDivLine"><select name="sort"><option value="">请选择</option><%=sSortList %></select></div></td> 
</tr>
<tr>
<td class="head">封图：</td>
<td><img src="images/nopic2.gif" id="pic1" width="96" height="96"  style="border:1px solid #e5e5e5; border-radius:3px; cursor:pointer;" class="fl5" onClick="$('#upFile').click();" /> <a href="#nogo" id="wapUploadBtn" class="fl5 bt2">上传</a></td>
</tr>
<tr>
<td class="head">内容：</td><td></td></tr>
<tr>
<td colspan="2"><textarea class="inputText" style="width:100%; height:300px;" name="content" id="content" rows="20" cols="30"><%=content%></textarea></td>
</tr>
</table>
<div class="clear10"></div>
<input type="submit" class="postSubmit" value="修改" />
</form>
<script language="javascript" type="text/javascript">
$("#wapUploadBtn").click(function(){
	$("#upFile").click();
});
$('#upFile').change(function(){
$("#pic1").attr('src',"/images/wait.gif");
$("#upFileForm").ajaxSubmit(
{
	url:"/inc/kfUpload.aspx",type:"POST",
	success:function(response)
	{
		var data=eval("("+response+")");
		if(data.status=="1")
		{ 
			valiUpPic('inputpic1','pic1',data.pic);
		}
		else
		{
			valiUpPic('inputpic1','pic1',data.pic);
  			alert(data.ps);
		}
  	},
 	error:function(msg)
	{
	}
});
$('#upFile').val('');
});

function valiUpPic(picInputId,picId,picValue)
{
	if(picValue!="")
	{
		if($("#"+picInputId)!=null)
		{
  			$("#"+picInputId).val(picValue);
		}
	}
	if($("#"+picId)!=null)
	{
		if($("#"+picInputId).val()!="")
		{
		    if(picValue.toLowerCase().indexOf("http://")==-1)
		    {
			   	$("#"+picId).attr('src',"/"+$("#"+picInputId).val());
		    }
		    else
		    {
				$("#"+picId).attr('src',$("#"+picInputId).val());
			}
		}
		else
		{
			$("#"+picId).attr('src','/user/images/nophoto.png');
		}
	}
  }
  valiUpPic('inputpic1','pic1','<%=pic_path%>');
  $('#sort').val('<%=sort%>');
  function valiForm()
  {
    return true
  }
</script>
</div>
</div>
</div></div>
<div class="clear80"></div>
</body>
</html>
