HeadBlock.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <script setup lang="ts">
  2. import { ref } from 'vue'
  3. import { Search } from '@element-plus/icons-vue'
  4. // import type { TabsInstance } from 'element-plus'
  5. import { useRoute, useRouter } from 'vue-router'
  6. const input3 = ref('')
  7. const tabs = ref([
  8. { title: '信用信息', placeholder: '请输入主体名称' },
  9. { title: '统一社会信用代码', placeholder: '请输入统一社会信用代码' },
  10. { title: '站内文章', placeholder: '请输入站内文章关键字' },
  11. ]);
  12. const route: any = useRoute()
  13. const router: any = useRouter()
  14. const munTabs = ref([
  15. { title: '首页', route:'home'},
  16. { title: '信用动态', route:'creditDynamics' },
  17. { title: '信用慧企', route:'creditWiseEnterprise' },
  18. { title: '信用评价结果', route:'creditEcaluationResults' },
  19. { title: '信用警示', route:'creditWarning' },
  20. { title: '信用服务', route:'creditServices' },
  21. { title: '通知公告', route:'about' },
  22. ]);
  23. const activeTab = ref(0); // 默认激活第一个tab
  24. const activeMun = ref(0); // 默认激活第一个tab
  25. const placeholder = ref('请输入主体名称');
  26. // const tabPosition = ref<TabsInstance['tabPosition']>('left')
  27. const setActiveTab = (index: any, value: any) => {
  28. activeTab.value = index;
  29. placeholder.value = value.placeholder;
  30. console.log(index, value);
  31. };
  32. const munActiveTab = (index: any,tab:any) => {
  33. console.log(index, tab);
  34. activeMun.value = index;
  35. router.push({
  36. path: tab.route,
  37. query: {}
  38. });
  39. };
  40. </script>
  41. <template>
  42. <div class="headContainer w100vw">
  43. <!-- 标题部分登录跳转 -->
  44. <div class="headTitle">
  45. <text>欢迎来到怀化市高新区企业信用信息分级分类平台</text>
  46. <div>
  47. <el-button type="primary">登录</el-button>
  48. </div>
  49. </div>
  50. <!-- 头部功能及其显示内容 -->
  51. <div class="headModule">
  52. <div>
  53. <H1>怀化市高新区企业信用信息分级分类平台</H1>
  54. <H3>www.aabbccd.com</H3>
  55. </div>
  56. <div class="headSearch">
  57. <!-- 搜索上方tab切换选择 -->
  58. <div class="headSTab">
  59. <div v-for="(tab, index) in tabs" :key="index" class="tab" :class="{ active: activeTab === index }"
  60. @click="setActiveTab(index, tab)">
  61. {{ tab.title }}
  62. </div>
  63. </div>
  64. <!-- 搜索框位置 -->
  65. <div>
  66. <el-input v-model="input3" style="width: 337px;height:33px" :placeholder=placeholder class="input-with-select">
  67. <template #append>
  68. <el-button :icon="Search" />
  69. </template>
  70. </el-input>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="D" style="display:flex;justify-content:center">
  75. <div style="width:100%;position: absolute;
  76. bottom: 0;
  77. display: flex;
  78. justify-content: center;
  79. background:rgba(255,255,255,.22);
  80. height:46px">
  81. <div class="headMune">
  82. <div v-for="(tab, index) in munTabs" :key="index" class="tab" :class="{ activeMun: activeMun === index }"
  83. @click="munActiveTab(index,tab)">
  84. {{ tab.title }}</div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </template>
  90. <style scoped lang="scss">
  91. $boxWidth: 1200px;
  92. .headContainer {
  93. background-image: url("../../assets/img/back.png");
  94. background-size: 100% 100%;
  95. height: 238px;
  96. position: relative;
  97. .headTitle {
  98. margin: 0 40px;
  99. height: 40px;
  100. display: flex;
  101. justify-content: space-between;
  102. align-items: center;
  103. text {
  104. font-weight: 400;
  105. font-size: 13px;
  106. color: #FFFFFF;
  107. }
  108. }
  109. .headModule {
  110. margin-top: 27px;
  111. width: $boxWidth;
  112. margin: 27px auto 0 auto;
  113. display: flex;
  114. justify-content: space-between;
  115. align-items: center;
  116. H1 {
  117. font-weight: bold;
  118. font-size: 26px;
  119. color: #FFFFFF;
  120. }
  121. H3 {
  122. font-weight: bold;
  123. font-size: 14px;
  124. color: #FFFFFF;
  125. margin: 16px 0 0 0;
  126. }
  127. .headSearch {
  128. .headSTab {
  129. display: flex;
  130. .tab {
  131. color: white;
  132. padding: 6px 6px;
  133. margin-bottom: 16px;
  134. border-radius: 6px;
  135. }
  136. .active {
  137. background-color: #FF9900;
  138. }
  139. }
  140. }
  141. }
  142. .headMune {
  143. width: 100%;
  144. position: absolute;
  145. bottom: 0;
  146. width: $boxWidth;
  147. display: flex;
  148. justify-content: space-between;
  149. align-items: center;
  150. height: 46px;
  151. .tab {
  152. color: white;
  153. width: 100%;
  154. height: 100%;
  155. display: flex;
  156. justify-content: center;
  157. align-items: center;
  158. }
  159. .activeMun {
  160. background-color: #FF9900;
  161. }
  162. }
  163. }
  164. </style>