indexcygyy.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title></title>
  7. <!-- 引入 Vue -->
  8. <script src="js/vue.min.js"></script>
  9. <!-- 引入样式 -->
  10. <link rel="stylesheet" href="css/index.css">
  11. <!-- 引入组件库 -->
  12. <script src="js/index.js"></script>
  13. <link rel="stylesheet" href="swiper/swiper-bundle.css">
  14. <!-- jquery-->
  15. <script src="js/jquery-3.5.1.min.js"></script>
  16. <script src="js/urljson.js"></script>
  17. <style>
  18. * {
  19. padding: 0;
  20. margin: 0;
  21. }
  22. ul {
  23. list-style-type: none;
  24. }
  25. li {
  26. list-style: none;
  27. }
  28. @font-face {
  29. font-family: 'DOUYU';
  30. src: url('fonts/DOUYUFONT-2.OTF');
  31. font-weight: normal;
  32. font-style: normal;
  33. }
  34. .backbutton {
  35. width: 7.3125rem;
  36. height: 2.625rem;
  37. background: rgb(0 0 0 / 30%);
  38. border-radius: 10px;
  39. display: flex;
  40. align-items: center;
  41. justify-content: center;
  42. position: absolute;
  43. top: 1.25rem;
  44. right: 1.5625rem;
  45. cursor: pointer;
  46. z-index: 99;
  47. }
  48. .backbutton img {
  49. margin-right: 0.625rem;
  50. }
  51. .topbg {
  52. position: absolute;
  53. top: 0;
  54. width: 100vw;
  55. height: 30vh;
  56. background-image: url(images/bg-indextop.png);
  57. background-size: 100% 100%;
  58. }
  59. #indexcygyy {
  60. height: 100vh;
  61. background-image: url(images/indexcygyy.png);
  62. background-size: 100% 100%;
  63. font-family: Microsoft YaHei;
  64. color: #FFFFFF;
  65. padding-top: 10px;
  66. box-sizing: border-box;
  67. position: relative;
  68. opacity: 0.8;
  69. }
  70. .bg-cygyy {
  71. background-image: url(images/indexcygyy.png);
  72. }
  73. .bg-dxkjy {
  74. background-image: url(images/bg-dxkjy.png) !important;
  75. }
  76. .bg-npxq {
  77. background-image: url(images/bg-npxq.png) !important;
  78. }
  79. .bg-ylcxg {
  80. background-image: url(images/bg-ylcxg.jpg) !important;
  81. }
  82. #indexcygyy .top {
  83. display: flex;
  84. margin: auto;
  85. justify-content: center;
  86. position: absolute;
  87. width: 100%;
  88. }
  89. #indexcygyy .logo {
  90. display: flex;
  91. align-items: center;
  92. font-size: 1.25rem;
  93. margin-right: 1.25rem;
  94. white-space: nowrap;
  95. cursor: pointer;
  96. }
  97. #indexcygyy .logo img {
  98. width: 3.5rem;
  99. height: 3.5rem;
  100. }
  101. #indexcygyy .menu {
  102. /* width: 60%; */
  103. max-width: 1065px;
  104. font-size: 1rem;
  105. display: flex;
  106. }
  107. #indexcygyy .menu li {
  108. width: 16%;
  109. cursor: pointer;
  110. white-space: nowrap;
  111. display: flex;
  112. align-items: center;
  113. justify-content: center;
  114. }
  115. #indexcygyy .menu .active span {
  116. font-size: 1.25rem;
  117. padding-bottom: 0.3125rem;
  118. box-sizing: border-box;
  119. border-bottom: 1px solid #fff;
  120. }
  121. .content {
  122. width: 53vw;
  123. min-width: 589px;
  124. height: 70vh;
  125. background: rgb(0 28 60 / 60%);
  126. border-radius: 10px;
  127. display: flex;
  128. flex-direction: column;
  129. align-items: center;
  130. margin-left: 8.3125rem;
  131. margin-top: 15vh;
  132. position: relative;
  133. }
  134. .content>div {
  135. margin-top: 2%;
  136. }
  137. .content>.title {
  138. /* margin-top: 1.875rem; */
  139. font-family: DOUYU;
  140. font-weight: normal;
  141. font-size: 1.625rem;
  142. color: #FFFFFF;
  143. /* line-height: 3rem; */
  144. /* text-shadow: 0px 2px 4px rgba(11, 96, 169, 0.25); */
  145. background: linear-gradient(0deg, rgba(184, 225, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  146. -webkit-background-clip: text;
  147. -webkit-text-fill-color: transparent;
  148. }
  149. .content>.line {
  150. width: 37.9375rem;
  151. height: 1.125rem;
  152. /* margin-bottom: 1.25rem; */
  153. }
  154. .content>.text {
  155. width: 95%;
  156. min-height: 120px;
  157. font-size: 1rem;
  158. color: #FFFFFF;
  159. line-height: 1.875rem;
  160. text-indent: 2.5rem;
  161. }
  162. .content .more {
  163. width: 95%;
  164. height: 3.75rem;
  165. background-image: url(images/more-cygyy.png);
  166. background-size: 100% 100%;
  167. font-size: 1.5rem;
  168. color: #E1F0FE;
  169. line-height: 2.75rem;
  170. text-align: center;
  171. cursor: pointer;
  172. }
  173. .swiper {
  174. width: 95%;
  175. height: 50%;
  176. /* margin: 2.5rem auto; */
  177. }
  178. .swiper .title {
  179. word-break: break-all;
  180. overflow: hidden;
  181. white-space: nowrap;
  182. text-overflow: ellipsis;
  183. }
  184. .swiper-slide.list {
  185. font-size: 1.125rem;
  186. display: flex;
  187. flex-direction: column;
  188. justify-content: space-evenly;
  189. cursor: pointer;
  190. }
  191. .swiper-slide img {
  192. display: block;
  193. width: 17.8125rem;
  194. height: 80%;
  195. object-fit: cover;
  196. }
  197. .swiper-slide .slidecontent {
  198. word-break: break-all;
  199. overflow: hidden;
  200. white-space: nowrap;
  201. text-overflow: ellipsis;
  202. display: block;
  203. font-size: 1rem;
  204. color: rgb(255 255 255 / 60%);
  205. }
  206. .swiper-button-next,
  207. .swiper-button-prev {
  208. position: absolute;
  209. top: 64%;
  210. transform: translateY(-50%);
  211. z-index: 20;
  212. color: #fff;
  213. margin-top: 0 !important;
  214. }
  215. .swiper-button-next {
  216. right: 0;
  217. }
  218. .swiper-button-prev {
  219. left: 0;
  220. }
  221. .swiper-button-prev:after,
  222. .swiper-button-next:after {
  223. font-size: 33px;
  224. }
  225. /* 淡出动画 */
  226. .fade-out {
  227. animation: fadeOut 1s forwards;
  228. }
  229. /* 淡入动画 */
  230. .fade-in {
  231. animation: fadeIn 1s forwards;
  232. }
  233. @keyframes fadeOut {
  234. from {
  235. opacity: 0.8;
  236. }
  237. to {
  238. opacity: 0.6;
  239. }
  240. }
  241. @keyframes fadeIn {
  242. from {
  243. opacity: 0.6;
  244. }
  245. to {
  246. opacity: 0.8;
  247. }
  248. }
  249. @media screen and (max-width:1600px) {
  250. html,
  251. body {
  252. font-size: 14px;
  253. }
  254. .content {
  255. width: 58vw;
  256. height: 68vh;
  257. }
  258. .swiper-button-next,
  259. .swiper-button-prev {
  260. top: 68%;
  261. }
  262. }
  263. @media screen and (max-width:1400px) {
  264. html,
  265. body {
  266. font-size: 14px;
  267. }
  268. .content {
  269. width: 56vw;
  270. height: 68vh;
  271. }
  272. }
  273. @media screen and (max-width:1300px) {
  274. html,
  275. body {
  276. font-size: 10px;
  277. }
  278. .content {
  279. width: 54vw;
  280. height: 50vh;
  281. }
  282. }
  283. </style>
  284. </head>
  285. <body>
  286. <div class="" id="indexcygyy" :class="{ 'fade-out': fadeOut, 'fade-in': fadeIn }"
  287. :style="{ backgroundImage: 'url(' + backgroundImage + ')' }">
  288. <div class="backbutton" @click="back">
  289. <img src="images/backlogo.png" alt="">
  290. <span>返回</span>
  291. </div>
  292. <div class="topbg"></div>
  293. <div class="top">
  294. <div class="logo" @click="goIndex">
  295. <img src="images/nalogo.png" alt="">
  296. <span>重庆市南岸区人民政府</span>
  297. </div>
  298. <ul class="menu">
  299. <li :class="{ active: currentTab == tab.id }" v-for="(tab, index) in this.titleList" :key="index"
  300. @click="menuChange(tab.id)" :style="{width:tab.textwidth+'px'}">
  301. <span>{{tab.title}}</span>
  302. </li>
  303. </ul>
  304. </div>
  305. <div class="content">
  306. <div class="title">{{currentTitle}}</div>
  307. <img src="images/cygyyline.png" alt="" class="line">
  308. <div class="text">{{parkDesc?parkDesc.slice(0,200):''}}<span
  309. v-if="parkDesc && parkDesc.length > 180">...</span>
  310. <span v-if="parkDesc && parkDesc.length > 180" style="color: #E5C999;cursor: pointer;"
  311. @click="cheakmore">详情>></span>
  312. </div>
  313. <div class="swiper mySwiper">
  314. <div class="swiper-wrapper">
  315. <div class="swiper-slide list" v-for="(item,index) in swiperList"
  316. @click="goToLink('ztcrdetail.html?ztid=' + item.id)">
  317. <div class="title" :title="item.carrierName">{{item.application}}</div>
  318. <div class="slidecontent">{{item.carrierName}}</div>
  319. <img :src="item.logo" alt="" v-if="item.logo">
  320. <img src="images/indexztcrno.png" alt="" v-else>
  321. </div>
  322. </div>
  323. </div>
  324. <div class="swiper-button-prev"></div>
  325. <div class="swiper-button-next"></div>
  326. <div class="more" @click="cheakmore">查看更多>></div>
  327. </div>
  328. </div>
  329. </body>
  330. <script src="swiper/swiper-bundle.js"></script>
  331. <script>
  332. // 初始化Vue实例
  333. new Vue({
  334. el: '#indexcygyy',
  335. data: function () {
  336. return {
  337. reqPtah: '',
  338. currentTab: -1,
  339. titleList: [],
  340. currentTitle: '',
  341. parkDesc: '',
  342. swiperList: [
  343. ],
  344. backgroundImage: 'images/indexcygyy.png',
  345. fadeOut: false,
  346. fadeIn: false
  347. };
  348. },
  349. created() {
  350. },
  351. mounted() {
  352. },
  353. methods: {
  354. goIndex() {
  355. window.location.href = "indexsyyg.html"
  356. },
  357. menuChange(id) {
  358. this.getDetailData(id);
  359. this.currentTab = id;
  360. this.getSellBuild(id);
  361. // if (id == 4) {
  362. // var bgClass = `bg-npxq`;
  363. // } else if (id == 6) {
  364. // var bgClass = `bg-dxkjy`;
  365. // } else if (id == 5) {
  366. // var bgClass = `bg-ylcxg`;
  367. // } else {
  368. // var bgClass = `bg-cygyy`;
  369. // }
  370. // $('#indexcygyy').removeClass();
  371. // $('#indexcygyy').addClass(bgClass);
  372. // .bg-dxkjy {
  373. // background-image: url() !important;
  374. // }
  375. // .bg-npxq {
  376. // background-image: url() !important;
  377. // }
  378. // .bg-ylcxg {
  379. // background-image: url(images/bg-ylcxg.jpg) !important;
  380. // }
  381. this.fadeOut = true;
  382. setTimeout(() => {
  383. if (id == 4) {
  384. this.backgroundImage = 'images/bg-npxq.png';
  385. } else if (id == 6) {
  386. this.backgroundImage = 'images/bg-dxkjy.png';
  387. } else if (id == 5) {
  388. this.backgroundImage = 'images/bg-ylcxg.jpg';
  389. } else {
  390. this.backgroundImage = 'images/indexcygyy.png';
  391. }
  392. this.fadeOut = false;
  393. this.fadeIn = true;
  394. setTimeout(() => {
  395. this.fadeIn = false;
  396. }, 1000);
  397. }, 1000);
  398. },
  399. back() {
  400. window.location.href = "indexsyyg.html"
  401. },
  402. cheakmore() {
  403. window.location.href = "syyggyy.html?id=" + this.currentTab;
  404. },
  405. goToLink(url) {
  406. if (url) {
  407. window.location.href = url;
  408. }
  409. },
  410. getSellBuild(id) {
  411. let that = this;
  412. $.ajax({
  413. url: conpath + "/sellBuild",
  414. type: "post",
  415. contentType: 'application/json',
  416. data: JSON.stringify({
  417. "currentPage": 1,
  418. "pageSize": 1000,
  419. "parkId": id
  420. }),
  421. async: false,
  422. dataType: "json",
  423. success: function (data) {
  424. let dataList = data.list;
  425. dataList.forEach(function (d) {
  426. d.logo = d.imgUrl ? d.imgUrl.split(",")[0] : '';
  427. });
  428. that.swiperList = dataList;
  429. }
  430. });
  431. },
  432. getParkData() {
  433. let that = this;
  434. $.ajax({
  435. url: conpath + "/parkData/",
  436. type: "get",
  437. dataType: "json",
  438. success: function (data) {
  439. data.forEach(function (item) {
  440. item.subtitleList = item.subtitle ? item.subtitle.split(",") : [];
  441. item.textwidth = item.title.length * 20;
  442. })
  443. that.titleList = data;
  444. console.log(that.titleList)
  445. }
  446. })
  447. },
  448. getDetailData(id) {
  449. let that = this;
  450. $.ajax({
  451. url: conpath + "/parkData/" + id,
  452. type: "get",
  453. dataType: "json",
  454. success: function (data) {
  455. that.currentTitle = data.title;
  456. document.title = that.currentTitle;
  457. that.parkDesc = data.desc ? data.desc : '';
  458. }
  459. })
  460. }
  461. },
  462. mounted() {
  463. const url = new URL(window.location.href);
  464. const id = url.searchParams.get('id');
  465. this.currentTab = id;
  466. this.getSellBuild(id);
  467. this.getDetailData(id);
  468. this.getParkData();
  469. if (id == 4) {
  470. var bgClass = `bg-npxq`;
  471. } else if (id == 6) {
  472. var bgClass = `bg-dxkjy`;
  473. } else if (id == 5) {
  474. var bgClass = `bg-ylcxg`;
  475. } else {
  476. var bgClass = `bg-cygyy`;
  477. }
  478. $('#indexcygyy').removeClass();
  479. $('#indexcygyy').addClass(bgClass);
  480. this.$nextTick(() => {
  481. var swiper = new Swiper(".mySwiper", {
  482. slidesPerView: 3,
  483. spaceBetween: 30,
  484. pagination: {
  485. el: ".swiper-pagination",
  486. clickable: true,
  487. },
  488. navigation: {
  489. nextEl: '.swiper-button-next',
  490. prevEl: '.swiper-button-prev',
  491. },
  492. });
  493. })
  494. }
  495. });
  496. </script>
  497. </html>