personal.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Hello MUI</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <script src="../js/mui.min.js"></script>
  10. <script src="../js/app.js"></script>
  11. <link rel="stylesheet" href="../css/mui.min.css">
  12. <style>
  13. html,
  14. body {
  15. background-color: #efeff4;
  16. }
  17. .mui-bar-nav~.mui-content {
  18. padding: 0;
  19. }
  20. .my-footer {
  21. height: 100px;
  22. position: fixed;
  23. bottom: 0;
  24. padding-left: 30px;
  25. padding-right: 30px;
  26. right: 0;
  27. left: 0;
  28. z-index: 10;
  29. }
  30. .my-mui-media-body {
  31. font-size: 20px !important;
  32. height: 35px !important;
  33. line-height: 25px !important;
  34. position: absolute;
  35. top: 130px;
  36. left: 130px;
  37. }
  38. .my-mui-grid-9 {
  39. margin-top: 20px !important;
  40. background-color: whitesmoke!important;
  41. }
  42. /*个人中心带底图的块*/
  43. .my-person-header {
  44. width: 100%;
  45. }
  46. /*按钮的样式*/
  47. .my-baoming {
  48. position: absolute;
  49. top: 200px;
  50. right: 40px;
  51. font-size: 14px;
  52. }
  53. .my-baoming span {
  54. color: #00cc00;
  55. }
  56. .button {
  57. display: inline-block;
  58. outline: none;
  59. cursor: pointer;
  60. text-align: center;
  61. text-decoration: none;
  62. font: 14px 'Microsoft yahei', Arial, Helvetica, sans-serif;
  63. padding: 0.2em 2em;
  64. text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
  65. -webkit-border-radius: .5em;
  66. -moz-border-radius: .5em;
  67. border-radius: .5em;
  68. -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  69. -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  70. box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  71. float: right;
  72. }
  73. .button:hover {
  74. text-decoration: none;
  75. }
  76. .button:active {
  77. position: relative;
  78. top: 1px;
  79. }
  80. /* 深绿色按钮的样式 */
  81. .deepgreen {
  82. color: white;
  83. line-height: 30px;
  84. background: #113f4a;
  85. text-align: center;
  86. background: -webkit-gradient(linear, left top, left bottom, from(#2e5e6a), to(#113f4a));
  87. background: -moz-linear-gradient(top, #00adee, #0078a5);
  88. filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#00adee', endColorstr='#0078a5');
  89. }
  90. .deepgreen:hover {
  91. background: #d21910;
  92. background: -webkit-gradient(linear, left top, left bottom, from(#de5852), to(#d21910));
  93. background: -moz-linear-gradient(top, #0095cc, #00678e);
  94. filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#0095cc', endColorstr='#00678e');
  95. }
  96. </style>
  97. </head>
  98. <body>
  99. <header class="mui-bar mui-bar-nav">
  100. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  101. <h1 class="mui-title">个人中心</h1>
  102. </header>
  103. <div class="mui-content">
  104. <img src="../images/person/person-header-tu.jpg" width="100%" height="auto" />
  105. <div class="my-mui-media-body">账号:
  106. <a id="personal-id" href="javascript:;"></a>
  107. </div>
  108. <!--<div class="my-baoming">
  109. <a href="javascript:;" class="button deepgreen">报名入口</a>
  110. </div>-->
  111. <div class="my-baoming">
  112. 已用时长:<span id="all-time-id"></span>&nbsp;&nbsp; 可用学时:
  113. <span id="available-time-id"></span>
  114. </div>
  115. <ul class="my-mui-grid-9 mui-table-view mui-grid-view mui-grid-9">
  116. <li class="mui-table-view-cell mui-media mui-col-xs-6 mui-col-sm-3">
  117. <a href="javascript:;" id="xitongshezhi-id">
  118. <img src="../images/person/my-person-xitongshezhi.png" style="width: 100%;height: auto;" />
  119. <div class="mui-media-body">系统设置</div>
  120. </a>
  121. </li>
  122. <li class="mui-table-view-cell mui-media mui-col-xs-6 mui-col-sm-3">
  123. <a href="javascript:;" id="xiaoxizhongxin-id">
  124. <img src="../images/person/my-person-xiaoxi.png" style="width: 100%;height: auto;" />
  125. <div class="mui-media-body">消息中心</div>
  126. </a>
  127. </li>
  128. </ul>
  129. <div id="tuichu-id" style="margin: 0px 20%;margin-top: 20px;">
  130. <a class="mui-btn mui-btn-block mui-btn-primary" style="font-size: 22px;padding: 5px 0px;">
  131. 退出账号
  132. </a>
  133. </div>
  134. <script type="text/javascript">
  135. /**
  136. * 点击账号跳转补充完善用户信息
  137. */
  138. function personalInfoEvent() {
  139. document.getElementById("personal-id").addEventListener('tap', function() {
  140. mui.openWindow({
  141. id: 'personalInfo-win',
  142. url: 'personal-info.html'
  143. })
  144. })
  145. }
  146. /**
  147. * 设置用户账号信息
  148. */
  149. function setAccount() {
  150. var isAlreadyLogin = window.localStorage.getItem('isAlreadyLogin');
  151. var phone = window.localStorage.getItem('phone');
  152. if (isAlreadyLogin) {
  153. var personal = document.getElementById("personal-id");
  154. personal.innerHTML = phone;
  155. }
  156. }
  157. /**
  158. * 退出登录状态
  159. */
  160. function tuichuEvent() {
  161. document.getElementById("tuichu-id").addEventListener('tap', function() {
  162. var btnArray = ['是', '否'];
  163. mui.confirm('确定要注销登录吗?', '', btnArray, function(e) {
  164. if (e.index == 0) {
  165. window.localStorage.setItem('isAlreadyLogin', false);
  166. window.localStorage.setItem('phone', '');
  167. mui.openWindow({
  168. id: 'dragIndex-win',
  169. url: '../dragIndex.html',
  170. waiting: {
  171. autoShow: false
  172. }
  173. });
  174. };
  175. });
  176. });
  177. }
  178. /**
  179. * 点击消息中心
  180. */
  181. function xiaoxizhongxinEvent() {
  182. document.getElementById("xiaoxizhongxin-id").addEventListener('tap', function() {
  183. mui.openWindow({
  184. id: 'msg-center-win',
  185. url: 'msg-center.html',
  186. waiting: {
  187. autoShow: false
  188. }
  189. });
  190. })
  191. }
  192. /**
  193. * 点击设置
  194. */
  195. function xitongshezhiEvent() {
  196. document.getElementById("xitongshezhi-id").addEventListener('tap', function() {
  197. mui.openWindow({
  198. id: 'seting-win',
  199. url: 'seting.html',
  200. waiting: {
  201. autoShow: false
  202. }
  203. });
  204. });
  205. }
  206. /**
  207. * 设置学习时长
  208. */
  209. function setTimeEvent() {
  210. document.getElementById("all-time-id").innerText = getRemainTime() +'分钟';
  211. document.getElementById("available-time-id").innerText = getAvaliableTime() +'分钟';
  212. }
  213. mui.init();
  214. mui.plusReady(function() {
  215. setAccount();
  216. tuichuEvent();
  217. xiaoxizhongxinEvent();
  218. xitongshezhiEvent();
  219. personalInfoEvent();
  220. setTimeEvent();
  221. });
  222. </script>
  223. </body>
  224. </html>