person_center.html
8.97 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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>我的信息</title>
<link rel="stylesheet" type="text/css" href="../../css/api.css"/>
<link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
<link rel="stylesheet" type="text/css" href="../../css/mine/mine.css"/>
<style>
html,
body{
background: #F4F6F9;
}
</style>
</head>
<body ontouchstart="">
<header class="aui-header-bar" style="padding-top:30px;background-color:#5B7FF8">
<div class="aui-header-left" tapmode onclick="closeWin();">
<i class="aui-iconfont aui-icon-left" style="color:#FFFFFF;font-size:16px;">返回</i>
</div>
<div class="aui-title" style="color:#FFFFFF;">我的信息</div>
<div class="aui-header-right">
</div>
</header>
<div class="person-center-list-panel">
<div class="inside-person-center-list-panel">
<div class="aui-row aui-row-flex" style="padding-top:15px;">
<div class="aui-col aui-col-span-5 aui-row-flex-start" style="margin-top:0.7rem">
<span class="title-obj" style="margin-top:0.3rem;">头像</span>
</div>
<div class="aui-col aui-col-span-19 aui-row-flex-end">
<img src="../../image/user-avatar-big.png" id="avatar" style="width:44px;height:44px;border-radius:50%;"/>
</div>
<!-- <div class="aui-col aui-col-span-2 aui-row-flex-end" style="margin-top:0.5rem"> -->
<!-- <i class="aui-iconfont aui-icon-right icon-right" style="color:#AEB8CE;"></i> -->
<!-- </div> -->
</div>
<div class="panel-line" style="margin-top:10px;"></div>
<div class="aui-row aui-row-flex margin-top-21">
<div class="aui-col aui-col-span-5 aui-row-flex-start">
<span class="title-obj">用户名</span>
</div>
<div class="aui-col aui-col-span-19 aui-row-flex-end">
<span class="person-center-span" id="user_name"></span>
</div>
</div>
<div class="panel-line margin-top-21"></div>
<div class="aui-row aui-row-flex margin-top-21" tapmode onclick="changePhone();">
<div class="aui-col aui-col-span-5 aui-row-flex-start">
<span class="title-obj">账号</span>
</div>
<div class="aui-col aui-col-span-17 aui-row-flex-end">
<span class="person-center-span" id="user_phone"></span>
</div>
<div class="aui-col aui-col-span-2 aui-row-flex-end">
<i class="aui-iconfont aui-icon-right icon-right" style="color:#AEB8CE;"></i>
</div>
</div>
<div class="panel-line margin-top-21"></div>
<div class="aui-row aui-row-flex margin-top-21" tapmode onclick="cleanCache();">
<div class="aui-col aui-col-span-5 aui-row-flex-start">
<span class="title-obj">清理缓存</span>
</div>
<div class="aui-col aui-col-span-17 aui-row-flex-end">
<span class="person-center-span" id="cache_size">0MB</span>
</div>
<div class="aui-col aui-col-span-2 aui-row-flex-end">
<i class="aui-iconfont aui-icon-right icon-right" style="color:#AEB8CE;"></i>
</div>
</div>
<div style="height:21px;"></div>
</div>
</div>
<!-- <div class="person-center-btn" tapmode onclick="submit();">提交</div> -->
<footer></footer>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/aui-actionsheet.js" ></script>
<script type="text/javascript">
var token;
var userId;
var actionsheet = new auiActionsheet();
apiready = function(){
api.parseTapmode();
var header = $api.dom('header'); // 获取 header 标签元素
var footer = $api.dom('footer'); // 获取 footer 标签元素
var headerH = $api.fixStatusBar(header);
var footerH = $api.fixTabBar(footer);
token = $api.getStorage('userToken');
userId = $api.getStorage('userID');
getUserInfo();
api.addEventListener({
name: 'changeAvatar'
}, function(ret, err){
if( ret ){
if (ret.value.destPath != "") {
var ele=$api.dom('#avatar');
$api.attr(ele,'src',ret.value.destPath);
avatarUrl = ret.value.destPath;
}
}
});
getCache();
};
function getCache() {
api.getCacheSize(function(ret) {
var size = ret.size/1024/1024;
$api.html($api.byId('cache_size'), size.toFixed(1)+'MB');
});
}
function cleanCache() {
var dialogBox = api.require('dialogBox');
dialogBox.alert({
texts: {
title: '',
content: '确定清空缓存吗?',
leftBtnTitle: '取消',
rightBtnTitle: '确认'
},
styles: {
bg: '#fff',
w: 300,
corner:2,
title: {
marginT: 20,
icon: '../../image/mine/img-signOut.png',
iconSize: 74,
titleSize: 14,
titleColor: '#000'
},
content: {
color: '#37394E',
size: 14
},
left: {
marginB: 0,
marginL: 0,
w: 150,
h: 47,
corner: 10,
bg: '#FFFFFF',
color: '#818295',
size: 16
},
right: {
marginB: 0,
marginL: 0,
w: 150,
h: 47,
corner: 10,
bg: '#FFFFFF',
color: '#5B7FF8',
size: 16
},
horizontalLine:{
color:'rgba(240,245,255,1)',
height:1
},
verticalLine:{
color:'rgba(240,245,255,1)',
width:1 //(可选项)数字类型;左右边按钮竖线的高度;默认:0
}
}
}, function(ret) {
dialogBox.close({
dialogName: 'alert'
});
if (ret.eventType == 'right') {
api.clearCache(function() {
api.toast({
msg: '清除完成'
});
$api.html($api.byId('cache_size'), '0MB');
});
}
})
}
function getUserInfo() {
var username_ = $api.getStorage('userName');
var userphone_ = $api.getStorage('userPhone');
$api.html($api.byId('user_name'), username_);
$api.html($api.byId('user_phone'), userphone_);
}
// function clickAvatar() {
// actionsheet.init({
// frameBounces:true,//当前页面是否弹动,(主要针对安卓端)
// title:"上传头像",
// cancelTitle:'取消',
// // destructiveTitle:'红色警告按钮',
// buttons:['拍照','图库选择']
// },function(ret){
// if(ret){
// getPicture(ret.buttonIndex);
// }
// })
// }
//选择头像方式
// function getPicture(sourceType) {
// var avatarType = ''
// switch (sourceType) {
// case 1:
// avatarType = 'camera';
// break;
// case 2:
// avatarType = 'pic';
// break;
// default:
//
// }
// //获取一张图像
// api.getPicture({
// sourceType: avatarType,
// encodingType: 'jpg',
// mediaValue: 'pic',
// allowEdit: false,
// quality: 10,
// saveToPhotoAlbum: true
// }, function(ret, err) {
// // 获取图像数据并进行裁剪处理
// if (ret) {
// var imgSrc = ret.data;
// api.openWin({
// name: 'clipImg',
// url: '../utils/fnImageClip.html',
// pageParam: {
// imgSrc: imgSrc
// }
// });
// }
// });
// }
function changePhone() {
api.openWin({
name: 'changePhone_win',
url: './changePhone_win.html',
slidBackEnabled: false,
});
}
function submit() {
console.log('----');
}
</script>
</html>