登录注册逻辑开发

This commit is contained in:
冯辉
2025-10-17 13:15:14 +08:00
parent 14dafac147
commit 959e9ee9e4
8 changed files with 192 additions and 121 deletions

View File

@@ -25,9 +25,9 @@ onLaunch((options) => {
}); });
}); });
} else { } else {
uni.redirectTo({ // uni.redirectTo({
url: '/pages/login/login', // url: '/pages/login/login',
}); // });
} }
}); });

View File

@@ -75,10 +75,10 @@ const { getTransformChildren } = useDictStore();
// 岗位类型数据 // 岗位类型数据
const getJobTypeData = () => { const getJobTypeData = () => {
return [ return [
{ label: '常规岗位', value: 'regular', text: '常规岗位' }, { label: '常规岗位', value: 0, text: '常规岗位' },
{ label: '就业见习岗位', value: 'internship', text: '就业见习岗位' }, { label: '就业见习岗位', value: 1, text: '就业见习岗位' },
{ label: '实习实训岗位', value: 'training', text: '实习实训岗位' }, { label: '实习实训岗位', value: 2, text: '实习实训岗位' },
{ label: '社区实践岗位', value: 'community', text: '社区实践岗位' } { label: '社区实践岗位', value: 3, text: '社区实践岗位' }
]; ];
}; };

View File

@@ -1,102 +1,102 @@
{ {
"name": "qingdao-employment-service", "name" : "qingdao-employment-service",
"appid": "__UNI__C939371", "appid" : "__UNI__C939371",
"description": "招聘", "description" : "招聘",
"versionName": "1.0.0", "versionName" : "1.0.0",
"versionCode": "100", "versionCode" : "100",
"transformPx": false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus": { "app-plus" : {
"usingComponents": true, "usingComponents" : true,
"nvueStyleCompiler": "uni-app", "nvueStyleCompiler" : "uni-app",
"compilerVersion": 3, "compilerVersion" : 3,
"splashscreen": { "splashscreen" : {
"alwaysShowBeforeRender": true, "alwaysShowBeforeRender" : true,
"waiting": true, "waiting" : true,
"autoclose": true, "autoclose" : true,
"delay": 0 "delay" : 0
}, },
/* */ /* */
"modules": {}, "modules" : {},
/* */ /* */
"distribute": { "distribute" : {
/* android */ /* android */
"android": { "android" : {
"permissions": [ "permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>", "<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
] ]
}, },
/* ios */ /* ios */
"ios": {}, "ios" : {},
/* SDK */ /* SDK */
"sdkConfigs": {} "sdkConfigs" : {}
} }
}, },
/* */ /* */
"quickapp": {}, "quickapp" : {},
/* */ /* */
"mp-weixin": { "mp-weixin" : {
"appid": "", "appid" : "wx9d1cbc11c8c40ba7",
"setting": { "setting" : {
"urlCheck": false, "urlCheck" : false,
"es6": true, "es6" : true,
"postcss": true, "postcss" : true,
"minified": true "minified" : true
}, },
"usingComponents": true, "usingComponents" : true,
"permission": { "permission" : {
"scope.userLocation": { "scope.userLocation" : {
"desc": "用于用户选择地图查看位置" "desc" : "用于用户选择地图查看位置"
} }
} }
}, },
"mp-alipay": { "mp-alipay" : {
"usingComponents": true "usingComponents" : true
}, },
"mp-baidu": { "mp-baidu" : {
"usingComponents": true "usingComponents" : true
}, },
"mp-toutiao": { "mp-toutiao" : {
"usingComponents": true "usingComponents" : true
}, },
"uniStatistics": { "uniStatistics" : {
"enable": false "enable" : false
}, },
"vueVersion": "3", "vueVersion" : "3",
"locale": "zh-Hans", "locale" : "zh-Hans",
"h5": { "h5" : {
"router": { "router" : {
"base": "/ks_app/", "base" : "/ks_app/",
"mode": "hash" "mode" : "hash"
}, },
"title": "青岛智慧就业服务", "title" : "青岛智慧就业服务",
"optimization": { "optimization" : {
"treeShaking": { "treeShaking" : {
"enable": true "enable" : true
} }
}, },
"sdkConfigs": { "sdkConfigs" : {
"maps": { "maps" : {
"amap": { "amap" : {
"key": "9cfc9370bd8a941951da1cea0308e9e3", "key" : "9cfc9370bd8a941951da1cea0308e9e3",
"securityJsCode": "7b16386c7f744c3ca05595965f2b037f", "securityJsCode" : "7b16386c7f744c3ca05595965f2b037f",
"serviceHost": "" "serviceHost" : ""
} }
} }
} }
} }
} }

View File

