Преглед изворни кода

fix(招聘) 重构页面 个人中心 首页 招聘页面

xing.li пре 3 година
родитељ
комит
4cdc1a5fbb

+ 13 - 1
api/recruit.js

@@ -3,12 +3,15 @@ import request from '../utils/request.js'
 class recruit extends request {
 
   //获取职位列表
-  static async getRecruitList(name = '', type = 1, page = 1, pageSize = 10) {
+  // type 1、社招;2、校招
+  // status 状态 默认1没发布 2已发布 3已过期
+  static async getRecruitList(name = '', type = 1, page = 1, pageSize = 10,status=2) {
     var data = {
       page: page,
       pageSize: pageSize,
       name: name,
       type: type,
+      // status: status,
     }
     const res = await this.postRequest(`${this.BASE_URL}open/recruit/list-recruit`, data)
 
@@ -89,6 +92,15 @@ class recruit extends request {
     return res.data;
   }
 
+    //获取职位信息
+    static async userRecruitInfo(openid) {
+      var data = {
+        openid: openid
+      }
+      const res = await this.postRequest(`${this.BASE_URL}open/recruit/user-recruit-info`, data)
+      return res.data;
+    }
+
 }
 
 export default recruit

+ 2 - 2
app.js

@@ -56,8 +56,8 @@ App({
         var params = {}
         params['openid'] = openId;
         var info =  await recruitApi.infoUser(params);
-        this.globalData.userInfo = info 
-        console.log(this.globalData.userInfo);
+        this.globalData.userInfo = info; 
+        // console.log(this.globalData.userInfo);
       }
      
   },

+ 13 - 3
app.wxss

@@ -34,7 +34,10 @@ white-space: nowrap;
 .info_top_right{
   font-size: 32rpx;
   font-weight: bold;
-  color: #FF8364
+  color: #FF8364;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
 }
 
 .info_mid_left,.info_mid_right{
@@ -43,8 +46,6 @@ font-weight: 500;
 color: #808080;
 }
 .info_bottom_2{
-  font-size: 28rpx;
-
   margin-left: 10rpx;
   font-size: 12px;
 font-weight: 600;
@@ -78,3 +79,12 @@ color: #6C6C6C;
 .no_data_text{
   font-size: 12px;
 }
+
+.close-status{
+  -webkit-filter: grayscale(100%);
+-moz-filter: grayscale(100%);
+-ms-filter: grayscale(100%);
+-o-filter: grayscale(100%);
+filter: grayscale(100%);
+filter: gray;
+}

+ 5 - 0
pages/collection/collection.js

@@ -99,6 +99,11 @@ Page({
   },
 
   goToInfo:function(e){
+
+     //已经结束的招聘不用查看详情
+     if(e.currentTarget.dataset.status==3){
+      return false;
+  }
     var id = e.currentTarget.dataset.id;
     wx.navigateTo({
       url: '../recruitInfo/recruitInfo?id='+id

+ 14 - 6
pages/collection/collection.wxml

@@ -2,26 +2,34 @@
 
 <view class="content" >
  
-  <view class="info" bindtap="goToInfo" wx:for="{{list}}" data-id="{{item.recruitInfo.id}}" wx:if="{{list.length>0}}">
+  <view class="info  {{item.recruitInfo.status==3?' close-status':''}}"  bindtap="goToInfo" wx:for="{{list}}" data-status="{{item.recruitInfo.status}}" data-id="{{item.recruitInfo.id}}" wx:if="{{list.length>0}}">
    <view class="info_top">
      <view class="info_top_left">{{item.recruitInfo.name}}</view>
      <view class="info_top_right">{{item.recruitInfo.salary}}</view>
    </view>
    <view class="info_mid">
      <view class="info_mid_left">
-       <view  class="info_mid_left_info">{{item.recruitInfo.workArea}}|</view>
-       <view  class="info_mid_left_info">{{item.recruitInfo.workingHours}}|</view>
+       <view  class="info_mid_left_info">{{item.recruitInfo.workArea}}</view>
+       <view  class="info_mid_left_info">{{item.recruitInfo.workingHours}}</view>
        <view  class="info_mid_left_info">{{item.recruitInfo.education}}</view>
      </view>
      <view class="info_mid_right">{{item.recruitInfo.releaseTime}}</view>
    </view>
-   <view class="info_bottom">
-     <image src="/images/new/depart.png" class="info_bottom_img"></image>
+   <view class="info_bottom" style="justify-content:space-between">
+   <view style="display:flex;flex-flow:row nowarp;justion-content:left">
+    <image src="/images/new/depart.png" class="info_bottom_img"></image>
      <view class="info_bottom_2">{{item.recruitInfo.demandDepartment}}</view>
    </view>
+   <view style="font-size:24rpx!important">
+    <span wx:if="{{item.recruitInfo.status==1}}">未开始</span>
+    <span wx:elif="{{item.recruitInfo.status==2}}">招聘中</span>
+    <span wx:elif="{{item.recruitInfo.status==3}}">停止招聘</span> 
+   </view>
+    
+   </view>
     </view>
     <view class="no_data_par" wx:if="{{list.length==0}}">
-      <image src="/images/icons/no_data.png" class="no_data_img"></image>
+      <image src="/images/new/no_data.png" class="no_data_img"></image>
       <view class="no_data_text">暂无数据</view>
     </view>
 </view>

+ 1 - 0
pages/collection/collection.wxss

@@ -21,3 +21,4 @@ Page {
   margin-bottom: 20rpx;
   padding: 5px 15px;
 }
+

+ 17 - 7
pages/index/index.js

@@ -1,4 +1,5 @@
 // pages/index/index.js
+const app = getApp()
 Page({
 
   /**
@@ -13,7 +14,11 @@ Page({
     vertical: false,
     autoplay: true,
     interval: 5000,
-    duration: 500
+    duration: 500,
+    userInfo:{
+    headerImg: "/images/new/head_img.png",
+    nickName:'Friend'
+  }
   },
 
   /**
@@ -21,16 +26,11 @@ Page({
    */
   onLoad: function (options) {
     if(options.url){
- 
       let url = decodeURIComponent(options.url);
- 
       wx.navigateTo({
         url
       })
- 
     }
-
-
   },
 
   /**
@@ -43,8 +43,18 @@ Page({
   /**
    * 生命周期函数--监听页面显示
    */
-  onShow: function () {
+  onShow:  async function () {
+    var openId = wx.getStorageSync('openId')
+    if(openId){
+      await app.setUserInfo(openId)
+    }
+    let userInfo = await app.getWxUserInfo()
 
+    if (userInfo) {
+      this.setData({
+        userInfo: userInfo,
+      })
+    }
   },
 
   /**

+ 2 - 2
pages/index/index.wxml

@@ -46,9 +46,9 @@
   </view>
 </view>
 <view class="person-button" bindtap="gotoPerson">
-<image class="head-img" src="/images/new/head_img.png"></image>
+<image class="head-img" src="{{userInfo.headerImg}}"></image>
 <view>
-<view style="font-weight:500">HI, TONY WU</view>
+<view style="font-weight:500">Hi, {{userInfo.nickName}}</view>
 <view style="font-weight:800;font-style: oblique;margin-top:10rpx;font-size:36rpx">期待您的加入</view>
 </view>
 <image class="person-center" src="/images/new/person_center.png"></image>

+ 24 - 4
pages/person/person.js

@@ -1,4 +1,4 @@
-
+import recruitApi from '../../api/recruit'
 const app = getApp()
 Page({
 
@@ -7,7 +7,12 @@ Page({
    */
   data: {
 
-    hasUserInfo: false
+    hasUserInfo: false,
+    deliveryRecruitStatus: 1,
+    deliveryNum: 4,
+    collectionNum: 3,
+    deliveryRecruitName: "品牌授权专员",
+    interviewedNum: 0
   },
 
   /**
@@ -28,13 +33,15 @@ Page({
    */
   onShow: async function () {
     let userInfo = await app.getWxUserInfo()
-
+    console.log(userInfo)
     if (userInfo) {
       userInfo.avatarUrl = userInfo.headerImg
       this.setData({
         userInfo: userInfo,
         hasUserInfo: true,
       })
+
+      this.userRecruitInfo(userInfo.openid);
     }
   },
 
@@ -85,6 +92,7 @@ Page({
           userInfo: res.userInfo,
           hasUserInfo: true
         })
+        this.userRecruitInfo(res.userInfo.openId)
       }
     })
   },
@@ -108,7 +116,7 @@ Page({
     wx.navigateTo({
       url: '../resume/resume?type=1',
     })
-  }
+  },
   // getMobile: async function (params) {
   //   console.log(params);
   //   let _self = this
@@ -128,4 +136,16 @@ Page({
   //     userInfo
   //   })
   // },
+  userRecruitInfo:async function(openId) {
+    var result = await recruitApi.userRecruitInfo(openId);
+    console.log(result);
+    this.setData({
+      collectionNum:result.collectionNum,
+      deliveryNum:result.deliveryNum,
+      deliveryRecruitName:result.deliveryRecruitName,
+      deliveryRecruitStatus:result.deliveryRecruitStatus,
+      interviewedNum:result.interviewedNum,
+    })
+    
+  },
 })

+ 13 - 8
pages/person/person.wxml

@@ -33,15 +33,15 @@
 
         <view class="opta-view">
             <view bindtap="gotoRecord" class="record-view">
-                <view class="opta-view-num">0</view>
+                <view class="opta-view-num">{{deliveryNum}}</view>
                 <view class="opta-view-text">已投简历</view>
             </view>
             <view bindtap="gotoRecord" class="record-yes-view">
-                <view class="opta-view-num">0</view>
+                <view class="opta-view-num">{{interviewedNum}}</view>
                 <view class="opta-view-text">待面试</view>
             </view>
             <view bindtap="gotoCollection" class="collection-view">
-                <view class="opta-view-num">0</view>
+                <view class="opta-view-num">{{collectionNum}}</view>
                 <view class="opta-view-text">已收藏</view>
             </view>
         </view>
@@ -50,11 +50,16 @@
         style="width:100%"></image>
 
         <view class="remind">
-        <view>沪上阿姨提醒您</view>
-        <view> 您投递的茶饮师职位正在初筛中</view>
-        <view> 如合适我们将在三个同昨日内与您电话沟通,请注意接听</view>
-        <view> 如果您的简历没有通过初筛</view>
-        <view> 可能是部分岗位要求不太符合,我们期待与您下一次的合作</view>
+        <view class="remind-title">沪上阿姨提醒您</view>
+        <view class="remind-text" wx:if="{{deliveryRecruitName}}">您投递的<span style="color:#FF8364">{{deliveryRecruitName}}</span>职位 <span style="color:#FF8364">正在初筛中</span>
+
+                如合适我们将在三个同昨日内与您电话沟通,请注意接听
+
+                如果您的简历没有通过初筛
+
+                可能是部分岗位要求不太符合,我们期待与您下一次的合作
+        </view>
+        <view class="remind-text" wx:if="{{!deliveryRecruitName}}">赶快去投递简历哦</view>
         </view>
     <!-- <view class="order" bindtap = "gotoResume">
         <image class="icons" src="../../images/icons/jianli.png">

+ 15 - 2
pages/person/person.wxss

@@ -221,8 +221,8 @@ margin-left: 5px;
   background-color: #FFE084;
 }
 .remind{
-  width: 320px;
-  height: 200px;
+  width: 330px;
+  height: 220px;
   z-index: 999;
   margin: 0 auto;
   border-radius: 20px;
@@ -230,5 +230,18 @@ margin-left: 5px;
   box-shadow: 0px 9px 9px 9px rgba(131, 131, 131, 0.16);
   position: relative;
   top: -322px;
+  padding-left: 18px;
+  padding-top:26px;
+}
 
+.remind-title{
+  font-size: 16px;
+font-weight: bold;
+color: #000000;
+}
+.remind-text{
+  margin-top: 39px;
+  font-size: 10px;
+  color: #000000;
+  white-space: pre-line;
 }

+ 4 - 0
pages/record/record.js

@@ -98,6 +98,10 @@ Page({
   },
 
   goToInfo:function(e){
+    //已经结束的招聘不用查看详情
+    if(e.currentTarget.dataset.status==3){
+        return false;
+    }
     var id = e.currentTarget.dataset.id;
     wx.navigateTo({
       url: '../recruitInfo/recruitInfo?id='+id

+ 9 - 5
pages/record/record.wxml

@@ -2,7 +2,7 @@
 
 <view class="content" >
  
- <view class="info" bindtap="goToInfo" wx:for="{{list}}" data-id="{{item.recruitInfo.id}}" wx:if="{{list.length>0}}">
+ <view class="info {{item.recruitInfo.status==3?' close-status':''}}" bindtap="goToInfo" wx:for="{{list}}" data-id="{{item.recruitInfo.id}}" data-status="{{item.recruitInfo.status}}" wx:if="{{list.length>0}}">
    <view class="info_top">
      <view class="info_top_left">{{item.recruitInfo.name}}</view>
      <view class="info_top_right">{{item.recruitInfo.salary}}</view>
@@ -20,14 +20,18 @@
      <view class="info_bottom_2">{{item.recruitInfo.demandDepartment}}</view>
    </view>
    <view class="info_bottom_date">
-    <view>投递时间:</view>
-    <view>{{item.addTs}}</view>
-    <!-- <view>已查阅</view> -->
+    <view>投递时间:{{item.addTs}}</view>
+    <view>
+    <span wx:if="{{item.recruitInfo.status==1}}">未开始</span>
+     <span wx:elif="{{item.recruitInfo.status==2}}">招聘中</span>
+    <span wx:elif="{{item.recruitInfo.status==3}}">停止招聘</span> 
+   
+    </view>
    </view>
  </view>
 
  <view class="no_data_par" wx:if="{{list.length==0}}">
-      <image src="/images/icons/no_data.png" class="no_data_img"></image>
+      <image src="/images/new/no_data.png" class="no_data_img"></image>
       <view class="no_data_text">暂无数据</view>
     </view>
 </view>

+ 2 - 2
pages/record/record.wxss

@@ -26,9 +26,9 @@ Page {
 .info_bottom_date{
   display: flex;
   flex-flow: row nowrap;
-  justify-content: left;
+  justify-content: space-between;
   /* padding: 0 15rpx; */
   font-size: 24rpx;
   color: #6C6C6C;
   
-}
+}

+ 10 - 4
pages/resume/resume.js

@@ -22,7 +22,7 @@ Page({
     emali:'',
     mobile:'',
     birthday:'1990-01-01',
-    gender:0,
+    gender:1,
     nowAddress:'',
     registeredAddress:'',
     highestEducation:0,
@@ -162,10 +162,16 @@ Page({
       birthday: e.detail.value
     })
   },
-  changeSex: function (e) {
+  // changeSex: function (e) {
     
-    this.setData({
-      gender: e.detail.value
+  //   this.setData({
+  //     gender: e.detail.value
+  //   })
+  // },
+  chooseSex:function(e){
+    let gender = e.currentTarget.dataset.gender;
+      this.setData({
+      gender: gender
     })
   },
   changeEducation: function (e) {

+ 10 - 3
pages/resume/resume.wxml

@@ -6,9 +6,16 @@
       <view class="info_left_1">*</view>
       <view class="info_left_2">姓名</view>
     </view>
-    <input type="text" class="info_right" maxlength="50" placeholder="请输入姓名" placeholder-class="placeholder" value="{{name}}" bindinput="bindInputName"/>
+    <input type="text" class="info_right" maxlength="50" placeholder="请输入姓名" placeholder-class="placeholder" value="{{name}}" bindinput="bindInputName"
+    style="width:260rpx"/>
+    <view class="sex-info" >
+    <view class="sex-info-man {{gender==1?'sex-info-active':''}}" bindtap="chooseSex" data-gender="1">男</view>
+    <view class="sex-info-woman {{gender==2?'sex-info-active':''}}"  bindtap="chooseSex" data-gender="2">女</view>
+    
+    </view>
+    
   </view>
-  <view class="info">
+  <!-- <view class="info">
     <view class="info_left">
       <view class="info_left_1">*</view>
       <view class="info_left_2">性别</view>
@@ -18,7 +25,7 @@
         </picker>
         <image class="next-gray" src="../../images/new/right_arrow.png">
         </image>
-  </view>
+  </view> -->
   <view class="info" >
     <view class="info_left">
       <view class="info_left_1"></view>

+ 23 - 0
pages/resume/resume.wxss

@@ -100,3 +100,26 @@ Page {
   line-height: 80rpx;
   border-radius: 10rpx;
 }
+
+.sex-info{
+  width: 110px;
+  display: flex;
+  flex-flow: row nowrap;
+  justify-content: left;
+}
+.sex-info-man,.sex-info-woman{
+  width: 40px;
+  background-color: #D4D4D4;
+  color: #000000;
+  text-align: center;
+  border-radius: 4px;
+  font-size: 12px;
+  line-height: 24px;
+  height: 24px;
+  margin-left: 10px;
+}
+
+.sex-info-active{
+  background-color: #FF8364!important;
+  color: #fff;
+}

+ 1 - 1
pages/sociology/sociology.wxml

@@ -44,7 +44,7 @@
     </view>
   </view>
   <view class="no_data_par" wx:if="{{recruitList.length==0}}">
-    <image src="/images/icons/no_data.png" class="no_data_img"></image>
+    <image src="/images/new/no_data.png" class="no_data_img"></image>
     <view class="no_data_text">暂无数据</view>
   </view>
 </view>

+ 3 - 5
project.config.json

@@ -4,7 +4,7 @@
     "ignore": []
   },
   "setting": {
-    "urlCheck": true,
+    "urlCheck": false,
     "es6": true,
     "enhance": true,
     "postcss": false,
@@ -29,14 +29,12 @@
       "disablePlugins": [],
       "outputPath": ""
     },
-    "bundle": false,
     "useIsolateContext": true,
-    "useCompilerModule": true,
-    "userConfirmedUseCompilerModuleSwitch": false,
     "userConfirmedBundleSwitch": false,
     "packNpmManually": false,
     "packNpmRelationList": [],
-    "minifyWXSS": false
+    "minifyWXSS": false,
+    "showES6CompileOption": false
   },
   "compileType": "miniprogram",
   "libVersion": "2.16.1",

+ 2 - 2
utils/request.js

@@ -1,8 +1,8 @@
 
 class request {
 
-//   static BASE_URL = 'http://oapi.shpr.top:81/'
-  static BASE_URL = 'https://oapi.shpr.top/'
+  static BASE_URL = 'http://oapi.shpr.top:81/'
+//   static BASE_URL = 'https://oapi.shpr.top/'
   static HEAD = {
       "Content-Type": "application/json",
       "token":'',