default.vue 1.8 KB

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