4.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. <template>
  2. <div>
  3. <div class="channelMenuTitle_skin4" v-if="componentStyle == 1 || componentStyle == 2 || componentStyle == 3">
  4. {{ title }}
  5. </div>
  6. <!--样式1-->
  7. <div class="channelMenuList" v-if="componentStyle == 1">
  8. <div v-for="item in navigateData">
  9. <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
  10. :class="{ active: targetSegment2 == item.aLIas_pinyin }">{{ item.alias }}</NuxtLink>
  11. </div>
  12. </div>
  13. <!--样式2-->
  14. <div class="channelMenuList menuListStyle2" v-if="componentStyle == 2">
  15. <div v-for="item in navigateData">
  16. <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
  17. :class="{ active: targetSegment2 == item.aLIas_pinyin }">{{ item.alias }}</NuxtLink>
  18. </div>
  19. </div>
  20. <!-- 样式3 -->
  21. <div class="channelMenuList menuListStyle3" v-if="componentStyle == 3">
  22. <div v-for="item in navigateData">
  23. <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
  24. :class="{ active: targetSegment2 == item.aLIas_pinyin }">{{ item.alias }}</NuxtLink>
  25. </div>
  26. </div>
  27. <!-- 样式4 -->
  28. <div class="channelMenuList menuListStyle4" v-if="componentStyle == 4">
  29. <div class="menuTitle">{{ title }}</div>
  30. <div class="menulist" v-for="item in navigateData">
  31. <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
  32. :class="{ active: targetSegment2 == item.aLIas_pinyin }">
  33. <span class="title">{{ item.alias }}</span>
  34. <span class="line" v-if="item.alias != navigateData[navigateData.length - 1].alias">/</span>
  35. </NuxtLink>
  36. </div>
  37. </div>
  38. <!-- 样式5 -->
  39. <div class="channelMenuList menuListStyle4 menuListStyle5" v-if="componentStyle == 5">
  40. <div class="menuTitle">{{ title }}</div>
  41. <div class="menulist" v-for="item in navigateData">
  42. <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
  43. :class="{ active: targetSegment2 == item.aLIas_pinyin }">
  44. <span class="title">{{ item.alias }}</span>
  45. <span class="line" v-if="item.alias != navigateData[navigateData.length - 1].alias">/</span>
  46. </NuxtLink>
  47. </div>
  48. </div>
  49. <!-- 样式6 -->
  50. <div class="channelMenuList menuListStyle4 menuListStyle6" v-if="componentStyle == 6">
  51. <div class="menuTitle">{{ title }}</div>
  52. <div class="menulist" v-for="item in navigateData">
  53. <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
  54. :class="{ active: targetSegment2 == item.aLIas_pinyin }">
  55. <span class="title">{{ item.alias }}</span>
  56. <span class="line" v-if="item.alias != navigateData[navigateData.length - 1].alias">/</span>
  57. </NuxtLink>
  58. </div>
  59. </div>
  60. <!--样式7-->
  61. <div class="menuListStyle7" v-if="componentStyle == 7">
  62. <div class="channelMenuListTitle">{{ title }}</div>
  63. <div class="hannelMenuListFloatMenu">
  64. <div v-for="item in navigateData">
  65. <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
  66. :class="{ active: targetSegment2 == item.aLIas_pinyin }">
  67. <span class="title">{{ item.alias }}</span>
  68. </NuxtLink>
  69. </div>
  70. </div>
  71. </div>
  72. <!--样式8-->
  73. <div class="menuListStyle7 menuListStyle8" v-if="componentStyle == 8">
  74. <div class="channelMenuListTitle">{{ title }}</div>
  75. <div class="hannelMenuListFloatMenu">
  76. <div v-for="item in navigateData">
  77. <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
  78. :class="{ active: targetSegment2 == item.aLIas_pinyin }">
  79. <span class="title">{{ item.alias }}</span>
  80. </NuxtLink>
  81. </div>
  82. </div>
  83. </div>
  84. <!--样式9-->
  85. <div class="menuListStyle7 menuListStyle9" v-if="componentStyle == 9">
  86. <div class="channelMenuListTitle">{{ title }}</div>
  87. <div class="hannelMenuListFloatMenu">
  88. <div v-for="item in navigateData">
  89. <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
  90. :class="{ active: targetSegment2 == item.aLIas_pinyin }">
  91. <span class="title">{{ item.alias }}</span>
  92. </NuxtLink>
  93. </div>
  94. </div>
  95. </div>
  96. <!--样式10-->
  97. <div class="menuListStyle7 menuListStyle9 menuListStyle8" v-if="componentStyle == 10">
  98. <div class="channelMenuListTitle">{{ title }}</div>
  99. <div class="hannelMenuListFloatMenu">
  100. <div v-for="item in navigateData">
  101. <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
  102. :class="{ active: targetSegment2 == item.aLIas_pinyin }">
  103. <span class="title">{{ item.alias }}</span>
  104. </NuxtLink>
  105. </div>
  106. </div>
  107. </div>
  108. <!--样式11-->
  109. <div class="menuListStyle11" v-if="componentStyle == 11">
  110. <div class="style11">
  111. <div class="channelMenuListTitle">
  112. <span>{{ title }}</span>
  113. </div>
  114. <div class="hannelMenuListFloatMenu">
  115. <div v-for="item in navigateData">
  116. <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
  117. :class="{ active: targetSegment2 == item.aLIas_pinyin }">
  118. <span class="title">{{ item.alias }}</span>
  119. </NuxtLink>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <!--样式12-->
  125. <div class="menuListStyle12" v-if="componentStyle == 12">
  126. <div class="channelMenuListTitle">
  127. <span>{{ title }}</span>
  128. </div>
  129. <div class="hannelMenuListFloatMenu">
  130. <div v-for="item in navigateData">
  131. <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
  132. :class="{ active: targetSegment2 == item.aLIas_pinyin }">
  133. <span class="title">{{ item.alias }}</span>
  134. </NuxtLink>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. </template>
  140. <script setup>
  141. //引入vue
  142. import { ref } from 'vue';
  143. //获得新闻数据
  144. const props = defineProps({
  145. componentStyle: Number,//样式编号
  146. navigateData: Array,//子导航数据
  147. routeId: Number//导航对应的cid
  148. });
  149. //获得导航名称
  150. const title = ref("")
  151. const mkdata = await requestDataPromise('/web/getOneWebsiteCategory', {
  152. method: 'GET',
  153. query: {
  154. 'catid': props.routeId,
  155. },
  156. });
  157. if (mkdata.code == 200) {
  158. title.value = mkdata.data.alias;
  159. }
  160. //获取当前url路径
  161. const route = useRoute();
  162. //获得当前的完整路径
  163. const fullPath = route.path;
  164. const segments = fullPath.split('/');
  165. const targetSegment = segments[1];
  166. const targetSegment2 = segments[2];
  167. //判断当前为第几层的列表页
  168. // const routeLevel = ref(0);
  169. // if(route.name == "dir-list-id"){
  170. // routeLevel.value = 1;
  171. // console.log("当前的路由层级为:" + routeLevel.value);
  172. // }
  173. // if(route.name == "dir-dir-list-id"){
  174. // routeLevel.value = 2;
  175. // console.log("当前的路由层级为:" + routeLevel.value);
  176. // }
  177. </script>
  178. <style lang="less" scoped>
  179. //基本样式 start ---------------------------------------->
  180. .channelMenuTitle_skin4 {
  181. width: 1200px;
  182. height: 32px;
  183. line-height: 32px;
  184. font-size: 24px;
  185. color: #fe8f00;
  186. font-weight: bold;
  187. text-align: center;
  188. background: url('https://img.bjzxtw.org.cn/pre/image/png/20251017/1760682472803297.png') no-repeat center center;
  189. margin-bottom: 25px;
  190. }
  191. .channelMenuList {
  192. display: flex;
  193. justify-content: flex-start;
  194. align-items: center;
  195. color: #333;
  196. border-bottom: 2px solid #fe8f00;
  197. padding-bottom: 15px;
  198. div {
  199. font-size: 16px;
  200. font-weight: bold;
  201. width: 150px;
  202. height: 22px;
  203. line-height: 22px;
  204. a {
  205. color: #333;
  206. display: block;
  207. text-align: center;
  208. &:hover {
  209. color: #fe8f00;
  210. }
  211. }
  212. a.active {
  213. color: #fe8f00;
  214. }
  215. &:first-child {
  216. color: #fe8f00;
  217. }
  218. }
  219. }
  220. //基本样式 end ---------------------------------------->
  221. //样式2 start ---------------------------------------->
  222. .menuListStyle2 {
  223. border-bottom: 0;
  224. }
  225. //样式2 end ---------------------------------------->
  226. //样式3
  227. .menuListStyle3 {
  228. border-bottom: 0;
  229. div {
  230. text-align: center;
  231. height: 36px;
  232. &:hover {
  233. color: #fe8f00;
  234. padding-bottom: 15px;
  235. border-bottom: 2px solid #fe8f00;
  236. box-sizing: border-box;
  237. }
  238. }
  239. }
  240. //样式4
  241. .menuListStyle4 {
  242. height: 54px;
  243. padding-top: 23px;
  244. padding-bottom: 0px;
  245. .menuTitle {
  246. width: 140px;
  247. font-size: 26px;
  248. font-weight: bold;
  249. color: #fe8f00;
  250. margin-right: 80px;
  251. }
  252. .menulist {
  253. display: flex;
  254. justify-content: flex-start;
  255. align-items: center;
  256. font-size: 16px;
  257. font-weight: bold;
  258. color: #333;
  259. padding: 15px 0;
  260. a {
  261. display: flex;
  262. justify-content: flex-start;
  263. align-items: center;
  264. .title {
  265. width: 120px;
  266. height: 16px;
  267. text-align: center;
  268. &:hover {
  269. color: #fe8f00;
  270. }
  271. }
  272. .line {
  273. color: #fe8f00;
  274. padding-top: 5px;
  275. }
  276. }
  277. }
  278. }
  279. //样式5
  280. .menuListStyle5 {
  281. border-bottom: none;
  282. }
  283. //样式6
  284. .menuListStyle6 {
  285. border-bottom: none;
  286. position: relative;
  287. }
  288. .menuListStyle6::after {
  289. content: '';
  290. position: absolute;
  291. bottom: -2px;
  292. left: 0;
  293. width: 8%;
  294. height: 2px;
  295. background-color: #fe8f00;
  296. }
  297. //样式7
  298. .menuListStyle7 {
  299. margin-top: 30px;
  300. position: relative;
  301. padding-top: 25px;
  302. padding-bottom: 15px;
  303. border-bottom: 2px solid #E4E4E4;
  304. .channelMenuListTitle {
  305. background: url(https://img.bjzxtw.org.cn/pre/image/png/20251017/1760682499809925.png) no-repeat center center;
  306. width: 200px;
  307. height: 40px;
  308. line-height: 40px;
  309. color: #ffffff;
  310. font-size: 24px;
  311. padding-left: 30px;
  312. box-sizing: border-box;
  313. }
  314. .hannelMenuListFloatMenu {
  315. position: absolute;
  316. display: flex;
  317. flex-wrap: wrap;
  318. font-size: 12px;
  319. color: #333333;
  320. font-weight: bold;
  321. top: 33px;
  322. right: 0;
  323. div {
  324. width: 123px;
  325. font-size: 16px;
  326. text-align: center;
  327. font-weight: bold;
  328. &:last-child {
  329. background: none;
  330. }
  331. &.active {
  332. color: #fe8f00
  333. }
  334. a {
  335. color: #333333;
  336. }
  337. a:hover {
  338. color: #fe8f00;
  339. }
  340. }
  341. }
  342. }
  343. //样式8
  344. .menuListStyle8 {
  345. border-bottom: none;
  346. }
  347. //样式9
  348. .menuListStyle9 {
  349. .hannelMenuListFloatMenu {
  350. div {
  351. width: 123px;
  352. font-size: 16px;
  353. text-align: center;
  354. font-weight: bold;
  355. height: 43px;
  356. &:last-child {
  357. background: none;
  358. }
  359. &.active {
  360. color: #fe8f00;
  361. border-bottom: 2px solid #fe8f00;
  362. }
  363. &:hover {
  364. color: #fe8f00;
  365. border-bottom: 2px solid #fe8f00;
  366. }
  367. }
  368. }
  369. }
  370. //样式11
  371. .menuListStyle11 {
  372. padding-top: 1px;
  373. .style11 {
  374. width: 1200px;
  375. height: 61px;
  376. display: flex;
  377. background-color: #fe8f00;
  378. color: #fff;
  379. margin-top: 20px;
  380. .channelMenuListTitle {
  381. width: 144px;
  382. height: 51px;
  383. text-align: center;
  384. background-color: #fff;
  385. color: #fe8f00;
  386. margin-top: 10px;
  387. margin-left: 35px;
  388. border-top-left-radius: 4px;
  389. border-top-right-radius: 4px;
  390. span {
  391. display: inline-block;
  392. font-size: 16px;
  393. font-weight: bold;
  394. padding: 10px 0;
  395. box-sizing: border-box;
  396. border-bottom: 2px solid #fe8f00;
  397. }
  398. }
  399. .hannelMenuListFloatMenu {
  400. width: 925px;
  401. height: 21px;
  402. margin-top: 23px;
  403. padding: 0 50px 0 45px;
  404. display: flex;
  405. justify-content: space-between;
  406. font-size: 16px;
  407. font-weight: bold;
  408. div {
  409. width: 122px;
  410. height: 20px;
  411. line-height: 16px;
  412. text-align: center;
  413. background: url(https://img.bjzxtw.org.cn/pre/image/png/20251017/176068252136920.png) no-repeat right 2px;
  414. &:last-child {
  415. background: none;
  416. }
  417. &.active {
  418. color: #fe8f00
  419. }
  420. a {
  421. color: #fff;
  422. }
  423. }
  424. }
  425. }
  426. }
  427. //样式12
  428. .menuListStyle12 {
  429. margin-top: 12px;
  430. position: relative;
  431. padding-bottom: 20px;
  432. border-bottom: 1px solid #d9d9d9;
  433. display: flex;
  434. .channelMenuListTitle {
  435. width: 153px;
  436. height: 52px;
  437. line-height: 52px;
  438. text-align: center;
  439. font-size: 18px;
  440. font-weight: bold;
  441. color: #fff;
  442. background: url(https://img.bjzxtw.org.cn/pre/image/png/20251017/1760682509222738.png) no-repeat left -4px;
  443. }
  444. .hannelMenuListFloatMenu {
  445. margin-left: 15px;
  446. width: 1030px;
  447. display: flex;
  448. justify-content: space-between;
  449. flex-wrap: wrap;
  450. font-size: 16px;
  451. color: #333333;
  452. font-weight: bold;
  453. height: 52px;
  454. line-height: 60px;
  455. div {
  456. width: 96px;
  457. padding: 0 15px;
  458. padding-bottom: 9px;
  459. text-align: center;
  460. background: url(https://img.bjzxtw.org.cn/pre/image/png/20251017/176068362214862.png) no-repeat right 22px;
  461. &:last-child {
  462. background: none;
  463. }
  464. &.active {
  465. color: #fe8f00;
  466. border-bottom: 2px solid #fe8f00;
  467. }
  468. a {
  469. color: #333333;
  470. span {
  471. display: inline-block;
  472. height: 70px;
  473. &:hover {
  474. color: #fe8f00;
  475. border-bottom: 2px solid #fe8f00;
  476. }
  477. }
  478. }
  479. }
  480. }
  481. }
  482. </style>