You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
2.5 KiB

3 months ago
  1. <template>
  2. <view class="content">
  3. <up-navbar leftText=" " :leftIconColor="'#fff'" :safeAreaInsetTop="true" :autoBack="true" :fixed="false"
  4. :bgColor="'transparent'" title="考试" :titleStyle="{color: '#fff'}"></up-navbar>
  5. <view class="padding">
  6. <view class="tabs flex-b">
  7. <view class="btn" @click="changeNav(item)" :class="{active: currentNav==item.name}"
  8. v-for="(item,index) in tabData" :key="index">{{ item.name }}</view>
  9. </view>
  10. <view class="card">
  11. <view class="title">
  12. <view class="titlebg">{{ currentNav }}</view>
  13. </view>
  14. <tab1 v-if="currentNav=='考试简介'"/>
  15. <tab2 v-if="currentNav=='考试流程'"/>
  16. <tab3 v-if="currentNav=='考试准备'"/>
  17. <tab4 v-if="currentNav=='注意事项'"/>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script setup>
  23. import {
  24. ref
  25. } from 'vue'
  26. import {
  27. onLoad,
  28. } from '@dcloudio/uni-app'
  29. import tab1 from './comp/tab1.vue'
  30. import tab2 from './comp/tab2.vue'
  31. import tab3 from './comp/tab3.vue'
  32. import tab4 from './comp/tab4.vue'
  33. const value = ref(false)
  34. const currentNav = ref('考试简介')
  35. function changeNav(val) {
  36. currentNav.value = val.name
  37. }
  38. onLoad((option) => {
  39. if (option.tab) currentNav.value = option.tab
  40. })
  41. const tabData = ref([{
  42. name: '考试简介',
  43. id: 1
  44. },
  45. {
  46. name: '考试准备',
  47. id: 3
  48. },
  49. {
  50. name: '考试流程',
  51. id: 2
  52. },
  53. {
  54. name: '注意事项',
  55. id: 4
  56. },
  57. ])
  58. </script>
  59. <style lang="scss" scoped>
  60. .tabs {
  61. display: flex;
  62. padding: 20rpx 0 10rpx 0;
  63. .btn {
  64. color: #fff;
  65. position: relative;
  66. // padding: 0 20rpx;
  67. &.active {
  68. &::before {
  69. content: '';
  70. position: absolute;
  71. left: 50%;
  72. bottom: -20rpx;
  73. width: 40rpx;
  74. height: 6rpx;
  75. background: #F6F7F8;
  76. border-radius: 3rpx;
  77. transform: translateX(-50%);
  78. }
  79. }
  80. }
  81. }
  82. .content {
  83. width: 100%;
  84. // background-color: #F6F7FA;
  85. min-height: 100vh;
  86. // padding: 0rpx 30rpx 30rpx 30rpx;
  87. padding-bottom: 30rpx;
  88. background: url('../../../static/images/bigImg/exambg.png') #F6F7FA no-repeat;
  89. background-size: 100% 800rpx;
  90. .card {
  91. background: #FFFFFF;
  92. border-radius: 20rpx;
  93. padding: 0 30rpx 30rpx 30rpx;
  94. margin-top: 50rpx;
  95. .title {
  96. height: 116rpx;
  97. display: flex;
  98. justify-content: center;
  99. .titlebg {
  100. width: 260rpx;
  101. height: 70rpx;
  102. font-weight: bold;
  103. font-size: 36rpx;
  104. background: url('../../../static/images/greetab.png') no-repeat;
  105. background-size: 100% 100%;
  106. text-align: center;
  107. line-height: 70rpx;
  108. color: #fff;
  109. }
  110. }
  111. }
  112. }
  113. </style>