index.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. <template>
  2. <view>
  3. <u-navbar back-text="荆州经开区共享用工平台" :customBack="customBack" :background="background"
  4. :back-text-style="backColor"></u-navbar>
  5. <!-- 头部 -->
  6. <view class="top">
  7. <!-- 搜索框 -->
  8. <view class="search">
  9. <u-search placeholder="请输入找工关键字" @focus="gotoUrl('pages/packages/search/search')"
  10. :show-action="false"></u-search>
  11. </view>
  12. </view>
  13. <!-- 幻灯片 -->
  14. <view class="swiper">
  15. <u-swiper :list="bannerlist"></u-swiper>
  16. </view>
  17. <!-- 功能区 -->
  18. <view class="function">
  19. <view class="function-item" @click="gotoUrl('pages/tab/choreInformation/choreInformation')">
  20. <view class="icon-box icon-box3">
  21. <view class="icon">
  22. <img src="@/assets/img/riFill-contacts-book-2-fill@1x.png" alt="">
  23. </view>
  24. </view>
  25. <view class="item-text">
  26. 零工驿站
  27. </view>
  28. </view>
  29. <view class="function-item" @click="gotoUrl('pages/packages/news/news?t=3&title=爱心驿站')">
  30. <view class="icon-box icon-box2">
  31. <view class="icon">
  32. <img src="@/assets/img/riFill-heart-2-fill@1x.png" alt="">
  33. </view>
  34. </view>
  35. <view class="item-text">
  36. 爱心驿站
  37. </view>
  38. </view>
  39. <view class="function-item" @click="gotoUrl('pages/packages/shareEmployment/shareEmployment')">
  40. <view class="icon-box">
  41. <view class="icon">
  42. <img src="@/assets/img/riFill-cloud-fill@1x.png" alt="">
  43. </view>
  44. </view>
  45. <view class="item-text">
  46. 共享用工
  47. </view>
  48. </view>
  49. <view class="function-item" @click="gotoUrl('pages/packages/skillTraining/skillTraining')">
  50. <view class="icon-box icon-box4">
  51. <view class="icon">
  52. <img src="@/assets/img/riFill-tools-fill@1x.png" alt="">
  53. </view>
  54. </view>
  55. <view class="item-text">
  56. 技能培训
  57. </view>
  58. </view>
  59. <view class="function-item" @click="gotoUrl('pages/packages/news/news?t=1&title=政策发布')">
  60. <view class="icon-box icon-box5">
  61. <view class="icon">
  62. <img src="@/assets/img/riFill-newspaper-fill@1x.png" alt="">
  63. </view>
  64. </view>
  65. <view class="item-text">
  66. 政策发布
  67. </view>
  68. </view>
  69. </view>
  70. <!-- 标签 -->
  71. <view class="tabs">
  72. <view class="title">
  73. <u-tabs bg-color="#F0F0F2" :list="tabList" :is-scroll="false" :current="current"
  74. @change="change"></u-tabs>
  75. <view class="more" @click="gotoUrl('pages/tab/jobInformation/jobInformation')">
  76. 更多
  77. <u-icon name="arrow-right"></u-icon>
  78. </view>
  79. </view>
  80. <!-- 卡片 -->
  81. <view class="classify-card">
  82. <view class="item" v-for="(item,i) in showList" :key="i"
  83. @click="gotoUrl('pages/packages/jobInformation/jobDetails?id='+item.id)">
  84. <view class="content-1">
  85. <!-- 职位 -->
  86. <view class="position">
  87. {{item.positionName}}
  88. </view>
  89. <!-- 薪水 -->
  90. <view class="salary">
  91. {{item.salary}}元/{{tabList[item.settlementMethod].unit}}
  92. </view>
  93. </view>
  94. <view class="content-2">
  95. <!-- 标签 -->
  96. <view class="tag">
  97. <!-- <view class="tag-item">
  98. 个人
  99. </view> -->
  100. <view class="tag-item">
  101. {{item.settlementMethodN}}
  102. </view>
  103. </view>
  104. <!-- 日期 -->
  105. <view class="date">
  106. {{item.createTime}}
  107. </view>
  108. </view>
  109. <view class="content-3">
  110. <view class="issuer">
  111. {{item.contacts}}
  112. </view>
  113. <view class="address">
  114. {{item.workArea}}
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. <u-divider style="margin-top: 10px;"
  120. :isnone="showList.length==0" nonetext="没有找到相关内容"
  121. @click="gotoUrl('pages/tab/jobInformation/jobInformation')"
  122. border-color="#CFD2D5">点击查看更多</u-divider>
  123. </view>
  124. <tabbar :current="0"></tabbar>
  125. </view>
  126. </template>
  127. <script>
  128. import * as API from '@/apis/pagejs/main.js'
  129. import tabbar from "@/components/Tabbar.vue"
  130. export default {
  131. components: {
  132. tabbar
  133. },
  134. data() {
  135. return {
  136. keyword: '',
  137. // 导航栏背景
  138. background: {
  139. backgroundColor: '#2795FD',
  140. },
  141. backColor: {
  142. color: '#ffffff'
  143. },
  144. bannerlist: [{
  145. image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
  146. },
  147. {
  148. image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
  149. },
  150. {
  151. image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
  152. }
  153. ],
  154. tabList: [{
  155. name: '最新',
  156. value:"",
  157. list:[],
  158. recordsTotal:0
  159. }, {
  160. name: '日结',
  161. unit:"日",
  162. value:"1",
  163. list:[],
  164. recordsTotal:0
  165. }, {
  166. name: '周结',
  167. unit:"周",
  168. value:"2",
  169. list:[],
  170. recordsTotal:0
  171. }, {
  172. name: '月结',
  173. unit:"月",
  174. value:"3",
  175. list:[],
  176. recordsTotal:0
  177. }],
  178. current: 0,
  179. homeList:[],
  180. }
  181. },
  182. onLoad() {
  183. this.findRecruitHomePage();
  184. this.findByOpenId();
  185. },
  186. computed:{
  187. showRecordsTotal(){
  188. return this.tabList[this.current].recordsTotal
  189. },
  190. showList(){
  191. return this.tabList[this.current].list
  192. }
  193. },
  194. methods: {
  195. findByOpenId(){
  196. API_weixin.findByOpenId({
  197. openId:this.carhelp.getOpenId(),
  198. noerror:true
  199. }).then((res) => {
  200. this.carhelp.setPersonInfo(res.data.regUser );
  201. this.carhelp.setToken(res.data.token);
  202. this.carhelp.setPersonInfoPlus(res.data);
  203. }).catch(error => {
  204. })
  205. },
  206. findRecruitHomePage(){
  207. uni.showLoading({
  208. title: "加载中",
  209. mask: true,
  210. })
  211. API.findRecruitHomePage({
  212. pageIndex:1,
  213. pageSize:5,
  214. type:this.tabList[this.current].value,
  215. }).then((res) => {
  216. uni.hideLoading();
  217. this.tabList[this.current].list=res.data.data
  218. this.tabList[this.current].recordsTotal=res.data.recordsTotal
  219. }).catch(error => {
  220. uni.showToast({
  221. title: error
  222. })
  223. //this.getPhone()
  224. })
  225. },
  226. customBack() {},
  227. change(index) {
  228. this.current = index;
  229. this.findRecruitHomePage()
  230. }
  231. }
  232. }
  233. </script>
  234. <style>
  235. page {
  236. background: #F0F0F2;
  237. padding-bottom: 50px;
  238. }
  239. </style>
  240. <style scoped lang="scss">
  241. /deep/.u-navbar {
  242. .u-icon--right {
  243. display: none !important;
  244. }
  245. }
  246. // 头部
  247. .top {
  248. // 搜索框
  249. .search {
  250. background-color: rgba(39, 149, 253, 1);
  251. padding: 16rpx 32rpx;
  252. }
  253. }
  254. // 功能区
  255. .function {
  256. background-color: #fff;
  257. padding: 32rpx 46rpx;
  258. display: flex;
  259. justify-content: space-between;
  260. .function-item {
  261. display: flex;
  262. flex-direction: column;
  263. justify-content: center;
  264. align-items: center;
  265. .icon-box {
  266. width: 96rpx;
  267. height: 96rpx;
  268. background-color: rgba(240, 233, 255, 1);
  269. text-align: center;
  270. border-radius: 999px;
  271. display: flex;
  272. justify-content: center;
  273. align-items: center;
  274. }
  275. .icon-box2 {
  276. background-color: rgba(255, 234, 230, 1);
  277. }
  278. .icon-box3 {
  279. background-color: rgba(227, 246, 255, 1);
  280. }
  281. .icon-box4 {
  282. background-color: rgba(255, 242, 224, 1);
  283. }
  284. .icon-box5 {
  285. background-color: rgba(221, 247, 238, 1);
  286. }
  287. .icon {
  288. width: 48rpx;
  289. height: 48rpx;
  290. img {
  291. width: 100%;
  292. height: 100%;
  293. }
  294. }
  295. .item-text {
  296. color: rgba(51, 51, 51, 1);
  297. margin-top: 8rpx;
  298. font-family: 'PingFang Medium';
  299. }
  300. }
  301. }
  302. // 标签
  303. .tabs {
  304. margin-top: 32rpx;
  305. .title {
  306. display: flex;
  307. justify-content: space-between;
  308. align-items: center;
  309. padding: 0rpx 24rpx;
  310. /deep/.u-tabs {
  311. width: 400rpx;
  312. }
  313. .more {
  314. color: rgba(119, 119, 119, 1);
  315. }
  316. }
  317. .classify-card {
  318. background-color: #fff;
  319. .item {
  320. padding: 24rpx 0;
  321. margin: 0 32rpx;
  322. border-bottom: 1px solid #F0F0F2;
  323. .content-1 {
  324. display: flex;
  325. justify-content: space-between;
  326. align-items: center;
  327. // 职位
  328. .position {
  329. color: rgba(16, 16, 16, 1);
  330. font-size: 36rpx;
  331. font-family: 'PingFang Medium';
  332. }
  333. // 薪水
  334. .salary {
  335. color: rgba(255, 61, 0, 1);
  336. font-size: 32rpx;
  337. font-family: 'PingFang Medium';
  338. }
  339. }
  340. .content-2 {
  341. margin-top: 12rpx;
  342. display: flex;
  343. justify-content: space-between;
  344. // 标签
  345. .tag {
  346. display: flex;
  347. .tag-item {
  348. width: 64rpx;
  349. height: 36rpx;
  350. line-height: 36rpx;
  351. border-radius: 8rpx;
  352. background-color: rgba(241, 241, 247, 1);
  353. color: rgba(129, 127, 153, 1);
  354. font-size: 24rpx;
  355. text-align: center;
  356. margin-right: 12rpx;
  357. }
  358. }
  359. // 日期
  360. .date {
  361. color: rgba(153, 153, 153, 1);
  362. font-size: 24rpx;
  363. }
  364. }
  365. .content-3 {
  366. margin-top: 20rpx;
  367. display: flex;
  368. justify-content: space-between;
  369. align-items: center;
  370. .issuer {
  371. color: rgba(51, 51, 51, 1);
  372. font-size: 24rpx;
  373. }
  374. .address {
  375. color: rgba(51, 51, 51, 1);
  376. font-size: 24rpx;
  377. }
  378. }
  379. }
  380. }
  381. }
  382. </style>