editpad.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title></title>
  8. <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
  9. <link rel="stylesheet" type="text/css" href="../../css/weui.min.css" />
  10. <link rel="stylesheet" type="text/css" href="../../css/style.css?v=1.2"/>
  11. <style>
  12. body{}
  13. .editpad-item{
  14. float:left;
  15. width:100px;
  16. }
  17. .setting-item{
  18. height: 1rem;
  19. line-height: 1rem;
  20. width:100%;
  21. /*border-bottom:1px solid #e8e8e8;*/
  22. text-align:left;
  23. font-size: 0.28rem;
  24. text-indent: 0.5em;
  25. }
  26. .setting-item input{
  27. width:100%;
  28. }
  29. .bot-input {
  30. padding: 0 0 0 0.25rem;
  31. font-size: 0.28rem;
  32. }
  33. </style>
  34. <script>
  35. (function(w, d, m) {
  36. function r() {
  37. var t = 100,
  38. o = 750,
  39. e = d.documentElement.clientWidth || w.innerWidth,
  40. n = m.max(m.min(e, 480), 320),
  41. h = 50;
  42. 320 >= n && (h = m.floor(n / o * t * .99)),
  43. n > 320 && 362 >= n && (h = m.floor(n / o * t * 1)),
  44. n > 362 && 375 >= n && (h = m.floor(n / o * t * 1)),
  45. n > 375 && (h = m.floor(n / o * t * .97)),
  46. d.querySelector("html").style.fontSize = h + "px"
  47. };
  48. r();
  49. w.onresize = function() {
  50. r()
  51. }
  52. })(window, document, Math);
  53. </script>
  54. </head>
  55. <body>
  56. <div class="topbar"></div>
  57. <header class="back-header back-header-bottom">
  58. <ul>
  59. <li class="padding-20 back-btn"><img class="back-header-ico" src="../../image/nav_button_back_default.png"/></li>
  60. <li class="back-header-title">修改密码</li>
  61. <li class="more-btn"></li>
  62. </ul>
  63. </header>
  64. <section class="white-back padding-top">
  65. <div class="h20"></div>
  66. <div class="setting-item">
  67. <input class="bot-input" placeholder="旧密码" id="old-password" type="password" value=""/>
  68. </div>
  69. <div class="setting-item">
  70. <input class="bot-input" placeholder="新密码" id="new-password" type="password" value=""/>
  71. </div>
  72. <div class="setting-item">
  73. <input class="bot-input" placeholder="确认密码" id="cfg-password" type="password" value=""/>
  74. </div>
  75. <div class="h50" style="height: 0.5rem;"></div>
  76. <div class="m-bottom">提 交</div>
  77. </section>
  78. </body>
  79. <script type="text/javascript" src="../../script/api.js"></script>
  80. <script type="text/javascript" src="../../script/jquery.min.js"></script>
  81. <script type="text/javascript" src="../../script/jquery.tap.js"></script>
  82. <script type="text/javascript">
  83. apiready = function(){
  84. setFixStatusBar();
  85. };
  86. $(".m-bottom").on("tap",function(){
  87. if($("#old-password").val()==""){
  88. api.toast({msg:'旧密码不能为空!'}); return false;
  89. }
  90. if($("#new-password").val()==""){
  91. api.toast({msg:'新密码不能为空!'}); return false;
  92. }
  93. if($("#new-password").val()!=$("#cfg-password").val()){
  94. api.toast({msg:'新密码和确认密码不一致'}); return false;
  95. }
  96. toast_loding_show();
  97. $.ajax({
  98. url : siteurl + 'v2/member/update',//'?do=editpad',
  99. data : {
  100. old_password: $("#old-password").val(),
  101. new_password: $("#new-password").val(),
  102. memberid: $api.getStorage("memberid")
  103. },
  104. headers: { "X-TOKEN": $api.getStorage("accesstoken") },
  105. dataType : 'json',
  106. type : 'post',
  107. success : function(datas) {
  108. toast_loding_hide();
  109. if(datas.result){
  110. api.toast({msg:'操作成功!'});
  111. setTimeCloseWin("editpad");
  112. }else{
  113. errcode(datas, datas.code);
  114. }
  115. }
  116. });
  117. return false;
  118. })
  119. </script>
  120. </html>