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

@ -48,10 +48,9 @@ function ProfileExperienceFragment(props: IProps, ref) {
const [workedYear, setWorkedYear] = useState(profile.workedYear);
const [workedAccounts, setWorkedAccounts] = useState(profile.workedAccounts || '');
const [newAccountExperience, setNewAccountExperience] = useState(profile.newAccountExperience);
const [workedSecCategoryStr, setWorkedSecCategoryStr] = useState(profile.workedSecCategoryStr || '');
// const [style, setStyle] = useState(calcInitStyle(profile.style));
const [maxGmv, setMaxGmv] = useState(calcInitMaxGmv(profile?.maxGmv || 0));
const [maxOnline, setMaxOnline] = useState(profile.maxOnline || '');
// const [maxOnline, setMaxOnline] = useState(profile.maxOnline || '');
const handleSelectWorkYear = useCallback((newYear: WorkedYears) => {
setWorkedYear(newYear);
@ -67,11 +66,6 @@ function ProfileExperienceFragment(props: IProps, ref) {
setNewAccountExperience(value);
}, []);
const handleInputWorkedSecCategoryStr = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
const value = e.detail.value || '';
setWorkedSecCategoryStr(value);
}, []);
// const handleStyleChange = useCallback((value: StyleType[]) => {
// log('handleStyleChange', value);
// setStyle(value);
@ -84,14 +78,14 @@ function ProfileExperienceFragment(props: IProps, ref) {
}
setMaxGmv(string2Number(value));
}, []);
const handleInputMaxOnline = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
const value = e.detail.value || '';
if (Number.isNaN(Number(value))) {
return;
}
setMaxOnline(string2Number(value));
}, []);
//
// const handleInputMaxOnline = useCallback((e: BaseEventOrig<InputProps.inputEventDetail>) => {
// const value = e.detail.value || '';
// if (Number.isNaN(Number(value))) {
// return;
// }
// setMaxOnline(string2Number(value));
// }, []);
useImperativeHandle(
ref,
@ -100,22 +94,21 @@ function ProfileExperienceFragment(props: IProps, ref) {
workedYear,
workedAccounts,
newAccountExperience,
workedSecCategoryStr,
// style: getStyleString(style.sort()),
maxOnline: maxOnline === '' ? undefined : maxOnline,
// maxOnline: maxOnline === '' ? undefined : maxOnline,
maxGmv: maxGmv === '' ? undefined : getMaxGmv(Number(maxGmv)),
}),
}),
[workedYear, workedAccounts, newAccountExperience, workedSecCategoryStr, maxGmv, maxOnline]
[workedYear, workedAccounts, newAccountExperience, maxGmv]
);
return (
<div className={PREFIX}>
<BlFormItem title="直播经验">
<BlFormItem title="直播经验" optional>
<BlFormSelect title="直播经验" value={workedYear} options={WORK_YEAR_OPTIONS} onSelect={handleSelectWorkYear} />
</BlFormItem>
<BlFormItem title="直播过的品类" optional>
<BlFormInput value={workedSecCategoryStr} maxlength={140} onInput={handleInputWorkedSecCategoryStr} />
<BlFormItem title="直播过的账号" optional>
<BlFormInput value={workedAccounts} maxlength={140} onInput={handleInputWorkedAccounts} />
</BlFormItem>
<BlFormItem title="自然流起号经验" optional>
<BlFormRadioGroup
@ -127,9 +120,6 @@ function ProfileExperienceFragment(props: IProps, ref) {
<BlFormRadio name text="有" value={newAccountExperience} />
</BlFormRadioGroup>
</BlFormItem>
<BlFormItem title="直播过的账号" optional>
<BlFormInput value={workedAccounts} maxlength={140} onInput={handleInputWorkedAccounts} />
</BlFormItem>
{/* <ProfileEditItem title="直播风格" optional>
<ProfileCheckboxGroup value={style} onChange={handleStyleChange}>
<ProfileCheckbox value={style} name={StyleType.Broadcasting} text="平播" />
@ -140,9 +130,9 @@ function ProfileExperienceFragment(props: IProps, ref) {
<BlFormItem title="最高GMV" optional>
<BlFormInput value={String(maxGmv)} type="number" maxlength={10} onInput={handleInputMaxGmv} rightText="W" />
</BlFormItem>
<BlFormItem title="最高在线人数" optional>
<BlFormInput value={String(maxOnline)} type="number" onInput={handleInputMaxOnline} rightText="人" />
</BlFormItem>
{/*<BlFormItem title="最高在线人数" optional>*/}
{/* <BlFormInput value={String(maxOnline)} type="number" onInput={handleInputMaxOnline} rightText="人" />*/}
{/*</BlFormItem>*/}
</div>
);
}