w-1440-default.vue 2.6 KB

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