index.vue 6.3 KB

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