index.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  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?type=1')"
  10. :show-action="false"></u-search>
  11. </view>
  12. </view>
  13. <!-- 幻灯片 -->
  14. <view class="swiper">
  15. <u-swiper :list="bannerlist" @click="clickBanner" ></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}}元/天
  92. </view>
  93. </view>
  94. <view class="content-2">
  95. <!-- 标签 -->
  96. <view class="tag">
  97. <view class="tag-item">
  98. {{item.workArea}}
  99. </view>
  100. <view class="tag-item">
  101. {{item.settlementMethodN}}
  102. </view>
  103. <view class="tag-item">
  104. {{item.industryN}}
  105. </view>
  106. </view>
  107. <!-- 日期 -->
  108. <view class="date">
  109. {{getTime(item)}}
  110. </view>
  111. </view>
  112. <view class="content-3">
  113. <view class="issuer">
  114. {{item.contacts}}
  115. </view>
  116. <view class="address">
  117. {{item.address}}
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. <u-divider style="margin-top: 10px;"
  123. :isnone="showList.length==0" nonetext="没有找到相关内容"
  124. @click="gotoUrl('pages/tab/jobInformation/jobInformation')"
  125. border-color="#CFD2D5">点击查看更多</u-divider>
  126. </view>
  127. <tabbar :current="0"></tabbar>
  128. </view>
  129. </template>
  130. <script>
  131. import * as API from '@/apis/pagejs/main.js'
  132. import tabbar from "@/components/Tabbar.vue"
  133. import * as API_weixin from '@/apis/weixin.js'
  134. export default {
  135. components: {
  136. tabbar
  137. },
  138. data() {
  139. return {
  140. keyword: '',
  141. // 导航栏背景
  142. background: {
  143. backgroundColor: '#2795FD',
  144. },
  145. backColor: {
  146. color: '#ffffff'
  147. },
  148. bannerlist: [
  149. ],
  150. tabList: [{
  151. name: '最新',
  152. value:"",
  153. list:[],
  154. recordsTotal:0
  155. }, {
  156. name: '日结',
  157. unit:"日",
  158. value:"1",
  159. list:[],
  160. recordsTotal:0
  161. }, {
  162. name: '周结',
  163. unit:"周",
  164. value:"2",
  165. list:[],
  166. recordsTotal:0
  167. }, {
  168. name: '月结',
  169. unit:"月",
  170. value:"3",
  171. list:[],
  172. recordsTotal:0
  173. }],
  174. current: 0,
  175. homeList:[],
  176. }
  177. },
  178. onLoad(op) {
  179. this.findRecruitHomePage();
  180. this.getBannerList()
  181. this.findByOpenId(op);
  182. },
  183. computed:{
  184. showRecordsTotal(){
  185. return this.tabList[this.current].recordsTotal
  186. },
  187. showList(){
  188. return this.tabList[this.current].list
  189. }
  190. },
  191. methods: {
  192. clickBanner(index,list) {
  193. var mod = list[index]
  194. if(mod){
  195. if(mod.linkUrl){
  196. uni.navigateTo({
  197. url:mod.linkUrl
  198. })
  199. }
  200. }
  201. },
  202. getBannerList(){
  203. API.bannerList({
  204. }).then((res) => {
  205. this.bannerlist =res.data.data.map(item=>{
  206. return {
  207. image:item.picUrl,
  208. linkUrl:item.linkUrl
  209. }
  210. })
  211. }).catch(error => {
  212. })
  213. },
  214. findByOpenId(op){
  215. API_weixin.findByOpenId({
  216. openId:this.carhelp.getOpenId(),
  217. noerror:true
  218. }).then((res) => {
  219. this.carhelp.setPersonInfo(res.data.regUser );
  220. this.carhelp.setToken(res.data.token);
  221. this.carhelp.setPersonInfoPlus(res.data);
  222. if(op.shareMP){
  223. if(op.t=='jobDetails'){
  224. uni.navigateTo({
  225. url:"/pages/packages/jobInformation/jobDetails?id="+op.id
  226. })
  227. }
  228. if(op.t=='jobSearchDetails'){
  229. uni.navigateTo({
  230. url:"/pages/packages/choreInformation/jobSearchDetails?id="+op.id
  231. })
  232. }
  233. }
  234. }).catch(error => {
  235. this.carhelp.logoff();
  236. })
  237. },
  238. findRecruitHomePage(){
  239. uni.showLoading({
  240. title: "加载中",
  241. mask: true,
  242. })
  243. API.findRecruitHomePage({
  244. pageIndex:1,
  245. pageSize:5,
  246. type:this.tabList[this.current].value,
  247. }).then((res) => {
  248. uni.hideLoading();
  249. this.tabList[this.current].list=res.data.data
  250. this.tabList[this.current].recordsTotal=res.data.recordsTotal
  251. }).catch(error => {
  252. uni.showToast({icon: 'none',
  253. title: error
  254. })
  255. //this.getPhone()
  256. })
  257. },
  258. customBack() {},
  259. change(index) {
  260. this.current = index;
  261. this.findRecruitHomePage()
  262. }
  263. }
  264. }
  265. </script>
  266. <style>
  267. page {
  268. background: #F0F0F2;
  269. padding-bottom: 50px;
  270. }
  271. </style>
  272. <style scoped lang="scss">
  273. /deep/.u-navbar {
  274. .u-icon--right {
  275. display: none !important;
  276. }
  277. }
  278. // 头部
  279. .top {
  280. // 搜索框
  281. .search {
  282. background-color: rgba(39, 149, 253, 1);
  283. padding: 16rpx 32rpx;
  284. }
  285. }
  286. // 功能区
  287. .function {
  288. background-color: #fff;
  289. padding: 32rpx 46rpx;
  290. display: flex;
  291. justify-content: space-between;
  292. .function-item {
  293. display: flex;
  294. flex-direction: column;
  295. justify-content: center;
  296. align-items: center;
  297. .icon-box {
  298. width: 96rpx;
  299. height: 96rpx;
  300. background-color: rgba(240, 233, 255, 1);
  301. text-align: center;
  302. border-radius: 999px;
  303. display: flex;
  304. justify-content: center;
  305. align-items: center;
  306. }
  307. .icon-box2 {
  308. background-color: rgba(255, 234, 230, 1);
  309. }
  310. .icon-box3 {
  311. background-color: rgba(227, 246, 255, 1);
  312. }
  313. .icon-box4 {
  314. background-color: rgba(255, 242, 224, 1);
  315. }
  316. .icon-box5 {
  317. background-color: rgba(221, 247, 238, 1);
  318. }
  319. .icon {
  320. width: 48rpx;
  321. height: 48rpx;
  322. img {
  323. width: 100%;
  324. height: 100%;
  325. }
  326. }
  327. .item-text {
  328. color: rgba(51, 51, 51, 1);
  329. margin-top: 8rpx;
  330. font-family: 'PingFang Medium';
  331. }
  332. }
  333. }
  334. // 标签
  335. .tabs {
  336. margin-top: 32rpx;
  337. .title {
  338. display: flex;
  339. justify-content: space-between;
  340. align-items: center;
  341. padding: 0rpx 24rpx;
  342. /deep/.u-tabs {
  343. width: 400rpx;
  344. }
  345. .more {
  346. color: rgba(119, 119, 119, 1);
  347. }
  348. }
  349. .classify-card {
  350. background-color: #fff;
  351. .item {
  352. padding: 24rpx 0;
  353. margin: 0 32rpx;
  354. border-bottom: 1px solid #F0F0F2;
  355. .content-1 {
  356. display: flex;
  357. justify-content: space-between;
  358. align-items: center;
  359. // 职位
  360. .position {
  361. color: rgba(16, 16, 16, 1);
  362. font-size: 36rpx;
  363. font-family: 'PingFang Medium';
  364. }
  365. // 薪水
  366. .salary {
  367. color: rgba(255, 61, 0, 1);
  368. font-size: 32rpx;
  369. font-family: 'PingFang Medium';
  370. }
  371. }
  372. .content-2 {
  373. margin-top: 12rpx;
  374. display: flex;
  375. justify-content: space-between;
  376. // 标签
  377. .tag {
  378. display: flex;
  379. .tag-item {
  380. min-width: 64rpx;
  381. height: 36rpx;
  382. line-height: 36rpx;
  383. border-radius: 8rpx;
  384. background-color: rgba(241, 241, 247, 1);
  385. color: rgba(129, 127, 153, 1);
  386. font-size: 24rpx;
  387. text-align: center;
  388. margin-right: 12rpx;
  389. padding: 0 12rpx;
  390. }
  391. }
  392. // 日期
  393. .date {
  394. color: rgba(153, 153, 153, 1);
  395. font-size: 24rpx;
  396. }
  397. }
  398. .content-3 {
  399. margin-top: 20rpx;
  400. display: flex;
  401. justify-content: space-between;
  402. align-items: center;
  403. .issuer {
  404. color: rgba(51, 51, 51, 1);
  405. font-size: 24rpx;
  406. }
  407. .address {
  408. color: rgba(51, 51, 51, 1);
  409. font-size: 24rpx;
  410. }
  411. }
  412. }
  413. }
  414. }
  415. </style>