index.vue 5.7 KB

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