info.html 2.7 KB
<!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">
	<title>个人中心</title>
	<link rel="stylesheet" href="__TMPL__/public/assets/css/login.css">
	<link rel="stylesheet" href="__TMPL__/public/assets/css/person.css">
	<link rel="stylesheet" href="__TMPL__/public/assets/css/mask.css">
</head>

<body>
	<!--头部  -->
	<include file="public@header"/>
	<main>
		<!--彈出框-->
		<div class="mask">

		</div>
		<div class="personal_center">
			<!--頭像-->
			<div class="personal_center_avatar">
				<notempty name="user.avatar">
					<img src="{:cmf_get_image_url($user.avatar)}" alt="">
					<else/>
					<img src="__TMPL__/public/assets/starImg/aicon_82.png" alt="">
				</notempty>
			</div>
			<!--編輯頭像-->
			<div class="Editor_avatar clearfix">
				<div class="Editor_avatar_icon">
					<img src="__TMPL__/public/assets/starImg/aicon_84.png" alt="">
				</div>
				<span><input type="file" id="personal-photo" name="avatar">编辑头像</span>
			</div>
			<!--修改資料-->
			<div class="Modifying clearfix" id="editInfo">
				<div class="Modifying_icon">
					<img src="__TMPL__/public/assets/starImg/aicon_85.png" alt="">
				</div>
				<span>修改资料</span>
			</div>
			<!--我的收藏-->
			<div class="Collection clearfix" id="myCollection">
				<div class="Collection_icon">
					<img src="__TMPL__/public/assets/starImg/aicon_86.png" alt="">
				</div>
				<span>我的收藏</span>
			</div>
		</div>

	</main>
	<div class="Keep">
		Copyright © 2004-2019 独角星球 版权所有
	</div>
</body>
</html>
<script src="__TMPL__/public/assets/js/jquery-3.2.1.min.js"></script>
<script src="__TMPL__/public/assets/js/public.js"></script>
<script src="__TMPL__/public/assets/js/uploadfile.js"></script>
<script>
	$(function(){
        $("#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>