<!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 class="index_ninth_one" id="logout"> <div class="index_ninth_one_img"> <img src="__TMPL__/public/assets/images/logout.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>