feat: 模卡更新
This commit is contained in:
@ -115,7 +115,6 @@ export default function AnchorPage() {
|
||||
const handleChangeSelectJob = useCallback((select?: JobManageInfo) => {
|
||||
log('select job change', select);
|
||||
setSelectJob(select);
|
||||
console.log('哈哈哈', !select);
|
||||
setOpenPopup(!select);
|
||||
setLastSelectMyJobId(select?.id || '');
|
||||
}, []);
|
||||
|
||||
@ -10,11 +10,27 @@
|
||||
left: 24px;
|
||||
right: 24px;
|
||||
bottom: 0;
|
||||
background: #F5F6FA;
|
||||
background: #f5f6fa;
|
||||
}
|
||||
|
||||
&__submit-btn {
|
||||
.button(@width: 100%, @height: 80px, @fontSize: 32px, @fontWeight: 400, @borderRadius: 48px);
|
||||
bottom: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
&__skip-btn-wrapper {
|
||||
text-align: center;
|
||||
bottom: 60px;
|
||||
}
|
||||
|
||||
&__skip-btn {
|
||||
color: @blHighlightColor;
|
||||
width: 161px;
|
||||
height: 40px;
|
||||
font-weight: 400;
|
||||
font-size: 32px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,25 +21,28 @@ import { navigateBack } from '@/utils/route';
|
||||
import Toast from '@/utils/toast';
|
||||
|
||||
import './index.less';
|
||||
import ProfileOthersFragment from '@/fragments/profile/others';
|
||||
|
||||
const PREFIX = 'page-material-create-profile';
|
||||
const log = logWithPrefix(PREFIX);
|
||||
|
||||
const REQUIRE_KEYS = {
|
||||
[ProfileGroupType.Basic]: ['name', 'gender', 'age', 'height', 'weight'],
|
||||
[ProfileGroupType.Basic]: ['name', 'gender', 'age'],
|
||||
[ProfileGroupType.Intention]: [
|
||||
'cityCodes',
|
||||
'employType',
|
||||
'acceptWorkForSit',
|
||||
'fullTimeMinPrice',
|
||||
'fullTimeMaxPrice',
|
||||
'partyTimeMinPrice',
|
||||
'partyTimeMaxPrice',
|
||||
],
|
||||
[ProfileGroupType.Experience]: ['workedYear'],
|
||||
[ProfileGroupType.Experience]: [],
|
||||
[ProfileGroupType.Advantages]: [],
|
||||
[ProfileGroupType.Others]: [],
|
||||
};
|
||||
|
||||
const COULD_SKIP = [ProfileGroupType.Experience, ProfileGroupType.Others];
|
||||
|
||||
const CONDITIONAL_REQUIRED_KEYS = {
|
||||
[ProfileGroupType.Intention]: [
|
||||
['fullTimeMinPrice', data => isFullTimePriceRequired(data.employType)],
|
||||
@ -52,11 +55,13 @@ const CONDITIONAL_REQUIRED_KEYS = {
|
||||
const getNextStepGroupType = (curType: ProfileGroupType) => {
|
||||
switch (curType) {
|
||||
case ProfileGroupType.Basic:
|
||||
return ProfileGroupType.Advantages;
|
||||
case ProfileGroupType.Intention:
|
||||
return ProfileGroupType.Experience;
|
||||
case ProfileGroupType.Experience:
|
||||
case ProfileGroupType.Intention:
|
||||
return ProfileGroupType.Basic;
|
||||
case ProfileGroupType.Experience:
|
||||
return ProfileGroupType.Others;
|
||||
case ProfileGroupType.Others:
|
||||
return ProfileGroupType.Advantages;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@ -88,7 +93,16 @@ export default function MaterialCreateProfile() {
|
||||
? ProfileExperienceFragment
|
||||
: groupType === ProfileGroupType.Advantages
|
||||
? ProfileAdvantagesFragment
|
||||
: Fragment;
|
||||
: groupType === ProfileGroupType.Others
|
||||
? ProfileOthersFragment
|
||||
: Fragment;
|
||||
|
||||
const handleSkip = useCallback(() => {
|
||||
const nextType = getNextStepGroupType(groupType);
|
||||
if (nextType) {
|
||||
setGroupType(nextType);
|
||||
}
|
||||
}, [groupType]);
|
||||
|
||||
const handleSubmit = useCallback(async () => {
|
||||
try {
|
||||
@ -123,14 +137,23 @@ export default function MaterialCreateProfile() {
|
||||
Taro.setNavigationBarTitle({ title });
|
||||
}, [groupType]);
|
||||
|
||||
const couldSkip = COULD_SKIP.includes(groupType);
|
||||
|
||||
return (
|
||||
<div className={PREFIX}>
|
||||
<ProfileFragment ref={ref} profile={{ cityCodes: location.cityCode || '' }} />
|
||||
<SafeBottomPadding />
|
||||
<div className={`${PREFIX}__footer`}>
|
||||
<Button className={`${PREFIX}__submit-btn`} onClick={handleSubmit}>
|
||||
<Button className={`${PREFIX}__submit-btn ${couldSkip ? 'up' : ''}`} onClick={handleSubmit}>
|
||||
{groupType === ProfileGroupType.Advantages ? '完成' : '下一步'}
|
||||
</Button>
|
||||
{couldSkip && (
|
||||
<div className={`${PREFIX}__skip-btn-wrapper`}>
|
||||
<div className={`${PREFIX}__skip-btn`} onClick={handleSkip}>
|
||||
跳过
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<SafeBottomPadding />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -12,6 +12,7 @@ import ProfileAdvantagesFragment from '@/fragments/profile/advantages';
|
||||
import ProfileBasicFragment from '@/fragments/profile/basic';
|
||||
import ProfileExperienceFragment from '@/fragments/profile/experience';
|
||||
import ProfileIntentionFragment from '@/fragments/profile/intention';
|
||||
import ProfileOthersFragment from '@/fragments/profile/others';
|
||||
import { MaterialProfile } from '@/types/material';
|
||||
import { logWithPrefix } from '@/utils/common';
|
||||
import { collectEvent } from '@/utils/event';
|
||||
@ -37,7 +38,9 @@ export default function MaterialEdit() {
|
||||
? ProfileExperienceFragment
|
||||
: groupType === ProfileGroupType.Advantages
|
||||
? ProfileAdvantagesFragment
|
||||
: Fragment;
|
||||
: groupType === ProfileGroupType.Others
|
||||
? ProfileOthersFragment
|
||||
: Fragment;
|
||||
log('MaterialEdit', groupType, ref);
|
||||
|
||||
const handleSubmit = useCallback(async () => {
|
||||
|
||||
Reference in New Issue
Block a user