index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view class="main">
  3. <!--轮播图-->
  4. <view class="banner">
  5. <u-swiper circular :radius="5" :indicator="true" keyName="pic" :list="bannerList" :height="160" class="uni-swiper" @click="click"></u-swiper>
  6. </view>
  7. <!--菜单-->
  8. <view class="menu">
  9. <view class="cd">
  10. <view class="out">
  11. <view class="int">
  12. <view class="icon" style="background-color: #f44336">&#xe6be;</view>
  13. <view class="title">失业登记</view>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="cd">
  18. <view class="out">
  19. <view class="int">
  20. <view class="icon" style="background-color: #4caf50">&#xe64a;</view>
  21. <view class="title">就业补贴</view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="cd">
  26. <view class="out">
  27. <view class="int">
  28. <view class="icon" style="background-color: #ff9800">&#xe73c;</view>
  29. <view class="title">培训指导</view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="cd">
  34. <view class="out">
  35. <view class="int">
  36. <view class="icon" style="background-color: #607d8b">&#xe998;</view>
  37. <view class="title">法务服务</view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="cd" @click="go('/pages/index/index')">
  42. <view class="out">
  43. <view class="int">
  44. <view class="icon" style="background-color: #03a9f4">&#xe725;</view>
  45. <view class="title">结算广场</view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="cd">
  50. <view class="out">
  51. <view class="int">
  52. <view class="icon" style="background-color: #795548">&#xe6a6;</view>
  53. <view class="title">社保窗口</view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <!--新闻-->
  59. <view class="news">
  60. <view class="gg">
  61. <view class="title">最新资讯</view>
  62. <view class="bor"></view>
  63. <view class="more" @click="go('/pages/news/index?type=新闻资讯')">
  64. <text>更多</text>
  65. <text class="icon">&#xe62b;</text>
  66. </view>
  67. </view>
  68. <view class="item" v-for="(item, index) in newsList" :key="index" @click="go('/pages/news/detail?id=' + item.id)">
  69. <view class="title omit">{{ item.title }}</view>
  70. <view class="date">{{ item.createTime.substring(5, 10) }}</view>
  71. </view>
  72. </view>
  73. <!--横幅-->
  74. <image :src="img.a1" class="hengfu" @click="go('/pages/news/index?type=政策专题')"></image>
  75. <!--图片内容-->
  76. <view class="ad" style="margin-left: -10px; margin-right: -10px">
  77. <view class="item" style="height: 190px">
  78. <view class="out" style="padding-right: 0px" @click="go('/pages/news/index?type=就业政策')">
  79. <view class="int" style="height: 175px; box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2)">
  80. <image :src="img.a2" style="height: 180px; width: 100%"></image>
  81. </view>
  82. </view>
  83. </view>
  84. <view class="item" style="height: 190px">
  85. <view class="out">
  86. <view class="int">
  87. <view class="it" style="height: 80px" @click="go('/pages/news/index?type=人才政策')">
  88. <image :src="img.a3" mode="aspectFill" style="height: 85px; width: 100%"></image>
  89. </view>
  90. <view class="it" style="height: 86px; margin-top: 10px" @click="go('/pages/news/index?type=创业政策')">
  91. <image :src="img.a4" mode="aspectFill" style="height: 83px; width: 100%"></image>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </template>
  99. <script>
  100. export default {
  101. data() {
  102. return {
  103. img: {
  104. a1: 'https://chenglantimes.com/prod-api/profile/upload/2024/06/15/1718439518187.jpg',
  105. a2: 'https://chenglantimes.com/prod-api/profile/upload/2024/05/20/1716197779982.jpg',
  106. a3: 'https://chenglantimes.com/prod-api/profile/upload/2024/05/20/1716195826603.jpg',
  107. a4: 'https://chenglantimes.com/prod-api/profile/upload/2024/05/20/1716198212203.jpg'
  108. },
  109. bannerList: [],
  110. newsList: []
  111. };
  112. },
  113. onLoad() {
  114. this.getData();
  115. },
  116. methods: {
  117. getData() {
  118. this.http.request({
  119. url: '/app/home/index',
  120. success: (res) => {
  121. this.contract = res.data.data.contract;
  122. this.bannerList = res.data.data.bannerList;
  123. this.newsList = res.data.data.newsList;
  124. }
  125. });
  126. },
  127. go(url) {
  128. uni.navigateTo({ url: url });
  129. }
  130. }
  131. };
  132. </script>
  133. <style lang="scss">
  134. .banner {
  135. margin-top: -10px;
  136. }
  137. .news {
  138. margin-top: 10px;
  139. background-color: white;
  140. border-radius: 7px;
  141. overflow: hidden;
  142. padding: 12px;
  143. box-shadow: $box-shadow;
  144. .gg {
  145. font-weight: bold;
  146. margin-bottom: 5px;
  147. border-bottom: 1px solid $line;
  148. padding-bottom: 10px;
  149. color: $font-c;
  150. .title {
  151. margin-left: 10px;
  152. }
  153. .bor {
  154. width: 5px;
  155. height: 12px;
  156. background-color: $main-color;
  157. border-radius: 20px;
  158. float: left;
  159. margin-top: -16px;
  160. }
  161. .more {
  162. float: right;
  163. font-size: 14px;
  164. font-weight: normal;
  165. margin-top: -20px;
  166. }
  167. }
  168. .item {
  169. padding-top: 9px;
  170. font-size: 14px;
  171. overflow: hidden;
  172. .title {
  173. float: left;
  174. width: 80%;
  175. }
  176. .date {
  177. float: right;
  178. }
  179. }
  180. }
  181. .hengfu {
  182. height: 100px;
  183. width: 100%;
  184. border-radius: 7px;
  185. margin-top: 10px;
  186. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2);
  187. }
  188. .ad {
  189. .item {
  190. float: left;
  191. width: 50%;
  192. overflow: hidden;
  193. .out {
  194. padding: 7px 10px 5px 10px;
  195. .int {
  196. overflow: hidden;
  197. border-radius: 7px;
  198. image {
  199. border-radius: 7px;
  200. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2);
  201. }
  202. }
  203. }
  204. }
  205. .it {
  206. overflow: hidden;
  207. border-radius: 7px;
  208. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2);
  209. }
  210. }
  211. </style>