-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPersonal_information.html
331 lines (284 loc) · 8.76 KB
/
Personal_information.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
<!DOCTYPE html>
<html class="no-js">
<head lang="en">
<meta charset="UTF-8">
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<title>Personal_information | My RSS</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="telephone=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="alternate icon" type="image/png" href="assets/i/favicon.png">
<link rel="stylesheet" href="assets/css/amazeui.min.css" />
<meta name="description" content="这是一个form页面">
<meta name="keywords" content="form">
<link rel="icon" type="image/png" href="assets/i/favicon.png">
<link rel="apple-touch-icon-precomposed" href="assets/i/[email protected]">
<meta name="apple-mobile-web-app-title" content="Amaze UI" />
<link rel="stylesheet" href="assets/css/admin.css">
<style>
@media only screen and (min-width: 1200px) {
.blog-g-fixed {
max-width: 1200px;
}
}
@media only screen and (min-width: 641px) {
.blog-sidebar {
font-size: 1.4rem;
}
}
.blog-main {
padding: 20px 0;
}
.blog-title {
margin: 10px 0 20px 0;
}
.blog-meta {
font-size: 14px;
margin: 10px 0 20px 0;
color: #222;
}
.blog-meta a {
color: #27ae60;
}
.blog-pagination a {
font-size: 1.4rem;
}
.blog-content img {
max-width: 100%;
height: auto;
}
.blog-footer {
padding: 10px 0;
text-align: center;
}
.collection-list a{
color:#434343;
}
.content-icon {
float: right;
margin: 0 10px;
}
#inf{
padding: 10px 10% 10px 20px;
}
</style>
</head>
<body>
<!-- header -->
<header class="am-topbar">
<h1 class="am-topbar-brand">
<a href="#">My RSS</a>
</h1>
<button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#doc-topbar-collapse'}"><span
class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>
<div class="am-collapse am-topbar-collapse" id="doc-topbar-collapse">
<ul id="nav" class="am-nav am-nav-pills am-topbar-nav">
<li><a href="Home_Page.html">发现</a></li>
<li><a href="Share.html">分享</a></li>
<li><a href="Collection.html">收藏</a></li>
<li><a href="Group.html">小组</a></li>
<li><a href="Source.html">来源</a></li>
<li class="am-active"><a href="Personal_information.html">个人信息</a></li>
</ul>
</div>
</header>
<div class="am-g am-g-fixed blog-g-fixed">
<!-- catalogue -->
<div class="am-u-md-4 blog-sidebar">
<div class="am-panel-group">
<div class="am-panel am-panel-default">
<div class="am-panel-bd">
<div class="am-g">
<div class="am-u-md-4">
<img class="am-img-circle am-img-thumbnail" src="http://s.amazeui.org/media/i/demos/bw-2014-06-19.jpg?imageView/1/w/200/h/200/q/80"
alt="" />
</div>
<!-- <div class="am-u-md-8">
<p>你可以使用本地上传头像。 </p>
<form class="am-form">
<div class="am-form-group">
<input type="file" id="user-pic">
<p class="am-form-help">请选择要上传的文件...</p>
<button type="button" class="am-btn am-btn-primary am-btn-xs">保存</button>
</div>
</form>
</div> -->
<div>
<h3 id="DuserName">ajax</h3>
</div>
</div>
</div>
</div>
<div class="am-panel am-panel-default admin-sidebar-panel">
<div class="am-panel-bd">
<p><span class="am-icon-bookmark"></span> 公告</p>
<p>时光静好,与君语;细水流年,与君同。—— My RSS</p>
</div>
</div>
</div>
</div>
<!-- content -->
<div class="am-u-md-8">
<div class="am-tabs am-margin" data-am-tabs>
<ul class="am-tabs-nav am-nav am-nav-tabs">
<li class="am-active" id="select1"><a onclick="show(1)">基本信息</a></li>
<li id="select2"><a onclick="show(2)">修改信息</a></li>
</ul>
<div class="am-tabs-bd" id="inf">
<div class="am-tab-panel am-fade am-in am-active" id="information1">
<div class="am-g am-margin-top" style="padding-left: 20px;">
<h3 id="Dsex">ajax</h3>
<h3 id="Demail">ajax</h3>
<h3 id="Dphone">ajax</h3>
</div>
</div>
<div class="am-tab-panel am-fade" id="information2">
<form class="am-form">
<h3>性别:</h3>
<div class="am-radio">
<label>
<input type="radio" name="sex" value="0" checked>女</label>
</div>
<div class="am-radio">
<label>
<input type="radio" name="sex" value="1">男</label>
</div>
<label for="email">邮箱:</label>
<input type="email" name="" id="email" value="" placeholder="***@**.com">
<br>
<label for="phone">电话:</label>
<input type="text" name="" id="phone" value="">
<br>
<div class="am-cf">
<input type="button" value="提交 保存" class="am-btn am-btn-primary am-round am-fl" onclick="Update()">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>
<footer class="blog-footer">
<hr>
<p>Personal_information | My RSS<br />
<small>© Copyright 2018</small>
</p>
</footer>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/amazeui.min.js"></script>
<script src="assets/js/app.js"></script>
<script type="text/javascript" src="assets/js/information-exchange.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script>
function Logincheck() {
var userId = document.URL.split("html")[1];
if (userId == "") {
alert("请先登录或注册!");
window.location.href = "Login.html";
}
}
Logincheck();
licolection = document.getElementById("nav").childNodes;
for (i = 0; i < parseInt(licolection.length / 2); ++i) {
element = licolection[i * 2 + 1].childNodes[0];
element.setAttribute('href', element.getAttribute('href') + "?" + document.URL.split("?")[1])
}
</script>
<script>
function show(num) {
for (var i = 1; i <= 2; i++) {
document.getElementById("information" + i).style.display = "none";
}
document.getElementById("information" + num).style.display = "block";
}
function Update() {
var reqId = "1";
var reqType = "Update";
var userId = document.URL.split("?")[1];
var sex = $("input[name='sex']:checked").val();
var email = document.getElementById("email").value;
var phone = document.getElementById("phone").value;
var objParam =
{
"reqId": reqId,
"reqType": reqType,
"reqParam":
{
"username": null,
"password": null,
"phone": phone,
"email": email,
"sex": sex,
},
"reqUserInfo":
{
"userId": userId
}
};
$.ajax
({
url: "http://120.79.191.240:8089/rssbackend/api/v1/user/update",
data: JSON.stringify(objParam),
datatype: "json",
type: "POST",
async: false,
contentType: "application/json",
success: function (objResult) {
window.location.href = "Personal_information.html?" + objResult.resResult.curData.userId;
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("aaaa");
}
});
}
function Detail() {
var reqId = "999";
var reqType = "Detail";
var userId = document.URL.split("?")[1];
var objParam =
{
"reqId": reqId,
"reqType": reqType,
"reqUserInfo":
{
"userId": userId
}
};
$.ajax
({
url: "http://120.79.191.240:8089/rssbackend/api/v1/user/detail",
data:
{
reqId: reqId,
reqType: reqType,
reqUserInfo: JSON.stringify({
"userId": userId
})
},
datatype: "json",
async: false,
timeout: 10000,
cache: true,
type: "GET",
contentType: "application/json",
success: function (objResult) {
document.getElementById("DuserName").innerHTML = "用户名:" + objResult.resResult.curData.username;
if (objResult.resResult.curData.sex)
document.getElementById("Dsex").innerHTML = "性别:男";
else
document.getElementById("Dsex").innerHTML = "性别:女";
document.getElementById("Demail").innerHTML = "邮箱:" + objResult.resResult.curData.email;
document.getElementById("Dphone").innerHTML = "电话:" + objResult.resResult.curData.phone;
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("错误代码:" + textStatus);
}
});
}
Detail();
</script>
</body>
</html>