feat: update material card

This commit is contained in:
chashaobao
2025-09-08 23:28:17 +08:00
parent f2e7fd9d85
commit b9cd0a3e6d
4 changed files with 89 additions and 66 deletions

View File

@ -62,6 +62,28 @@ export const getBasicInfo = (profile: Pick<MaterialProfile, 'age' | 'height' | '
return result.join('·');
};
export const getSalary = (
data: Pick<MaterialProfile, 'fullTimeMaxPrice' | 'fullTimeMinPrice' | 'partyTimeMaxPrice' | 'partyTimeMinPrice'>
) => {
const { fullTimeMinPrice, fullTimeMaxPrice, partyTimeMinPrice, partyTimeMaxPrice } = data;
const prices: string[] = [];
if (fullTimeMinPrice && fullTimeMaxPrice) {
if (fullTimeMinPrice >= 50000) {
prices.push(`${fullTimeMinPrice / 1000}K以上/月`);
} else {
prices.push(`${fullTimeMinPrice / 1000}-${fullTimeMaxPrice / 1000}K/月`);
}
}
if (partyTimeMinPrice && partyTimeMaxPrice) {
if (partyTimeMinPrice >= 500) {
prices.push(`500以上/小时`);
} else {
prices.push(`${partyTimeMinPrice}-${partyTimeMaxPrice}/小时`);
}
}
return prices.filter(Boolean).join(' ');
};
export const chooseMedia = async (option: Taro.chooseMedia.Option = {}) => {
try {
const result = await Taro.chooseMedia({