default.vue 2.3 KB

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