代码拉取完成,页面将自动刷新
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link href="css/mui.css" rel="stylesheet" />
<style type="text/css">
.me-line { /* 行高*/
line-height: 42px;
}
.me-font { /* 字体大小*/
font-size: 16px;
}
.me-right { /* 右箭头的样式*/
color: lightgray;
margin-left: 3px;
}
</style>
</head>
<body>
<ul class="mui-table-view">
<li class="mui-table-view-cell mui-media">
<a id="link_myface" href="javascript:;">
<span class="mui-pull-right mui-icon mui-icon-arrowright me-line me-right"></span>
<img id="img_my_face" class="mui-media-object mui-pull-right" src="" >
<div class="mui-media-body me-line me-font">
头像
</div>
</a>
</li>
<li class="mui-table-view-cell mui-media">
<a id="link_nickname" href="javascript:;">
<span class="mui-pull-right mui-icon mui-icon-arrowright me-right"></span>
<span id="span_nickname" class="mui-pull-right" style="color: gray;font-size: 14px;"></span>
<div class="mui-media-body">
昵称
</div>
</a>
</li>
<li class="mui-table-view-cell mui-media">
<a href="javascript:;">
<span id="span_username" class="mui-pull-right" style="color: gray;font-size: 14px;"></span>
<div class="mui-media-body">
账号
</div>
</a>
</li>
<li class="mui-table-view-cell mui-media">
<a id="link_my_qrcode" href="javascript:;">
<span class="mui-pull-right mui-icon mui-icon-arrowright me-right"></span>
<img class="mui-media-object mui-pull-right"
src="image/qrcode.png" style="max-width: 20px;height: 20px;">
<div class="mui-media-body">
我的二维码
</div>
</a>
</li>
</ul>
<br />
<ul class="mui-table-view">
<li class="mui-table-view-cell mui-media" style="text-align: center;">
<a id="link_logout" href="javascript:;">
<div class="mui-media-body">
退出登录
</div>
</a>
</li>
</ul>
<script src="js/mui.js"></script>
<script type="text/javascript" src="js/app.js" ></script>
<script type="text/javascript">
mui.init()
mui.plusReady(function(){
// 获得当前的webview,刷新当前用户信息,监听show事件
var meWebview = plus.webview.currentWebview();
meWebview.addEventListener("show", function() {
refreshUserInfo();
});
// 页面跳转,我的头像
var link_myface = document.getElementById("link_myface");
link_myface.addEventListener("tap", function() {
mui.openWindow("myface.html", "myface.html");
});
// 添加自定义事件,刷新头像
window.addEventListener("refresh", function(){
refreshUserInfo();
});
// 页面跳转,修改昵称
var link_nickname = document.getElementById("link_nickname");
link_nickname.addEventListener("tap", function() {
mui.openWindow("mynickname.html", "mynickname.html");
});
// 查看我的二维码
var link_my_qrcode = document.getElementById("link_my_qrcode");
link_my_qrcode.addEventListener("tap", function(){
mui.openWindow({
url: "myQRCode.html",
id: "myQRCode.html",
styles: {}
})
});
// 用户退出
var link_logout = document.getElementById("link_logout");
link_logout.addEventListener("tap", function(){
app.userLogout();
mui.openWindow("login.html", "login.html");
});
})
function refreshUserInfo() {
//获取当前用户登录对象
var user = app.getUserGlobalInfo();
//console.log(JSON.stringify(user))
if (user != null) {
var faceImage = user.faceImage;
var nickname = user.nickname;
var username = user.username;
var span_nickname = document.getElementById("span_nickname");
var span_username = document.getElementById("span_username");
span_nickname.innerHTML = nickname;
span_username.innerHTML = username;
if (app.isNotNull(faceImage)) {
var img_my_face = document.getElementById("img_my_face");
img_my_face.src = app.imgServerUrl + faceImage;
}
}
}
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。