feat: 模卡更新

This commit is contained in:
chashaobao
2025-11-03 22:18:39 +08:00
parent fde2027588
commit 5e3e6903cb
31 changed files with 479 additions and 193 deletions

View File

@ -2,7 +2,7 @@ import Taro from '@tarojs/taro';
import { PageUrl } from '@/constants/app';
import { CollectEventName } from '@/constants/event';
import { GenderType, MaterialViewSource } from '@/constants/material';
import { EDUCATION_TYPE_LABELS, GenderType, MaterialViewSource } from '@/constants/material';
import { MessageSubscribeIds } from '@/constants/subscribe';
import http from '@/http';
import { API } from '@/http/api';
@ -44,7 +44,9 @@ const updateUserIfNeed = async () => {
await requestUserInfo();
};
export const getBasicInfo = (profile: Pick<MaterialProfile, 'age' | 'height' | 'weight' | 'shoeSize' | 'gender'>) => {
export const getBasicInfo = (
profile: Pick<MaterialProfile, 'age' | 'height' | 'weight' | 'shoeSize' | 'gender' | 'educationType'>
) => {
const result: string[] = [];
if (typeof profile.age !== 'undefined' && profile.age !== null) {
result.push(`${profile.age}`);
@ -59,6 +61,9 @@ export const getBasicInfo = (profile: Pick<MaterialProfile, 'age' | 'height' | '
result.push(`${profile.shoeSize}`);
}
result.push(profile.gender === GenderType.MEN ? '男' : '女');
if (typeof profile.educationType !== 'undefined' && profile.educationType !== null) {
result.push(EDUCATION_TYPE_LABELS[profile.educationType]);
}
return result.join('·');
};