info.html
4.0 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/swiper-3.4.2.min.css" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/base.css" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/index.css" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/mask.css">
<title>个人中心</title>
<style>
#personal-photo {
position: absolute;
width: 38%;
height: 13%;
font-size: 12px;
right: 30%;
top: 25%;
opacity: 0;
cursor: pointer;
}
</style>
</head>
<body class="index_tenth_bgimg">
<include file="public@header"/>
<!--彈出框-->
<div class="mask">
</div>
<div class="index_ninth">
<div class="index_ninth_contant">
<div class="index_ninth_one idnex_ninth_first">
<div class="index_ninth_one_img">
<img src="__TMPL__/public/assets/images/cicon_68@2x.png" alt="" />
</div>
<div class="index_ninth_one_title">
<input type="file" id="personal-photo" name="avatar">编辑头像
</div>
</div>
<div class="index_ninth_one" id="editInfo">
<div class="index_ninth_one_img">
<img src="__TMPL__/public/assets/images/cicon_69@2x.png" alt="" />
</div>
<div class="index_ninth_one_title">
修改资料
</div>
</div>
<div class="index_ninth_one" id="myCollection">
<div class="index_ninth_one_img">
<img src="__TMPL__/public/assets/images/cicon_70@2x.png" alt="" />
</div>
<div class="index_ninth_one_title">
我的收藏
</div>
</div>
</div>
<div class="index_ninth_photo">
<notempty name="user.avatar">
<img src="{:cmf_get_image_url($user.avatar)}" alt="">
<else/>
<img src="__TMPL__/public/assets/images/aicon_82.png" alt="">
</notempty>
</div>
<div class="index_tenth_bottom">
<p class="beian">
Copyright © 2004-2019 独角星球 版权所有
</p>
<p class="beian">
京ICP备17035112号-2
</p>
</div>
</div>
</body>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script>
<script src="__TMPL__/public/assets/js/swiper.min.js"></script>
<script src="__TMPL__/public/assets/js/public.js"></script>
<script src="__TMPL__/public/assets/js/uploadfile.js"></script>
<script>
$(function(){
var source = $('#source').val();
if(source != '本站'){
$("#personal-photo").attr('disabled','disabled');
}
$("#personal-photo").on("change",function(){
var img_size = $("input[type=file]").get(0).files[0].size;
if (img_size > 1024000){
mask("上传图片过大,请上传小于1M的图片");
}else {
$.ajaxFileUpload({
url: '/portal/login/updateAvatar', //用于文件上传的服务器端请求地址
secureuri: false, //是否需要安全协议,一般设置为false
fileElementId: 'personal-photo', //文件上传域的ID
dataType: 'json', //返回值类型 一般设置为json
success: function (data){ //服务器成功响应处理函数
mask(data.msg);
window.location.href = '/';
}
});
}
});
});
</script>
</html>