index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <view class="content" style="position: relative;">
  3. <view>
  4. <image src="https://zdsz.obs.cn-south-1.myhuaweicloud.com/file/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="/static/icon/sgglpt.png" mode="" class="header-title"></image>
  9. </view>
  10. <view class="align-items" style="position: absolute; top: 180rpx; left: 300rpx; font-size: 10pt;font-size: 36rpx; color: #fff;">
  11. {{name}} !欢迎你登录本应用
  12. </view>
  13. <!-- <view class="align-items" style="position: absolute; top: 90rpx; left: 0;" @click="gotopage('/pages/noLogin/typeList')">
  14. <back></back>
  15. </view> -->
  16. </view>
  17. <view style="margin: 0 30rpx;">
  18. <swiper class="swiper" @change="change" autoplay="true" interval="3000">
  19. <swiper-item v-for="(item,index) in lunbo" :key="index">
  20. <view>
  21. <image :src="item.picUrl" mode=""></image>
  22. </view>
  23. </swiper-item>
  24. </swiper>
  25. </view>
  26. <!-- <view class="distance justify-content">
  27. <view class="square" @click="gotopage('/pages/cityConstrution/cityConstrution')">
  28. <image src="/static/icon/city.png" mode="" class="icon"></image>
  29. <view class="font-thirty-six">
  30. 阀管施工
  31. </view>
  32. </view>
  33. <view class="square" @click="history()">
  34. <image src="/static/icon/construction.png" mode="" class="icon"></image>
  35. <view class="font-thirty-six">
  36. 历史施工
  37. </view>
  38. </view>
  39. <view class="square" @click="gotopage('/pages/service/service')">
  40. <image src="/static/icon/service.png" mode="" class="icon"></image>
  41. <view class="font-thirty-six">
  42. 服务说明
  43. </view>
  44. </view>
  45. <view class="square" @click="gotopage('/pages/aboutme/aboutme')">
  46. <image src="/static/icon/construction.png" mode="" class="icon"></image>
  47. <view class="font-thirty-six">
  48. 关于我们
  49. </view>
  50. </view>
  51. </view>
  52. <view class="justify-content" style="margin: 50rpx 30rpx 0;"> -->
  53. <view class="tongzhicont">
  54. <view class="gonggao">
  55. <view class="justify-content">
  56. <view class="font-forty-eight text" >
  57. 公告内容
  58. </view>
  59. <view class="font-thirty-six darkgray more" @click="more()" >
  60. 更多<u-icon name="arrow-right" ></u-icon>
  61. </view>
  62. </view>
  63. <view v-for="(item,index) in list" style="margin: 30rpx 0;">
  64. <u-parse class="title" :html="item.text"></u-parse>
  65. </view>
  66. </view>
  67. <view class="notice" :key="index">
  68. <view style="margin: 30rpx 0;">
  69. <rich-text class="one-title" :nodes="oneManage.title"></rich-text>
  70. <rich-text class="one-time" :nodes="oneManage.time"></rich-text>
  71. <!-- <view class="font-forty"> -->
  72. <mpHtml :content="oneManage.text"></mpHtml>
  73. <!-- </view> -->
  74. </view>
  75. </view>
  76. <!-- </view> -->
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. import service from '@/api/index.js'
  82. import mpHtml from'@/components/mp-html/mp-html.vue'
  83. export default {
  84. components:{
  85. mpHtml
  86. },
  87. data() {
  88. return {
  89. list:[],
  90. oneManage:{},
  91. name:'',
  92. lunbo:[]
  93. }
  94. },
  95. onLoad() {
  96. uni.showTabBar();
  97. //this.getLunBo();
  98. this.getUserName();
  99. },
  100. onShow() {
  101. this.getOne();
  102. this.getnotice()
  103. uni.showTabBar();
  104. },
  105. methods: {
  106. getUserName(){
  107. service.getUserName().then(res=>{
  108. this.name = res.name;
  109. this.power = res.power;
  110. })
  111. },
  112. change(e) {
  113. this.current = e.detail.current;
  114. },
  115. gotopage(url){
  116. uni.navigateTo({
  117. url
  118. })
  119. },
  120. getLunBo(){
  121. service.getLunBo().then(res=>{
  122. this.lunbo = res;
  123. })
  124. },
  125. getOne()
  126. {
  127. service.getOne().then(res=>{
  128. this.oneManage= res
  129. console.log(this.oneManage)
  130. })
  131. },
  132. getnotice(){
  133. service.getNoticeList().then(res=>{
  134. let list =[]
  135. this.list=[]
  136. list=res
  137. let i=res.length-1
  138. if(res.length!=0)
  139. {
  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: 310rpx;
  167. height: 40rpx;
  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>