企业注册根据信用代码回显企业信息
This commit is contained in:
@@ -120,7 +120,8 @@ const generateTabbarList = () => {
|
|||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
if (userType === 0) {
|
if (userType === 0) {
|
||||||
baseItems.splice(2, 0, {
|
// 企业用户:将招聘会添加到第1个位置,AI图标保持在中间
|
||||||
|
baseItems.splice(1, 0, {
|
||||||
id: 5,
|
id: 5,
|
||||||
text: '招聘会',
|
text: '招聘会',
|
||||||
path: '/pages/careerfair/careerfair',
|
path: '/pages/careerfair/careerfair',
|
||||||
@@ -129,6 +130,14 @@ const generateTabbarList = () => {
|
|||||||
centerItem: false,
|
centerItem: false,
|
||||||
badge: 0,
|
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;
|
return baseItems;
|
||||||
};
|
};
|
||||||
@@ -194,12 +203,12 @@ const switchTab = (item, index) => {
|
|||||||
// 判断企业信息字段company是否为null或undefined
|
// 判断企业信息字段company是否为null或undefined
|
||||||
if (!currentUserInfo.company || currentUserInfo.company === null) {
|
if (!currentUserInfo.company || currentUserInfo.company === null) {
|
||||||
// 企业信息为空,跳转到企业信息补全页面
|
// 企业信息为空,跳转到企业信息补全页面
|
||||||
uni.navigateTo({
|
uni.redirectTo({
|
||||||
url: '/packageA/pages/complete-info/company-info',
|
url: '/packageA/pages/complete-info/company-info',
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 企业信息完整,跳转到发布岗位页面
|
// 企业信息完整,跳转到发布岗位页面
|
||||||
uni.navigateTo({
|
uni.redirectTo({
|
||||||
url: '/packageA/pages/job/publishJob',
|
url: '/packageA/pages/job/publishJob',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -228,7 +237,7 @@ const switchTab = (item, index) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 跳转到对应的页面
|
// 跳转到对应的页面
|
||||||
uni.navigateTo({
|
uni.redirectTo({
|
||||||
url: targetPath,
|
url: targetPath,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -237,26 +246,10 @@ const switchTab = (item, index) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断是否为 tabBar 页面
|
// 所有页面都使用 redirectTo 避免页面栈溢出
|
||||||
const tabBarPages = [
|
uni.redirectTo({
|
||||||
'/pages/index/index',
|
url: item.path,
|
||||||
'/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,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
currentItem.value = item.id;
|
currentItem.value = item.id;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
// baseUrl: 'http://39.98.44.136:8080', // 测试
|
// baseUrl: 'http://39.98.44.136:8080', // 测试
|
||||||
baseUrl: 'https://www.xjksly.cn/api/ks', // 正式环境
|
// baseUrl: 'https://www.xjksly.cn/api/ks', // 正式环境
|
||||||
// baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试
|
baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试
|
||||||
|
|
||||||
// LCBaseUrl:'http://10.110.145.145:9100',//内网端口
|
// LCBaseUrl:'http://10.110.145.145:9100',//内网端口
|
||||||
// LCBaseUrlInner:'http://10.110.145.145:10100',//招聘、培训、帮扶
|
// LCBaseUrlInner:'http://10.110.145.145:10100',//招聘、培训、帮扶
|
||||||
|
|||||||
@@ -23,13 +23,16 @@
|
|||||||
<!-- 统一社会信用代码 -->
|
<!-- 统一社会信用代码 -->
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="label">统一社会信用代码</view>
|
<view class="label">统一社会信用代码</view>
|
||||||
<input
|
<view class="input-with-button">
|
||||||
class="input-field"
|
<input
|
||||||
v-model="formData.socialCreditCode"
|
class="input-field"
|
||||||
placeholder="请输入统一社会信用代码"
|
v-model="formData.socialCreditCode"
|
||||||
maxlength="18"
|
placeholder="请输入统一社会信用代码"
|
||||||
@input="updateCompletion"
|
maxlength="18"
|
||||||
/>
|
@input="updateCompletion"
|
||||||
|
/>
|
||||||
|
<button class="query-button" @click="queryCompanyByCreditCode">查询</button>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 企业注册地点 -->
|
<!-- 企业注册地点 -->
|
||||||
@@ -600,6 +603,42 @@ const cancel = () => {
|
|||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据社会信用代码查询企业信息
|
||||||
|
const queryCompanyByCreditCode = async () => {
|
||||||
|
const creditCode = formData.socialCreditCode.trim()
|
||||||
|
if (!creditCode) {
|
||||||
|
$api.msg('请输入统一社会信用代码')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
uni.showLoading({ title: '查询中...' })
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await $api.createRequest('/app/company/queryCodeCompany', { code: creditCode }, 'get')
|
||||||
|
uni.hideLoading()
|
||||||
|
|
||||||
|
if (response.code === 200 && response.data) {
|
||||||
|
const companyData = response.data
|
||||||
|
// 回显企业信息到表单
|
||||||
|
if (companyData.name) formData.companyName = companyData.name
|
||||||
|
if (companyData.location) formData.registeredAddress = companyData.location
|
||||||
|
if (companyData.description) formData.companyIntro = companyData.description
|
||||||
|
if (companyData.nature) formData.nature = companyData.nature
|
||||||
|
if (companyData.registeredAddress) formData.registeredAddress = companyData.registeredAddress
|
||||||
|
if (companyData.legalPerson) formData.legalPersonName = companyData.legalPerson
|
||||||
|
// 其他字段根据接口返回的数据结构进行映射
|
||||||
|
updateCompletion()
|
||||||
|
$api.msg('企业信息查询成功')
|
||||||
|
} else {
|
||||||
|
$api.msg('未查询到企业信息')
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
uni.hideLoading()
|
||||||
|
$api.msg('查询失败,请重试')
|
||||||
|
console.error('查询企业信息失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 确认提交
|
// 确认提交
|
||||||
const confirm = () => {
|
const confirm = () => {
|
||||||
// 验证必填字段
|
// 验证必填字段
|
||||||
@@ -837,6 +876,25 @@ defineExpose({
|
|||||||
font-size: 28rpx
|
font-size: 28rpx
|
||||||
line-height: 1.4
|
line-height: 1.4
|
||||||
|
|
||||||
|
.input-with-button
|
||||||
|
flex: 1
|
||||||
|
display: flex
|
||||||
|
align-items: center
|
||||||
|
gap: 16rpx
|
||||||
|
|
||||||
|
.query-button
|
||||||
|
padding: 8rpx 16rpx
|
||||||
|
background: #256BFA
|
||||||
|
color: #fff
|
||||||
|
font-size: 20rpx
|
||||||
|
border-radius: 6rpx
|
||||||
|
border: none
|
||||||
|
min-width: 100rpx
|
||||||
|
text-align: center
|
||||||
|
|
||||||
|
&:active
|
||||||
|
background: #1a5cd9
|
||||||
|
|
||||||
.input-con
|
.input-con
|
||||||
flex: 1
|
flex: 1
|
||||||
font-size: 28rpx
|
font-size: 28rpx
|
||||||
|
|||||||
Reference in New Issue
Block a user