index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  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. <b>{{item.positionName}}</b>
  88. </view>
  89. <!-- 薪水 -->
  90. <view class="salary">
  91. {{item.salary}}元/天
  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}}{{item.address}}
  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. import * as API_weixin from '@/apis/weixin.js'
  131. export default {
  132. components: {
  133. tabbar
  134. },
  135. data() {
  136. return {
  137. keyword: '',
  138. // 导航栏背景
  139. background: {
  140. backgroundColor: '#2795FD',
  141. },
  142. backColor: {
  143. color: '#ffffff'
  144. },
  145. bannerlist: [{
  146. image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
  147. },
  148. {
  149. image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
  150. },
  151. {
  152. image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
  153. }
  154. ],
  155. tabList: [{
  156. name: '最新',
  157. value:"",
  158. list:[],
  159. recordsTotal:0
  160. }, {
  161. name: '日结',
  162. unit:"日",
  163. value:"1",
  164. list:[],
  165. recordsTotal:0
  166. }, {
  167. name: '周结',
  168. unit:"周",
  169. value:"2",
  170. list:[],
  171. recordsTotal:0
  172. }, {
  173. name: '月结',
  174. unit:"月",
  175. value:"3",
  176. list:[],
  177. recordsTotal:0
  178. }],
  179. current: 0,
  180. homeList:[],
  181. }
  182. },
  183. onLoad(op) {
  184. if(op.shareMP){
  185. if(op.t=='jobDetails'){
  186. uni.navigateTo({
  187. url:"/pages/packages/jobInformation/jobDetails?id="+op.id
  188. })
  189. }
  190. }
  191. this.findRecruitHomePage();
  192. this.findByOpenId();
  193. },
  194. computed:{
  195. showRecordsTotal(){
  196. return this.tabList[this.current].recordsTotal
  197. },
  198. showList(){
  199. return this.tabList[this.current].list
  200. }
  201. },
  202. methods: {
  203. findByOpenId(){
  204. API_weixin.findByOpenId({
  205. openId:this.carhelp.getOpenId(),
  206. noerror:true
  207. }).then((res) => {
  208. this.carhelp.setPersonInfo(res.data.regUser );
  209. this.carhelp.setToken(res.data.token);
  210. this.carhelp.setPersonInfoPlus(res.data);
  211. }).catch(error => {
  212. })
  213. },
  214. findRecruitHomePage(){
  215. uni.showLoading({
  216. title: "加载中",
  217. mask: true,
  218. })
  219. API.findRecruitHomePage({
  220. pageIndex:1,
  221. pageSize:5,
  222. type:this.tabList[this.current].value,
  223. }).then((res) => {
  224. uni.hideLoading();
  225. this.tabList[this.current].list=res.data.data
  226. this.tabList[this.current].recordsTotal=res.data.recordsTotal
  227. }).catch(error => {
  228. uni.showToast({
  229. title: error
  230. })
  231. //this.getPhone()
  232. })
  233. },
  234. customBack() {},
  235. change(index) {
  236. this.current = index;
  237. this.findRecruitHomePage()
  238. }
  239. }
  240. }
  241. </script>
  242. <style>
  243. page {
  244. background: #F0F0F2;
  245. padding-bottom: 50px;
  246. }
  247. </style>
  248. <style scoped lang="scss">
  249. /deep/.u-navbar {
  250. .u-icon--right {
  251. display: none !important;
  252. }
  253. }
  254. // 头部
  255. .top {
  256. // 搜索框
  257. .search {
  258. background-color: rgba(39, 149, 253, 1);
  259. padding: 16rpx 32rpx;
  260. }
  261. }
  262. // 功能区
  263. .function {
  264. background-color: #fff;
  265. padding: 32rpx 46rpx;
  266. display: flex;
  267. justify-content: space-between;
  268. .function-item {
  269. display: flex;
  270. flex-direction: column;
  271. justify-content: center;
  272. align-items: center;
  273. .icon-box {
  274. width: 96rpx;
  275. height: 96rpx;
  276. background-color: rgba(240, 233, 255, 1);
  277. text-align: center;
  278. border-radius: 999px;
  279. display: flex;
  280. justify-content: center;
  281. align-items: center;
  282. }
  283. .icon-box2 {
  284. background-color: rgba(255, 234, 230, 1);
  285. }
  286. .icon-box3 {
  287. background-color: rgba(227, 246, 255, 1);
  288. }
  289. .icon-box4 {
  290. background-color: rgba(255, 242, 224, 1);
  291. }
  292. .icon-box5 {
  293. background-color: rgba(221, 247, 238, 1);
  294. }
  295. .icon {
  296. width: 48rpx;
  297. height: 48rpx;
  298. img {
  299. width: 100%;
  300. height: 100%;
  301. }
  302. }
  303. .item-text {
  304. color: rgba(51, 51, 51, 1);
  305. margin-top: 8rpx;
  306. font-family: 'PingFang Medium';
  307. }
  308. }
  309. }
  310. // 标签
  311. .tabs {
  312. margin-top: 32rpx;
  313. .title {
  314. display: flex;
  315. justify-content: space-between;
  316. align-items: center;
  317. padding: 0rpx 24rpx;
  318. /deep/.u-tabs {
  319. width: 400rpx;
  320. }
  321. .more {
  322. color: rgba(119, 119, 119, 1);
  323. }
  324. }
  325. .classify-card {
  326. background-color: #fff;
  327. .item {
  328. padding: 24rpx 0;
  329. margin: 0 32rpx;
  330. border-bottom: 1px solid #F0F0F2;
  331. .content-1 {
  332. display: flex;
  333. justify-content: space-between;
  334. align-items: center;
  335. // 职位
  336. .position {
  337. color: rgba(16, 16, 16, 1);
  338. font-size: 36rpx;
  339. font-family: 'PingFang Medium';
  340. }
  341. // 薪水
  342. .salary {
  343. color: rgba(255, 61, 0, 1);
  344. font-size: 32rpx;
  345. font-family: 'PingFang Medium';
  346. }
  347. }
  348. .content-2 {
  349. margin-top: 12rpx;
  350. display: flex;
  351. justify-content: space-between;
  352. // 标签
  353. .tag {
  354. display: flex;
  355. .tag-item {
  356. width: 64rpx;
  357. height: 36rpx;
  358. line-height: 36rpx;
  359. border-radius: 8rpx;
  360. background-color: rgba(241, 241, 247, 1);
  361. color: rgba(129, 127, 153, 1);
  362. font-size: 24rpx;
  363. text-align: center;
  364. margin-right: 12rpx;
  365. }
  366. }
  367. // 日期
  368. .date {
  369. color: rgba(153, 153, 153, 1);
  370. font-size: 24rpx;
  371. }
  372. }
  373. .content-3 {
  374. margin-top: 20rpx;
  375. display: flex;
  376. justify-content: space-between;
  377. align-items: center;
  378. .issuer {
  379. color: rgba(51, 51, 51, 1);
  380. font-size: 24rpx;
  381. }
  382. .address {
  383. color: rgba(51, 51, 51, 1);
  384. font-size: 24rpx;
  385. }
  386. }
  387. }
  388. }
  389. }
  390. </style>