index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. <yxp-txt-scroll :text="content" fontSize="30" duration="5000" delay="500" txtPadding="10"
  16. style=" margin: auto; width: 80%;" @onClick="goDetails"></yxp-txt-scroll>
  17. <view
  18. style=" text-align: right;width: 70px;color: #fff; display: flex; justify-content: end;align-items: center;"
  19. @click="more()">
  20. 更多
  21. <image :src="loadImgSrc('icon_right.png')" style="width: 15px;height: 15px;" mode="widthFix" />
  22. </view>
  23. </view>
  24. </view>
  25. <view class="notice" v-for="(item,index) in list" :key="index" v-if="index==0">
  26. <view class="justify-content">
  27. <view class="font-forty" style="font-size: 42rpx; font-weight: bold;">
  28. {{item.noticeTitle}}
  29. </view>
  30. <view class="font-twenty-eight gray" style="display: flex; align-items: center; margin-top: 20rpx; color:#777;">
  31. <image :src="loadImgSrc('time.png')" style="width: 26rpx;height: 26rpx; margin-right: 15rpx;"></image> {{item.createTime}}
  32. </view>
  33. </view>
  34. <view class="font-thirty-two black" style="margin: 30rpx 0;">
  35. <rich-text :nodes="item.noticeContent"></rich-text>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import yxpTxtScroll from '../components/yxp-txt-scroll/yxp-txt-scroll.nvue'
  42. import {
  43. getNoticeList,
  44. } from '@/api/common'
  45. export default {
  46. components: {
  47. yxpTxtScroll
  48. },
  49. data() {
  50. return {
  51. list: [],
  52. content: [],
  53. noticeDetails: {},
  54. }
  55. },
  56. onLoad() {
  57. this.lists()
  58. uni.setNavigationBarTitle({
  59. title: ''
  60. })
  61. },
  62. methods: {
  63. goDetails(item) {
  64. uni.navigateTo({
  65. url: '/pages/notice/noticeDetail?params=' + encodeURIComponent(JSON.stringify(
  66. item))
  67. })
  68. },
  69. more() {
  70. uni.navigateTo({
  71. url: '/pages/notice/noticeList'
  72. });
  73. },
  74. lists() {
  75. uni.showLoading()
  76. getNoticeList('3', '1', '').then(res => { //查注意事项
  77. uni.hideLoading();
  78. if (res.code == '200') {
  79. if (res.rows.length > 0) {
  80. this.list = res.rows
  81. } else {
  82. this.$modal.msg('暂无数据')
  83. }
  84. } else {
  85. this.$modal.msg(res.msg)
  86. }
  87. })
  88. getNoticeList('1', '1', '').then(res => { //通知公告
  89. if (res.code == '200') {
  90. if (res.rows.length > 0) {
  91. this.noticeDetails = res.rows[0]
  92. this.content.push(
  93. res.rows[0]
  94. )
  95. } else {
  96. this.$modal.msg('暂无数据')
  97. }
  98. } else {
  99. this.$modal.msg(res.msg)
  100. }
  101. })
  102. }
  103. }
  104. }
  105. </script>
  106. <style scoped lang="scss">
  107. .gg-container {
  108. background-color: #fff;
  109. display: flex;
  110. flex-direction: column;
  111. }
  112. .gg-tit {
  113. width: 100%;
  114. position: relative;
  115. top: 0;
  116. height: 40vh;
  117. display: flex;
  118. justify-content: center;
  119. align-items: center;
  120. }
  121. .gg-body {
  122. display: flex;
  123. position: absolute;
  124. bottom: 25rpx;
  125. width: 728rpx;
  126. height: 80rpx;
  127. background: linear-gradient(0deg, #90BDFF, #3F93FD, #20B9D5);
  128. border-radius: 40rpx;
  129. justify-content: center;
  130. align-items: center;
  131. .gg-body-tt {
  132. text-align: left;
  133. margin-left: 5px;
  134. width: 25%;
  135. display: flex;
  136. align-items: center;
  137. color: #FFFFFF;
  138. font-weight: bold;
  139. font-size: 30rpx;
  140. }
  141. }
  142. .content {
  143. display: flex;
  144. flex-direction: column;
  145. align-items: center;
  146. justify-content: center;
  147. }
  148. .background {
  149. border: 15px solid hsla(0, 0%, 100%, .5);
  150. background: white;
  151. background-clip: padding-box;
  152. /*从padding开始往外面裁剪背景*/
  153. }
  154. .container {
  155. display: flex;
  156. margin-left: 10px;
  157. margin-top: 10px;
  158. margin-right: 10px;
  159. align-items: flex-start;
  160. justify-content: space-between;
  161. }
  162. .gg-title {
  163. width: 100%;
  164. position: absolute;
  165. z-index: 1;
  166. display: flex;
  167. justify-content: center;
  168. align-items: center;
  169. font-size: 40rpx;
  170. font-weight: bold;
  171. color: #FFFFFF;
  172. }
  173. .notice {
  174. margin: 20rpx;
  175. padding: 20rpx;
  176. background: #FFFFFF;
  177. box-shadow: 0rpx 8rpx 17rpx 0rpx rgba(0, 0, 0, 0.04);
  178. border-radius: 10rpx;
  179. }
  180. .text {
  181. border-left: 15rpx solid #3857F3;
  182. padding-left: 20rpx;
  183. }
  184. </style>