homePage.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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. d
  135. },
  136. }
  137. </script>
  138. <style scoped lang="scss">
  139. page {
  140. padding-bottom: 50px;
  141. font-family: 'Regular';
  142. }
  143. .sticky {
  144. width: 100%;
  145. position: fixed;
  146. top: 0;
  147. left: 0;
  148. right: 0;
  149. z-index: 100;
  150. border-bottom: 1px solid #fff;
  151. padding: 16rpx 40rpx;
  152. background-color: #fff;
  153. uni-input {
  154. background-color: #E8E8E8;
  155. height: 32px;
  156. line-height: 32px;
  157. border-radius: 8px;
  158. text-align: center;
  159. }
  160. }
  161. .u-search {
  162. /deep/.uni-input-placeholder {
  163. font-weight: bold;
  164. }
  165. /deep/.uni-input-input {
  166. color: #ffffff !important;
  167. font-weight: bold;
  168. }
  169. }
  170. .search-box {
  171. width: 100%;
  172. background-color: #4F3C27;
  173. padding: 16rpx 40rpx;
  174. position: absolute;
  175. line-height: 32px;
  176. color: #ffffff !important;
  177. opacity: 0.4;
  178. z-index: 999;
  179. opacity: 0.4;
  180. }
  181. // 公告
  182. .notice {
  183. background-color: rgba(255, 255, 255, 1);
  184. line-height: 40px;
  185. display: flex;
  186. padding: 0 32rpx;
  187. .title {
  188. color: rgba(31, 74, 153, 1);
  189. font-size: 18px;
  190. font-weight: bold;
  191. }
  192. .content {
  193. width: 380rpx;
  194. white-space: nowrap;
  195. overflow: hidden;
  196. text-overflow: ellipsis;
  197. color: rgba(51, 51, 51, 1);
  198. margin-left: 14px;
  199. }
  200. .date {
  201. color: rgba(119, 119, 119, 1);
  202. margin-left: auto;
  203. }
  204. }
  205. // 宫格
  206. .grid {
  207. img {
  208. width: 80rpx;
  209. height: 80rpx;
  210. }
  211. .grid-text {
  212. color: rgba(51, 51, 51, 1);
  213. margin-top: 8rpx;
  214. }
  215. }
  216. // 新闻资讯
  217. .news {
  218. padding: 40rpx 32rpx;
  219. background-color: rgba(244, 244, 244, 1);
  220. .title {
  221. display: flex;
  222. align-items: center;
  223. margin-bottom: 40rpx;
  224. font-family: 'SemiBold';
  225. img {
  226. width: 40rpx;
  227. height: 40rpx;
  228. margin-right: 8rpx;
  229. }
  230. }
  231. .news-item {
  232. display: flex;
  233. justify-content: space-between;
  234. margin-bottom: 40rpx;
  235. .content {
  236. display: flex;
  237. flex-direction: column;
  238. justify-content: space-between;
  239. .news-title {
  240. color: rgba(51, 51, 51, 1);
  241. font-size: 16px;
  242. text-align: justify;
  243. width: 438rpx;
  244. white-space: nowrap;
  245. overflow: hidden;
  246. text-overflow: ellipsis;
  247. }
  248. .information {
  249. margin-top: 44rpx;
  250. display: flex;
  251. justify-content: space-between;
  252. color: #777777;
  253. }
  254. }
  255. }
  256. .img {
  257. width: 224rpx;
  258. border-radius: 5px;
  259. overflow: hidden;
  260. img {
  261. width: 100%;
  262. height: 100%;
  263. }
  264. }
  265. }
  266. </style>