index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <template>
  2. <view class="gg-container">
  3. <view class="gg-tit">
  4. <view class="gg-title">
  5. <image :src="loadImgSrc('logo-gg.png')" style="width: 100rpx; height: 71rpx;"></image>
  6. 长春市贞达市政施工管理平台
  7. </view>
  8. <image :src="loadImgSrc('gg-bg.png')" style="width: 100%; position:absolute;height: 40vh;" />
  9. <view class="gg-body">
  10. <view class="gg-body-tt">
  11. <image :src="loadImgSrc('gg-lb.png')" style="width: 60rpx; height: 60rpx;margin-right: 10rpx;">
  12. </image>
  13. <view>公告</view>
  14. </view>
  15. <view class="container-gg">
  16. <view class="notice-text-box">
  17. <view class="notice-text-con">{{content1}}</view>
  18. </view>
  19. </view>
  20. <view
  21. style=" text-align: right;width: 50px;color: #fff; display: flex; justify-content: end;align-items: center;"
  22. @click="more()">
  23. 更多
  24. <image :src="loadImgSrc('icon_right.png')" style="width: 15px;height: 15px;" mode="widthFix" />
  25. </view>
  26. </view>
  27. </view>
  28. <view class="notice" v-for="(item,index) in list" :key="index" v-if="index==0">
  29. <view class="justify-content">
  30. <view class="font-forty" style="font-size: 42rpx; font-weight: bold;">
  31. {{item.noticeTitle}}
  32. </view>
  33. <view class="font-twenty-eight gray"
  34. style="display: flex; align-items: center; margin-top: 20rpx; color:#777;">
  35. <image :src="loadImgSrc('time.png')" style="width: 26rpx;height: 26rpx; margin-right: 15rpx;">
  36. </image> {{item.createTime}}
  37. </view>
  38. </view>
  39. <view class="font-thirty-two black" style="margin: 30rpx 0;">
  40. <rich-text :nodes="item.noticeContent"></rich-text>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. getNoticeList,
  48. } from '@/api/common'
  49. export default {
  50. data() {
  51. return {
  52. list: [],
  53. content: [],
  54. content1: '',
  55. noticeDetails: {},
  56. }
  57. },
  58. onLoad() {
  59. this.lists()
  60. uni.setNavigationBarTitle({
  61. title: ''
  62. })
  63. },
  64. methods: {
  65. goDetails(item) {
  66. uni.navigateTo({
  67. url: '/pages/notice/noticeDetail?params=' + encodeURIComponent(JSON.stringify(
  68. item))
  69. })
  70. },
  71. more() {
  72. uni.navigateTo({
  73. url: '/pages/notice/noticeList'
  74. });
  75. },
  76. lists() {
  77. uni.showLoading()
  78. getNoticeList('3', '1', '').then(res => { //查注意事项
  79. uni.hideLoading();
  80. if (res.code == '200') {
  81. if (res.rows.length > 0) {
  82. this.list = res.rows
  83. } else {
  84. this.$modal.msg('暂无数据')
  85. }
  86. } else {
  87. this.$modal.msg(res.msg)
  88. }
  89. })
  90. getNoticeList('1', '1', '').then(res => { //通知公告
  91. if (res.code == '200') {
  92. if (res.rows.length > 0) {
  93. this.noticeDetails = res.rows[0]
  94. this.content.push(
  95. res.rows[0]
  96. )
  97. this.content1 = res.rows[0].noticeTitle
  98. } else {
  99. this.$modal.msg('暂无数据')
  100. }
  101. } else {
  102. this.$modal.msg(res.msg)
  103. }
  104. })
  105. }
  106. }
  107. }
  108. </script>
  109. <style scoped lang="scss">
  110. .gg-container {
  111. background-color: #fff;
  112. display: flex;
  113. flex-direction: column;
  114. }
  115. .gg-tit {
  116. width: 100%;
  117. position: relative;
  118. top: 0;
  119. height: 40vh;
  120. display: flex;
  121. justify-content: center;
  122. align-items: center;
  123. }
  124. .gg-body {
  125. display: flex;
  126. position: absolute;
  127. bottom: 25rpx;
  128. width: 728rpx;
  129. height: 80rpx;
  130. background: linear-gradient(0deg, #90BDFF, #3F93FD, #20B9D5);
  131. border-radius: 40rpx;
  132. justify-content: center;
  133. align-items: center;
  134. .gg-body-tt {
  135. text-align: left;
  136. margin-left: 5px;
  137. width: 20%;
  138. display: flex;
  139. align-items: center;
  140. color: #FFFFFF;
  141. font-weight: bold;
  142. font-size: 30rpx;
  143. }
  144. }
  145. .content {
  146. display: flex;
  147. flex-direction: column;
  148. align-items: center;
  149. justify-content: center;
  150. }
  151. .background {
  152. border: 15px solid hsla(0, 0%, 100%, .5);
  153. background: white;
  154. background-clip: padding-box;
  155. /*从padding开始往外面裁剪背景*/
  156. }
  157. .container {
  158. display: flex;
  159. margin-left: 10px;
  160. margin-top: 10px;
  161. margin-right: 10px;
  162. align-items: flex-start;
  163. justify-content: space-between;
  164. }
  165. .gg-title {
  166. width: 100%;
  167. position: absolute;
  168. z-index: 1;
  169. display: flex;
  170. justify-content: center;
  171. align-items: center;
  172. font-size: 40rpx;
  173. font-weight: bold;
  174. color: #FFFFFF;
  175. }
  176. .notice {
  177. margin: 20rpx;
  178. padding: 20rpx;
  179. background: #FFFFFF;
  180. box-shadow: 0rpx 8rpx 17rpx 0rpx rgba(0, 0, 0, 0.04);
  181. border-radius: 10rpx;
  182. }
  183. .text {
  184. color: white;
  185. padding-left: 20rpx;
  186. }
  187. .container-gg {
  188. flex: 1;
  189. display: flex;
  190. flex-direction: column;
  191. overflow: hidden;
  192. /* #ifndef APP-PLUS */
  193. height: 100%;
  194. width: 100%;
  195. /* #endif */
  196. }
  197. .notice-text-box {
  198. display: flex;
  199. flex-direction: column;
  200. position: relative;
  201. /* #ifndef APP-PLUS */
  202. height: 100%;
  203. width: 100%;
  204. /* #endif */
  205. flex: 1;
  206. align-items: center;
  207. justify-content: center;
  208. }
  209. .notice-text-con {
  210. flex: 1;
  211. display: flex;
  212. color: white;
  213. flex-direction: row;
  214. align-items: center;
  215. flex-wrap: nowrap;
  216. /* #ifndef APP-PLUS */
  217. white-space: pre;
  218. -webkit-animation: scroll-left 4s infinite linear;
  219. animation: scroll-left 4s infinite linear;
  220. left: 0;
  221. padding-left: 100%;
  222. /* #endif */
  223. position: absolute;
  224. /* #ifdef APP-NVUE */
  225. left: 0;
  226. /* #endif */
  227. }
  228. /* #ifndef APP-NVUE */
  229. @-webkit-keyframes scroll-left {
  230. 0% {
  231. -webkit-transform: translateX(0);
  232. transform: translateX(0);
  233. }
  234. 100% {
  235. -webkit-transform: translateX(-100%);
  236. transform: translateX(-100%);
  237. }
  238. }
  239. @keyframes scroll-left {
  240. 0% {
  241. -webkit-transform: translateX(0);
  242. transform: translateX(0);
  243. }
  244. 100% {
  245. -webkit-transform: translateX(-100%);
  246. transform: translateX(-100%);
  247. }
  248. }
  249. /* #endif */
  250. </style>