PingAnYeXianSZCG_Web 前端代码

signout.html 2.7KB

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