index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view class="content">
  3. <div class="swiper-box" style="width: 100%">
  4. <swiper
  5. class="swiper"
  6. indicator-dots="true"
  7. autoplay="true"
  8. duration="500"
  9. style="height: 300rpx"
  10. >
  11. <swiper-item v-for="(item, index) in swiperList" :key="index">
  12. <image
  13. :src="item.img"
  14. mode="aspectFill"
  15. style="width: 100%; height: 100%"
  16. ></image>
  17. </swiper-item>
  18. </swiper>
  19. </div>
  20. <div class="input-box">
  21. <image src="/static/policy/u377.png" alt="" />
  22. <input type="text" placeholder="请输入政策关键词搜索" />
  23. </div>
  24. <div class="policy-box">
  25. <div class="policy-title"><p>最新政策</p></div>
  26. <div class="policy-item-box">
  27. <div
  28. v-for="(item, idx) in policyList"
  29. :key="idx"
  30. :class="{ active: active === idx }"
  31. class="policy-item-name"
  32. @click="active = idx"
  33. >
  34. {{ item }}
  35. </div>
  36. </div>
  37. <div class="policy-content">
  38. <div
  39. class="policy-content-item"
  40. v-for="(item, idx) in policyData"
  41. :key="idx"
  42. >
  43. <div class="policy-content-item-left">
  44. <p class="policy-content-item-left-title">{{ item.title }}</p>
  45. <div class="policy-content-item-left-time">
  46. <p class="moment">{{ item.moment }}</p>
  47. <p class="maxMony">{{ item.maxMony }}</p>
  48. <p class="leftDay">{{ item.leftDay }}</p>
  49. </div>
  50. </div>
  51. <div class="policy-content-item-img">
  52. <image :src="item.img" alt="" />
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. swiperList: [
  64. {
  65. img: "/static/swiper/swiper1.jpg",
  66. },
  67. {
  68. img: "/static/swiper/swiper2.jpg",
  69. },
  70. ],
  71. policyList: ["省级政策", "市级政策", "区级政策", "新城政策"],
  72. active: 0,
  73. policyData: new Array(5).fill({
  74. title:
  75. "工业金额信息化部办公厅 组织开2021念工业互联网平台创新互联网工业文化产业项目征集工作。",
  76. moment: "2021-07-12",
  77. maxMony: "最高500.00万",
  78. leftDay: "剩5天",
  79. img: "/static/policy/u388.jpg",
  80. }),
  81. };
  82. },
  83. onLoad() {},
  84. methods: {},
  85. };
  86. </script>
  87. <style lang="scss">
  88. .content {
  89. display: flex;
  90. flex-direction: column;
  91. align-items: center;
  92. justify-content: center;
  93. box-sizing: border-box;
  94. .input-box {
  95. width: 100%;
  96. height: 100rpx;
  97. background-color: #6ea0ec;
  98. display: flex;
  99. justify-content: center;
  100. align-items: center;
  101. position: relative;
  102. image {
  103. position: absolute;
  104. left: 72rpx;
  105. width: 40rpx;
  106. height: 40rpx;
  107. }
  108. input {
  109. background-color: #ffffff;
  110. width: 90%;
  111. height: 70%;
  112. border-radius: 50rpx;
  113. padding: 3rpx;
  114. font-size: 26rpx;
  115. padding-left: 80rpx;
  116. box-sizing: border-box;
  117. }
  118. }
  119. .policy-box {
  120. margin-top: 50rpx;
  121. width: 100%;
  122. display: flex;
  123. flex-direction: column;
  124. .policy-title {
  125. width: 100%;
  126. p {
  127. background-color: #02a7f0;
  128. width: 190rpx;
  129. height: 70rpx;
  130. color: #ffffff;
  131. border-radius: 0 40rpx 40rpx 0rpx;
  132. font-size: 30rpx;
  133. display: flex;
  134. justify-content: center;
  135. align-items: center;
  136. }
  137. }
  138. .policy-item-box {
  139. display: flex;
  140. justify-content: space-between;
  141. margin: 0 20rpx;
  142. margin-top: 10rpx;
  143. .policy-item-name {
  144. padding-bottom: 10rpx;
  145. }
  146. .active {
  147. font-weight: 600;
  148. border-bottom: 7rpx solid #02a7f0;
  149. }
  150. }
  151. .policy-content {
  152. width: 100%;
  153. display: flex;
  154. box-sizing: border-box;
  155. flex-direction: column;
  156. .policy-content-item {
  157. margin: 0 20rpx;
  158. display: flex;
  159. border-bottom: 1px solid #c1c1c1;
  160. padding-bottom: 10rpx;
  161. margin-top: 20rpx;
  162. justify-content: space-between;
  163. .policy-content-item-left {
  164. display: flex;
  165. flex-direction: column;
  166. width: 70%;
  167. .policy-content-item-left-title {
  168. text-overflow: -o-ellipsis-lastline;
  169. overflow: hidden;
  170. text-overflow: ellipsis;
  171. display: -webkit-box;
  172. -webkit-line-clamp: 2;
  173. line-clamp: 2;
  174. -webkit-box-orient: vertical;
  175. font-size: 28rpx;
  176. margin-bottom: 10rpx;
  177. }
  178. .policy-content-item-left-time {
  179. width: 100%;
  180. display: flex;
  181. align-items: center;
  182. .moment {
  183. color: #c1c1c1;
  184. font-size: 20rpx;
  185. margin-right: 20rpx;
  186. }
  187. .maxMony {
  188. font-size: 20rpx;
  189. color: #00bfbf;
  190. border: 1px solid #00bfbf;
  191. padding: 10rpx;
  192. margin-right: 20rpx;
  193. }
  194. .leftDay {
  195. font-size: 20rpx;
  196. background: #f7bbc3;
  197. color: #e32579;
  198. padding: 10rpx;
  199. border: 1px solid #f7bbc3;
  200. }
  201. }
  202. }
  203. .policy-content-item-img {
  204. image {
  205. width: 180rpx;
  206. height: 120rpx;
  207. }
  208. }
  209. }
  210. }
  211. }
  212. }
  213. </style>