From 26f293c79c561a77d43c1c50741f955b7b7c8ad9 Mon Sep 17 00:00:00 2001 From: wangxia <779219182@qq.com> Date: Tue, 5 Aug 2025 18:45:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E6=B3=A8=E6=97=B6=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=9B=A2=E9=98=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/bind.js | 2 + main.js | 6 +- pages/person/index.vue | 138 ++++++++++++------------ root/detail/userShare.vue | 259 +++++++++++++++++++++++++++++++-------------- root/person/teamManage.vue | 6 +- 5 files changed, 262 insertions(+), 149 deletions(-) diff --git a/api/bind.js b/api/bind.js index 5ee9576..5142294 100644 --- a/api/bind.js +++ b/api/bind.js @@ -7,6 +7,8 @@ let bindInfo = { bind_recordDetail:"/assistant/circle/agency/apply/info",// 申请记录当前行记录详情 bind_recordSubmit:"/assistant/circle/agency/apply/agree",// 通过申请提交事件 bind_enterpriseDetail:"/assistant/circle/agency/detail",// 企业详情 + bind_getAgencyByAdminTel:"/yishoudan/agency/getAgencyByAdminTel",// 根据团队创建人手机号获取团队信息 + bind_getWaitNum:"/assistant/circle/agency/countPending",// 获取统计处理中的数量 bind_getApplyNum:"/assistant/circle/agency/countHasNotReadNum",// 获取通过未读的关注数 bind_isSee:"/assistant/circle/agency/himSee",// 让不让他看 diff --git a/main.js b/main.js index 9858219..71c4412 100644 --- a/main.js +++ b/main.js @@ -74,6 +74,8 @@ export function createApp () { uni.setStorageSync("SHOW_INVITE", 1); resolve(res) }); + } else { + resolve(res) } }, @@ -94,7 +96,7 @@ export function createApp () { uni.setStorageSync('apply-userinfo-copy', JSON.stringify(res)); uni.setStorageSync("apply-agencyId", res.user.agencyId); // 单独存储 -- 代理id,方便获取 uni.setStorageSync("apply-supplierAccount", res.supplierAccount); // 单独存储 -- 是否是发单号,方便获取 0.不是发单号 1.是发单号 - if (res.agencyStatus == 1) { + if (res.agencyStatus == 1) { G.Get(apiInfo.login_agencyInfo, {}, (aRes) => { uni.setStorageSync("agencyInfo", aRes.agency); // 1是创建者 2是普通成员 uni.setStorageSync("IS_CREATOR", aRes.agency.userId == res.user.id || res.admin == true ? 1 : 2); // 1是创建者 2是普通成员 @@ -103,6 +105,8 @@ export function createApp () { uni.setStorageSync("SHOW_INVITE", 1); resolve(res) }); + } else { + resolve(res) } }) }) diff --git a/pages/person/index.vue b/pages/person/index.vue index efec115..7384698 100644 --- a/pages/person/index.vue +++ b/pages/person/index.vue @@ -330,18 +330,20 @@ export default { that.isCreator = uni.getStorageSync("IS_CREATOR") == 1 ? true : false; that.agencyInfo = uni.getStorageSync("agencyInfo"); if (uni.getStorageSync("apply-token")) { - that.setUserInfo(); - // that.userInfo = uni.getStorageSync("apply-userinfo"); - that.isLogin = uni.getStorageSync("apply-token") ? true : false; - if (that.isLogin) { + that.isLogin = true; + console.log(56456567675); + this.G.checkToken().then(() => { + console.log(123123123123123); + that.setUserInfo(); this.getAuthInfo(); this.getData(); this.getNum(); - if(uni.getStorageSync("apply-userinfo").agencyStatus == 1){ - this.getCompanyInfo(); + if (uni.getStorageSync("apply-userinfo").agencyStatus == 1) { + this.getCompanyInfo(); + } + }); - } - } + // that.userInfo = uni.getStorageSync("apply-userinfo"); } else { that.waitNum_ups = 0; that.pageSpeed = 1; @@ -674,67 +676,67 @@ export default { console.log("res", res); if (res) { that.map = res; + let resdata = res.classify1num; + that.todayDataList = [ + { + name: "报名", + num: resdata.signUps || 0, + path: "/root/person/todayData", + }, + { + name: "到面", + num: resdata.arrived || 0, + path: "/root/person/todayData", + }, + { + name: "通过", + num: resdata.passed || 0, + path: "/root/person/todayData", + }, + { + name: "入职", + num: resdata.entry || 0, + path: "/root/person/todayData", + }, + { + name: "在职", + num: resdata.obJob || 0, + path: "/root/person/todayData", + }, + ]; + that.billDataList = [ + { + name: "审核中", + num: that.map.classify1num.num10 || 0, + type: 1, + path: "/root/person/applyIndex?status=1", + }, + { + name: "待接待", + num: that.map.classify1num.num20 || 0, + type: 2, + path: "/root/person/applyIndex?status=2", + }, + { + name: "待面试", + num: that.map.classify1num.num25 || 0, + type: 3, + path: "/root/person/applyIndex?status=3", + }, + { + name: "待入职", + num: that.map.classify1num.num30 || 0, + type: 4, + path: "/root/person/applyIndex?status=4", + }, + { + name: "在职中", + num: that.map.classify1num.num40 || 0, + type: 5, + path: "/root/person/applyIndex?status=5", + }, + ]; } - let resdata = res.classify1num; - that.todayDataList = [ - { - name: "报名", - num: resdata.signUps || 0, - path: "/root/person/todayData", - }, - { - name: "到面", - num: resdata.arrived || 0, - path: "/root/person/todayData", - }, - { - name: "通过", - num: resdata.passed || 0, - path: "/root/person/todayData", - }, - { - name: "入职", - num: resdata.entry || 0, - path: "/root/person/todayData", - }, - { - name: "在职", - num: resdata.obJob || 0, - path: "/root/person/todayData", - }, - ]; - that.billDataList = [ - { - name: "审核中", - num: that.map.classify1num.num10 || 0, - type: 1, - path: "/root/person/applyIndex?status=1", - }, - { - name: "待接待", - num: that.map.classify1num.num20 || 0, - type: 2, - path: "/root/person/applyIndex?status=2", - }, - { - name: "待面试", - num: that.map.classify1num.num25 || 0, - type: 3, - path: "/root/person/applyIndex?status=3", - }, - { - name: "待入职", - num: that.map.classify1num.num30 || 0, - type: 4, - path: "/root/person/applyIndex?status=4", - }, - { - name: "在职中", - num: that.map.classify1num.num40 || 0, - type: 5, - path: "/root/person/applyIndex?status=5", - }, - ]; } ); }, diff --git a/root/detail/userShare.vue b/root/detail/userShare.vue index 743bdbd..91f001d 100644 --- a/root/detail/userShare.vue +++ b/root/detail/userShare.vue @@ -1,37 +1,22 @@ @@ -160,14 +179,24 @@ export default { return { numSlot: [], fromShare: false, - background:{ - backgroundColor: 'transparent', + background: { + backgroundColor: "transparent", + }, + teamInfo: { + tel: "", + userName: "", }, + userInfo: {}, + chooseTeam: {}, + teamList: [], navColor: "rgb(255,255,255,0)", isLogin: null, isShowMore: true, isShowJob: true, submitConfirm: false, + joinTeamConfirm: false, + joinTeamDrawerShow: false, + pageSpeed: 0, agencyId: 0, loading: true, @@ -239,11 +268,11 @@ export default { inviteUserId: 0, refreshing: false, - mtScroll:0, - backgroundScale: 0, // 背景缩放比例 - startY: 0, // 触摸起始位置 - moveY: 0, // 触摸移动位置 - isTouching: false, // 是否正在触摸 + mtScroll: 0, + backgroundScale: 0, // 背景缩放比例 + startY: 0, // 触摸起始位置 + moveY: 0, // 触摸移动位置 + isTouching: false, // 是否正在触摸 }; }, onPageScroll(e) { @@ -323,7 +352,7 @@ export default { } }, methods: { - // 触摸开始事件 + // 触摸开始事件 onTouchStart(e) { this.mtScroll = 0; this.backgroundScale = 0; @@ -335,28 +364,32 @@ export default { // 触摸移动事件 onTouchMove(e) { - if (!this.isTouching) return; - - if (e.touches && e.touches.length > 0) { - this.moveY = e.touches[0].pageY; - const moveDistance = this.moveY - this.startY; - - // 只有向下移动(moveDistance > 0)且移动距离合理时才触发下拉效果 - if (moveDistance > 0 && moveDistance < 200) { // 限制最大下拉距离 - const query = uni.createSelectorQuery().in(this); - query.select('.scroll-container').boundingClientRect(data => { - if (data) { - const scrollTop = data.scrollTop || 0; - // 只有在滚动到顶部且向下拉动时才执行缩放 - if (scrollTop <= 0) { - // 根据移动距离计算缩放值,使效果更自然 - this.backgroundScale = Math.min(moveDistance * 0.2, 800); // 限制最大缩放值 - this.mtScroll = Math.min(moveDistance * 0.2, 800); - } - } - }).exec(); - } + if (!this.isTouching) return; + + if (e.touches && e.touches.length > 0) { + this.moveY = e.touches[0].pageY; + const moveDistance = this.moveY - this.startY; + + // 只有向下移动(moveDistance > 0)且移动距离合理时才触发下拉效果 + if (moveDistance > 0 && moveDistance < 200) { + // 限制最大下拉距离 + const query = uni.createSelectorQuery().in(this); + query + .select(".scroll-container") + .boundingClientRect((data) => { + if (data) { + const scrollTop = data.scrollTop || 0; + // 只有在滚动到顶部且向下拉动时才执行缩放 + if (scrollTop <= 0) { + // 根据移动距离计算缩放值,使效果更自然 + this.backgroundScale = Math.min(moveDistance * 0.2, 800); // 限制最大缩放值 + this.mtScroll = Math.min(moveDistance * 0.2, 800); + } + } + }) + .exec(); } + } }, // 触摸结束事件 @@ -385,7 +418,7 @@ export default { animate(); }, onScrollToLower() { - let that = this; + let that = this; if (!that.isLogin) { return false; } @@ -393,8 +426,8 @@ export default { that.query.page++; that.getDefault("concat"); } - }, - + }, + goHome() { if (this.fromShare) { uni.switchTab({ @@ -741,17 +774,6 @@ export default { }); }, - handleSubmit() { - let that = this; - this.G.isLogin(); - if (this.G.isLogin()) { - // 根据参数,判断是名片打开还是其他页面打开 - - this.submitConfirm = true; - return; - } - }, - getAgencyById() { let that = this; return new Promise((reso, reject) => { @@ -795,10 +817,11 @@ export default { let that = this; this.isLogin = true; console.log("successLogin", e); + this.loginInfo = uni.getStorageSync("apply-userinfo"); that.getAgencyInfo().then(() => { that.getAgencyById().then(() => { // that.query.page++; - console.log('Boolean(e.agencyId)',Boolean(e.agencyId)); + console.log("Boolean(e.agencyId)", Boolean(e.agencyId)); if (Boolean(e.agencyId) == false || that.info.recordStatus == 3 || that.info.recordStatus == 4 || that.info.recordStatus == 6) { that.handleSubmit(); } else { @@ -816,6 +839,7 @@ export default { jobLogin() { let that = this; this.isLogin = true; + this.loginInfo = uni.getStorageSync("apply-userinfo"); that.getAgencyInfo().then(() => { that.getAgencyById().then(() => { // that.query.page++; @@ -823,6 +847,87 @@ export default { }); }); }, + handleSubmit() { + let that = this; + this.G.isLogin(); + if (this.G.isLogin()) { + if (that.loginInfo.agencyId) { + that.submitConfirm = true; + } else { + that.G.handleConfirm({ + cancelText: "创建团队", + confirmText: "加入团队", + content: "请确认公司是否已创建团队,如果有可直接加入,如果没有可创建。", + success: (res) => { + if (res.confirm) { + this.joinTeamConfirm = true; + } else { + this.submitConfirm = true; + } + }, + }); + } + } + }, + searchTeamByTel() { + let that = this; + if (!that.teamInfo.tel || !that.G.setReg(that.teamInfo.tel, "tel")) { + uni.showToast({ + title: "请输入正确的手机号", + icon: "none", + }); + return; + } + that.G.Get(that.api.bind_getAgencyByAdminTel, { tel: that.teamInfo.tel }, (res) => { + that.teamList = res; + that.joinTeamDrawerShow = true; + console.log(res); + }); + }, + clickTeam(_item) { + let that = this; + that.chooseTeam = _item; + that.joinTeamDrawerShow = false; + }, + joinTeam() { + let that = this; + console.log("that.chooseTeam", that.chooseTeam); + if (!that.chooseTeam.agencyId) { + uni.showToast({ + title: "请选择一个团队", + icon: "none", + }); + return; + } + if (!that.teamInfo.userName) { + uni.showToast({ + title: "请输入您的昵称", + icon: "none", + }); + return; + } + this.G.Post(this.api.order_addApply, { agencyId: that.chooseTeam.agencyId, username: this.teamInfo.userName }, (res) => { + uni.showToast({ + title: "申请成功", + icon: "none", + }); + this.joinTeamConfirm = false; + that.G.handleConfirm({ + confirmText: "确认", + showCancel: false, + content: "您已发起申请,审核通过即可加入该团队", + success: (res) => { + if (res.confirm) { + uni.switchTab({ + url: "/pages/home/index", + }); + } + }, + }); + console.log(res); + }); + }, + handleUpdateTab() {}, }, }; @@ -845,6 +950,6 @@ export default { } } .scroll-area { - height: 100vh; + height: 100vh; } diff --git a/root/person/teamManage.vue b/root/person/teamManage.vue index 3b8224a..f5f922e 100644 --- a/root/person/teamManage.vue +++ b/root/person/teamManage.vue @@ -50,14 +50,14 @@
- +
- +