/
userinfo.html
122 lines (108 loc) · 3.9 KB
/
userinfo.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
{include="user/style"}
<title>资料与账号 - 个人中心</title>
</head>
<body>
{include="user/top"}
<div class="login-page page">
<div class="container clearfix">
{include="user/left_nav"}
<div class="user-right">
{include="user/tips"}
<div class="user-content">
<h2>资料与账号</h2>
<form action="" method="POST" onsubmit="return checkform()" id="jizhiform" class="user-form">
<input type="hidden" name="csrfkey" value="{$csrfkey}">
<span id="fields_ext"></span>
<div class="form-control">
<label for="password">新密码:</label>
<div class="form-password">
<input type="password" class="password1" name="password" id="t_password" value="" placeholder="如果不修改,请留空">
<i class="iconfont iconyanjing"></i><i class="iconfont iconyanjing-guan"></i>
</div>
</div>
<div class="form-control">
<span><label for="setpassword">确认密码:</label></span>
<div class="form-password">
<input type="password" class="password1" name="repassword" id="t_repassword" value="" placeholder="如果不修改,请留空">
<i class="iconfont iconyanjing"></i><i class="iconfont iconyanjing-guan"></i>
</div>
</div>
<div class="form-control">
<label for="">邀请链接:</label>
<input type="text" value="{fun U('login/register')}?invite={$member['id']}" readonly name="invite" id="t_invite" placeholder="邀请链接">
</div>
<div class="form-control">
<label for="submit"></label>
<input type="submit" name="submit" value="提交">
</div>
</form>
</div>
</div>
</div>
</div>
{include="user/footer"}
<script type="text/javascript">
function get_fields(tid,id){
var id = arguments[1]?arguments[1]:0;
$.post("{fun U('common/get_fields')}",{molds:'member',tid:tid,id:id},function(res){
if(res.code==0){
//默认 res.tpl输出的是layui的模板HTML,可以审核元素查看res里面的内容
//$("#ext_fields").html(res.tpl);
var html = '';
var len = res.fields_list.length;
if(len>0){
//根据对应的字段,进行HTML设计
for(var i=0;i<len;i++){
}
}
$("#fields_ext").html(res.tpl);
}
},'json');
}
$(function(){
get_fields(0,{$member['id']});
})
function checkform(){
var password = $.trim($("#t_password").val());
var repassword = $.trim($("#t_repassword").val());
if(password!=repassword){
alert('两次密码不同!');$("#t_password").focus();return false;
}
return true;
}
$(document).ready(function(){
$("#fileid").change(function(){
var form=document.getElementById("jizhiform");
var data =new FormData(form);
data.append('filename','file');
$.ajax({
url: "{fun U('user/uploads')}",//处理图片的文件路径
type: "POST",//传输方式
data: data,
dataType:"json", //返回格式为json
processData: false, // 告诉jQuery不要去处理发送的数据
contentType: false, // 告诉jQuery不要去设置Content-Type请求头
success: function(response){
if(response.code==0){
var result = '';
result +='<img src="' + response['url'] + '" height="100" />';
//$("#fileid").hide();
// $("#upload_ok").show();
$('.view_img').html(result);
$("#fileurl").val(response['url']);
}else{
alert(response.error);
}
}
});
});
});
</script>
</body>
</html>