index.vue 5.8 KB

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