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.

130 lines
5.4 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 appid = "";
var appsecret = "";
var domain = "";
mui.ajax("/baseService/mobile/getWxInformation",{
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 code = GetQueryString("code");
if(GetQueryString("type")){
var type = GetQueryString("type");
}
if(GetQueryString("place_id")){
var place_id = GetQueryString("place_id");
var state = GetQueryString("state");
}
if(GetQueryString("person_id")){
var person_id = GetQueryString("person_id");
}
mui.ajax("/baseService/mobile/getopenid",{
data:{
appid:appid,
appsecret:appsecret,
code:code
},
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){
var wx_openid = array['wx_openid'];
var identity_id = array['identity_id'];
if(array['person_id']){
if(type==1){
window.location.href = "http://"+domain+"/baseService/html/pages/mobile/wx_user_bind.html?wx_openid="+wx_openid;
}
if(type==2){
window.location.href = "http://"+domain+"/baseService/html/pages/mobile/wx_user_unbound.html?wx_openid="+wx_openid;
}
if(type==3){
window.location.href = "http://"+domain+"/baseService/html/pages/mobile/wx_user_info.html?wx_openid="+wx_openid+"&identity_id="+identity_id;
}
if(type==4){
window.location.href = "http://"+domain+"/baseService/html/pages/mobile/wx_stu_returnapply.html?wx_openid="+wx_openid+"&identity_id="+identity_id;
}
if(type==5){
window.location.href = "http://"+domain+"/baseService/html/pages/mobile/wx_teaclass_checkin_list.html?wx_openid="+wx_openid;
}
if(place_id){
if(state==1){
window.location.href = "http://"+domain+"/baseService/html/pages/mobile/wx_stu_checkin_verification.html?wx_openid="+wx_openid+"&place_id="+place_id;
}
if(state==2){
window.location.href = "http://"+domain+"/baseService/html/pages/mobile/wx_stu_signIn_verification.html?wx_openid="+wx_openid+"&place_id="+place_id;
}
}
if(person_id){
window.location.href = "http://"+domain+"/baseService/html/pages/mobile/wx_stu_temperature_add.html?wx_openid="+wx_openid+"&person_id="+person_id;
}
}else{
window.location.href = "http://"+domain+"/baseService/html/pages/mobile/wx_user_bind.html?wx_openid="+wx_openid;
}
})
}
});
})
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>