Bez popisu

signout.html 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE html>
  2. <html class="ui-page-login">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  6. <title>个人中心</title>
  7. <link href="css/mui.min.css" rel="stylesheet" />
  8. <style>
  9. .mui-btn-primary {
  10. width: 90%;
  11. height: 46px;
  12. left: 50%;
  13. transform: translate(-50%);
  14. -webkit-transform: translate(-50%);
  15. padding: 0;
  16. }
  17. .mui-icon-contact{
  18. color: #007aff;
  19. }
  20. .mui-content-padded {
  21. margin-top: 10%;
  22. }
  23. </style>
  24. <script src="js/zepto.js"></script>
  25. <script src="Script/Common/huayi.http.js"></script>
  26. <script>
  27. var userCode = helper.cookies.get("usercode");
  28. if(!userCode) {
  29. window.location.href = "./login.html?type=3";
  30. }
  31. </script>
  32. </head>
  33. <body>
  34. <div class="mui-card">
  35. <!--页眉,放置标题-->
  36. <div class="mui-card-header">用户信息</div>
  37. <!--内容区-->
  38. <div class="mui-card-content">
  39. <ul class="mui-table-view">
  40. <li class="mui-table-view-cell">
  41. <span class="mui-icon mui-icon-contact"></span> 账号
  42. <span id="usercode" class="mui-badge mui-badge-primary mui-badge-inverted"></span>
  43. </li>
  44. </ul>
  45. </div>
  46. <!--<div class="mui-card-footer">页脚</div>-->
  47. </div>
  48. <div class="mui-content-padded">
  49. <button id="signout" class="mui-btn mui-btn-block mui-btn-primary">退出</button>
  50. </div>
  51. <script src="js/mui.min.js"></script>
  52. <script src="Script/Common/huayi.config.js"></script>
  53. <script>
  54. Zepto(function($) {
  55. $('#usercode').text(userCode);
  56. $("#signout").on('tap', function() {
  57. var btnArray = ['取消', '确定'];
  58. mui.confirm('您确定要退出吗?', ' ', btnArray, function(e) {
  59. if(e.index == 1) { //确定
  60. helper.cookies.set("usercode", "");
  61. f_close();//关闭当前页面
  62. }
  63. });
  64. });
  65. });
  66. function f_close() {
  67. if(typeof(WeixinJSBridge) != "undefined") {
  68. //WeixinJSBridge.call('closeWindow');
  69. WeixinJSBridge.invoke('closeWindow', {}, function(res) {
  70. //alert(res.err_msg);
  71. });
  72. } else {
  73. if(navigator.userAgent.indexOf("MSIE") > 0) {
  74. if(navigator.userAgent.indexOf("MSIE 6.0") > 0) {
  75. window.opener = null;
  76. window.close();
  77. } else {
  78. window.open('', '_top');
  79. window.top.close();
  80. }
  81. } else if(navigator.userAgent.indexOf("Firefox") > 0) {
  82. window.location.href = 'about:blank ';
  83. } else {
  84. window.location.href="about:blank";
  85. window.close();
  86. /*window.opener = null;
  87. window.open('', '_self', '');
  88. window.close();*/
  89. }
  90. }
  91. }
  92. </script>
  93. </body>
  94. </html>