<%@ page language="C#" autoeventwireup="true" inherits="wap_user_weiyouhui, 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" />
</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();
	form.on('select(city)', function(data){
acLoadAddress($("#city").val(),"");
});
	form.on('select(sortid)', function(data){
acLoadWeiyouhuiSort($("#sortid").val(),'');
});
});
</script>
<div align="left">
<div class="wapPageTitle"><a href="/wap/user/index2.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=weiyouhui" class="layui-form" method="post" name="weiyouhui" id="weiyouhui">
<table width="100%" class="userMessTable" border="0" cellspacing="0" cellpadding="5">
<tr>
<td class="head" width="80">门面图片：</td>
<td><input class="inputText" value="<%=sPic%>" name="pic" id="inputpic" type="hidden" size="39" />
<img src="/images/nopic.png" id="imgpic" width="96" height="96" style="border:1px solid #e5e5e5; border-radius:3px; cursor:pointer;" class="fl5" onClick="upPic('inputpic','imgpic')" /><a href="#nogo" class="bt2 fl5" onClick="upPic('inputpic','imgpic')">上传</a></td> 
</tr>
<tr>
<td class="head">公众号<br>二维码</td>
<td><input class="inputText" value="<%=sWxPic%>" name="wxPic" id="inputwxPic" type="hidden" size="39" />
<img src="/images/nopic.png" id="imgwxPic" width="96" height="96" style="border:1px solid #e5e5e5; border-radius:3px; cursor:pointer;" class="fl5" onClick="upPic('inputwxPic','imgwxPic')" />　<a href="#nogo" class="bt2 fl5" onClick="upPic('inputwxPic','imgwxPic')">上传</a></td>
</tr>
<tr>
<td class="head">商家名称：</td>
<td><input class="inputText" value="<%=sName%>" name="name" type="text" size="39" /></td>
</tr>
<tr>
<td class="head">类别：</td>
<td><div class="selectDivLine"><%=tools.showWeiyouhuiSortSelectAdmin("sortid","sortid1")%></div></td>
</tr>
<tr>
<td class="head">所在地：</td>
<td><div class="selectDivLine"><%=tools.showAddressSelect("city", "city1")%></div></td>
</tr>
<tr>
<td class="head">手机：</td>
<td><input class="inputText" value="<%=sTel%>" name="tel" type="text" size="39" /></td>
</tr>
<tr>
<td class="head">电话：</td>
<td><input class="inputText" value="<%=sPhone%>" name="phone" type="text" size="39" /></td>
</tr>
<tr>
<td class="head">QQ：</td>
<td><input class="inputText" value="<%=sQq%>" name="qq" type="text" size="39" /></td>
</tr>
<tr>
<td class="head">微信：</td>
<td><input class="inputText" value="<%=sWeixin%>" name="weixin" type="text" size="39" /></td>
</tr>
<tr>
<td class="head">营业时间：</td>
<td><input class="inputText" value="<%=sOpeningHours%>" name="openingHours" type="text" size="39" /></td>
</tr>
<tr>
<td class="head">地址：</td>
<td><input class="inputText" value="<%=sAddress%>" name="address" type="text" size="39" /></td>
</tr>
<tr>
<td class="head">优惠说明：</td>
<td><textarea class="inputTextarea" name="sale" rows="5" cols="50"><%=sSale%></textarea></td>
</tr>
<tr>
<td class="head">商家介绍：</td>
<td><textarea class="inputTextarea" name="about" rows="5" cols="50"><%=sAbout%></textarea></td>
</tr>
</table>
<div class="clear10"></div>
<input type="submit" class="postSubmit" value="修改资料" />
</form>
<script language="javascript" type="text/javascript">
function valiUpPic(picId,picValue)
{
	if(picValue!="")
	{
		$('#'+picId).attr('src','/'+picValue);
	}
	else
	{
		$('#'+picId).attr('src','/images/nopic.png');
	}
}
$("select[name='city']").find("option[value='<%=sCity%>']").attr("selected",true);
acLoadAddress("<%=sCity%>","<%=sCity1%>");
$("select[name='sortid']").find("option[value='<%=sSort%>']").attr("selected",true);
acLoadWeiyouhuiSort("<%=sSort%>","<%=sSort1%>");
valiUpPic("imgpic",document.getElementById("inputpic").value);
valiUpPic("imgwxPic",document.getElementById("inputwxPic").value);
</script>
<script type="text/javascript">
var objPic='';
var objBtn='';
function upPic(pic,btn)
{
	objPic=pic;
	objBtn=btn;
	$("#upFile").click();
}
$('#upFile').change(function(){
$("#"+objBtn).attr('src',"/images/wait.gif");
$("#upFileForm").ajaxSubmit(
{
	url:"/inc/kfUpload.aspx",type:"POST",
	success:function(response)
	{
		var data=eval("("+response+")");
		if(data.status=="1")
		{
			$("#"+objPic).val(data.pic);
			$("#"+objBtn).attr('src',"/"+data.pic);
		}
		else
		{
			$("#"+objBtn).attr('src',"/"+$("#"+objPic).val());
  			alert(data.ps);
		}
  	},
 	error:function(msg)
	{
	}
});
$('#upFile').val('');
});
</script>
</div>
</div>
</div></div>
<div class="clear80"></div>
</body>
</html>
