App.vue 3.3 KB

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