From 8a9c2c0bccce0da2bf33ca8cd30176f2bd8e50e7 Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Wed, 30 Jul 2025 15:50:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=A1=B5=E9=9D=A2=E5=88=B7=E6=96=B0=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor: 重构列表组件为独立组件并优化代码结构 fix: 修复订单详情页薪资显示和联系客服功能 feat: 添加认证状态检查和企业/个人认证流程 style: 优化页面布局和文本显示 perf: 改进地理位置选择和逆地理编码逻辑 docs: 更新注释和移除无用代码 test: 添加认证状态和简历完成状态检查测试 chore: 更新基础URL配置和组件路径 --- common/config.js | 3 +- .../component => components/list}/enterprise.vue | 2 +- .../home/component => components/list}/master.vue | 2 +- config.js | 3 + pages/auth/index.vue | 50 +++++++++- pages/home/index.vue | 4 +- pages/order/component/enterprise.vue | 25 ++--- pages/order/component/master.vue | 26 ++---- pages/order/index.vue | 5 + pages_subpack/category/index.vue | 103 +++------------------ pages_subpack/employ-progress/index.vue | 38 +++++++- pages_subpack/job-order-detail/index.vue | 97 ++++++++++++------- pages_subpack/master-detail/index.vue | 71 ++++++++------ pages_subpack/order-detail/boss.vue | 50 +++++----- pages_subpack/order-detail/index.vue | 81 ++++++++++------ pages_subpack/release/component/enterprise.vue | 59 +++++++----- pages_subpack/release/component/master.vue | 35 +++---- pages_subpack/work-detail/index.vue | 81 +++++++++++++--- store/modules/user.js | 74 ++++++++++++++- 19 files changed, 495 insertions(+), 314 deletions(-) rename {pages/home/component => components/list}/enterprise.vue (99%) rename {pages/home/component => components/list}/master.vue (98%) diff --git a/common/config.js b/common/config.js index 25503b0..cefa564 100644 --- a/common/config.js +++ b/common/config.js @@ -3,7 +3,8 @@ module.exports = { // baseUrl:"https://employadmin.hhlm1688.com" // baseUrl:"http://h5.xzaiyp.top", //测试环境 // baseUrl:"http://youyi-test.natapp1.cc", - baseUrl:"https://admin.zhixuanlietou.com", + baseUrl:"http://127.0.0.1:8001", + // baseUrl:"https://admin.zhixuanlietou.com", // http://youyi-test.natapp1.cc diff --git a/pages/home/component/enterprise.vue b/components/list/enterprise.vue similarity index 99% rename from pages/home/component/enterprise.vue rename to components/list/enterprise.vue index 8bacb39..f7dcdba 100644 --- a/pages/home/component/enterprise.vue +++ b/components/list/enterprise.vue @@ -70,7 +70,7 @@ - 联系他 + 立即聘用 diff --git a/pages/home/component/master.vue b/components/list/master.vue similarity index 98% rename from pages/home/component/master.vue rename to components/list/master.vue index a323ec5..2359097 100644 --- a/pages/home/component/master.vue +++ b/components/list/master.vue @@ -27,7 +27,7 @@ {{items.createTime | formatTime}} - 立即接单 + 立即应聘 diff --git a/config.js b/config.js index 60c2eab..0fa37c4 100644 --- a/config.js +++ b/config.js @@ -9,6 +9,9 @@ const type = 'prod' // 环境配置 const config = { + local : { + baseUrl : 'http://127.0.0.1:8001/employ-api', + }, dev : { baseUrl : 'http://augcl.natapp1.cc/employ-api', }, diff --git a/pages/auth/index.vue b/pages/auth/index.vue index 41ebc37..0cb39d5 100644 --- a/pages/auth/index.vue +++ b/pages/auth/index.vue @@ -151,12 +151,16 @@ url:"/pages/login/index" }) }else{ - uni.navigateTo({ - url:"/pages/identity/index" - }) + // 检查个人和企业认证状态 + that.checkAuthStatus() } }).catch((error) =>{ - + uni.hideLoading() + uni.showToast({ + title: '登录失败,请重试', + icon: 'none', + duration: 2000 + }) }) } }) @@ -166,6 +170,44 @@ url:"/pages/home/index" }) }, + checkAuthStatus() { + let that = this + // 显示认证状态检查加载提示 + uni.showLoading({ + title: '检查认证状态...', + mask: true + }) + + // 检查个人认证状态 + this.$store.dispatch('onPersonalAuth', { + success: (person) => { + // 个人认证通过,直接跳转到首页 + uni.hideLoading() + uni.switchTab({ + url: "/pages/home/index" + }) + }, + fail: (person) => { + // 个人认证未通过,检查企业认证 + that.$store.dispatch('onEnterpriseAuth', { + success: (company) => { + // 企业认证通过,直接跳转到首页 + uni.hideLoading() + uni.switchTab({ + url: "/pages/home/index" + }) + }, + fail: (company) => { + // 个人和企业都未认证,跳转到身份选择页面 + uni.hideLoading() + uni.navigateTo({ + url: "/pages/identity/index" + }) + } + }) + } + }) + }, handleOpenPrivacyContract() { // 打开隐私协议页面 wx.openPrivacyContract({ diff --git a/pages/home/index.vue b/pages/home/index.vue index 9e5981d..d91702f 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -80,8 +80,8 @@ noticeList, queryConfigList } from "@/common/api.js" - import enterpriseBox from "./component/enterprise.vue" - import masterBox from "./component/master.vue" + import enterpriseBox from "@/components/list/enterprise.vue" + import masterBox from "@/components/list/master.vue" import QQMapWX from "@/util/qqmap-wx-jssdk.min.js" export default{ components:{ diff --git a/pages/order/component/enterprise.vue b/pages/order/component/enterprise.vue index 76ba9f7..535c0c4 100644 --- a/pages/order/component/enterprise.vue +++ b/pages/order/component/enterprise.vue @@ -34,15 +34,18 @@ - 总价格: + 试工日薪: {{items.payMoney}} + class="se-fs-24">¥ + {{items.employJob && items.employJob.salaryDay || 0}} + - + style="background: transparent; border: none; padding: 0; margin: 0; line-height: 50rpx;"> 联系客服 - + @@ -144,17 +147,7 @@ url: "/pages_subpack/order-detail/index?orderId=" + event.id }) }, - callPhone(event) { - uni.makePhoneCall({ - phoneNumber: event.phone, - success: () => { - console.log("拨打成功"); - }, - fail: (err) => { - console.error("拨打失败", err); - }, - }) - } + } } diff --git a/pages/order/component/master.vue b/pages/order/component/master.vue index 8579859..9cfa7bd 100644 --- a/pages/order/component/master.vue +++ b/pages/order/component/master.vue @@ -37,13 +37,17 @@ - 总价格: - {{ item.jobMoney }} + 试工日薪: + + {{ item.employSeek && item.employSeek.dayMoney || 0 }} + - + @@ -145,17 +149,7 @@ url: "/pages_subpack/job-order-detail/index?orderId=" + event.id }) }, - callPhone(event) { - uni.makePhoneCall({ - phoneNumber: event.phone, - success: () => { - console.log("拨打成功"); - }, - fail: (err) => { - console.error("拨打失败", err); - }, - }) - } + } } diff --git a/pages/order/index.vue b/pages/order/index.vue index 8fad492..cd9fe26 100644 --- a/pages/order/index.vue +++ b/pages/order/index.vue @@ -41,6 +41,11 @@ }, onShow() { this.isLogin = !!uni.getStorageSync('token') + if(this.current==0){ + this.$refs.enterpriseBoxRef.onRefresh(); + }else if(this.current==1){ + this.$refs.masterBoxRef.onRefresh(); + } }, onReachBottom() { if(this.current==0){ diff --git a/pages_subpack/category/index.vue b/pages_subpack/category/index.vue index 0b1f673..71dccfc 100644 --- a/pages_subpack/category/index.vue +++ b/pages_subpack/category/index.vue @@ -17,97 +17,13 @@ }" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;" :list="navList" @click="navClick($event)"> - + + + @@ -122,7 +38,14 @@ querySeekList, getSysText } from "@/common/api.js" + import master from "@/components/list/master.vue" + import enterprise from "@/components/list/enterprise.vue" + export default { + components: { + master, + enterprise + }, data() { return { tpageNo: 1, diff --git a/pages_subpack/employ-progress/index.vue b/pages_subpack/employ-progress/index.vue index f23a0ba..a731a49 100644 --- a/pages_subpack/employ-progress/index.vue +++ b/pages_subpack/employ-progress/index.vue @@ -25,6 +25,8 @@ diff --git a/pages_subpack/release/component/enterprise.vue b/pages_subpack/release/component/enterprise.vue index cd27fcf..5deb911 100644 --- a/pages_subpack/release/component/enterprise.vue +++ b/pages_subpack/release/component/enterprise.vue @@ -342,31 +342,44 @@ handleAreaChange(){ const that = this; wx.chooseLocation({ + type: 'gcj02', // type: 'wgs84', success: function (res) { - const qqmapsdk = new QQMapWX({ - key: 'TT7BZ-Z3LW4-KOAUB-KWHOA-SBJJ6-Y5B6R' // 必填 - }); - uni.showLoading({ - title:"获取中...." - }) - qqmapsdk.reverseGeocoder({ - location: { - latitude: res.latitude, - longitude: res.longitude - }, - success: function(response) { - console.log('逆地理编码结果:', response); - uni.hideLoading() - that.form.longitude = response.result.location.lng - that.form.latitude = response.result.location.lat - that.form.area = response.result.address - }, - fail: function(error) { - uni.hideLoading() - console.error('逆地理编码失败:', error); - } - }); + + that.form.latitude = res.latitude + that.form.longitude = res.longitude + + if (!res.address && res.name) { //用户直接选择城市的逻辑 + return that.form.area = res.name + } + if (res.address || res.name) { + return that.form.area = res.address + res.name + } + that.form.area = '' //用户啥都没选就点击勾选 + + // const qqmapsdk = new QQMapWX({ + // key: 'TT7BZ-Z3LW4-KOAUB-KWHOA-SBJJ6-Y5B6R' // 必填 + // }); + // uni.showLoading({ + // title:"获取中...." + // }) + // qqmapsdk.reverseGeocoder({ + // location: { + // latitude: res.latitude, + // longitude: res.longitude + // }, + // success: function(response) { + // console.log('逆地理编码结果:', response); + // uni.hideLoading() + // that.form.longitude = response.result.location.lng + // that.form.latitude = response.result.location.lat + // that.form.area = response.result.address + // }, + // fail: function(error) { + // uni.hideLoading() + // console.error('逆地理编码失败:', error); + // } + // }); } }) // this.showPicker = true diff --git a/pages_subpack/release/component/master.vue b/pages_subpack/release/component/master.vue index 99b63f3..11304c6 100644 --- a/pages_subpack/release/component/master.vue +++ b/pages_subpack/release/component/master.vue @@ -295,31 +295,20 @@ handleAreaChange(){ const that = this; wx.chooseLocation({ + type: 'gcj02', // type: 'wgs84', success: function (res) { - const qqmapsdk = new QQMapWX({ - key: 'TT7BZ-Z3LW4-KOAUB-KWHOA-SBJJ6-Y5B6R' // 必填 - }); - uni.showLoading({ - title:"获取中...." - }) - qqmapsdk.reverseGeocoder({ - location: { - latitude: res.latitude, - longitude: res.longitude - }, - success: function(response) { - console.log('逆地理编码结果:', response); - uni.hideLoading() - that.form.longitude = response.result.location.lng - that.form.latitude = response.result.location.lat - that.form.area = response.result.address - }, - fail: function(error) { - uni.hideLoading() - console.error('逆地理编码失败:', error); - } - }); + + that.form.latitude = res.latitude + that.form.longitude = res.longitude + + if (!res.address && res.name) { //用户直接选择城市的逻辑 + return that.form.area = res.name + } + if (res.address || res.name) { + return that.form.area = res.address + res.name + } + that.form.area = '' //用户啥都没选就点击勾选 } }) }, diff --git a/pages_subpack/work-detail/index.vue b/pages_subpack/work-detail/index.vue index 803a51e..42a724f 100644 --- a/pages_subpack/work-detail/index.vue +++ b/pages_subpack/work-detail/index.vue @@ -3,8 +3,19 @@ {{items.title}} - - {{items.salaryMin}} - {{items.salaryMax}} + + + + + 日薪: + {{ items.salaryDay }}元 + + + 月薪: + {{items.salaryMin}} - {{items.salaryMax}}元 + @@ -54,7 +65,7 @@ - 立即接单 + 立即应聘 @@ -87,14 +98,62 @@ }) }, onPayment(){ - addOrderWork({id:this.id}).then(response=>{ - - console.log("下单成功"); - uni.navigateTo({ - url:"/pages_subpack/payment/index?id="+response.result.id - }) - }).catch(error=>{ - + uni.showLoading({ + title: '加载中' + }) + // 检查个人认证状态 + this.$store.dispatch('onPersonalAuth', { + success: (person) => { + // 个人认证通过,继续检查简历状态 + this.$store.dispatch('onResumeComplete', { + success: (resume) => { + // 简历已完成,执行接单操作 + addOrderWork({id:this.id}).then(response=>{ + uni.hideLoading() + console.log("下单成功"); + uni.navigateTo({ + url:"/pages_subpack/payment/index?id="+response.result.id + }) + }).catch(error=>{ + uni.hideLoading() + }) + }, + fail: (resume) => { + uni.hideLoading() + // 简历未完成 + uni.showModal({ + title: '提示', + content: '请先完成简历信息,才能接单', + showCancel: false, + confirmText: '去完善', + success: (res) => { + if (res.confirm) { + uni.navigateTo({ + url: '/pages_subpack/resume/index' + }) + } + } + }) + } + }) + }, + fail: (person) => { + uni.hideLoading() + // 个人认证未通过 + uni.showModal({ + title: '提示', + content: '请先完成个人认证,审核通过后才能接单', + showCancel: false, + confirmText: '去认证', + success: (res) => { + if (res.confirm) { + uni.navigateTo({ + url: '/pages_subpack/person/index' + }) + } + } + }) + } }) }, openAddress(){ diff --git a/store/modules/user.js b/store/modules/user.js index 35bce30..e90679f 100644 --- a/store/modules/user.js +++ b/store/modules/user.js @@ -7,9 +7,8 @@ export default { mutations: { onAuth(state){ - }, - + setUserInfo(state,obj){ state.userInfo = obj.userInfo state.token = obj.token @@ -31,5 +30,74 @@ export default { }, }, - actions: {} + actions: { + // 企业身份认证检查 + async onEnterpriseAuth({ commit }, config = { + success: () => {}, + fail: () => {}, + }) { + try { + const { getAuthenticationCompany } = await import('@/common/api.js') + const response = await getAuthenticationCompany({}) + const company = response.result + + if (company && company.status == 1) { + // 认证审核通过 + config.success(company) + } else { + // 认证未通过或未认证 + config.fail(company) + } + } catch (error) { + console.error('企业认证检查失败:', error) + config.fail(null) + } + }, + + // 个人身份认证检查 + async onPersonalAuth({ commit }, config = { + success: () => {}, + fail: () => {}, + }) { + try { + const { getAuthenticationPerson } = await import('@/common/api.js') + const response = await getAuthenticationPerson({}) + const person = response.result + + if (person && person.status == 1) { + // 认证审核通过 + config.success(person) + } else { + // 认证未通过或未认证 + config.fail(person) + } + } catch (error) { + console.error('个人认证检查失败:', error) + config.fail(null) + } + }, + + // 简历完成状态检查 + async onResumeComplete({ commit }, config = { + success: () => {}, + fail: () => {}, + }) { + try { + const { queryResumeById } = await import('@/common/api.js') + const response = await queryResumeById({}) + const resume = response.result + + if (resume && resume.id) { + // 简历已完成 + config.success(resume) + } else { + // 简历未完成 + config.fail(resume) + } + } catch (error) { + console.error('简历状态检查失败:', error) + config.fail(null) + } + } + } } \ No newline at end of file