noheader.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div class="container" id="markIsAppWebview" :data-app="deviceType.app">
  3. <nuxt class="main"/>
  4. </div>
  5. </template>
  6. <script>
  7. import ProginnHeader from "@/components/header";
  8. import ProginnFooter from "@/components/footer";
  9. import WxHeader from "@/components/wx_header";
  10. import {mapState, mapMutations} from "vuex";
  11. import Stats from "@/mixins/stats";
  12. export default {
  13. components: {
  14. ProginnHeader,
  15. ProginnFooter,
  16. WxHeader
  17. },
  18. data() {
  19. return {
  20. isWeixinApp: true
  21. }
  22. },
  23. mixins: [Stats],
  24. computed: {
  25. ...mapState(["isPC", "isWeixin", "deviceType", "noneCommonFooter"])
  26. },
  27. mounted() {
  28. console.log("route.path", this.$route);
  29. this.isWeixinApp = navigator.userAgent.indexOf("miniProgram") > -1;
  30. this.checkTerminal();
  31. window.addEventListener("resize", this.checkInnerWidth);
  32. // 修改密码处理
  33. if (
  34. this.$route.path.includes("/setting/check/change_mobile") ||
  35. this.$route.path.includes("/setting/check/real_info")
  36. ) {
  37. // 如果上页不是验证码页面,则认为是复制地址过来,强制踢出
  38. if (
  39. localStorage.getItem("proginn-history") !== "/setting/check/old_mobile"
  40. ) {
  41. this.$message("请验证旧手机号。");
  42. setTimeout(() => {
  43. this.$router.replace("/setting/check/old_mobile");
  44. }, 1500);
  45. }
  46. } else {
  47. localStorage.removeItem("proginn-history");
  48. }
  49. },
  50. methods: {
  51. ...mapMutations(["updateIsPC", "updateIsWeixin"]),
  52. checkTerminal() {
  53. this.updateIsPC({
  54. isPC: window.innerWidth > 960
  55. });
  56. this.updateIsWeixin({
  57. isWeixin: window.navigator.userAgent
  58. .toLowerCase()
  59. .match(/MicroMessenger/i)
  60. });
  61. }
  62. }
  63. };
  64. </script>
  65. <style>
  66. *,
  67. *:before,
  68. *:after {
  69. box-sizing: border-box;
  70. margin: 0;
  71. }
  72. .container {
  73. display: flex;
  74. flex-direction: column;
  75. align-items: center;
  76. }
  77. .main {
  78. min-width: 1000px;
  79. min-height: calc(100vh - 376px);
  80. margin: 20px 0 30px !important;
  81. }
  82. .__nuxt-error-page .title {
  83. font-size: 100%;
  84. }
  85. @media screen and (max-width: 960px) {
  86. .main {
  87. min-width: auto;
  88. }
  89. }
  90. </style>