default.vue 2.6 KB

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