feat: 模卡更新
This commit is contained in:
@ -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('·');
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user