head.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <div id="head">
  3. <el-row>
  4. <el-col :span="24" class="head">
  5. <div class="w_1200" v-if="is_head">
  6. <el-row :gutter="20" class="one">
  7. <el-row :gutter="10" class="left">
  8. <el-col :span="4">
  9. <el-image class="image" :src="siteInfo.logoUrl" fit="fill" />
  10. </el-col>
  11. <el-col :span="20">
  12. <div class="title">{{ siteInfo.zhTitle }}</div>
  13. <div class="English">{{ siteInfo.zhEnglish }}</div>
  14. </el-col>
  15. </el-row>
  16. <el-col :span="8" class="right">
  17. <a-input-search v-model:value="input" placeholder="请输入您想搜索的内容" enter-button @search="onSearch" />
  18. </el-col>
  19. <el-col :span="4" class="button">
  20. <a-space wrap>
  21. <a-button @click="toLogin" type="primary">登录</a-button>
  22. <a-button @click="toRegister">注册</a-button>
  23. </a-space>
  24. </el-col>
  25. </el-row>
  26. </div>
  27. <el-col :span="24" class="two" v-if="is_menu">
  28. <a-menu @select="selectMenu" v-model:selectedKeys="current" mode="horizontal" theme="dark" :items="menuList" />
  29. </el-col>
  30. <el-col :span="24" class="thr">
  31. <slot name="info"></slot>
  32. </el-col>
  33. <div class="foot" v-if="is_foot">
  34. <div class="w_1200 footflex">
  35. <el-image class="image" src="/src/assets/unit.png" fit="fill" />
  36. <el-col :span="12" class="foot_1">
  37. <div class="footTitle">
  38. <span>业务洽谈:0431-81165166</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>企业邮箱:jlpstm@126.com</span></div>
  39. <div class="footTitle">地 址:长春朝阳区前进大街1244号(吉林省科技厅科研园)</div>
  40. <div class="footTitle">版权所有:Copyright©2007-2023 吉林省创新指导中心 │ 吉ICP备14005689号</div>
  41. <div class="footTitle">技术支持:长春市福瑞科技有限公司</div>
  42. </el-col>
  43. <el-col :span="3" class="foot_2">
  44. <div class="footTop">关于我们</div>
  45. <div class="footTitle footflex1">
  46. <span class="footSpan" @click="toHelp('1')">关于我们</span> <span class="footSpan"
  47. @click="toHelp('2')">意见反馈</span>
  48. </div>
  49. <div class="footTitle footflex1">
  50. <span class="footSpan" @click="toHelp('3')">联系我们</span> <span class="footSpan"
  51. @click="toHelp('4')">法律条款</span>
  52. </div>
  53. </el-col>
  54. <el-col :span="4" class="foot_3 footflex">
  55. <el-image class="image" src="/src/assets/code.png" fit="fill" />
  56. <el-image class="image" src="/src/assets/code.png" fit="fill" />
  57. </el-col>
  58. </div>
  59. </div>
  60. </el-col>
  61. </el-row>
  62. </div>
  63. </template>
  64. <script setup lang="ts">
  65. import type { Ref } from 'vue';
  66. import { ref, toRefs, watch } from 'vue';
  67. import { siteInfo } from '@/layout/site';
  68. import { MenuProps } from 'ant-design-vue';
  69. import { useRouter } from 'vue-router';
  70. const router = useRouter();
  71. const props = defineProps({
  72. is_head: { type: Boolean, default: true },
  73. is_menu: { type: Boolean, default: true },
  74. is_foot: { type: Boolean, default: true },
  75. currentIndex: { type: String, default: 'home' }
  76. });
  77. const { is_menu, is_head, is_foot, currentIndex } = toRefs(props);
  78. const current = ref<any>([currentIndex.value]);
  79. const menuList = ref<MenuProps['items']>([
  80. {
  81. key: 'home',
  82. label: '首页',
  83. title: '首页'
  84. },
  85. {
  86. key: 'tran',
  87. label: '交易大厅',
  88. title: '交易大厅'
  89. },
  90. {
  91. key: 'achieve',
  92. label: '成果大厅',
  93. title: '成果大厅'
  94. },
  95. {
  96. key: 'demand',
  97. label: '需求大厅',
  98. title: '需求大厅'
  99. },
  100. {
  101. key: 'service',
  102. label: '服务大厅',
  103. title: '服务大厅'
  104. },
  105. {
  106. key: 'activity',
  107. label: '活动大厅',
  108. title: '活动大厅'
  109. }
  110. ]);
  111. const input: Ref<any> = ref('');
  112. // 选择菜单
  113. const emit = defineEmits(['selectMenu']);
  114. const selectMenu = (item) => {
  115. emit('selectMenu', item);
  116. };
  117. /*监听props*/
  118. watch(props, (newProps) => {
  119. current.value = [newProps.currentIndex];
  120. });
  121. // 查询
  122. const onSearch = (searchValue: string) => {
  123. console.log('use value', searchValue);
  124. console.log('or use this.value', input.value);
  125. };
  126. // 登录
  127. const toLogin = (status) => {
  128. router.push({ path: '/login', query: { status } });
  129. };
  130. // 去注册
  131. const toRegister = () => {
  132. router.push({ path: '/register' });
  133. };
  134. // 帮助中心
  135. const toHelp = (type) => {
  136. router.push({ path: '/help', query: { type } });
  137. };
  138. </script>
  139. <style scoped lang="scss">
  140. .head {
  141. .one {
  142. display: flex;
  143. align-items: center;
  144. justify-content: space-between;
  145. padding: 20px 0;
  146. .left {
  147. .title {
  148. font-family: Helvetica, Arial, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', STHeiti, '华文细黑', sans-serif;
  149. font-size: 28px;
  150. color: #121834;
  151. line-height: 32px;
  152. font-weight: 500;
  153. padding-bottom: 8px;
  154. }
  155. .English {
  156. font-size: 15px;
  157. }
  158. }
  159. }
  160. .two {
  161. display: flex;
  162. justify-content: center;
  163. width: 100%;
  164. padding: 10px 0;
  165. background: #001529;
  166. position: sticky;
  167. top: 0;
  168. width: 100%;
  169. z-index: 99999;
  170. }
  171. }
  172. .foot {
  173. padding: 5px 0;
  174. font-size: 13px;
  175. background-color: #2e3546;
  176. color: #f0f2f5;
  177. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
  178. 'Segoe UI Symbol', 'Noto Color Emoji';
  179. font-variant: tabular-nums;
  180. line-height: 1.5715;
  181. font-feature-settings: 'tnum', 'tnum';
  182. .image {
  183. width: 78px;
  184. height: 78px;
  185. }
  186. .footTitle {
  187. margin: 5px 0 0 0;
  188. .footSpan {
  189. margin-bottom: 3px;
  190. }
  191. }
  192. .footTop {
  193. font-size: 18px;
  194. margin-bottom: 12px;
  195. }
  196. }
  197. .footflex {
  198. display: flex;
  199. align-items: center;
  200. justify-content: space-evenly;
  201. }
  202. .footflex1 {
  203. display: flex;
  204. align-items: center;
  205. justify-content: space-between;
  206. }</style>