safecenter.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <!doctype html>
  2. <html class="no-js">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="description" content="">
  7. <meta name="keywords" content="">
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9. <title>安全中心</title>
  10. <!-- Set render engine for 360 browser -->
  11. <meta name="renderer" content="webkit">
  12. <!-- No Baidu Siteapp-->
  13. <meta http-equiv="Cache-Control" content="no-siteapp" />
  14. <!-- Add to homescreen for Chrome on Android -->
  15. <meta name="mobile-web-app-capable" content="yes">
  16. <!-- Add to homescreen for Safari on iOS -->
  17. <meta name="apple-mobile-web-app-capable" content="yes">
  18. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  19. <meta name="apple-mobile-web-app-title" content="幸运生肖" />
  20. <!-- Tile icon for Win8 (144x144 + tile color) -->
  21. <meta name="msapplication-TileColor" content="#0e90d2">
  22. <link rel="stylesheet" href="__CDN__/assets/shop/css/amazeui.css">
  23. <link rel="stylesheet" href="__CDN__/assets/shop/css/app.css">
  24. <style>
  25. .am-list > li{border-bottom: 1px solid #eee}
  26. .userIcon{
  27. width: 40px;
  28. height: 40px;
  29. margin: 0 auto;
  30. }
  31. #img1{
  32. position: absolute;
  33. top: -5px;
  34. right:0;
  35. }
  36. .icon-cearma{
  37. position: absolute;
  38. bottom: 1%;
  39. right: 5%;
  40. width: 24px;
  41. }
  42. #up-img-touch{ position: relative;}
  43. #file{
  44. position: absolute;
  45. top: 0;
  46. width: 60px;
  47. height: 100%;
  48. opacity: 0;
  49. cursor: pointer;
  50. left:-50px;
  51. }
  52. </style>
  53. </head>
  54. <body class="am-bg-white">
  55. <!-- Header -->
  56. <header data-am-widget="header" class="am-header am-header-default">
  57. <div class="am-header-left am-header-nav">
  58. <a href="javascript:void(0);" onclick="javascript:history.back(-1);return false;"><i class="am-header-icon am-icon-angle-left"></i></a>
  59. </div>
  60. <h1 class="am-header-title">
  61. <a href="#title-link">安全中心</a>
  62. </h1>
  63. <div class="am-header-right am-header-nav"></div>
  64. </header>
  65. <!-- Content -->
  66. <div class="wapper">
  67. <div class="am-margin-bottom-xs">
  68. <div><img src="__CDN__/assets/shop/img/bg1.png" width="100%"/>
  69. </div>
  70. <ul class="am-list am-list-static am-list-border am-margin-bottom-0 am-margin-top-0">
  71. <li onclick="window.location.href='updatepwd1.html'">
  72. <span>修改登录密码</span>
  73. <span class="am-fr am-link-muted am-icon am-icon-angle-right am-padding-left-sm"></span>
  74. </li>
  75. <li onclick="window.location.href='updatepwd2.html'">
  76. <span>修改支付密码</span>
  77. <span class="am-fr am-link-muted am-icon am-icon-angle-right am-padding-left-sm"></span>
  78. </li>
  79. </ul>
  80. </div>
  81. </div>
  82. <!--[if (gte IE 9)|!(IE)]><!-->
  83. <script src="__CDN__/assets/shop/js/jquery.min.js"></script>
  84. <!--<![endif]-->
  85. <!--[if lte IE 8 ]>
  86. <script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
  87. <script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
  88. <script src="__CDN__/assets/shop/js/amazeui.ie8polyfill.min.js"></script>
  89. <![endif]-->
  90. <script src="__CDN__/assets/shop/js/amazeui.min.js"></script>
  91. <script src="__CDN__/assets/shop/js/app.js"></script>
  92. <script src="__CDN__/assets/libs/layer/layer.js"></script>
  93. <script>
  94. /*上传头像*/
  95. var file = document.getElementById('file');
  96. var image = document.getElementById("img1");
  97. file.onchange = function() {
  98. var fileData = this.files[0];//获取到一个FileList对象中的第一个文件( File 对象),是我们上传的文件
  99. var pettern = /^image/;
  100. console.info(fileData.type)
  101. if (!pettern.test(fileData.type)) {
  102. layer.msg("图片格式不正确");
  103. return;
  104. }
  105. var reader = new FileReader();
  106. reader.readAsDataURL(fileData);//异步读取文件内容,结果用data:url的字符串形式表示
  107. /*当读取操作成功完成时调用*/
  108. reader.onload = function(e) {
  109. console.log(e); //查看对象
  110. image.setAttribute("src", this.result)
  111. }
  112. var formData = new FormData($( "#form1" )[0]);
  113. $.ajax({
  114. //几个参数需要注意一下
  115. type: "POST",//方法类型
  116. dataType: "json",//预期服务器返回的数据类型
  117. url: "{:url('ajax/upload')}" ,
  118. data: formData,
  119. contentType: false, //不设置内容类型
  120. processData: false, //不处理数据
  121. success: function (result) {
  122. if(result.code>0)
  123. {
  124. $('input[name=avatar]').val(result.data.url);
  125. jQuery.post("{:url('api/user/toupdateuserinfo')}" ,{avatar:result.data.url},function(data) {
  126. if(data.code>0)
  127. {
  128. layer.msg(data.msg,{time:500},function(){
  129. locaiton=location;
  130. });
  131. }else{
  132. layer.msg(data.msg);
  133. }
  134. });
  135. }else{
  136. layer.msg(result.msg);
  137. }
  138. },
  139. error : function() {
  140. layer.msg("网络异常!");
  141. }
  142. });
  143. }
  144. function cache()
  145. {
  146. jQuery.post("{:url('shop/ajax/clearcache')}" ,{},function(data) {
  147. if(data.code>0)
  148. {
  149. layer.msg('执行完毕');
  150. }else{
  151. layer.msg('网络错误,请重新操作~');
  152. }
  153. });
  154. }
  155. </script>
  156. </body>
  157. </html>