index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view class="content" style="position: relative;">
  3. <view>
  4. <image src="/static/icon/backgroundimg.png" mode="" class="header"></image>
  5. </view>
  6. <view class="align-items" style="position: absolute; top: 90rpx; left: 0;" @click="gotopage('/pages/noLogin/typeList')">
  7. <back></back>
  8. </view>
  9. <view style="margin: 0 30rpx;">
  10. <swiper class="swiper" @change="change" autoplay="true" interval="3000">
  11. <swiper-item v-for="(item,index) in lunbo" :key="index">
  12. <view>
  13. <image :src="item.picUrl" mode=""></image>
  14. </view>
  15. </swiper-item>
  16. </swiper>
  17. </view>
  18. <view class="distance justify-content">
  19. <view class="square" @click="gotopage('/pages/cityConstrution/cityConstrution')">
  20. <image src="/static/icon/city.png" mode="" class="icon"></image>
  21. <view class="font-thirty-six">
  22. 阀管施工
  23. </view>
  24. </view>
  25. <view class="square" @click="history()">
  26. <image src="/static/icon/construction.png" mode="" class="icon"></image>
  27. <view class="font-thirty-six">
  28. 历史施工
  29. </view>
  30. </view>
  31. <view class="square" @click="gotopage('/pages/service/service')">
  32. <image src="/static/icon/service.png" mode="" class="icon"></image>
  33. <view class="font-thirty-six">
  34. 服务说明
  35. </view>
  36. </view>
  37. <view class="square" @click="gotopage('/pages/aboutme/aboutme')">
  38. <image src="/static/icon/construction.png" mode="" class="icon"></image>
  39. <view class="font-thirty-six">
  40. 关于我们
  41. </view>
  42. </view>
  43. </view>
  44. <view class="justify-content" style="margin: 50rpx 30rpx 0;">
  45. <view class="font-forty-eight text">
  46. 公告内容
  47. </view>
  48. <view class="font-thirty-six darkgray" @click="more()">
  49. 查看更多
  50. <u-icon name="arrow-right"></u-icon>
  51. </view>
  52. </view>
  53. <view class="notice" v-for="(item,index) in list" :key="index">
  54. <view class="justify-content">
  55. <view class="font-forty">
  56. {{item.title}}
  57. </view>
  58. <view class="font-twenty-eight gray">
  59. {{item.time}}
  60. </view>
  61. </view>
  62. <view class="font-thirty-two black" style="margin: 30rpx 0;">
  63. <rich-text :nodes="item.text"></rich-text>
  64. </view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. import service from '@/api/index.js'
  70. export default {
  71. data() {
  72. return {
  73. list:[],
  74. lunbo:[]
  75. }
  76. },
  77. onLoad() {
  78. this.getLunBo();
  79. },
  80. onShow() {
  81. this.getnotice();
  82. },
  83. methods: {
  84. change(e) {
  85. this.current = e.detail.current;
  86. },
  87. gotopage(url){
  88. uni.navigateTo({
  89. url
  90. })
  91. },
  92. getLunBo(){
  93. service.getLunBo().then(res=>{
  94. this.lunbo = res;
  95. })
  96. },
  97. getnotice(){
  98. service.getNoticeList().then(res=>{
  99. this.list = res
  100. })
  101. },
  102. more(){
  103. uni.navigateTo({
  104. url:'/pages/notice/noticeList'
  105. })
  106. },
  107. history(){
  108. uni.switchTab({
  109. url:'/pages/historyConstruction/historyConstruction'
  110. })
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .header {
  117. width: 100%;
  118. height: 300rpx;
  119. }
  120. .swiper {
  121. position: absolute;
  122. top: 200rpx;
  123. width: 690rpx;
  124. height: 280rpx;
  125. margin: 0 30rpx;
  126. }
  127. .distance{
  128. margin: 250rpx 30rpx 0;
  129. .square{
  130. margin: 15rpx;
  131. text-align: center;
  132. .icon{
  133. width: 100rpx;
  134. height: 100rpx;
  135. }
  136. }
  137. }
  138. .notice{
  139. margin: 20rpx;
  140. padding: 20rpx;
  141. background: #FFFFFF;
  142. box-shadow: 0rpx 8rpx 17rpx 0rpx rgba(0, 0, 0, 0.04);
  143. border-radius: 10rpx;
  144. }
  145. .text{
  146. border-left: 15rpx solid #3857F3;
  147. padding-left: 20rpx;
  148. }
  149. </style>