index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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. onTabItemTap(e)
  106. {
  107. console.log(e)
  108. uni.removeStorageSync('type')
  109. },
  110. methods: {
  111. getUserName(){
  112. service.getUserName().then(res=>{
  113. this.name = res.name;
  114. this.power = res.power;
  115. })
  116. },
  117. change(e) {
  118. this.current = e.detail.current;
  119. },
  120. gotopage(url){
  121. uni.navigateTo({
  122. url
  123. })
  124. },
  125. getLunBo(){
  126. service.getLunBo().then(res=>{
  127. this.lunbo = res;
  128. })
  129. },
  130. getOne()
  131. {
  132. service.getOne().then(res=>{
  133. this.oneManage= res
  134. console.log(this.oneManage)
  135. })
  136. },
  137. getnotice(){
  138. service.getNoticeList().then(res=>{
  139. let list =[]
  140. this.list=[]
  141. list=res
  142. let i=res.length-1
  143. if(res.length!=0)
  144. {
  145. this.list.push(list[i])
  146. }else{
  147. this.list=res
  148. }
  149. })
  150. },
  151. more(){
  152. console.log(11111)
  153. uni.navigateTo({
  154. url:'/pages/notice/noticeList'
  155. })
  156. },
  157. history(){
  158. uni.switchTab({
  159. url:'/pages/historyConstruction/historyConstruction'
  160. })
  161. }
  162. }
  163. }
  164. </script>
  165. <style lang="scss" scoped>
  166. .header {
  167. width: 100%;
  168. height: 530rpx;
  169. }
  170. .header-title{
  171. width: 310rpx;
  172. height: 40rpx;
  173. }
  174. .row-item{
  175. overflow: hidden;
  176. -webkit-line-clamp: 2;
  177. text-overflow: ellipsis;
  178. display: -webkit-box;
  179. -webkit-box-orient: vertical;
  180. }
  181. .tongzhicont{
  182. position: absolute;
  183. top: 396rpx;
  184. width: 100%;
  185. }
  186. .more{
  187. font-size: 30rpx;
  188. color: #666666;
  189. }
  190. .gonggao{
  191. width: 90%;
  192. margin: 0 auto;
  193. border-radius: 30rpx;
  194. background: linear-gradient(45deg, #ffffff, #e7f9ff);
  195. box-shadow: 7rpx 1rpx 10rpx #e5f0ff;
  196. padding: 20rpx;
  197. }
  198. .one-title{
  199. font-size: 40rpx;
  200. font-weight: bold;
  201. color: #666;
  202. line-height: 2rem;
  203. }
  204. .one-time{
  205. color: #999;
  206. font-size: 32rpx;
  207. }
  208. .font-forty{
  209. font-size: 32rpx;
  210. line-height: 2rem;
  211. margin: 20rpx 0 0 0;
  212. }
  213. .title{
  214. overflow: hidden;
  215. text-overflow: ellipsis;
  216. width: 100%;
  217. /*将对象作为弹性伸缩盒子模型显示*/
  218. display: -webkit-box;
  219. /*限制文本行数*/
  220. -webkit-line-clamp: 2;
  221. /*子元素的排列方式*/
  222. -webkit-box-orient: vertical;
  223. /*将对象作为弹性伸缩盒子模型显示*/
  224. }
  225. .swiper {
  226. position: absolute;
  227. top: 200rpx;
  228. width: 690rpx;
  229. height: 280rpx;
  230. margin: 0 30rpx;
  231. }
  232. .distance{
  233. margin: 250rpx 30rpx 0;
  234. .square{
  235. margin: 15rpx;
  236. text-align: center;
  237. .icon{
  238. width: 100rpx;
  239. height: 100rpx;
  240. }
  241. }
  242. }
  243. .notice{
  244. margin: 20rpx;
  245. padding: 20rpx;
  246. background: #FFFFFF;
  247. box-shadow: 0rpx 8rpx 17rpx 0rpx rgba(0, 0, 0, 0.04);
  248. border-radius: 10rpx;
  249. }
  250. .text{
  251. padding-left: 20rpx;
  252. font-size: 44rpx;
  253. font-weight: bold;
  254. color: #4194fd;
  255. }
  256. </style>