diff --git a/components/CustomTabBar/CustomTabBar.vue b/components/CustomTabBar/CustomTabBar.vue index a393352..5e21f93 100644 --- a/components/CustomTabBar/CustomTabBar.vue +++ b/components/CustomTabBar/CustomTabBar.vue @@ -4,14 +4,17 @@ class="tabbar-item" v-for="(item, index) in tabbarList" :key="index" + :class="{ 'center-item': item.centerItem }" @click.stop="switchTab(item, index)" @tap.stop="switchTab(item, index)" > - + + + {{ item.badge }} @@ -59,22 +62,13 @@ const generateTabbarList = () => { }, { id: 2, - text: '智能客服', - path: '/pages/chat/chat', - iconPath: '/static/tabbar/logo3.png', - selectedIconPath: '/static/tabbar/logo3.png', + text: '', + path: '/packageA/pages/chat/chat', + iconPath: '/static/tabbar/robot2.png', + selectedIconPath: '/static/tabbar/robot2.png', centerItem: true, badge: readMsg.badges[2]?.count || 0, }, - { - id: 3, - text: '消息', - path: '/pages/msglog/msglog', - iconPath: '/static/tabbar/chat4.png', - selectedIconPath: '/static/tabbar/chat4ed.png', - centerItem: false, - badge: readMsg.badges[3]?.count || 0, - }, { id: 4, text: '我的', @@ -126,7 +120,8 @@ const generateTabbarList = () => { // #endif } if (userType === 0) { - baseItems.splice(2, 0, { + // 企业用户:将招聘会添加到第1个位置,AI图标保持在中间 + baseItems.splice(1, 0, { id: 5, text: '招聘会', path: '/pages/careerfair/careerfair', @@ -135,6 +130,14 @@ const generateTabbarList = () => { centerItem: false, badge: 0, }); + // 调整AI图标的位置到中间(索引2) + const aiItem = baseItems.find(item => item.id === 2); + if (aiItem) { + // 移除AI图标 + baseItems.splice(baseItems.indexOf(aiItem), 1); + // 将AI图标插入到中间位置 + baseItems.splice(2, 0, aiItem); + } } return baseItems; }; @@ -200,12 +203,12 @@ const switchTab = (item, index) => { // 判断企业信息字段company是否为null或undefined if (!currentUserInfo.company || currentUserInfo.company === null) { // 企业信息为空,跳转到企业信息补全页面 - uni.navigateTo({ + uni.redirectTo({ url: '/packageA/pages/complete-info/company-info', }); } else { // 企业信息完整,跳转到发布岗位页面 - uni.navigateTo({ + uni.redirectTo({ url: '/packageA/pages/job/publishJob', }); } @@ -234,7 +237,7 @@ const switchTab = (item, index) => { } // 跳转到对应的页面 - uni.navigateTo({ + uni.redirectTo({ url: targetPath, }); @@ -243,26 +246,10 @@ const switchTab = (item, index) => { } } - // 判断是否为 tabBar 页面 - const tabBarPages = [ - '/pages/index/index', - '/pages/careerfair/careerfair', - '/pages/chat/chat', - '/pages/msglog/msglog', - '/pages/mine/mine' - ]; - - if (tabBarPages.includes(item.path)) { - // TabBar 页面使用 redirectTo 避免页面栈溢出 - uni.redirectTo({ - url: item.path, - }); - } else { - // 非 TabBar 页面使用 navigateTo - uni.navigateTo({ - url: item.path, - }); - } + // 所有页面都使用 redirectTo 避免页面栈溢出 + uni.redirectTo({ + url: item.path, + }); currentItem.value = item.id; }; @@ -275,6 +262,34 @@ onMounted(() => { diff --git a/components/tabbar/midell-box.vue b/components/tabbar/midell-box.vue index d3e6e3a..fd18b2e 100644 --- a/components/tabbar/midell-box.vue +++ b/components/tabbar/midell-box.vue @@ -76,7 +76,7 @@ const generateTabbarList = () => { { id: 2, text: 'AI+', - path: '/pages/chat/chat', + path: '/packageA/pages/chat/chat', iconPath: '../../static/tabbar/logo3.png', selectedIconPath: '../../static/tabbar/logo3.png', centerItem: true, @@ -148,7 +148,7 @@ const changeItem = (item) => { const tabBarPages = [ '/pages/index/index', '/pages/careerfair/careerfair', - '/pages/chat/chat', + '/packageA/pages/chat/chat', '/pages/msglog/msglog', '/pages/mine/mine' ]; diff --git a/components/wxAuthLogin/WxAuthLogin.vue b/components/wxAuthLogin/WxAuthLogin.vue index a251881..754bea6 100644 --- a/components/wxAuthLogin/WxAuthLogin.vue +++ b/components/wxAuthLogin/WxAuthLogin.vue @@ -103,12 +103,19 @@ - + + + + 我已阅读并同意 + + 《隐私协议》 + + @@ -128,6 +135,7 @@ const popup = ref(null); const userType = ref(null); // 用户角色:1-求职者,0-企业 const orgType = ref(null); // 机构类型 const orgTypeOptions = ref([]); // 机构类型选项 +const agreedToAgreement = ref(false); // 是否同意用户协议 const emit = defineEmits(['success', 'cancel']); // 获取机构类型字典 @@ -159,6 +167,10 @@ const open = () => { popup.value?.open(); userType.value = null; // 重置角色选择 orgType.value = null; // 重置机构类型选择 + + // 检查是否已同意协议 + const agreed = uni.getStorageSync('agreedToUserAgreement'); + agreedToAgreement.value = !!agreed; }; // 关闭弹窗 @@ -191,26 +203,25 @@ const validateRole = () => { return false; } + // 验证是否同意用户协议 + if (!agreedToAgreement.value) { + $api.msg('请先阅读并同意隐私协议'); + return false; + } + return true; }; const getPhoneNumber = (e) => { console.log('获取手机号:', e); console.log('userType.value', userType.value) - // 验证角色是否已选择 + // 验证角色、机构类型和隐私协议 + if (!validateRole()) { + return; + } if (e.detail.errMsg === 'getPhoneNumber:ok') { - if (userType.value === null) { - $api.msg('请先选择您的角色'); - return true; - } - - // 验证机构类型是否已选择(仅单位角色) - if (userType.value === 0 && orgType.value === null) { - $api.msg('请选择机构类型'); - return true; - } uni.login({ provider: 'weixin', success: (loginRes) => { @@ -363,6 +374,11 @@ const wxLogin = () => { // 测试账号登录(仅开发环境) const testLogin = () => { + // 验证角色、机构类型和隐私协议 + if (!validateRole()) { + return; + } + uni.showLoading({ title: '登录中...' }); const params = { @@ -409,18 +425,21 @@ const testLogin = () => { }); }; +// 切换协议同意状态 +const toggleAgreement = () => { + agreedToAgreement.value = !agreedToAgreement.value; +}; + // 打开用户协议 const openAgreement = (type) => { const urls = { - user: '/pages/agreement/user', - privacy: '/pages/agreement/privacy' + user: '/packageA/pages/agreement/user', + privacy: '/packageA/pages/agreement/privacy' }; - if (urls[type]) { - uni.navigateTo({ - url: urls[type] - }); - } + uni.navigateTo({ + url: urls[type] + }); }; // 暴露方法供父组件调用 @@ -596,10 +615,23 @@ defineExpose({ margin-left: 12rpx .auth-agreement - text-align: center + display: flex + align-items: center + justify-content: center font-size: 24rpx color: #999999 line-height: 1.6 + flex-wrap: wrap + gap: 8rpx + + .agreement-checkbox + display: flex + align-items: center + cursor: pointer + + .agreement-text + margin-left: 8rpx + color: #666666 .link color: #256BFA diff --git a/package.json b/package.json index afea3cf..3b8730e 100644 --- a/package.json +++ b/package.json @@ -4,5 +4,8 @@ "dayjs": "^1.11.19", "mp-html": "^2.5.2", "sm-crypto": "^0.3.13" + }, + "devDependencies": { + "crypto-js": "^4.2.0" } } diff --git a/packageA/pages/UnitDetails/UnitDetails.vue b/packageA/pages/UnitDetails/UnitDetails.vue index 13e4745..e4db336 100644 --- a/packageA/pages/UnitDetails/UnitDetails.vue +++ b/packageA/pages/UnitDetails/UnitDetails.vue @@ -1,16 +1,11 @@