index.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  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="bannerClick"></u-swiper>
  6. </view>
  7. <!--通知公告-->
  8. <view class="notice">
  9. <u-notice-bar color="#545555" :text="noticeList" :step="true" direction="column" mode="link" bgColor="white" speed="300" url="/pages/notice/index"></u-notice-bar>
  10. </view>
  11. <!--菜单-->
  12. <view class="menu">
  13. <view class="cd" @click="url('就业失业登记')">
  14. <view class="out">
  15. <view class="int">
  16. <view class="icon" style="background-color: #f44336">&#xe648;</view>
  17. <view class="title">就业失业登记</view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="cd" @click="url('就业创业补贴')">
  22. <view class="out">
  23. <view class="int">
  24. <view class="icon" style="background-color: #4caf50">&#xe64a;</view>
  25. <view class="title">就业创业补贴</view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="cd" @click="url('法务服务')">
  30. <view class="out">
  31. <view class="int">
  32. <view class="icon" style="background-color: #607d8b">&#xe998;</view>
  33. <view class="title">法务服务</view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="cd" @click="url('社保窗口')">
  38. <view class="out">
  39. <view class="int">
  40. <view class="icon" style="background-color: #795548">&#xe6a6;</view>
  41. <view class="title">社保窗口</view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="cd" @click="go('/pages/job/map')">
  46. <view class="out">
  47. <view class="int">
  48. <view class="icon" style="background-color: #f44336">&#xe647;</view>
  49. <view class="title">地图找工</view>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="cd" @click="go('/pages/job/list?type=0')">
  54. <view class="out">
  55. <view class="int">
  56. <view class="icon" style="background-color: #4581fb">&#xe9d9;</view>
  57. <view class="title">全职</view>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="cd" @click="go('/pages/job/list?type=1')">
  62. <view class="out">
  63. <view class="int">
  64. <view class="icon" style="background-color: #ff5722">&#xe62a;</view>
  65. <view class="title">兼职</view>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="cd" @click="go('/pages/job/enterprise/card')">
  70. <view class="out">
  71. <view class="int">
  72. <view class="icon" style="background-color: #ff9800">&#xe725;</view>
  73. <view class="title">企业卡片</view>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="cd" @click="go('/pages/statement/index/index')">
  78. <view class="out">
  79. <view class="int">
  80. <view class="icon" style="background-color: #03a9f4">&#xe63c;</view>
  81. <view class="title">结算广场</view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <!--新闻-->
  87. <view class="news">
  88. <view class="gg">
  89. <view class="title">最新资讯</view>
  90. <view class="bor"></view>
  91. <view class="more" @click="go('/pages/news/index?type=新闻资讯')">
  92. <text>更多</text>
  93. <text class="icon">&#xe62b;</text>
  94. </view>
  95. </view>
  96. <view class="bhe" :style="{ height: expand ? 'auto' : '60px' }">
  97. <view class="item" v-for="(item, index) in newsList" :key="index" @click="go('/pages/news/detail?id=' + item.id)">
  98. <view class="title omit">{{ item.title }}</view>
  99. <view class="date">{{ item.createTime.substring(5, 10) }}</view>
  100. </view>
  101. </view>
  102. <view class="expand" @click="expand = !expand">
  103. <text class="icon" v-if="expand">&#xe61c;</text>
  104. <text class="icon" v-else>&#xe617;</text>
  105. <text>{{ expand ? '收起' : '展开' }}</text>
  106. </view>
  107. </view>
  108. <!--横幅-->
  109. <image :src="img.a1" class="hengfu" @click="go('/pages/news/index?type=政策专题')"></image>
  110. <!--图片内容-->
  111. <view class="ad" style="margin-left: -10px; margin-right: -10px">
  112. <view class="item" style="height: 190px">
  113. <view class="out" style="padding-right: 0px" @click="go('/pages/news/index?type=就业政策')">
  114. <view class="int" style="height: 175px; box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2)">
  115. <image :src="img.a2" style="height: 180px; width: 100%"></image>
  116. </view>
  117. </view>
  118. </view>
  119. <view class="item" style="height: 190px">
  120. <view class="out">
  121. <view class="int">
  122. <view class="it" style="height: 80px" @click="go('/pages/news/index?type=人才政策')">
  123. <image :src="img.a3" mode="aspectFill" style="height: 85px; width: 100%"></image>
  124. </view>
  125. <view class="it" style="height: 86px; margin-top: 10px" @click="go('/pages/news/index?type=创业政策')">
  126. <image :src="img.a4" mode="aspectFill" style="height: 83px; width: 100%"></image>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. <u-action-sheet :title="title" round="20" :actions="urls" @select="selectClick" cancelText="取消" :show="show" @close="show = false"></u-action-sheet>
  133. </view>
  134. </template>
  135. <script>
  136. export default {
  137. data() {
  138. return {
  139. title: '就业失业登记',
  140. urls: [],
  141. img: {
  142. a1: 'https://chenglantimes.com/prod-api/profile/upload/2024/06/15/1718439518187.jpg',
  143. a2: 'https://chenglantimes.com/prod-api/profile/upload/2024/05/20/1716197779982.jpg',
  144. a3: 'https://chenglantimes.com/prod-api/profile/upload/2024/05/20/1716195826603.jpg',
  145. a4: 'https://chenglantimes.com/prod-api/profile/upload/2024/05/20/1716198212203.jpg'
  146. },
  147. bannerList: [],
  148. noticeList: [],
  149. newsList: [],
  150. expand: false,
  151. show: false
  152. };
  153. },
  154. onLoad() {
  155. this.getData();
  156. },
  157. methods: {
  158. getData() {
  159. //轮播图
  160. this.http.request({
  161. url: '/app/home/banner/1',
  162. success: (res) => {
  163. this.bannerList = res.data.data;
  164. }
  165. });
  166. //通知公告
  167. this.http.request({
  168. url: '/app/home/notice/小程序通知',
  169. success: (res) => {
  170. res.data.data.forEach((item) => {
  171. this.noticeList.push(item.title);
  172. });
  173. }
  174. });
  175. //资讯
  176. this.http.request({
  177. url: '/app/home/news',
  178. success: (res) => {
  179. this.newsList = res.data.data;
  180. }
  181. });
  182. },
  183. url(title) {
  184. this.title = title;
  185. this.show = true;
  186. if (title == '就业失业登记') {
  187. this.urls = [
  188. { name: '就业登记', url: 'https://chenglantimes.com/a1' },
  189. { name: '失业登记', url: 'https://chenglantimes.com/a2' }
  190. ];
  191. }
  192. if (title == '就业创业补贴') {
  193. this.urls = [
  194. { name: '返乡入乡创业人员一次性创业扶持补贴', url: 'https://chenglantimes.com/a3' },
  195. { name: '困难人员灵活就业社保补贴', url: 'https://chenglantimes.com/a4' },
  196. { name: '毕业生灵活就业社保补贴', url: 'https://chenglantimes.com/a5' },
  197. { name: '一次性创业扶持补贴', url: 'https://chenglantimes.com/a6' },
  198. { name: '高校毕业生求职创业补贴', url: 'https://chenglantimes.com/a7' }
  199. ];
  200. }
  201. if (title == '法务服务') {
  202. this.urls = [
  203. { name: '劳动维权申请', url: 'https://chenglantimes.com/4a1' },
  204. { name: '劳动监察投诉', url: 'https://chenglantimes.com/4a2' },
  205. { name: '劳动监察举报', url: 'https://chenglantimes.com/4a3' },
  206. { name: '劳动监察登记查询', url: 'https://chenglantimes.com/4a4' },
  207. { name: '劳动人事仲裁申请', url: 'https://chenglantimes.com/4a5' },
  208. { name: '劳动人事调解申请', url: 'https://chenglantimes.com/4a6' }
  209. ];
  210. }
  211. if (title == '社保窗口') {
  212. this.urls = [
  213. { name: '养老保险待遇发放账户维护申请', url: 'https://chenglantimes.com/6a1' },
  214. { name: '转移查询', url: 'https://chenglantimes.com/6a2' },
  215. { name: '养老待遇发放查询', url: 'https://chenglantimes.com/6a3' }
  216. ];
  217. }
  218. },
  219. selectClick(e) {
  220. uni.navigateTo({
  221. url: '/pages/other/webview?src=' + e.url
  222. });
  223. },
  224. //点击轮播图
  225. bannerClick(index) {
  226. let item = this.bannerList[index];
  227. if (item.contentType == '新闻资讯') {
  228. uni.navigateTo({ url: '/pages/news/detail?id=' + item.contentId });
  229. }
  230. if (item.contentType == '通知公告') {
  231. uni.navigateTo({ url: '/pages/notice/detail?id=' + item.contentId });
  232. }
  233. if (item.contentType == '工作职位') {
  234. uni.navigateTo({ url: '/pages/job/detail?id=' + item.contentId });
  235. }
  236. },
  237. go(url) {
  238. uni.navigateTo({ url: url });
  239. }
  240. }
  241. };
  242. </script>
  243. <style lang="scss">
  244. .banner {
  245. margin-top: -10px;
  246. }
  247. .notice {
  248. margin-top: 10px;
  249. border-radius: 5px;
  250. overflow: hidden;
  251. box-shadow: $box-shadow;
  252. }
  253. .news {
  254. margin-top: 10px;
  255. background-color: white;
  256. border-radius: 7px;
  257. overflow: hidden;
  258. padding: 12px;
  259. box-shadow: $box-shadow;
  260. .gg {
  261. font-weight: bold;
  262. margin-bottom: 5px;
  263. border-bottom: 1px solid $line;
  264. padding-bottom: 10px;
  265. color: $font-c;
  266. .title {
  267. margin-left: 10px;
  268. }
  269. .bor {
  270. width: 5px;
  271. height: 12px;
  272. background-color: $main-color;
  273. border-radius: 20px;
  274. float: left;
  275. margin-top: -16px;
  276. }
  277. .more {
  278. float: right;
  279. font-size: 14px;
  280. font-weight: normal;
  281. margin-top: -20px;
  282. }
  283. }
  284. .bhe {
  285. height: 60px;
  286. overflow: hidden;
  287. .item {
  288. padding-top: 9px;
  289. font-size: 15px;
  290. overflow: hidden;
  291. .title {
  292. float: left;
  293. width: 80%;
  294. }
  295. .date {
  296. float: right;
  297. }
  298. }
  299. }
  300. .expand {
  301. text-align: center;
  302. font-size: 15px;
  303. color: $font-c;
  304. padding-top: 10px;
  305. .icon {
  306. padding-right: 3px;
  307. }
  308. }
  309. }
  310. .hengfu {
  311. height: 100px;
  312. width: 100%;
  313. border-radius: 7px;
  314. margin-top: 10px;
  315. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2);
  316. }
  317. .ad {
  318. .item {
  319. float: left;
  320. width: 50%;
  321. overflow: hidden;
  322. .out {
  323. padding: 7px 10px 5px 10px;
  324. .int {
  325. overflow: hidden;
  326. border-radius: 7px;
  327. image {
  328. border-radius: 7px;
  329. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2);
  330. }
  331. }
  332. }
  333. }
  334. .it {
  335. overflow: hidden;
  336. border-radius: 7px;
  337. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2);
  338. }
  339. }
  340. </style>