3.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. <template>
  2. <div>
  3. <div class="channelMenuTitle_skin3" 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. </div>
  114. </template>
  115. <script setup>
  116. //引入vue
  117. import {ref} from 'vue';
  118. //获得新闻数据
  119. const props = defineProps({
  120. componentStyle:Number,//样式编号
  121. navigateData:Array,//子导航数据
  122. routeId:Number//导航对应的cid
  123. });
  124. //获得导航名称
  125. const title = ref("")
  126. const mkdata = await requestDataPromise('/web/getOneWebsiteCategory', {
  127. method: 'GET',
  128. query: {
  129. 'catid': props.routeId,
  130. },
  131. });
  132. if (mkdata.code == 200) {
  133. title.value = mkdata.data.parent_name;
  134. }
  135. //获取当前url路径
  136. const route = useRoute();
  137. //获得当前的完整路径
  138. const fullPath = route.path;
  139. const segments = fullPath.split('/');
  140. const targetSegment = segments[1];
  141. const targetSegment2 = segments[2];
  142. //判断当前为第几层的列表页
  143. // const routeLevel = ref(0);
  144. // if(route.name == "dir-list-id"){
  145. // routeLevel.value = 1;
  146. // console.log("当前的路由层级为:" + routeLevel.value);
  147. // }
  148. // if(route.name == "dir-dir-list-id"){
  149. // routeLevel.value = 2;
  150. // console.log("当前的路由层级为:" + routeLevel.value);
  151. // }
  152. </script>
  153. <style lang="less" scoped>
  154. //基本样式 start ---------------------------------------->
  155. .channelMenuTitle_skin3 {
  156. width: 1200px;
  157. height: 32px;
  158. line-height: 32px;
  159. font-size: 24px;
  160. color:#c82200;
  161. font-weight: bold;
  162. text-align: center;
  163. background: url('https://img.bjzxtw.org.cn/pre/image/png/20251010/176008410726316.png') no-repeat center center;
  164. margin-bottom: 25px;
  165. }
  166. .channelMenuList {
  167. display: flex;
  168. justify-content: flex-start;
  169. align-items: center;
  170. color: #333;
  171. border-bottom: 2px solid #c82200;
  172. padding-bottom: 15px;
  173. div {
  174. font-size: 16px;
  175. font-weight: bold;
  176. width: 150px;
  177. height: 22px;
  178. line-height: 22px;
  179. a {
  180. color: #333;
  181. display: block;
  182. text-align: center;
  183. &:hover {
  184. color: #c82200;
  185. }
  186. }
  187. a.active {
  188. color: #c82200;
  189. }
  190. &:first-child {
  191. color: #c82200;
  192. }
  193. }
  194. }
  195. //基本样式 end ---------------------------------------->
  196. //样式2 start ---------------------------------------->
  197. .menuListStyle2 {
  198. border-bottom: 0;
  199. }
  200. //样式2 end ---------------------------------------->
  201. //样式3
  202. .menuListStyle3 {
  203. border-bottom: 0;
  204. div{
  205. text-align: center;
  206. height: 36px;
  207. &:hover {
  208. color: #c82200;
  209. padding-bottom: 15px;
  210. border-bottom: 2px solid #c82200;
  211. box-sizing: border-box;
  212. }
  213. }
  214. }
  215. //样式4
  216. .menuListStyle4 {
  217. height: 54px;
  218. padding-top: 23px;
  219. padding-bottom: 0px;
  220. .menuTitle {
  221. width: 140px;
  222. font-size: 26px;
  223. font-weight: bold;
  224. color: #c82200;
  225. margin-right: 80px;
  226. }
  227. .menulist {
  228. display: flex;
  229. justify-content: flex-start;
  230. align-items: center;
  231. font-size: 16px;
  232. font-weight: bold;
  233. color: #333;
  234. padding: 15px 0;
  235. a{
  236. display: flex;
  237. justify-content: flex-start;
  238. align-items: center;
  239. .title{
  240. width: 120px;
  241. height: 16px;
  242. text-align: center;
  243. &:hover{
  244. color: #c82200;
  245. }
  246. }
  247. .line{
  248. color: #c82200;
  249. padding-top: 5px;
  250. }
  251. }
  252. }
  253. }
  254. //样式5
  255. .menuListStyle5 {
  256. border-bottom: none;
  257. }
  258. //样式6
  259. .menuListStyle6 {
  260. border-bottom: none;
  261. position: relative;
  262. }
  263. .menuListStyle6::after {
  264. content: '';
  265. position: absolute;
  266. bottom: -2px;
  267. left: 0;
  268. width: 8%;
  269. height: 2px;
  270. background-color: #c82200;
  271. }
  272. //样式7
  273. .menuListStyle7 {
  274. margin-top: 30px;
  275. position: relative;
  276. padding-top: 25px;
  277. padding-bottom: 15px;
  278. border-bottom: 2px solid #E4E4E4;
  279. .channelMenuListTitle {
  280. background: url(https://img.bjzxtw.org.cn/pre/image/png/20251013/176033405969221.png) no-repeat center center;
  281. width: 200px;
  282. height: 40px;
  283. line-height: 40px;
  284. color: #ffffff;
  285. font-size: 24px;
  286. padding-left: 30px;
  287. box-sizing: border-box;
  288. }
  289. .hannelMenuListFloatMenu {
  290. position: absolute;
  291. display: flex;
  292. flex-wrap: wrap;
  293. font-size: 12px;
  294. color: #333333;
  295. font-weight: bold;
  296. top:33px;
  297. right: 0;
  298. div {
  299. width: 123px;
  300. font-size: 16px;
  301. text-align: center;
  302. font-weight: bold;
  303. &:last-child{
  304. background: none;
  305. }
  306. &.active {
  307. color:#c82200
  308. }
  309. a{
  310. color: #333333;
  311. }
  312. a:hover{
  313. color: #c82200;
  314. }
  315. }
  316. }
  317. }
  318. //样式8
  319. .menuListStyle8 {
  320. border-bottom: none;
  321. }
  322. //样式9
  323. .menuListStyle9 {
  324. .hannelMenuListFloatMenu {
  325. div {
  326. width: 123px;
  327. font-size: 16px;
  328. text-align: center;
  329. font-weight: bold;
  330. height: 43px;
  331. &:last-child{
  332. background: none;
  333. }
  334. &.active {
  335. color:#c82200;
  336. border-bottom: 2px solid #c82200;
  337. }
  338. &:hover{
  339. color: #c82200;
  340. border-bottom: 2px solid #c82200;
  341. }
  342. }
  343. }
  344. }
  345. //样式11
  346. .menuListStyle11{
  347. padding-top: 1px;
  348. .style11{
  349. width: 1200px;
  350. height: 61px;
  351. display: flex;
  352. background-color: #c82200;
  353. color: #fff;
  354. margin-top: 20px;
  355. .channelMenuListTitle{
  356. width: 144px;
  357. height: 51px;
  358. text-align: center;
  359. background-color: #fff;
  360. color: #c82200;
  361. margin-top: 10px;
  362. margin-left: 35px;
  363. border-top-left-radius: 4px;
  364. border-top-right-radius: 4px;
  365. span{
  366. display: inline-block;
  367. font-size: 16px;
  368. font-weight: bold;
  369. padding: 10px 0;
  370. box-sizing: border-box;
  371. border-bottom: 2px solid #c82200;
  372. }
  373. }
  374. .hannelMenuListFloatMenu{
  375. width: 925px;
  376. height: 21px;
  377. margin-top: 23px;
  378. padding: 0 50px 0 45px;
  379. display: flex;
  380. justify-content: space-between;
  381. font-size: 16px;
  382. font-weight: bold;
  383. div {
  384. width: 122px;
  385. height: 20px;
  386. line-height: 16px;
  387. text-align: center;
  388. background: url(https://img.bjzxtw.org.cn/pre/image/png/20251010/1760086774438601.png) no-repeat right 2px;
  389. &:last-child{
  390. background: none;
  391. }
  392. &.active {
  393. color:#c82200
  394. }
  395. a{
  396. color: #fff;
  397. }
  398. }
  399. }
  400. }
  401. }
  402. </style>