You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
4.7 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>返校报到</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!--标准mui.css-->
<link rel="stylesheet" href="../../lib/mui/css/mui.min.css">
<!--App自定义的css-->
<link rel="stylesheet" type="text/css" href="../../lib/mui/css/app.css"/>
<style>
.title{
margin: 20px 15px 7px;
color: #6d6d72;
font-size: 15px;
}
</style>
</head>
<body>
<script src="../../lib/mui/js/mui.min.js"></script>
<script type="text/javascript">
mui.ready(function() {
var place_id = GetQueryString("place_id");
var appid = "";
var appsecret = "";
var domain = "";
mui.ajax("/baseService/mobile/getWxInformation",{
data:{
appid:appid,
appsecret:appsecret,
},
type: "GET",
async:false,
dataType:'json',
error:function(xhr,status,statusText){
alert("请求失败,状态:"+statusText+","+status);
},
success:function(json){
var obj = eval(json);
mui.each(obj,function(index,array){
appid = array['appid'];
appsecret = array['appSecret'];
})
}
});
mui.ajax("/baseService/mobile/getWxDomain",{
type: "GET",
async:false,
dataType:'json',
error:function(xhr,status,statusText){
alert("请求失败,状态:"+statusText+","+status);
},
success:function(json){
var obj = eval(json);
mui.each(obj,function(index,array){
domain = array['domain'];
})
}
});
var redirect_uri ="http://"+domain+"/baseService/html/pages/mobile/wx_stu_checkin_getopenid.html?place_id="+place_id;
var getCodeUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appid+"&redirect_uri="+redirect_uri+"&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect";
if(!GetQueryString("code")){
window.location.href = getCodeUrl;
}else{
var code = GetQueryString("code");
mui.ajax("/baseService/mobile/getopenid",{
data:{
appid:appid,
appsecret:appsecret,
code:code
},
type: "GET",
dataType:'json',
error:function(xhr,status,statusText){
alert("请求失败,状态:"+statusText+","+status);
},
success:function(json){
var obj = eval(json);
mui.each(obj,function(index,array){
var wx_openid = array['wx_openid']
mui.ajax("/baseService/mobile/bangdingYz",{
data:{
wx_openid:wx_openid
},
type: "GET",
dataType:'json',
error:function(xhr,status,statusText){
alert("请求失败,状态:"+statusText+","+status);
},
success:function(json){
var obj = eval(json);
mui.each(obj,function(index,array){
if(array['message']==103){
window.location.href = "http://"+domain+"/baseService/html/pages/mobile/wx_user_bind.html";
}else{
window.location.href = "http://"+domain+"/baseService/html/pages/mobile/wx_stu_checkin_verification.html?wx_openid="+wx_openid+"&place_id="+place_id;
}
})
}
});
})
}
});
}
function GetQueryString(name)
{
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);//search,查询?后面的参数,并匹配正则
if(r!=null){
return unescape(r[2]);
}else{
return null;
}
}
})
</script>
</body>
</html>