my.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
  6. <meta name="format-detection" content="telephone=no"/>
  7. <meta name="format-detection" content="email=no"/>
  8. <title>my</title>
  9. <link rel="stylesheet" href="../css/reset.css">
  10. <link rel="stylesheet" href="../css/style.css">
  11. <style>
  12. html,body{
  13. height: 100%;
  14. }
  15. .my{
  16. height: 100%;
  17. background-color: #f7f7f7;
  18. }
  19. .my_con li{
  20. height: 4.5rem;
  21. line-height: 4.5rem;
  22. color: #212121;
  23. font-size: 1.3rem;
  24. background-color: #fff;
  25. padding: 0 1rem;
  26. border-bottom: 1px solid #efefef;
  27. }
  28. .my_con li span:nth-of-type(2){
  29. color: #b5b5b5;
  30. font-size: 1.3rem;
  31. }
  32. </style>
  33. </head>
  34. <body>
  35. <div class="my">
  36. <div class="my_con">
  37. <ul>
  38. <li class="clearFix">
  39. <span class="left">个人资料</span><span class="right">〉</span>
  40. </li>
  41. <li class="clearFix">
  42. <span class="left">修改密码</span><span class="right">〉</span>
  43. </li>
  44. <li class="clearFix">
  45. <span class="left">注销登录</span><span class="right">〉</span>
  46. </li>
  47. </ul>
  48. </div>
  49. </div>
  50. <script src="../script/jquery-3.1.0.min.js"></script>
  51. <script type="text/javascript" src="../script/api.js"></script>
  52. <script>
  53. apiready=function () {
  54. $(function () {
  55. $(".my_con").on('click','li',function () {
  56. switch ($(this).index()){
  57. case 0:toUserData();
  58. break;
  59. case 1:changePW();
  60. break;
  61. case 2:toLogin();
  62. break;
  63. }
  64. })
  65. function toUserData() {
  66. api.openWin({
  67. name: 'userdata',
  68. url: './userdata.html',
  69. animation: {
  70. type: 'push',
  71. subType: 'from_right',
  72. duration: 400
  73. },
  74. delay:300
  75. });
  76. }
  77. function changePW() {
  78. api.openWin({
  79. name: 'changePW',
  80. url: './changePW.html',
  81. animation: {
  82. type: 'push',
  83. subType: 'from_right',
  84. duration: 400
  85. },
  86. delay:300
  87. });
  88. }
  89. function toLogin() {
  90. api.actionSheet({
  91. title: '确定要注销当前账号吗?',
  92. cancelTitle: '取消',
  93. destructiveTitle: '确认',
  94. style:{
  95. itemNormalColor:'#fff',
  96. fontNormalColor:'#4796ff'
  97. }
  98. }, function(ret, err) {
  99. var index = ret.buttonIndex;
  100. if(index==1){
  101. $api.rmStorage("user");
  102. $api.rmStorage("userdata");
  103. api.openWin({
  104. name: 'login',
  105. url: './login.html',
  106. animation: {
  107. type: 'movein',
  108. subType: 'from_right',
  109. duration: 400
  110. },
  111. delay:300
  112. });
  113. }
  114. });
  115. }
  116. })
  117. }
  118. </script>
  119. </body>
  120. </html>