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

@ -9,7 +9,7 @@ import { PageUrl } from '@/constants/app';
import { MaterialViewSource, WORK_YEAR_LABELS } from '@/constants/material';
import { AnchorInfo } from '@/types/material';
import { calcDistance } from '@/utils/location';
import { getBasicInfo } from '@/utils/material';
import { getBasicInfo, getSalary } from '@/utils/material';
import { navigateTo } from '@/utils/route';
import { activeDate } from '@/utils/time';
@ -22,17 +22,6 @@ interface IProps {
}
const PREFIX = 'anchor-card';
const getSalary = (data: AnchorInfo) => {
const { fullTimeMinPrice, fullTimeMaxPrice, partyTimeMinPrice, partyTimeMaxPrice } = data;
const prices: string[] = [];
if (fullTimeMinPrice && fullTimeMaxPrice) {
prices.push(`${fullTimeMinPrice / 1000}-${fullTimeMaxPrice / 1000}K/月`);
}
if (partyTimeMinPrice && partyTimeMaxPrice) {
prices.push(`${partyTimeMinPrice}-${partyTimeMaxPrice}/小时`);
}
return prices.filter(Boolean).join(' ');
};
function AnchorCard(props: IProps) {
const { data, jobId, validator } = props;