<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ page isELIgnored="false" %>
<%@page import="com.sino.rrs.entity.RcRescueCompanyPO"%>
<html>
<head>
<meta charset="utf-8">
<title>个人信息</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="format-detection" content="email=no">
<link rel="stylesheet" href="/SinoGYS/css/newCss/reset.css" />
<link rel="stylesheet" href="/SinoGYS/css/newCss/myInfo.css" />
<link rel="stylesheet" href="/SinoGYS/weixincss/weui.min.css">
<link rel="stylesheet" href="/SinoGYS/weixincss/jquery-weui.css">
<link rel="stylesheet" href="/SinoGYS/weixincss/demos.css">
<script src="/SinoGYS/js/jquery-1.7.2.js" type="text/javascript"></script>
<script src="/SinoGYS/js/jquery-weui.js"></script>

 <script type="text/javascript">
        var ohtml=document.documentElement;
        function getWidth(){
            var screenWidth=ohtml.clientWidth;
            if(screenWidth<320){
                ohtml.style.fontSize="13.3333px";
            }else if(screenWidth>1080){
                ohtml.style.fontSize="45px";
            }else{
                ohtml.style.fontSize=screenWidth/(1080/45)+"px";
            }
        }
        getWidth();
        window.onresize=function(){
            getWidth();
        };
    </script>
</head>

<%
	String weixinUserId=request.getParameter("weixinUserId");
	String openId=request.getParameter("openId");
	String acceptFlag=request.getParameter("flag");
 %>

<body>
	<input type="hidden" id="weixinUserId" name="weixinUserId" value="<%=weixinUserId%>">
	<div class="infoWrapper">
  		<ul class="myInfo">
  			<li>
  				公司名称
  				<div class="rightInfo">
  					<a href="#" class="infoItem">${companyInfo.companyName }</a>
  				</div>
  			</li>
  			<li>
  				 接受通知
  				<%if(Integer.parseInt(acceptFlag)==0){ %>
				        <div class="rightInfo">
				          <input class="weui_switch" style='margin-top:0.7rem' type="checkbox" onclick="checkbox(this,'<%=openId %>')" checked>
				        </div>
				<%}else{ %>
				        <div class="rightInfo">
				          <input class="weui_switch" style='margin-top:0.7rem' type="checkbox" onclick="checkbox(this,'<%=openId %>')">
				        </div>
				<%} %>
  			</li>
  		</ul>
  		<div class="inputWrapper">
  			<input class="loginFormSubmit loginBtnActive" type="button" value="退       出">
  		</div>	
  	</div>
</body>
<script type="text/javascript">
	function checkbox(o,openId){
		if(o.checked){
			//被选中，打开(接受通知，可以收到模板消息)
			$.getJSON("/SinoGYS/CompanyOrVehicleNoticeAction.do?CMD=updateCompanyNotice",{acceptFlag:0,openId:openId});  //更改状态为0
		}else{
			//关闭(不接受模板消息)
			$.getJSON("/SinoGYS/CompanyOrVehicleNoticeAction.do?CMD=updateCompanyNotice",{acceptFlag:1,openId:openId});  //更改状态为1
		}
	}
	
	$(".loginBtnActive").on("click",function(){
		$.confirm("您确定要退出当前用户吗？",function(){
			$.getJSON("/SinoGYS/RescueVehicleAction.do?CMD=modifyIdentity",{weixinUserId:$("#weixinUserId").val()},function(data){
  				if(data.code==true){    //服务商退出
  					window.location.href="/SinoGYS/supplier/userRegister.jsp?weixinUserId="+$("#weixinUserId").val();
  				}
		 	});  					 
  			},function(){
  				//取消操作
  		 });
	});
</script>
</html>
