index - 新页面数据对接完成.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  1. <template>
  2. <view>
  3. <view class="status_bar"></view>
  4. <view class="container">
  5. <view class="top"></view>
  6. <view class="content">
  7. <!-- 查询 -->
  8. <view class="search" @click="go_search()">
  9. <view class="icon">
  10. <image src="./icon/search.png" mode=""></image>
  11. </view>
  12. <view class="text">查询</view>
  13. </view>
  14. <!-- 日期天气 -->
  15. <view class="date">
  16. <view class="text">{{date}}</view>
  17. <view class="icon">
  18. <image src="./icon/weather.png" mode=""></image>
  19. </view>
  20. </view>
  21. <!-- 值班 -->
  22. <view class="notice">
  23. <view class="left">
  24. <uni-notice-bar scrollable="true" :speed="20" background-color="#ffffff00" color="#fff"
  25. single="true" :text="notice"></uni-notice-bar>
  26. </view>
  27. <view class="right">
  28. <view class="icon">
  29. <uni-icons type="more-filled" size="20" color="#fff"></uni-icons>
  30. </view>
  31. </view>
  32. </view>
  33. <!-- 轮播 -->
  34. <view class="banner">
  35. <swiper class="box" autoplay circular>
  36. <swiper-item v-for="(item_2,index_2) in banner" :key="index_2" @click="go_link(item_2.jumpURL)">
  37. <view class="item">
  38. <view class="img">
  39. <image :src="item_2.imgURL"></image>
  40. </view>
  41. <view class="title">
  42. <view class="text">{{item_2.title}}</view>
  43. <view class="num">
  44. <text>{{index_2+1}} / {{banner.length}}</text>
  45. </view>
  46. </view>
  47. </view>
  48. </swiper-item>
  49. </swiper>
  50. </view>
  51. <view v-for="(item,index) in common">
  52. <view class="banner" v-if="item.type_name == '轮播图' && item.index == index">
  53. <swiper class="box" autoplay circular>
  54. <swiper-item v-for="(item_2,index_2) in banner" :key="index_2" @click="go_link(item_2.jumpURL)">
  55. <view class="item">
  56. <view class="img">
  57. <image :src="item_2.imgURL"></image>
  58. </view>
  59. <view class="title">
  60. <view class="text">{{item_2.title}}</view>
  61. <view class="num">
  62. <text>{{index_2+1}} / {{banner.length}}</text>
  63. </view>
  64. </view>
  65. </view>
  66. </swiper-item>
  67. </swiper>
  68. </view>
  69. <view class="fixed_system" v-if="item.type_name == '七个建设' && item.index == index">
  70. <view class="line">
  71. <view class="item" v-for="(item_2,index_2) in item.data" :key="index_2" v-if="index_2 < 3">
  72. <view class="icon">
  73. <image src="./icon/icon.png" mode=""></image>
  74. </view>
  75. <view class="text">{{item_2.title}}</view>
  76. </view>
  77. </view>
  78. <view class="line">
  79. <view class="item" v-for="(item_2,index_2) in item.data" :key="index_2" v-if="index_2 > 2">
  80. <view class="icon">
  81. <image src="./icon/icon.png" mode=""></image>
  82. </view>
  83. <view class="text">{{item_2.title}}</view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="nav" v-if="item.type_name == '实操应用' && item.index == index">
  88. <view class="section" v-for="(item_2,index_2) in item.data" :key="index_2">
  89. <view class="title">
  90. <view class="icon"></view>
  91. <view class="text">{{item_2.title}}</view>
  92. </view>
  93. <view class="list">
  94. <view class="item" v-for="(item_3,index_3) in item_2.children" :key="index_3">
  95. <view class="icon">
  96. <image src="./icon/icon_1.png" mode=""></image>
  97. </view>
  98. <view class="text">{{item_3.title}}</view>
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. <view class="nav" v-if="item.type_name == '数据平台' && item.index == index">
  104. <view class="section" v-for="(item_2,index_2) in item.data" :key="index_2">
  105. <view class="title">
  106. <view class="icon"></view>
  107. <view class="text">{{item_2.title}}</view>
  108. </view>
  109. <view class="list">
  110. <view class="item" v-for="(item_3,index_3) in item_2.children" :key="index_3">
  111. <view class="icon">
  112. <image src="./icon/icon_1.png" mode=""></image>
  113. </view>
  114. <view class="text">{{item_3.title}}</view>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. <view class="nav" v-if="item.type_name == '学习资料' && item.index == index">
  120. <view class="section" v-for="(item_2,index_2) in item.data" :key="index_2">
  121. <view class="title">
  122. <view class="icon"></view>
  123. <view class="text">{{item_2.title}}</view>
  124. </view>
  125. <view class="list">
  126. <view class="item" v-for="(item_3,index_3) in item_2.children" :key="index_3">
  127. <view class="icon">
  128. <image src="./icon/icon_1.png" mode=""></image>
  129. </view>
  130. <view class="text">{{item_3.title}}</view>
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. </view>
  136. <!-- 七块体系建设 -->
  137. <!-- <view class="fixed_system">
  138. <view class="line">
  139. <view class="item" v-for="(item,index) in data.build" :key="index" v-if="index < 3">
  140. <view class="icon">
  141. <image src="./icon/icon.png" mode=""></image>
  142. </view>
  143. <view class="text">{{item.name}}</view>
  144. </view>
  145. </view>
  146. <view class="line">
  147. <view class="item" v-for="(item,index) in data.build" :key="index" v-if="index > 2">
  148. <view class="icon">
  149. <image src="./icon/icon.png" mode=""></image>
  150. </view>
  151. <view class="text">{{item.name}}</view>
  152. </view>
  153. </view>
  154. </view> -->
  155. <!-- 待办事项 -->
  156. <view class="todo">
  157. <view class="left">
  158. <view class="title">
  159. <view class="icon"></view>
  160. <view class="text">待办事项</view>
  161. </view>
  162. </view>
  163. <view class="right">
  164. <view class="tip">您有 <text style="color: #FF0000;">5</text> 项待办</view>
  165. <view class="detail">
  166. 详情 <uni-icons type="right" size="12" color="#B5B5B5"></uni-icons>
  167. </view>
  168. </view>
  169. </view>
  170. <!-- 实操应用 -->
  171. <!-- 数据平台 -->
  172. <!-- 学习资料 -->
  173. <!-- <view class="nav">
  174. <view class="section" v-for="(item,index) in data.common" :key="index">
  175. <view class="title">
  176. <view class="icon"></view>
  177. <view class="text">{{item.title}}</view>
  178. </view>
  179. <view class="list">
  180. <view class="item" v-for="(item_2,index_2) in item.list" :key="index_2">
  181. <view class="icon">
  182. <image src="./icon/icon_1.png" mode=""></image>
  183. </view>
  184. <view class="text">{{item_2.name}}</view>
  185. </view>
  186. </view>
  187. </view>
  188. </view> -->
  189. <!-- 动态信息 -->
  190. <view class="news">
  191. <view class="title_box">
  192. <view class="left">
  193. <view class="title">
  194. <view class="icon"></view>
  195. <view class="text">动态信息</view>
  196. </view>
  197. </view>
  198. <view class="right" @click="go_more()">
  199. <view class="detail">
  200. 查看全部 <uni-icons type="right" size="12" color="#B5B5B5"></uni-icons>
  201. </view>
  202. </view>
  203. </view>
  204. <view class="list">
  205. <view class="item" v-for="(item,index) in news" :key="index">
  206. <view class="icon"></view>
  207. <view class="inner">
  208. <view class="new_title">{{item.title}}</view>
  209. <view class="tip">
  210. <view class="time">{{item.created_at}}</view>
  211. <view class="detail" @click="go_detail(item.id)">
  212. 详情<image src="./icon/new_detail.png" mode=""></image>
  213. </view>
  214. </view>
  215. </view>
  216. </view>
  217. </view>
  218. </view>
  219. </view>
  220. </view>
  221. </view>
  222. </template>
  223. <script>
  224. import {
  225. getCurrentDate
  226. } from "@/common/time.js"
  227. import {
  228. goToLink
  229. } from "@/common/common.js"
  230. import data from "./data.json"
  231. export default {
  232. data() {
  233. return {
  234. data: {},
  235. date: "",
  236. notice: "",
  237. banner: [],
  238. news: [],
  239. common: []
  240. }
  241. },
  242. onPullDownRefresh() {
  243. uni.reLaunch({
  244. url: "./index"
  245. })
  246. setTimeout(function() {
  247. uni.stopPullDownRefresh();
  248. }, 1000);
  249. },
  250. onLoad() {
  251. this.data = data
  252. this.date = getCurrentDate()
  253. this.get_notice()
  254. this.get_scrollImg_list()
  255. this.get_article_list()
  256. this.get_home_aqyk_newLinks()
  257. },
  258. methods: {
  259. get_notice() {
  260. this.$api.notice_list({
  261. }).then((res) => {
  262. if (res.data.data.content) {
  263. this.notice = res.data.data.content.replace(/<br /g, " ").replace(/>/g, " ").replace(/\//g,
  264. " ")
  265. } else {
  266. this.notice = "暂无公告"
  267. }
  268. })
  269. },
  270. get_scrollImg_list() {
  271. this.$api.scrollImg_list({
  272. }).then((res) => {
  273. this.banner = res.data.data.data
  274. })
  275. },
  276. get_article_list() {
  277. this.$api.article_list({
  278. }).then((res) => {
  279. this.news = res.data.data.data
  280. })
  281. },
  282. get_home_aqyk_newLinks() {
  283. this.$api.home_aqyk_newLinks({
  284. }).then((res) => {
  285. // console.log(res.data)
  286. let data = res.data
  287. data.forEach((item,index)=>{
  288. item['index'] = index
  289. })
  290. console.log(data)
  291. this.common = res.data
  292. })
  293. },
  294. go_search() {
  295. uni.navigateTo({
  296. url: "../../index/search/search?mine_code=ningmeijituan"
  297. })
  298. },
  299. go_link(link) {
  300. let item = {
  301. link: link
  302. }
  303. goToLink(item, this.mine_code)
  304. },
  305. // 打开详情页
  306. go_detail(id) {
  307. uni.navigateTo({
  308. url: "../../index/news/news?id=" + id + "&mine_code=ningmeijituan"
  309. })
  310. },
  311. // 打开列表
  312. go_more() {
  313. uni.navigateTo({
  314. url: "../../index/news/news_list/news_list?mine_code=ningmeijituan"
  315. })
  316. }
  317. }
  318. }
  319. </script>
  320. <style lang="scss">
  321. .status_bar {
  322. background-color: #00A0E8;
  323. }
  324. .container {
  325. position: relative;
  326. }
  327. .top {
  328. position: fixed;
  329. top: 0;
  330. left: 0;
  331. width: 750rpx;
  332. height: 665rpx;
  333. background-image: linear-gradient(to top, #FFFFFF 0%, #00A0E8 100%);
  334. }
  335. .content {
  336. position: absolute;
  337. top: 0rpx;
  338. box-sizing: border-box;
  339. padding: 25rpx;
  340. .search {
  341. width: 700rpx;
  342. height: 64rpx;
  343. box-sizing: border-box;
  344. border: 2rpx solid #FFFFFF;
  345. border-radius: 30rpx;
  346. opacity: 0.5;
  347. display: flex;
  348. align-items: center;
  349. padding: 0 30rpx;
  350. .icon {
  351. margin-right: 10rpx;
  352. image {
  353. width: 35rpx;
  354. height: 27rpx;
  355. }
  356. }
  357. .text {
  358. color: #DDF4FF;
  359. font-size: 27rpx;
  360. }
  361. }
  362. .date {
  363. height: 98rpx;
  364. display: flex;
  365. align-items: center;
  366. justify-content: space-between;
  367. .text {
  368. font-size: 34rpx;
  369. font-weight: 400;
  370. color: #FFFFFF;
  371. font-weight: 700;
  372. }
  373. .icon {
  374. image {
  375. width: 38rpx;
  376. height: 29rpx;
  377. }
  378. }
  379. }
  380. .notice {
  381. background: #FFFFFF40;
  382. border-radius: 21rpx;
  383. box-sizing: border-box;
  384. padding: 25rpx;
  385. height: 124rpx;
  386. display: flex;
  387. justify-content: space-between;
  388. align-items: center;
  389. .left {
  390. width: 580rpx;
  391. /deep/.uni-noticebar {
  392. margin-bottom: 0;
  393. }
  394. }
  395. .right {
  396. width: 50rpx;
  397. height: 72rpx;
  398. display: flex;
  399. align-items: center;
  400. .icon {
  401. transform: rotate(90deg);
  402. }
  403. }
  404. }
  405. .banner {
  406. margin-top: 30rpx;
  407. .box {
  408. width: 700rpx;
  409. height: 430rpx;
  410. .item {
  411. width: 700rpx;
  412. position: relative;
  413. .img {
  414. text-align: center;
  415. image {
  416. width: 700rpx;
  417. height: 400rpx;
  418. border-radius: 20rpx;
  419. }
  420. }
  421. .title {
  422. position: absolute;
  423. left: 0;
  424. bottom: 10rpx;
  425. box-sizing: border-box;
  426. padding: 15rpx 20rpx;
  427. width: 700rpx;
  428. font-size: 30rpx;
  429. display: flex;
  430. justify-content: space-between;
  431. .text {
  432. width: 520rpx;
  433. color: #FFFFFF;
  434. overflow: hidden;
  435. text-overflow: ellipsis;
  436. white-space: nowrap;
  437. }
  438. .num {
  439. color: #FFFFFF;
  440. text {
  441. color: #FFFFFF;
  442. }
  443. }
  444. }
  445. }
  446. }
  447. }
  448. .fixed_system {
  449. margin: -10rpx -25rpx 0;
  450. box-sizing: border-box;
  451. padding: 25rpx 0;
  452. width: 750rpx;
  453. height: 436rpx;
  454. background-image: url(./icon/section.png);
  455. background-size: 100% 100%;
  456. background-repeat: no-repeat;
  457. .line {
  458. box-sizing: border-box;
  459. padding: 25rpx;
  460. display: flex;
  461. justify-content: center;
  462. .item {
  463. margin-right: 54rpx;
  464. .icon {
  465. image {
  466. width: 109rpx;
  467. height: 109rpx;
  468. display: block;
  469. }
  470. }
  471. .text {
  472. font-size: 25rpx;
  473. color: #171717;
  474. }
  475. }
  476. }
  477. .line:first-child {
  478. .item:nth-child(3) {
  479. margin-right: 0;
  480. }
  481. }
  482. .line:last-child {
  483. .item:nth-child(4) {
  484. margin-right: 0;
  485. }
  486. }
  487. }
  488. .todo {
  489. padding: 20rpx 0;
  490. display: flex;
  491. justify-content: space-between;
  492. align-items: center;
  493. .left {
  494. .title {
  495. display: flex;
  496. align-items: center;
  497. .icon {
  498. width: 9rpx;
  499. height: 34rpx;
  500. background-color: #04A0E8;
  501. border-radius: 5rpx;
  502. }
  503. .text {
  504. margin-left: 10rpx;
  505. color: #6A6A6A;
  506. font-size: 33rpx;
  507. font-weight: 700;
  508. }
  509. }
  510. }
  511. .right {
  512. display: flex;
  513. align-items: baseline;
  514. .tip {
  515. font-size: 25rpx;
  516. color: #6A6A6A;
  517. }
  518. .detail {
  519. margin-left: 24rpx;
  520. font-size: 25rpx;
  521. color: #B5B5B5;
  522. }
  523. }
  524. }
  525. .nav {
  526. background-color: #F7F9F7;
  527. margin: 0 -25rpx;
  528. width: 750rpx;
  529. padding-top: 20rpx;
  530. .section {
  531. margin-bottom: 20rpx;
  532. background-color: #FFFFFF;
  533. box-sizing: border-box;
  534. padding: 25rpx;
  535. .title {
  536. padding: 20rpx 0;
  537. display: flex;
  538. align-items: center;
  539. .icon {
  540. width: 9rpx;
  541. height: 34rpx;
  542. background-color: #04A0E8;
  543. border-radius: 5rpx;
  544. }
  545. .text {
  546. margin-left: 10rpx;
  547. color: #6A6A6A;
  548. font-size: 33rpx;
  549. font-weight: 700;
  550. }
  551. }
  552. .list {
  553. width: 700rpx;
  554. overflow: hidden;
  555. .item {
  556. margin-top: 20rpx;
  557. float: left;
  558. margin-right: 20rpx;
  559. width: 120rpx;
  560. text-align: center;
  561. .icon {
  562. image {
  563. width: 73rpx;
  564. height: 73rpx;
  565. }
  566. }
  567. .text {
  568. color: #171717;
  569. font-size: 24rpx;
  570. white-space: nowrap;
  571. overflow: hidden;
  572. text-overflow: ellipsis;
  573. }
  574. }
  575. .item:nth-child(5n) {
  576. margin-right: 0;
  577. }
  578. }
  579. }
  580. }
  581. .news {
  582. background-color: #F7F9F7;
  583. margin: 0 -25rpx;
  584. margin-bottom: 40rpx;
  585. padding-top: 20rpx;
  586. .title_box {
  587. background-color: #FFFFFF;
  588. box-sizing: border-box;
  589. padding: 25rpx;
  590. display: flex;
  591. justify-content: space-between;
  592. align-items: center;
  593. .left {
  594. .title {
  595. display: flex;
  596. align-items: center;
  597. .icon {
  598. width: 9rpx;
  599. height: 34rpx;
  600. background-color: #04A0E8;
  601. border-radius: 5rpx;
  602. }
  603. .text {
  604. margin-left: 10rpx;
  605. color: #6A6A6A;
  606. font-size: 33rpx;
  607. font-weight: 700;
  608. }
  609. }
  610. }
  611. .right {
  612. display: flex;
  613. align-items: baseline;
  614. .tip {
  615. font-size: 25rpx;
  616. color: #6A6A6A;
  617. }
  618. .detail {
  619. margin-left: 24rpx;
  620. font-size: 25rpx;
  621. color: #B5B5B5;
  622. }
  623. }
  624. }
  625. .list {
  626. box-sizing: border-box;
  627. padding: 25rpx;
  628. background-color: #FFFFFF;
  629. .item {
  630. margin-bottom: 20rpx;
  631. display: flex;
  632. justify-content: space-between;
  633. border-bottom: 1rpx solid #F5F6F7;
  634. .icon {
  635. position: relative;
  636. top: 16rpx;
  637. width: 8rpx;
  638. height: 8rpx;
  639. background: #999999;
  640. border-radius: 50%;
  641. }
  642. .inner {
  643. width: 680rpx;
  644. .new_title {
  645. color: #171717;
  646. font-size: 29rpx;
  647. line-height: 44rpx;
  648. }
  649. .tip {
  650. margin: 20rpx 0;
  651. display: flex;
  652. justify-content: space-between;
  653. .time {
  654. font-size: 23rpx;
  655. color: #999999;
  656. }
  657. .detail {
  658. color: #FD6B5C;
  659. font-size: 23rpx;
  660. image {
  661. margin-left: 8rpx;
  662. width: 19rpx;
  663. height: 16rpx;
  664. }
  665. }
  666. }
  667. }
  668. }
  669. .item:last-child {
  670. border: none;
  671. }
  672. }
  673. }
  674. }
  675. </style>