4.vue 15 KB

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