pageNavigation.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <div class="navigate">
  3. <div class="partOne">
  4. <div class="inner">
  5. <div class="navLeft">
  6. <div class="navClass">
  7. <div>
  8. 资讯信息
  9. </div>
  10. <div>
  11. 网上互动
  12. </div>
  13. </div>
  14. </div>
  15. <ul class="navigationOne">
  16. <li v-for="item in navigation1"
  17. @mousemove="item.alias == '供求信息' ? showTwo = true : showTwo = false">
  18. <NuxtLink :href="getLinkPath(item)" :title="item.alias"
  19. :target="item.is_url == 1 ? '_blank' : '_self'">
  20. {{ item.alias }}
  21. </NuxtLink>
  22. </li>
  23. </ul>
  24. <ul class="navigationTwo" v-if="showTwo" @mouseleave="showTwo = false">
  25. <li v-for="(item, index) in secNav" :key="index">
  26. <NuxtLink :href="`/gongqiuxinxi/${item.aLIas_pinyin}/index.html`" :title="item.alias"
  27. :target="item.is_url == 1 ? '_blank' : '_self'">
  28. {{ item.alias }}
  29. </NuxtLink>
  30. </li>
  31. </ul>
  32. </div>
  33. </div>
  34. <div class="partTwo">
  35. <div class="inner">
  36. <ul class="part2_left">
  37. <li>农资商城</li>
  38. <li class="part2_navList" v-for="item in navigation2">
  39. <NuxtLink :href="getLinkPath(item)" :title="item.alias"
  40. :target="item.is_url == 1 ? '_blank' : '_self'">
  41. {{ item.alias }}
  42. </NuxtLink>
  43. </li>
  44. </ul>
  45. <ul class="part2_right">
  46. <li class="part2_right_navList" v-for="(item, index) in navigation3">
  47. <NuxtLink :href="getLinkPath(item)" :title="item.alias"
  48. :target="item.is_url == 1 ? '_blank' : '_self'">
  49. {{ item.alias }}
  50. </NuxtLink>
  51. <em v-if="index != 2"></em>
  52. </li>
  53. </ul>
  54. </div>
  55. </div>
  56. <!-- 深度服务 -->
  57. <div class="deepServer">
  58. <div class="inner">
  59. <div class="deepServer_left">
  60. <div class="serverTitle">
  61. <NuxtLink href="/">
  62. 网站首页
  63. </NuxtLink>
  64. </div>
  65. <el-checkbox-group v-model="checkList">
  66. <el-checkbox label="产品" value="1" disabled />
  67. <el-checkbox label="企业" value="2" disabled />
  68. <el-checkbox label="人才" value="3" disabled />
  69. <el-checkbox label="展会" value="4" disabled />
  70. <el-checkbox label="资讯" value="5" checked disabled />
  71. </el-checkbox-group>
  72. <!-- <div class="serverTitle1">
  73. <a href="">
  74. 农资商务中心
  75. </a>
  76. </div> -->
  77. </div>
  78. <div class="deepServer_right">
  79. <div class="searchRole">
  80. <input type="text" v-model="inputValue" placeholder="输入关键词" class="ipt">
  81. <em @click="goToPrimary"></em>
  82. </div>
  83. <!-- <div class="serverTitle_right">
  84. 【高级搜索】
  85. </div> -->
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </template>
  91. <script setup>
  92. //1.获取导航菜单 start ---------------------------------------->
  93. import { ElCheckbox, ElCheckboxGroup, ElMessage } from 'element-plus'
  94. let showTwo = ref(false);
  95. //第一行导航菜单 10个
  96. const navigation1 = ref([]);
  97. //两行的导航菜单 20个
  98. const navigation2 = ref([]);
  99. //三行的导航菜单 3个
  100. const navigation3 = ref([]);
  101. //获取导航菜单1
  102. async function getNavigation1() {
  103. const mkdata = await requestDataPromise('/web/getWebsiteModelCategory', {
  104. method: 'GET',
  105. query: {
  106. 'pid': 0,
  107. 'num': 28,
  108. 'placeid': 1
  109. },
  110. });
  111. navigation1.value = mkdata.data;
  112. }
  113. getNavigation1();
  114. //获取导航菜单2
  115. async function getNavigation2() {
  116. const mkdata = await requestDataPromise('/web/getWebsiteModelCategory', {
  117. method: 'GET',
  118. query: {
  119. 'pid': 0,
  120. 'num': 10,
  121. 'placeid': 29
  122. },
  123. });
  124. navigation2.value = mkdata.data;
  125. }
  126. getNavigation2();
  127. //获取导航菜单3
  128. async function getNavigation3() {
  129. const mkdata = await requestDataPromise('/web/getWebsiteModelCategory', {
  130. method: 'GET',
  131. query: {
  132. 'pid': 0,
  133. 'num': 3,
  134. 'placeid': 38
  135. },
  136. });
  137. navigation3.value = mkdata.data;
  138. }
  139. getNavigation3();
  140. // 1.4 获取供求信息二级导航
  141. //引入导航
  142. const { $pageNav } = useNuxtApp();
  143. const pid = $pageNav[14];
  144. console.log('供求信息二级栏目', pid);
  145. const secNav = ref([]);
  146. async function getNavigation4() {
  147. const mkdata = await requestDataPromise('/web/getWebsiteModelCategory', {
  148. method: 'GET',
  149. query: {
  150. 'pid': pid,
  151. 'num': 2,
  152. 'placeid': 1,
  153. 'type': 1
  154. },
  155. });
  156. console.log("供求信息二级栏目", mkdata.data);
  157. secNav.value = mkdata.data;
  158. }
  159. getNavigation4();
  160. //1.获取导航菜单 end ---------------------------------------->
  161. //2.搜索 start ---------------------------------------->
  162. const typeValue = ref("")
  163. const checkList = ref([]);// 多选框
  164. const inputValue = ref("") //关键词搜索
  165. //2.1跳转到搜索页面
  166. let goToPrimary = async () => {
  167. if (inputValue.value == "") {
  168. ElMessage.error('搜索项不能为空!')
  169. } else {
  170. const route = `/search/search?keyword=${inputValue.value}`;
  171. window.location.href = route;
  172. }
  173. }
  174. onMounted(async () => {
  175. })
  176. //2.搜索 end ---------------------------------------->
  177. </script>
  178. <style lang="less" scoped>
  179. @import url('@/assets/css/public/nav.less');
  180. </style>