-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathusercenter.html
133 lines (127 loc) · 4.5 KB
/
usercenter.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html>
<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">
<link rel="stylesheet" href="css/mui.min.css">
<link rel="stylesheet" href="css/app.css">
<style type="text/css">
.mui-table-view-cell{font-size: 0.875rem;}
</style>
</head>
<body class="mui-plus mui-statusbar mui-statusbar-offset">
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">个人中心</h1>
<!--<a class="mui-icon mui-icon-bars mui-pull-right"></a>-->
</header>
<div class="mui-content">
<ul class="mui-table-view" style="margin-top:1.625rem">
<li class="mui-table-view-cell">
<a>姓名<span class="mui-pull-right" id="name_val_d">**</span></a>
</li>
<li class="mui-table-view-cell">
<a>身份账号<span class="mui-pull-right" id="account_val_d">**</span></a>
</li>
</ul>
<ul class="mui-table-view" style="margin-top: 1rem;">
<li class="mui-table-view-cell">
<a>警员编号<span class="mui-pull-right" id="idnumber_val"></span></a>
</li>
<li class="mui-table-view-cell">
<a>所属机关<span class="mui-pull-right" id="subordinateorgan_val">榆林市局</span></a>
</li>
</ul>
<ul class="mui-table-view" style="margin-top: 1rem;">
<li class="mui-table-view-cell" style="text-align: center;">
<a id="login-out">退出登录</a>
</li>
</ul>
</div>
</body>
<script src="js/mui.min.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>
<script type="text/javascript" src="js/applogin.js" ></script>
<script src="js/watermark.js" type="text/javascript"></script>
<script>
mui.init();
(function($) {
if(app.checkUser()){
function grzx(){
mui.ajax(base_url+"userDetail/usercenter?guid="+new Date().getTime(),{
dataType:'json',//服务器返回json格式数据
type:'post',//HTTP请求类型
timeout:10000,//超时时间设置为10秒
headers:{
'Content-Type':'application/x-www-form-urlencoded' //此处如果使用application/json 会遇到post发送参数失败的问题
,'user_id_token':app.getUser().userid
,'id':"19"
},
data:{
"id":app.getUser().userid
},
success:function(data){
if(data.code=='200'){
console.log(JSON.stringify(data));
data = data.data;
if(data.photoUrl != undefined && data.photoUrl!=''){
document.getElementById('head-img1').src = smallUploadPath + data.photoUrl ;
}
if(data.name == undefined || data.name == ''){
document.getElementById('name_val_d').innerHTML = '未填写' ;
}else{
document.getElementById('name_val_d').innerHTML = data.name ;
}
document.getElementById('account_val_d').innerHTML = data.idnumber ;
document.getElementById('idnumber_val').innerHTML = data.policenumber ;
/*setTimeout(function() {
initImgPreview();
}, 300);*/
}else{
mui.alert(data.message);
}
}
})
}
/*mui.post(base_url+"userDetail/usercenter?guid="+new Date().getTime(),{"id":app.getUser().userid},function(data){
if(data.code=='200'){
console.log(JSON.stringify(data));
data = data.data;
if(data.photoUrl != undefined && data.photoUrl!=''){
document.getElementById('head-img1').src = smallUploadPath + data.photoUrl ;
}
if(data.name == undefined || data.name == ''){
document.getElementById('name_val_d').innerHTML = '未填写' ;
}else{
document.getElementById('name_val_d').innerHTML = data.name ;
}
document.getElementById('account_val_d').innerHTML = data.idnumber ;
document.getElementById('idnumber_val').innerHTML = data.policenumber ;
/*setTimeout(function() {
initImgPreview();
}, 300);
}else{
mui.alert(data.message);
}
});*/
}
})(mui);
//退出登录
document.getElementById("login-out").addEventListener('tap', function() {
app.removeUser();
mui.openWindow({
url:'login.html',
id:'login.html'
});
// mui.get(base_url+"/login-out.action?guid="+new Date().getTime(),
// function(date){
// plus.nativeUI.toast("退出成功!");
// mui.back();
// }
// );
});
</script>
</html>