index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  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" v-if="bannerlist.length">
  15. <u-swiper img-mode="scaleToFill" mode="none" :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. <span class="tophot" v-if="false">置顶</span> {{item.positionName}}
  88. </view>
  89. <!-- 薪水 -->
  90. <view class="salary">
  91. {{item.salary}}{{getUnit(item)}}
  92. </view>
  93. </view>
  94. <view class="content-2">
  95. <!-- 标签 -->
  96. <view class="tag">
  97. <view class="tag-item tag-item2" v-if="getLastTime(item.lastLoginTime)">
  98. 活跃
  99. </view>
  100. <view class="tag-item">
  101. {{item.workArea}}
  102. </view>
  103. <view class="tag-item">
  104. {{item.settlementMethodN}}
  105. </view>
  106. <view class="tag-item">
  107. {{item.industryN}}
  108. </view>
  109. </view>
  110. <!-- 日期 -->
  111. <view class="date">
  112. {{getTime(item)}}
  113. </view>
  114. </view>
  115. <view class="content-3">
  116. <view class="issuer">
  117. {{item.contacts}}
  118. </view>
  119. <view class="address">
  120. {{item.address}}
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. <u-divider style="margin-top: 10px;" :isnone="showList.length==0" nonetext="没有找到相关内容"
  126. @click="gotoUrl('pages/tab/jobInformation/jobInformation')" border-color="#CFD2D5">查看更多</u-divider>
  127. </view>
  128. <tabbar :current="0"></tabbar>
  129. </view>
  130. </template>
  131. <script>
  132. import * as API from '@/apis/pagejs/main.js'
  133. import tabbar from "@/components/Tabbar.vue"
  134. import * as API_weixin from '@/apis/weixin.js'
  135. export default {
  136. components: {
  137. tabbar
  138. },
  139. onShareTimeline() {
  140. return {
  141. title: "荆州蓝领通",
  142. }
  143. },
  144. onShareAppMessage(res) {
  145. if (res.from === 'button') { // 来自页面内分享按钮
  146. //.log(res.target)
  147. }
  148. return {
  149. title: "荆州蓝领通",
  150. path: '/pages/main/index/index'
  151. }
  152. },
  153. data() {
  154. return {
  155. keyword: '',
  156. // 导航栏背景
  157. background: {
  158. backgroundColor: '#2795FD',
  159. },
  160. backColor: {
  161. color: '#ffffff'
  162. },
  163. bannerlist: [],
  164. tabList: [{
  165. name: '最新',
  166. value: "",
  167. list: [],
  168. recordsTotal: 0
  169. }, {
  170. name: '日结',
  171. unit: "日",
  172. value: "1",
  173. list: [],
  174. recordsTotal: 0
  175. }, {
  176. name: '周结',
  177. unit: "周",
  178. value: "2",
  179. list: [],
  180. recordsTotal: 0
  181. }, {
  182. name: '月结',
  183. unit: "月",
  184. value: "3",
  185. list: [],
  186. recordsTotal: 0
  187. }],
  188. cameraShow:false,
  189. current: 0,
  190. homeList: [],
  191. }
  192. },
  193. onShow() {
  194. this.findRecruitHomePage();
  195. },
  196. onLoad(op) {
  197. //this.getBannerList()
  198. this.getNewsInfo()
  199. this.findByOpenId(op);
  200. this.authorize();
  201. },
  202. computed: {
  203. showRecordsTotal() {
  204. return this.tabList[this.current].recordsTotal
  205. },
  206. showList() {
  207. return this.tabList[this.current].list
  208. }
  209. },
  210. onReachBottom() {
  211. uni.navigateTo({
  212. url: "/pages/tab/jobInformation/jobInformation"
  213. })
  214. },
  215. methods: {
  216. authorize2(){
  217. wx.authorize({
  218. scope:'scope.camera',
  219. success:()=> {
  220. uni.showToast({
  221. title:"授权成功"
  222. })
  223. this.cameraShow=true;
  224. },
  225. fail(res){
  226. console.log(res)
  227. //authorize:fail auth deny 关闭了
  228. //if(res.errMsg=="authorize:fail privacy permission is not authorized"){
  229. // uni.showModal({
  230. // showCancel:false,
  231. // content:"授权失败,可点击'右上角...'-'设置'-'摄像头'授权",
  232. // title:"提示",
  233. // })
  234. // uni.showToast({
  235. // title:"授权成功"
  236. // })
  237. //}
  238. },
  239. complete:()=> {
  240. //this.authorize()
  241. }
  242. })
  243. },
  244. authorize(){
  245. wx.getSetting({
  246. success:(settingRes)=> {
  247. if(!settingRes.authSetting['scope.camera']){
  248. this.authorize2()
  249. }else{
  250. }
  251. },fail(res){
  252. console.log(res)
  253. }
  254. })
  255. },
  256. getNewsInfo() {
  257. API_weixin.bannerList({
  258. classify: 1,
  259. }).then((res) => {
  260. uni.hideLoading();
  261. //this.newsList = res.data.data;
  262. this.bannerlist = res.data.data.map(item => {
  263. item.image = item.picUrl
  264. return item
  265. })
  266. }).catch(error => {
  267. uni.showToast({
  268. icon: 'none',
  269. title: error,
  270. icon: "none"
  271. })
  272. })
  273. },
  274. getBannerList() {
  275. API.bannerList({
  276. }).then((res) => {
  277. this.bannerlist = res.data.data.map(item => {
  278. return {
  279. image: item.picUrl,
  280. linkUrl: item.linkUrl
  281. }
  282. })
  283. }).catch(error => {
  284. })
  285. },
  286. findByOpenId(op) {
  287. API_weixin.findByOpenId({
  288. openId: this.carhelp.getOpenId(),
  289. noerror: true
  290. }).then((res) => {
  291. this.carhelp.setPersonInfo(res.data.regUser);
  292. this.carhelp.setToken(res.data.token);
  293. this.carhelp.setPersonInfoPlus(res.data);
  294. }).catch(error => {
  295. this.carhelp.logoff();
  296. })
  297. },
  298. findRecruitHomePage() {
  299. uni.showLoading({
  300. title: "加载中",
  301. mask: true,
  302. })
  303. API.findRecruitSearch({
  304. pageIndex: 1,
  305. pageSize: 5,
  306. status: 0,
  307. statusType: this.tabList[this.current].value,
  308. }).then((res) => {
  309. uni.hideLoading();
  310. this.tabList[this.current].list = res.data.data
  311. this.tabList[this.current].recordsTotal = res.data.recordsTotal
  312. }).catch(error => {
  313. uni.showToast({
  314. icon: 'none',
  315. title: error
  316. })
  317. //this.getPhone()
  318. })
  319. },
  320. customBack() {},
  321. change(index) {
  322. this.current = index;
  323. this.findRecruitHomePage()
  324. }
  325. }
  326. }
  327. </script>
  328. <style>
  329. page {
  330. background: #F0F0F2;
  331. padding-bottom: 50px;
  332. }
  333. </style>
  334. <style scoped lang="scss">
  335. /deep/.u-navbar {
  336. .u-icon--right {
  337. display: none !important;
  338. }
  339. }
  340. .tophot {
  341. padding: 2rpx 6rpx;
  342. border: 1px solid #2795FD;
  343. border-radius: 8rpx;
  344. color: #2795FD;
  345. line-height: 24rpx;
  346. font-size: 24rpx;
  347. margin-right: 12rpx;
  348. }
  349. // 头部
  350. .top {
  351. // 搜索框
  352. .search {
  353. background-color: rgba(39, 149, 253, 1);
  354. padding: 16rpx 32rpx;
  355. }
  356. }
  357. // 功能区
  358. .function {
  359. background-color: #fff;
  360. padding: 32rpx 46rpx;
  361. display: flex;
  362. justify-content: space-between;
  363. .function-item {
  364. display: flex;
  365. flex-direction: column;
  366. justify-content: center;
  367. align-items: center;
  368. .icon-box {
  369. width: 96rpx;
  370. height: 96rpx;
  371. background-color: rgba(240, 233, 255, 1);
  372. text-align: center;
  373. border-radius: 999px;
  374. display: flex;
  375. justify-content: center;
  376. align-items: center;
  377. }
  378. .icon-box2 {
  379. background-color: rgba(255, 234, 230, 1);
  380. }
  381. .icon-box3 {
  382. background-color: rgba(227, 246, 255, 1);
  383. }
  384. .icon-box4 {
  385. background-color: rgba(255, 242, 224, 1);
  386. }
  387. .icon-box5 {
  388. background-color: rgba(221, 247, 238, 1);
  389. }
  390. .icon {
  391. width: 48rpx;
  392. height: 48rpx;
  393. img {
  394. width: 100%;
  395. height: 100%;
  396. }
  397. }
  398. .item-text {
  399. color: rgba(51, 51, 51, 1);
  400. margin-top: 8rpx;
  401. font-family: 'PingFang Medium';
  402. }
  403. }
  404. }
  405. // 标签
  406. .tabs {
  407. margin-top: 32rpx;
  408. .title {
  409. display: flex;
  410. justify-content: space-between;
  411. align-items: center;
  412. padding: 0rpx 24rpx;
  413. /deep/.u-tabs {
  414. width: 400rpx;
  415. }
  416. .more {
  417. color: rgba(119, 119, 119, 1);
  418. }
  419. }
  420. .classify-card {
  421. background-color: #fff;
  422. .item {
  423. padding: 24rpx 0;
  424. margin: 0 32rpx;
  425. border-bottom: 1px solid #F0F0F2;
  426. .content-1 {
  427. display: flex;
  428. justify-content: space-between;
  429. align-items: center;
  430. // 职位
  431. .position {
  432. color: rgba(16, 16, 16, 1);
  433. font-size: 36rpx;
  434. font-family: 'PingFang Medium';
  435. display: flex;
  436. align-items: center;
  437. }
  438. // 薪水
  439. .salary {
  440. color: rgba(255, 61, 0, 1);
  441. font-size: 32rpx;
  442. font-family: 'PingFang Medium';
  443. min-width: 260rpx;
  444. text-align: end;
  445. }
  446. }
  447. .content-2 {
  448. margin-top: 12rpx;
  449. display: flex;
  450. justify-content: space-between;
  451. // 标签
  452. .tag {
  453. display: flex;
  454. flex-wrap: wrap;
  455. .tag-item {
  456. min-width: 64rpx;
  457. height: 36rpx;
  458. line-height: 36rpx;
  459. border-radius: 8rpx;
  460. background-color: rgba(241, 241, 247, 1);
  461. color: rgba(129, 127, 153, 1);
  462. font-size: 24rpx;
  463. text-align: center;
  464. margin-right: 12rpx;
  465. padding: 0 8rpx;
  466. overflow: hidden;
  467. }
  468. .tag-item2 {
  469. background-color:rgb(70, 150, 246);
  470. color: #fff;
  471. }
  472. }
  473. // 日期
  474. .date {
  475. color: rgba(153, 153, 153, 1);
  476. font-size: 24rpx;
  477. min-width: 160rpx;
  478. }
  479. }
  480. .content-3 {
  481. margin-top: 20rpx;
  482. display: flex;
  483. justify-content: space-between;
  484. align-items: center;
  485. .issuer {
  486. color: rgba(51, 51, 51, 1);
  487. font-size: 24rpx;
  488. }
  489. .address {
  490. color: rgba(51, 51, 51, 1);
  491. font-size: 24rpx;
  492. }
  493. }
  494. }
  495. }
  496. }
  497. </style>