App.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <NavBar
  3. v-if="showNavBar"
  4. :show-nav-icons="!/^\/password/.test($route.path)"
  5. :fixed="true"
  6. />
  7. <div
  8. class="main-container"
  9. :class="{ 'white-down-md': state.bgWhite }"
  10. :style="$route.path === '/' ? 'min-height: auto; padding-bottom: 0;' : ''"
  11. >
  12. <router-view
  13. :key="$route.fullPath"
  14. :class="[
  15. 'main-wrapper',
  16. { 'main-wrapper-fluid': $route.path === '/invite' },
  17. ]"
  18. />
  19. </div>
  20. <PageFooter v-if="$route.path !== '/'" />
  21. <ul v-else class="contents">
  22. <li><router-link to="/login">登录</router-link></li>
  23. <li><router-link to="/account">账号信息</router-link></li>
  24. <li><router-link to="/password/reset">密码找回</router-link></li>
  25. <li><router-link to="/order">我的订单</router-link></li>
  26. <li><router-link to="/gift-card">我的礼品卡</router-link></li>
  27. <li><router-link to="/benefits">会员权益</router-link></li>
  28. <li><router-link to="/renewal">续费管理</router-link></li>
  29. <li><router-link to="/mailing/fill">邮寄商品</router-link></li>
  30. <li><router-link to="/fill-order">购买下单</router-link></li>
  31. <li><router-link to="/pay-result/success">支付成功</router-link></li>
  32. <li><router-link to="/pay-result/fail">支付失败</router-link></li>
  33. <li><router-link to="/imei/bind">绑定IMEI</router-link></li>
  34. <li><router-link to="/appointment">维修预约</router-link></li>
  35. <li><router-link to="/appointment-list">维修记录</router-link></li>
  36. <li><router-link to="/invite">邀请好友</router-link></li>
  37. </ul>
  38. </template>
  39. <script setup lang="ts">
  40. import { computed, watch } from 'vue'
  41. import { useRoute } from 'vue-router'
  42. import { state } from './store'
  43. import NavBar from './components/nav-bar/index.vue'
  44. import PageFooter from './components/footer/index.vue'
  45. const route = useRoute()
  46. const navBarIgnore = ['/login', '/register']
  47. const showNavBar = computed(() => !navBarIgnore.includes(route.path))
  48. watch(
  49. () => route.path,
  50. () => (state.bgWhite = false)
  51. )
  52. </script>
  53. <style lang="scss">
  54. .main-container {
  55. min-height: 100vh;
  56. padding-bottom: 48px;
  57. background: #f7f7f7;
  58. overflow: hidden;
  59. &:first-child {
  60. background: lightblue;
  61. }
  62. &.white-down-md {
  63. @include media-breakpoint-down(md) {
  64. background: #fff;
  65. }
  66. }
  67. @include media-breakpoint-up(md) {
  68. min-height: auto;
  69. }
  70. @include media-breakpoint-only(md) {
  71. padding-bottom: 0;
  72. }
  73. @include media-breakpoint-up(lg) {
  74. padding-bottom: 64px;
  75. }
  76. .nav-bar + & {
  77. padding-top: var(--nav-bar-height);
  78. }
  79. }
  80. .main-wrapper {
  81. margin: auto;
  82. overflow: hidden;
  83. @include media-breakpoint-up(lg) {
  84. width: 768px * 2;
  85. }
  86. @include media-breakpoint-up(xl) {
  87. width: 999px * 2;
  88. }
  89. &-fluid {
  90. width: 100%;
  91. }
  92. .white-down-md & {
  93. background: #fff;
  94. @include media-breakpoint-up(lg) {
  95. margin-top: 64px;
  96. }
  97. }
  98. }
  99. .contents {
  100. margin-top: var(--nav-bar-height);
  101. padding-top: 50px;
  102. text-align: center;
  103. line-height: 74px;
  104. font-size: 36px;
  105. a {
  106. color: $primary-color;
  107. text-decoration: underline;
  108. }
  109. }
  110. </style>