<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>私塾家</title>
<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
<script th:include="sys/common/metaJS" th:remove="tag"></script> 
</head>
 <style type="text/css">
    body{min-width:180px;}
    .btn{
    	  width: 100px;
    	}
    </style>
<body>
<div class="formbody">
		<ul class="forminfo">
			<li  >
				<label>微信菜单:<b>*</b></label>
				 <textarea class="textinput" rows="10" id="menu" name="menu"></textarea>
			</li>
			<li>
				<label>&nbsp;</label>
				<button type="button" onclick="update_user();" class="btn">提交</button>
				<button type="button" class="btn" onclick="closeWin();">取消</button>
			</li>
		</ul>
</div>
</body>
<script type="text/javascript">

function update_user(){
	if($('#menu').val()!=null && $('#menu').val()!='' ){
		var content ="您确定要生成微信菜单吗?";
		parent.layer.confirm(content, {
			icon: 4, btn: ['确定','关闭'] //按钮
		}, function(){
			var url="[[${sysUrl}]]/sys/role/saveWeiXinMenu";
			 var params ={
			            'menu' : $("#menu").val()
			        };
			$.post(url,params,function(data){
				if(data.meta.success){
					parent.layer.msg("修改成功",{icon:1});
					closeWin();
				}else{
					parent.layer.msg(data.meta.message,{icon:11});
					closeWin();
				}
			});
		});
		
	}
}
function closeWin(){
	parent.layer.close(parent.layer.getFrameIndex(window.name));
}
</script>
</html>