From a2927510086b0701b86274bea983e2e8eddd1bb5 Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Fri, 20 Dec 2024 14:41:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api.js | 51 ++++++----------- api/http.js | 5 +- api/model/company.js | 19 +++++++ api/model/contact.js | 25 +++++++++ api/model/login.js | 13 ++++- api/model/vip.js | 14 +++++ api/model/work.js | 36 ++++++++++++ components/list/workList/index.vue | 13 ++++- config.js | 7 ++- pages/index/center.vue | 2 +- pages_order/auth/wxUserInfo.vue | 8 +-- pages_order/work/addResume.vue | 2 +- pages_order/work/jobPosting.vue | 110 ++++++++++++++++++++++++++++++++++--- store/store.js | 22 +++++--- utils/utils.js | 16 +++++- 15 files changed, 279 insertions(+), 64 deletions(-) create mode 100644 api/model/company.js create mode 100644 api/model/contact.js create mode 100644 api/model/vip.js create mode 100644 api/model/work.js diff --git a/api/api.js b/api/api.js index 1bbd6a2..a8bdabf 100644 --- a/api/api.js +++ b/api/api.js @@ -1,10 +1,11 @@ import http from './http.js' +import utils from '../utils/utils.js' let limit = {} let debounce = {} -const models = ['score', 'boss', 'login'] +const models = ['score', 'boss', 'login', 'vip', 'company', 'work'] const config = { // 示例 @@ -119,15 +120,15 @@ const config = { //获取工作信息列表 - employeeQueryJobList: { - url: '/api/employee/queryJobListByAll', - method: 'GET', - }, + // employeeQueryJobList: { + // url: '/api/employee/queryJobListByAll', + // method: 'GET', + // }, //根据Id查看工作详情 - employeeQueryJobById: { - url: '/api/employee/queryJobById', - method: 'GET', - }, + // employeeQueryJobById: { + // url: '/api/employee/queryJobById', + // method: 'GET', + // }, //我的收藏 employeeQueryCollectionJobList: { url: '/api/employee/queryJobCollectionList', @@ -146,12 +147,6 @@ const config = { method: 'GET', auth: true, }, - //联系记录-谁看过我 - employeeQueryWatchMe: { - url: '/api/employee/queryWatchMe', - method: 'GET', - auth: true, - }, //电子合同-获取电子合同列表 employeeQueryContractList: { url: '/api/employee/queryContractList', @@ -185,23 +180,11 @@ const config = { auth: true, }, //我的招工 - bossQueryJobListByUserId: { - url: '/api/boss/queryJobListByUserId', - method: 'GET', - auth: true, - }, - //会员中心-联系记录-我看过谁 - bossQueryWatchWho: { - url: '/api/boss/queryWatchWho', - method: 'GET', - auth: true, - }, - //会员中心-联系记录-谁看过我 - bossQueryWatchMe: { - url: '/api/boss/queryWatchMe', - method: 'GET', - auth: true, - }, + // bossQueryJobListByUserId: { + // url: '/api/boss/queryJobListByUserId', + // method: 'GET', + // auth: true, + // }, } export function api(key, data, callback, loadingTitle) { @@ -234,9 +217,7 @@ export function api(key, data, callback, loadingTitle) { //必须登录 if (req.auth) { if (!uni.getStorageSync('token')) { - uni.navigateTo({ - url: '/pages_order/auth/wxLogin' - }) + utils.toLogin() console.error('需要登录') return } diff --git a/api/http.js b/api/http.js index 8f7078e..3c18457 100644 --- a/api/http.js +++ b/api/http.js @@ -1,5 +1,6 @@ import Vue from 'vue' +import utils from '../utils/utils.js' function http(uri, data, callback, method = 'GET', showLoading, title) { @@ -29,9 +30,7 @@ function http(uri, data, callback, method = 'GET', showLoading, title) { res.data.message == '操作失败,用户不存在!'){ uni.removeStorageSync('token') console.error('登录过期'); - uni.navigateTo({ - url: '/pages_order/auth/wxLogin' - }) + utils.toLogin() } if(res.statusCode == 200 && res.data.code != 200){ diff --git a/api/model/company.js b/api/model/company.js new file mode 100644 index 0000000..612d870 --- /dev/null +++ b/api/model/company.js @@ -0,0 +1,19 @@ + +// 企业相关接口 + +const api = { + // 查看企业信息 + getCompany: { + url: '/company/updateUser', + method: 'GET', + }, + // 修改企业信息 + getCompany: { + url: '/company/updateUser', + method: 'POST', + auth : true, + limit : 1500, + }, +} + +export default api \ No newline at end of file diff --git a/api/model/contact.js b/api/model/contact.js new file mode 100644 index 0000000..e49c6b4 --- /dev/null +++ b/api/model/contact.js @@ -0,0 +1,25 @@ + +// 联系记录相关接口 + +const api = { + //联系记录-谁看过我(谁看过我的简历) + employeeQueryWatchMe: { + url: '/employ/check/queryWatchMeEmployee', + method: 'GET', + auth: true, + }, + //会员中心-联系记录-谁看过我(谁看过我的招工) + bossQueryWatchMe: { + url: '/employ/check/queryWatchMeBoss', + method: 'GET', + auth: true, + }, + //会员中心-联系记录-我看过谁 + bossQueryWatchWho: { + url: '/api/boss/queryWatchWho', + method: 'GET', + auth: true, + }, +} + +export default api \ No newline at end of file diff --git a/api/model/login.js b/api/model/login.js index 7535d00..13be1cd 100644 --- a/api/model/login.js +++ b/api/model/login.js @@ -12,7 +12,7 @@ const api = { }, // 修改个人信息接口 updateInfo: { - url: '/info/updateInfo', + url: '/employ/user/updateUser', method: 'POST', auth: true, limit : 500, @@ -30,9 +30,18 @@ const api = { }, // 获取个人信息 getInfo: { - url: '/employ/user/updateUser', + url: '/employ/user/queryUser', method: 'GET', auth: true, + limit : 500, + }, + // 获取个人信息 + bindPhone: { + url: '/api/login/bindPhone', + method: 'GET', + auth: true, + limit : 500, + showLoading : true, }, } diff --git a/api/model/vip.js b/api/model/vip.js new file mode 100644 index 0000000..0968f1b --- /dev/null +++ b/api/model/vip.js @@ -0,0 +1,14 @@ + +// VIP相关接口 + +const api = { + // 开通VIP + addVIP: { + url: '/employ/vip/addVIP', + method: 'POST', + auth : true, + limit : 1500, + }, +} + +export default api \ No newline at end of file diff --git a/api/model/work.js b/api/model/work.js new file mode 100644 index 0000000..df9f625 --- /dev/null +++ b/api/model/work.js @@ -0,0 +1,36 @@ + +// 工作相关接口 + +const api = { + // 首页-添加工作信息 + addJob: { + url: '/employ/job/addJob', + method: 'POST', + auth : true, + limit : 1500, + }, + // 首页-根据Id查看工作详情 + employeeQueryJobList: { + url: '/employ/job/queryJobById', + method: 'GET', + }, + // 首页-查询工作信息列表 + employeeQueryJobById: { + url: '/employ/job/queryJobList', + method: 'GET', + }, + // 会员中心-我的招工 + bossQueryJobListByUserId: { + url: '/employ/job/queryJobListByUserId', + method: 'GET', + auth : true, + }, + // 首页-修改工作信息 + updateJob: { + url: '/employ/job/updateJob', + method: 'GET', + auth : true, + }, +} + +export default api \ No newline at end of file diff --git a/components/list/workList/index.vue b/components/list/workList/index.vue index 319e01d..8a36982 100644 --- a/components/list/workList/index.vue +++ b/components/list/workList/index.vue @@ -40,11 +40,22 @@ } }, methods: { - getData(){ + getData(params){ if(uni.getStorageSync('token')){ this.queryParams.token = uni.getStorageSync('token') } + if(!params || params.length == 0){ + this.queryParams = { + pageNo: this.queryParams.pageNo, + pageSize: this.queryParams.pageSize, + } + }else{ + + } + + console.log(params); + this.$api(this.api, this.queryParams, res => { if(res.code == 200){ this.list = res.result.records diff --git a/config.js b/config.js index a6f0195..f98fd44 100644 --- a/config.js +++ b/config.js @@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools' Vue.use(uvUI); // 当前环境 -const type = 'prod' +const type = 'dev2' // 环境配置 @@ -15,9 +15,12 @@ const config = { dev : { baseUrl : 'http://augcl.natapp1.cc/employ-api', }, + dev2 : { + baseUrl : 'http://h5.xzaiyp.top/employ-api', + }, prod : { baseUrl : 'https://employadmin.augcl.com/employ-api', - } + }, } diff --git a/pages/index/center.vue b/pages/index/center.vue index dc59307..ec17e4a 100644 --- a/pages/index/center.vue +++ b/pages/index/center.vue @@ -220,7 +220,7 @@ } }, onShow() { - // this.$store.commit('getUserInfo') + this.$store.commit('getUserInfo') }, methods: { diff --git a/pages_order/auth/wxUserInfo.vue b/pages_order/auth/wxUserInfo.vue index 738bc6d..b20ddc3 100644 --- a/pages_order/auth/wxUserInfo.vue +++ b/pages_order/auth/wxUserInfo.vue @@ -1,10 +1,10 @@