index.vue 5.7 KB

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