| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <!doctype html>
- <html class="no-js">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="description" content="">
- <meta name="keywords" content="">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>安全中心</title>
- <!-- Set render engine for 360 browser -->
- <meta name="renderer" content="webkit">
- <!-- No Baidu Siteapp-->
- <meta http-equiv="Cache-Control" content="no-siteapp" />
- <!-- Add to homescreen for Chrome on Android -->
- <meta name="mobile-web-app-capable" content="yes">
- <!-- Add to homescreen for Safari on iOS -->
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <meta name="apple-mobile-web-app-title" content="幸运生肖" />
- <!-- Tile icon for Win8 (144x144 + tile color) -->
- <meta name="msapplication-TileColor" content="#0e90d2">
- <link rel="stylesheet" href="__CDN__/assets/shop/css/amazeui.css">
- <link rel="stylesheet" href="__CDN__/assets/shop/css/app.css">
- <style>
- .am-list > li{border-bottom: 1px solid #eee}
- .userIcon{
- width: 40px;
- height: 40px;
- margin: 0 auto;
- }
- #img1{
- position: absolute;
- top: -5px;
- right:0;
- }
- .icon-cearma{
- position: absolute;
- bottom: 1%;
- right: 5%;
- width: 24px;
- }
- #up-img-touch{ position: relative;}
- #file{
- position: absolute;
- top: 0;
- width: 60px;
- height: 100%;
- opacity: 0;
- cursor: pointer;
- left:-50px;
- }
- </style>
- </head>
- <body class="am-bg-white">
- <!-- Header -->
- <header data-am-widget="header" class="am-header am-header-default">
- <div class="am-header-left am-header-nav">
- <a href="javascript:void(0);" onclick="javascript:history.back(-1);return false;"><i class="am-header-icon am-icon-angle-left"></i></a>
- </div>
- <h1 class="am-header-title">
- <a href="#title-link">安全中心</a>
- </h1>
- <div class="am-header-right am-header-nav"></div>
- </header>
- <!-- Content -->
- <div class="wapper">
- <div class="am-margin-bottom-xs">
- <div><img src="__CDN__/assets/shop/img/bg1.png" width="100%"/>
- </div>
- <ul class="am-list am-list-static am-list-border am-margin-bottom-0 am-margin-top-0">
- <li onclick="window.location.href='updatepwd1.html'">
- <span>修改登录密码</span>
- <span class="am-fr am-link-muted am-icon am-icon-angle-right am-padding-left-sm"></span>
- </li>
- <li onclick="window.location.href='updatepwd2.html'">
- <span>修改支付密码</span>
- <span class="am-fr am-link-muted am-icon am-icon-angle-right am-padding-left-sm"></span>
- </li>
- </ul>
- </div>
- </div>
-
- <!--[if (gte IE 9)|!(IE)]><!-->
- <script src="__CDN__/assets/shop/js/jquery.min.js"></script>
- <!--<![endif]-->
- <!--[if lte IE 8 ]>
- <script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
- <script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
- <script src="__CDN__/assets/shop/js/amazeui.ie8polyfill.min.js"></script>
- <![endif]-->
- <script src="__CDN__/assets/shop/js/amazeui.min.js"></script>
- <script src="__CDN__/assets/shop/js/app.js"></script>
- <script src="__CDN__/assets/libs/layer/layer.js"></script>
- <script>
- /*上传头像*/
- var file = document.getElementById('file');
- var image = document.getElementById("img1");
- file.onchange = function() {
- var fileData = this.files[0];//获取到一个FileList对象中的第一个文件( File 对象),是我们上传的文件
- var pettern = /^image/;
- console.info(fileData.type)
- if (!pettern.test(fileData.type)) {
- layer.msg("图片格式不正确");
- return;
- }
- var reader = new FileReader();
- reader.readAsDataURL(fileData);//异步读取文件内容,结果用data:url的字符串形式表示
- /*当读取操作成功完成时调用*/
- reader.onload = function(e) {
- console.log(e); //查看对象
- image.setAttribute("src", this.result)
- }
- var formData = new FormData($( "#form1" )[0]);
- $.ajax({
- //几个参数需要注意一下
- type: "POST",//方法类型
- dataType: "json",//预期服务器返回的数据类型
- url: "{:url('ajax/upload')}" ,
- data: formData,
- contentType: false, //不设置内容类型
- processData: false, //不处理数据
- success: function (result) {
- if(result.code>0)
- {
- $('input[name=avatar]').val(result.data.url);
- jQuery.post("{:url('api/user/toupdateuserinfo')}" ,{avatar:result.data.url},function(data) {
- if(data.code>0)
- {
- layer.msg(data.msg,{time:500},function(){
- locaiton=location;
- });
- }else{
- layer.msg(data.msg);
- }
- });
- }else{
- layer.msg(result.msg);
- }
- },
- error : function() {
- layer.msg("网络异常!");
- }
- });
- }
- function cache()
- {
- jQuery.post("{:url('shop/ajax/clearcache')}" ,{},function(data) {
- if(data.code>0)
- {
- layer.msg('执行完毕');
- }else{
- layer.msg('网络错误,请重新操作~');
- }
- });
- }
- </script>
- </body>
- </html>
|