index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <view class="content" style="position: relative;">
  3. <view>
  4. <image src="https://121.37.40.217/app/images/5fde4230055e4eefb4dded5ba3325333.png" mode="" class="header">
  5. </image>
  6. </view>
  7. <view class="justify-content">
  8. <view class="align-items" style="position: absolute; top: 66rpx;left: 40rpx;">
  9. <image src="https://121.37.40.217/app/images/sgglpt.png" mode="" class="header-title"></image>
  10. </view>
  11. <view class="align-items"
  12. style="position: absolute; top: 180rpx; left: 300rpx; font-size: 10pt;font-size: 36rpx; color: #fff;">
  13. {{name}} !欢迎你登录本应用
  14. </view>
  15. <!-- <view class="align-items" style="position: absolute; top: 90rpx; left: 0;" @click="gotopage('/pages/noLogin/typeList')">
  16. <back></back>
  17. </view> -->
  18. </view>
  19. <view style="margin: 0 30rpx;">
  20. <swiper class="swiper" @change="change" autoplay="true" interval="3000">
  21. <swiper-item v-for="(item,index) in lunbo" :key="index">
  22. <view>
  23. <image :src="item.picUrl" mode=""></image>
  24. </view>
  25. </swiper-item>
  26. </swiper>
  27. </view>
  28. <!-- <view class="distance justify-content">
  29. <view class="square" @click="gotopage('/pages/cityConstrution/cityConstrution')">
  30. <image src="https://121.37.40.217/app/images//city.png" mode="" class="icon"></image>
  31. <view class="font-thirty-six">
  32. 阀管施工
  33. </view>
  34. </view>
  35. <view class="square" @click="history()">
  36. <image src="https://121.37.40.217/app/images//construction.png" mode="" class="icon"></image>
  37. <view class="font-thirty-six">
  38. 历史施工
  39. </view>
  40. </view>
  41. <view class="square" @click="gotopage('/pages/service/service')">
  42. <image src="https://121.37.40.217/app/images//service.png" mode="" class="icon"></image>
  43. <view class="font-thirty-six">
  44. 服务说明
  45. </view>
  46. </view>
  47. <view class="square" @click="gotopage('/pages/aboutme/aboutme')">
  48. <image src="https://121.37.40.217/app/images//construction.png" mode="" class="icon"></image>
  49. <view class="font-thirty-six">
  50. 关于我们
  51. </view>
  52. </view>
  53. </view>
  54. <view class="justify-content" style="margin: 50rpx 30rpx 0;"> -->
  55. <view class="tongzhicont">
  56. <view class="gonggao">
  57. <view class="justify-content">
  58. <view class="font-forty-eight text"> 公告内容 </view>
  59. <view class="font-thirty-six darkgray more" @click="more()"> 更多<u-icon name="arrow-right"></u-icon>
  60. </view>
  61. </view>
  62. <view v-for="(item,index) in list" style="margin: 30rpx 0;">
  63. <u-parse class="title" :html="item.text"></u-parse>
  64. </view>
  65. </view>
  66. <view class="notice" :key="index">
  67. <view style="margin: 30rpx 0;">
  68. <rich-text class="one-title" :nodes="oneManage.title"></rich-text>
  69. <rich-text class="one-time" :nodes="oneManage.time"></rich-text>
  70. <!-- <view class="font-forty"> -->
  71. <mpHtml :content="oneManage.text"></mpHtml>
  72. <!-- </view> -->
  73. </view>
  74. </view>
  75. <!-- </view> -->
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. import service from '@/api/index.js'
  81. import mpHtml from '@/components/mp-html/mp-html.vue'
  82. export default {
  83. components: {
  84. mpHtml
  85. },
  86. data() {
  87. return {
  88. list: [],
  89. oneManage: {},
  90. name: '',
  91. lunbo: []
  92. }
  93. },
  94. onLoad() {
  95. uni.showTabBar();
  96. //this.getLunBo();
  97. this.getUserName();
  98. },
  99. onShow() {
  100. this.getOne();
  101. this.getnotice()
  102. uni.showTabBar();
  103. },
  104. onTabItemTap(e) {
  105. console.log(e)
  106. uni.removeStorageSync('type')
  107. },
  108. methods: {
  109. getUserName() {
  110. service.getUserName().then(res => {
  111. this.name = res.name;
  112. this.power = res.power;
  113. })
  114. },
  115. change(e) {
  116. this.current = e.detail.current;
  117. },
  118. gotopage(url) {
  119. uni.navigateTo({
  120. url
  121. })
  122. },
  123. getLunBo() {
  124. service.getLunBo().then(res => {
  125. this.lunbo = res;
  126. })
  127. },
  128. getOne() {
  129. service.getOne().then(res => {
  130. this.oneManage = res
  131. console.log(this.oneManage)
  132. })
  133. },
  134. getnotice() {
  135. service.getNoticeList().then(res => {
  136. let list = []
  137. this.list = []
  138. list = res
  139. let i = res.length - 1
  140. if (res.length != 0) {
  141. this.list.push(list[i])
  142. } else {
  143. this.list = res
  144. }
  145. })
  146. },
  147. more() {
  148. console.log(11111)
  149. uni.navigateTo({
  150. url: '/pages/notice/noticeList'
  151. })
  152. },
  153. history() {
  154. uni.switchTab({
  155. url: '/pages/historyConstruction/historyConstruction'
  156. })
  157. }
  158. }
  159. }
  160. </script>
  161. <style lang="scss" scoped>
  162. .header {
  163. width: 100%;
  164. height: 530rpx;
  165. }
  166. .header-title {
  167. width: 310rpx;
  168. height: 40rpx;
  169. }
  170. .row-item {
  171. overflow: hidden;
  172. -webkit-line-clamp: 2;
  173. text-overflow: ellipsis;
  174. display: -webkit-box;
  175. -webkit-box-orient: vertical;
  176. }
  177. .tongzhicont {
  178. position: absolute;
  179. top: 396rpx;
  180. width: 100%;
  181. }
  182. .more {
  183. font-size: 30rpx;
  184. color: #666666;
  185. }
  186. .gonggao {
  187. width: 90%;
  188. margin: 0 auto;
  189. border-radius: 30rpx;
  190. background: linear-gradient(45deg, #ffffff, #e7f9ff);
  191. box-shadow: 7rpx 1rpx 10rpx #e5f0ff;
  192. padding: 20rpx;
  193. }
  194. .one-title {
  195. font-size: 40rpx;
  196. font-weight: bold;
  197. color: #666;
  198. line-height: 2rem;
  199. }
  200. .one-time {
  201. color: #999;
  202. font-size: 32rpx;
  203. }
  204. .font-forty {
  205. font-size: 32rpx;
  206. line-height: 2rem;
  207. margin: 20rpx 0 0 0;
  208. }
  209. .title {
  210. overflow: hidden;
  211. text-overflow: ellipsis;
  212. width: 100%;
  213. /*将对象作为弹性伸缩盒子模型显示*/
  214. display: -webkit-box;
  215. /*限制文本行数*/
  216. -webkit-line-clamp: 2;
  217. /*子元素的排列方式*/
  218. -webkit-box-orient: vertical;
  219. /*将对象作为弹性伸缩盒子模型显示*/
  220. }
  221. .swiper {
  222. position: absolute;
  223. top: 200rpx;
  224. width: 690rpx;
  225. height: 280rpx;
  226. margin: 0 30rpx;
  227. }
  228. .distance {
  229. margin: 250rpx 30rpx 0;
  230. .square {
  231. margin: 15rpx;
  232. text-align: center;
  233. .icon {
  234. width: 100rpx;
  235. height: 100rpx;
  236. }
  237. }
  238. }
  239. .notice {
  240. margin: 20rpx;
  241. padding: 20rpx;
  242. background: #FFFFFF;
  243. box-shadow: 0rpx 8rpx 17rpx 0rpx rgba(0, 0, 0, 0.04);
  244. border-radius: 10rpx;
  245. }
  246. .text {
  247. padding-left: 20rpx;
  248. font-size: 44rpx;
  249. font-weight: bold;
  250. color: #4194fd;
  251. }
  252. </style>