default.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. this.checkTerminal();
  27. window.addEventListener("resize", this.checkInnerWidth);
  28. // 修改密码处理
  29. if (
  30. this.$route.path.includes("/setting/check/change_mobile") ||
  31. this.$route.path.includes("/setting/check/real_info")
  32. ) {
  33. // 如果上页不是验证码页面,则认为是复制地址过来,强制踢出
  34. if (
  35. localStorage.getItem("proginn-history") !== "/setting/check/old_mobile"
  36. ) {
  37. this.$message("请验证旧手机号。");
  38. setTimeout(() => {
  39. this.$router.replace("/setting/check/old_mobile");
  40. }, 1500);
  41. }
  42. } else {
  43. localStorage.removeItem("proginn-history");
  44. }
  45. },
  46. methods: {
  47. ...mapMutations(["updateIsPC", "updateIsWeixin"]),
  48. checkTerminal() {
  49. this.updateIsPC({
  50. isPC: window.innerWidth > 960
  51. });
  52. this.updateIsWeixin({
  53. isWeixin: window.navigator.userAgent
  54. .toLowerCase()
  55. .match(/MicroMessenger/i)
  56. });
  57. }
  58. }
  59. };
  60. </script>
  61. <style>
  62. *,
  63. *:before,
  64. *:after {
  65. box-sizing: border-box;
  66. margin: 0;
  67. }
  68. .container {
  69. display: flex;
  70. flex-direction: column;
  71. align-items: center;
  72. }
  73. .main {
  74. min-width: 1000px;
  75. min-height: calc(100vh - 376px);
  76. margin: 20px 0 30px;
  77. }
  78. .__nuxt-error-page .title {
  79. font-size: 100%;
  80. }
  81. @media screen and (max-width: 960px) {
  82. .main {
  83. min-width: auto;
  84. }
  85. }
  86. </style>