homePage.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. <template>
  2. <view>
  3. <!-- 吸顶搜索框 -->
  4. <view class="sticky" v-if="flag">
  5. <input type="text" placeholder="请输入搜索内容">
  6. </view>
  7. <!-- 轮播图 -->
  8. <view class="slideshow">
  9. <view class="wrap">
  10. <view class="search-box">
  11. <u-search color="black" search-icon-color="#fff" placeholder-color="#fff" bg-color="#8a7170"
  12. placeholder="请输入搜索内容" :show-action="false" input-align="center"></u-search>
  13. </view>
  14. <u-swiper mode="none" :list="list" :title="true" height="422"></u-swiper>
  15. </view>
  16. </view>
  17. <!-- 公告 -->
  18. <view class="notice">
  19. <view class="title">
  20. 公告
  21. </view>
  22. <view class="content">
  23. 荆州市地方铁路有限公司招标111111111
  24. </view>
  25. <view class="date">
  26. 2022-12-08
  27. </view>
  28. </view>
  29. <!-- 宫格 -->
  30. <view class="grid">
  31. <u-grid :col="4" :border="false">
  32. <u-grid-item>
  33. <img src="../../assets/img/tlgk.png" alt="">
  34. <view class="grid-text">铁路概况</view>
  35. </u-grid-item>
  36. <u-grid-item>
  37. <img src="../../assets/img/jgsz.png" alt="">
  38. <view class="grid-text">机构设置</view>
  39. </u-grid-item>
  40. <u-grid-item>
  41. <img src="../../assets/img/zwdt.png" alt="">
  42. <view class="grid-text">政务动态</view>
  43. </u-grid-item>
  44. <u-grid-item>
  45. <img src="../../assets/img/djdt.png" alt="">
  46. <view class="grid-text">党建动态</view>
  47. </u-grid-item>
  48. <u-grid-item>
  49. <img src="../../assets/img/fzxc.png" alt="">
  50. <view class="grid-text">法制宣传</view>
  51. </u-grid-item>
  52. <u-grid-item>
  53. <img src="../../assets/img/jjjc.png" alt="">
  54. <view class="grid-text">纪检监察</view>
  55. </u-grid-item>
  56. <u-grid-item>
  57. <img src="../../assets/img/wmcj.png" alt="">
  58. <view class="grid-text">文明创建</view>
  59. </u-grid-item>
  60. <u-grid-item>
  61. <img src="../../assets/img/wnfw.png" alt="">
  62. <view class="grid-text">为您服务</view>
  63. </u-grid-item>
  64. </u-grid>
  65. </view>
  66. <!-- 新闻资讯 -->
  67. <view class="news">
  68. <view class="title">
  69. <view class="icon">
  70. <img src="../../assets/img/news.png" alt="">
  71. </view>
  72. <view class="text">
  73. 新闻资讯
  74. </view>
  75. </view>
  76. <view class="news-item" v-for="item in 4">
  77. <view class="content">
  78. <view class="news-title">
  79. 李春华带队到岳阳港考察学习
  80. </view>
  81. <view class="information">
  82. <view class="classify">
  83. 行业资讯
  84. </view>
  85. <view class="date">
  86. 2020-12-30
  87. </view>
  88. </view>
  89. </view>
  90. <view class="img">
  91. <img src="../../assets/img/newsPic.png" alt="">
  92. </view>
  93. </view>
  94. </view>
  95. <u-divider bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
  96. <tabbar current="0"></tabbar>
  97. </view>
  98. </template>
  99. <script>
  100. import tabbar from "../../components/Tabbar.vue"
  101. export default {
  102. components: {
  103. tabbar
  104. },
  105. data() {
  106. return {
  107. flag: false,
  108. scrollTop: "",
  109. list: [{
  110. image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
  111. title: '昨夜星辰昨夜风,画楼西畔桂堂东'
  112. },
  113. {
  114. image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
  115. title: '身无彩凤双飞翼,心有灵犀一点通'
  116. },
  117. {
  118. image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
  119. title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
  120. }
  121. ],
  122. }
  123. },
  124. methods: {
  125. onPageScroll(e) {
  126. this.scrollTop = e.scrollTop;
  127. console.log(this.scrollTop);
  128. if (this.scrollTop >= 200) {
  129. this.flag = true;
  130. } else {
  131. this.flag = false;
  132. }
  133. },
  134. },
  135. }
  136. </script>
  137. <style scoped lang="scss">
  138. page {
  139. padding-bottom: 50px;
  140. font-family: 'Regular';
  141. }
  142. .sticky {
  143. width: 100%;
  144. position: fixed;
  145. top: 0;
  146. left: 0;
  147. right: 0;
  148. z-index: 100;
  149. border-bottom: 1px solid #fff;
  150. padding: 16rpx 40rpx;
  151. background-color: #fff;
  152. uni-input {
  153. background-color: #E8E8E8;
  154. height: 32px;
  155. line-height: 32px;
  156. border-radius: 8px;
  157. text-align: center;
  158. }
  159. }
  160. .u-search {
  161. /deep/.uni-input-placeholder {
  162. font-weight: bold;
  163. }
  164. /deep/.uni-input-input {
  165. color: #ffffff !important;
  166. font-weight: bold;
  167. }
  168. }
  169. .search-box {
  170. width: 100%;
  171. background-color: #4F3C27;
  172. padding: 16rpx 40rpx;
  173. position: absolute;
  174. line-height: 32px;
  175. color: #ffffff !important;
  176. opacity: 0.4;
  177. z-index: 999;
  178. opacity: 0.4;
  179. }
  180. // 公告
  181. .notice {
  182. background-color: rgba(255, 255, 255, 1);
  183. line-height: 40px;
  184. display: flex;
  185. padding: 0 32rpx;
  186. .title {
  187. color: rgba(31, 74, 153, 1);
  188. font-size: 18px;
  189. font-weight: bold;
  190. }
  191. .content {
  192. width: 380rpx;
  193. white-space: nowrap;
  194. overflow: hidden;
  195. text-overflow: ellipsis;
  196. color: rgba(51, 51, 51, 1);
  197. margin-left: 14px;
  198. }
  199. .date {
  200. color: rgba(119, 119, 119, 1);
  201. margin-left: auto;
  202. }
  203. }
  204. // 宫格
  205. .grid {
  206. img {
  207. width: 80rpx;
  208. height: 80rpx;
  209. }
  210. .grid-text {
  211. color: rgba(51, 51, 51, 1);
  212. margin-top: 8rpx;
  213. }
  214. }
  215. // 新闻资讯
  216. .news {
  217. padding: 40rpx 32rpx;
  218. background-color: rgba(244, 244, 244, 1);
  219. .title {
  220. display: flex;
  221. align-items: center;
  222. margin-bottom: 40rpx;
  223. font-family: 'SemiBold';
  224. img {
  225. width: 40rpx;
  226. height: 40rpx;
  227. margin-right: 8rpx;
  228. }
  229. }
  230. .news-item {
  231. display: flex;
  232. justify-content: space-between;
  233. margin-bottom: 40rpx;
  234. .content {
  235. display: flex;
  236. flex-direction: column;
  237. justify-content: space-between;
  238. .news-title {
  239. color: rgba(51, 51, 51, 1);
  240. font-size: 16px;
  241. text-align: justify;
  242. width: 438rpx;
  243. white-space: nowrap;
  244. overflow: hidden;
  245. text-overflow: ellipsis;
  246. }
  247. .information {
  248. margin-top: 44rpx;
  249. display: flex;
  250. justify-content: space-between;
  251. color: #777777;
  252. }
  253. }
  254. }
  255. .img {
  256. width: 224rpx;
  257. border-radius: 5px;
  258. overflow: hidden;
  259. img {
  260. width: 100%;
  261. height: 100%;
  262. }
  263. }
  264. }
  265. </style>