default.vue 2.0 KB

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