index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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">&#xe648;</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">
  42. <view class="out">
  43. <view class="int">
  44. <view class="icon" style="background-color: #795548">&#xe6a6;</view>
  45. <view class="title">社保窗口</view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="cd" @click="go('/pages/job/map')">
  50. <view class="out">
  51. <view class="int">
  52. <view class="icon" style="background-color: #f44336">&#xe647;</view>
  53. <view class="title">地图找工</view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="cd" @click="go('/pages/job/list?type=0')">
  58. <view class="out">
  59. <view class="int">
  60. <view class="icon" style="background-color: #4581fb">&#xe9d9;</view>
  61. <view class="title">全职</view>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="cd" @click="go('/pages/job/list?type=1')">
  66. <view class="out">
  67. <view class="int">
  68. <view class="icon" style="background-color: #ff5722">&#xe62a;</view>
  69. <view class="title">兼职</view>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="cd" @click="go('/pages/job/enterprise/card')">
  74. <view class="out">
  75. <view class="int">
  76. <view class="icon" style="background-color: #ff9800">&#xe725;</view>
  77. <view class="title">企业卡片</view>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="cd" @click="go('/pages/statement/index/index')">
  82. <view class="out">
  83. <view class="int">
  84. <view class="icon" style="background-color: #03a9f4">&#xe63c;</view>
  85. <view class="title">结算广场</view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <!--通知公告-->
  91. <!--新闻-->
  92. <view class="news">
  93. <view class="gg">
  94. <view class="title">通知公告</view>
  95. <view class="bor"></view>
  96. <view class="more" @click="go('/pages/notice/index')">
  97. <text>更多</text>
  98. <text class="icon">&#xe62b;</text>
  99. </view>
  100. </view>
  101. <view class="bhe">
  102. <view class="item" v-for="(item, index) in noticeList" :key="index" @click="go('/pages/news/detail?id=' + item.id)">
  103. <view class="title omit">{{ item.title }}</view>
  104. <view class="date">{{ item.createTime.substring(5, 10) }}</view>
  105. </view>
  106. </view>
  107. </view>
  108. <!--新闻-->
  109. <view class="news">
  110. <view class="gg">
  111. <view class="title">最新资讯</view>
  112. <view class="bor"></view>
  113. <view class="more" @click="go('/pages/news/index?type=新闻资讯')">
  114. <text>更多</text>
  115. <text class="icon">&#xe62b;</text>
  116. </view>
  117. </view>
  118. <view class="bhe" :style="{ height: expand ? 'auto' : '60px' }">
  119. <view class="item" v-for="(item, index) in newsList" :key="index" @click="go('/pages/news/detail?id=' + item.id)">
  120. <view class="title omit">{{ item.title }}</view>
  121. <view class="date">{{ item.createTime.substring(5, 10) }}</view>
  122. </view>
  123. </view>
  124. <view class="expand" @click="expand = !expand">
  125. <text class="icon" v-if="expand">&#xe61c;</text>
  126. <text class="icon" v-else>&#xe617;</text>
  127. <text>{{ expand ? '收起' : '展开' }}</text>
  128. </view>
  129. </view>
  130. <!--横幅-->
  131. <image :src="img.a1" class="hengfu" @click="go('/pages/news/index?type=政策专题')"></image>
  132. <!--图片内容-->
  133. <view class="ad" style="margin-left: -10px; margin-right: -10px">
  134. <view class="item" style="height: 190px">
  135. <view class="out" style="padding-right: 0px" @click="go('/pages/news/index?type=就业政策')">
  136. <view class="int" style="height: 175px; box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2)">
  137. <image :src="img.a2" style="height: 180px; width: 100%"></image>
  138. </view>
  139. </view>
  140. </view>
  141. <view class="item" style="height: 190px">
  142. <view class="out">
  143. <view class="int">
  144. <view class="it" style="height: 80px" @click="go('/pages/news/index?type=人才政策')">
  145. <image :src="img.a3" mode="aspectFill" style="height: 85px; width: 100%"></image>
  146. </view>
  147. <view class="it" style="height: 86px; margin-top: 10px" @click="go('/pages/news/index?type=创业政策')">
  148. <image :src="img.a4" mode="aspectFill" style="height: 83px; width: 100%"></image>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. </view>
  154. </view>
  155. </template>
  156. <script>
  157. export default {
  158. data() {
  159. return {
  160. img: {
  161. a1: 'https://chenglantimes.com/prod-api/profile/upload/2024/06/15/1718439518187.jpg',
  162. a2: 'https://chenglantimes.com/prod-api/profile/upload/2024/05/20/1716197779982.jpg',
  163. a3: 'https://chenglantimes.com/prod-api/profile/upload/2024/05/20/1716195826603.jpg',
  164. a4: 'https://chenglantimes.com/prod-api/profile/upload/2024/05/20/1716198212203.jpg'
  165. },
  166. bannerList: [],
  167. noticeList: [],
  168. newsList: [],
  169. expand: false
  170. };
  171. },
  172. onLoad() {
  173. this.getData();
  174. },
  175. methods: {
  176. getData() {
  177. //轮播图
  178. this.http.request({
  179. url: '/app/home/banner/1',
  180. success: (res) => {
  181. this.bannerList = res.data.data;
  182. }
  183. });
  184. //通知公告
  185. this.http.request({
  186. url: '/app/home/notice/小程序通知',
  187. success: (res) => {
  188. this.noticeList = res.data.data;
  189. }
  190. });
  191. //资讯
  192. this.http.request({
  193. url: '/app/home/news',
  194. success: (res) => {
  195. this.newsList = res.data.data;
  196. }
  197. });
  198. },
  199. go(url) {
  200. uni.navigateTo({ url: url });
  201. }
  202. }
  203. };
  204. </script>
  205. <style lang="scss">
  206. .banner {
  207. margin-top: -10px;
  208. }
  209. .notice {
  210. border-radius: 5px;
  211. margin-top: 10px;
  212. }
  213. .news {
  214. margin-top: 10px;
  215. background-color: white;
  216. border-radius: 7px;
  217. overflow: hidden;
  218. padding: 12px;
  219. box-shadow: $box-shadow;
  220. .gg {
  221. font-weight: bold;
  222. margin-bottom: 5px;
  223. border-bottom: 1px solid $line;
  224. padding-bottom: 10px;
  225. color: $font-c;
  226. .title {
  227. margin-left: 10px;
  228. }
  229. .bor {
  230. width: 5px;
  231. height: 12px;
  232. background-color: $main-color;
  233. border-radius: 20px;
  234. float: left;
  235. margin-top: -16px;
  236. }
  237. .more {
  238. float: right;
  239. font-size: 14px;
  240. font-weight: normal;
  241. margin-top: -20px;
  242. }
  243. }
  244. .bhe {
  245. height: 60px;
  246. overflow: hidden;
  247. .item {
  248. padding-top: 9px;
  249. font-size: 15px;
  250. overflow: hidden;
  251. .title {
  252. float: left;
  253. width: 80%;
  254. }
  255. .date {
  256. float: right;
  257. }
  258. }
  259. }
  260. .expand {
  261. text-align: center;
  262. font-size: 15px;
  263. color: $font-c;
  264. padding-top: 10px;
  265. .icon {
  266. padding-right: 3px;
  267. }
  268. }
  269. }
  270. .hengfu {
  271. height: 100px;
  272. width: 100%;
  273. border-radius: 7px;
  274. margin-top: 10px;
  275. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2);
  276. }
  277. .ad {
  278. .item {
  279. float: left;
  280. width: 50%;
  281. overflow: hidden;
  282. .out {
  283. padding: 7px 10px 5px 10px;
  284. .int {
  285. overflow: hidden;
  286. border-radius: 7px;
  287. image {
  288. border-radius: 7px;
  289. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2);
  290. }
  291. }
  292. }
  293. }
  294. .it {
  295. overflow: hidden;
  296. border-radius: 7px;
  297. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2);
  298. }
  299. }
  300. </style>