@@ -373,12 +373,21 @@ function clearfindJob(job) {
} }
function nextDetail(job) { function nextDetail(job) {
// 记录岗位类型,用作数据分析 // 登录
if (job.jobCategory) { let token = uni.getStorageSync('token') || ''; // 同步获取 缓存信息
const recordData = recommedIndexDb.JobParameter(job); if (token) {
recommedIndexDb.addRecord(recordData); // 记录岗位类型,用作数据分析
if (job.jobCategory) {
const recordData = recommedIndexDb.JobParameter(job);
recommedIndexDb.addRecord(recordData);
}
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
} else {
uni.redirectTo({
url: '/pages/login/login',
});
} }
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
} }
function navToService(serviceType) { function navToService(serviceType) {
@@ -422,7 +431,12 @@ function openFilter() {
...pageState.search, ...pageState.search,
}; };
for (const [key, value] of Object.entries(values)) { for (const [key, value] of Object.entries(values)) {
pageState.search[key] = value.join(','); // 特殊处理岗位类型,直接传递数字值
if (key === 'jobType') {
pageState.search.type = value.join(',');
} else {
pageState.search[key] = value.join(',');
}
} }
showFilter.value = false; showFilter.value = false;
getJobList('refresh'); getJobList('refresh');

View File

@@ -22,7 +22,7 @@ import { useReadMsg } from '@/stores/useReadMsg';
const { unreadCount } = storeToRefs(useReadMsg()); const { unreadCount } = storeToRefs(useReadMsg());
onLoad(() => { onLoad(() => {
useReadMsg().fetchMessages(); // useReadMsg().fetchMessages();
}); });
</script> </script>

View File

@@ -56,9 +56,17 @@
<view class="input-titile">学历</view> <view class="input-titile">学历</view>
<input class="input-con" v-model="state.educationText" disabled placeholder="本科" /> <input class="input-con" v-model="state.educationText" disabled placeholder="本科" />
</view> </view>
<view class="content-input"> <view class="content-input" :class="{ 'input-error': idCardError }">
<view class="input-titile">身份证</view> <view class="input-titile">身份证</view>
<input class="input-con2" v-model="fromValue.idcard" maxlength="18" placeholder="本科" /> <input
class="input-con2"
v-model="fromValue.idcard"
maxlength="18"
placeholder="请输入身份证号码"
@input="validateIdCard"
/>
<view v-if="idCardError" class="error-message">{{ idCardError }}</view>
<view v-if="fromValue.idcard && !idCardError" class="success-message"> 身份证格式正确</view>
</view> </view>
</view> </view>
<view class="next-btn" @tap="nextStep">下一步</view> <view class="next-btn" @tap="nextStep">下一步</view>
@@ -130,7 +138,7 @@ const openSelectPopup = inject('openSelectPopup');
// console.log(config.appInfo.areaName); // console.log(config.appInfo.areaName);
// status // status
const selectJobsModel = ref(); const selectJobsModel = ref();
const tabCurrent = ref(0); const tabCurrent = ref(1);
const salay = [2, 5, 10, 15, 20, 25, 30, 50, 80, 100]; const salay = [2, 5, 10, 15, 20, 25, 30, 50, 80, 100];
const state = reactive({ const state = reactive({
station: [], station: [],
@@ -154,6 +162,9 @@ const fromValue = reactive({
idcard: '', idcard: '',
}); });
// 身份证校验相关
const idCardError = ref('');
onLoad((parmas) => { onLoad((parmas) => {
getTreeselect(); getTreeselect();
}); });
@@ -163,6 +174,26 @@ onMounted(() => {});
function changeSex(sex) { function changeSex(sex) {
fromValue.sex = sex; fromValue.sex = sex;
} }
// 身份证实时校验
function validateIdCard() {
const idCard = fromValue.idcard.trim();
// 如果为空,清除错误信息
if (!idCard) {
idCardError.value = '';
return;
}
// 使用身份证校验器进行校验
const result = IdCardValidator.validate(idCard);
if (result.valid) {
idCardError.value = '';
} else {
idCardError.value = result.message;
}
}
function changeExperience() { function changeExperience() {
openSelectPopup({ openSelectPopup({
title: '工作经验', title: '工作经验',
@@ -239,6 +270,19 @@ function changeJobs() {
} }
function nextStep() { function nextStep() {
// 校验身份证号码
const idCard = fromValue.idcard.trim();
if (!idCard) {
$api.msg('请输入身份证号码');
return;
}
const result = IdCardValidator.validate(idCard);
if (!result.valid) {
$api.msg(result.message);
return;
}
tabCurrent.value += 1; tabCurrent.value += 1;
} }
@@ -451,6 +495,19 @@ function complete() {
border-radius: 2rpx border-radius: 2rpx
background: #697279; background: #697279;
transform: rotate(45deg) transform: rotate(45deg)
.error-message
color: #ff4757;
font-size: 24rpx;
margin-top: 10rpx;
line-height: 1.4;
.success-message
color: #2ed573;
font-size: 24rpx;
margin-top: 10rpx;
line-height: 1.4;
.input-error
.input-con2
border-bottom-color: #ff4757;
.content-sex .content-sex
height: 110rpx; height: 110rpx;
display: flex display: flex

View File

@@ -101,7 +101,7 @@ const useUserStore = defineStore("user", () => {
token.value = value token.value = value
uni.setStorageSync('token', value); uni.setStorageSync('token', value);
// 获取消息列表 // 获取消息列表
useReadMsg().fetchMessages() // useReadMsg().fetchMessages()
// 获取用户信息 // 获取用户信息
return getUserResume() return getUserResume()
} }

View File

@@ -13,7 +13,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "", "libVersion": "",
"appid": "touristappid", "appid": "wx9d1cbc11c8c40ba7",
"projectname": "qingdao-employment-service", "projectname": "qingdao-employment-service",
"condition": { "condition": {
"search": { "search": {