App.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <div id="app">
  3. <div class="router-wrap" :class="{'has-pub-nav': navShow,'inputing':chatInputFocus}">
  4. <router-view></router-view>
  5. </div>
  6. <div class="pub-nav" v-show="navShow">
  7. <div :class="['nav-item',{'active':$route.name == 'chatList'}]" @click="$router.replace('/')">
  8. <i class="chat-icon"></i>
  9. <span class="title">{{$t('h5.chat')}}</span>
  10. </div>
  11. <div :class="['nav-item',{'active':$route.name == 'aboutMe'}]" @click="$router.replace('/me')">
  12. <i class="me-icon"></i>
  13. <span class="title">{{$t('h5.mine')}}</span>
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. import { accountLoginMixin } from '@/mixins/login'
  20. import { mapState } from 'vuex'
  21. export default {
  22. name: 'App',
  23. mixins: [accountLoginMixin],
  24. computed: {
  25. ...mapState({
  26. toApp: state => state.chat.toApp,
  27. chatInputFocus: state => state.group.chatInputFocus
  28. }),
  29. navShow () {
  30. return this.$route.name == 'chatList' || this.$route.name == 'aboutMe'
  31. }
  32. },
  33. methods: {},
  34. async created () {
  35. this.checkLocalLogin()
  36. }
  37. }
  38. </script>
  39. <style lang="scss">
  40. @import "@/style/base.scss";
  41. @import "@/style/h5.scss";
  42. .fade-enter-active,
  43. .fade-leave-active {
  44. transition: opacity 0.3s ease;
  45. }
  46. .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
  47. opacity: 0;
  48. }
  49. html {
  50. height: 100%;
  51. }
  52. body {
  53. min-height: 100%;
  54. background: #f2f2f2;
  55. }
  56. .router-wrap {
  57. padding-bottom: px2rem(104);
  58. background-color: #f2f2f2;
  59. @media #{$iphonex} {
  60. height: px2rem(146);
  61. }
  62. }
  63. .inputing {
  64. .box-ft{
  65. padding-bottom: 0 !important;
  66. }
  67. }
  68. .pub-nav {
  69. position: fixed;
  70. left: 0;
  71. right: 0;
  72. bottom: 0;
  73. z-index: 100;
  74. height: px2rem(106);
  75. background-color: #fafafa;
  76. border-top: 1px solid #e5e5e5;
  77. display: flex;
  78. @media #{$iphonex} {
  79. height: px2rem(146);
  80. }
  81. .chat-icon {
  82. background: url("../../assets/h5/nav-chat-icon1.png") no-repeat;
  83. width: px2rem(48);
  84. height: px2rem(41);
  85. background-size: 100%;
  86. }
  87. .me-icon {
  88. background: url("../../assets/h5/nav-me-icon1.png") no-repeat;
  89. width: px2rem(37);
  90. height: px2rem(41);
  91. background-size: 100%;
  92. }
  93. .title {
  94. display: block;
  95. text-align: center;
  96. font-size: px2rem(20);
  97. color: #a5b5ce;
  98. margin-top: px2rem(10);
  99. }
  100. .nav-item {
  101. flex: 1;
  102. box-sizing: border-box;
  103. padding-top: px2rem(22);
  104. text-decoration: none;
  105. &.active {
  106. .chat-icon {
  107. background: url("../../assets/h5/nav-chat-icon.png") no-repeat;
  108. background-size: 100%;
  109. }
  110. .me-icon {
  111. background: url("../../assets/h5/nav-me-icon.png") no-repeat;
  112. background-size: 100%;
  113. }
  114. .title {
  115. color: #32a1f7;
  116. }
  117. }
  118. i {
  119. display: block;
  120. margin: 0 auto;
  121. }
  122. }
  123. }
  124. </style>