修复入驻两个问题

This commit is contained in:
al 2024-10-31 18:16:47 +08:00
parent 886ac93858
commit 90c9cac703
3 changed files with 46 additions and 41 deletions

View File

@ -136,7 +136,7 @@ export default function CreateProfile() {
return;
}
const _spacePrice = parseInt(spacePrice * 100, 10);
if (isNaN(_spacePrice) || _spacePrice < 0) {
if (isNaN(_spacePrice) || _spacePrice < 0 || _spacePrice > 388800) {
Toast.show({
icon: "fail",
content: "请输入有效的解锁空间价格",
@ -203,41 +203,41 @@ export default function CreateProfile() {
}));
setIsSubmitting(true);
// try {
// const body = {
// profile: spaceIntro,
// admission_price: parseInt(spacePrice * 100, 10),
// ironfanship_price: parseInt(ironFanPrice * 100, 10),
// is_superfanship_enabled: openSuper ? 1 : 0,
// superfan_price_list,
// };
// const _data = await requireAPI(
// "POST",
// "/api/zone/create",
// {
// body,
// },
// true
// );
// if (_data.ret === -1) {
// Toast.show({
// icon: "fail",
// content: _data.msg,
// position: "top",
// });
// return;
// }
// Toast.show({
// icon: "success",
// content: "",
// position: "top",
// });
// router.back();
// } catch (error) {
// console.error(error);
// } finally {
// setIsSubmitting(false);
// }
try {
const body = {
profile: spaceIntro,
admission_price: parseInt(spacePrice * 100, 10),
ironfanship_price: parseInt(ironFanPrice * 100, 10),
is_superfanship_enabled: openSuper ? 1 : 0,
superfan_price_list,
};
const _data = await requireAPI(
"POST",
"/api/zone/create",
{
body,
},
true
);
if (_data.ret === -1) {
Toast.show({
icon: "fail",
content: _data.msg,
position: "top",
});
return;
}
Toast.show({
icon: "success",
content: "修改成功,请重进空间刷新查看",
position: "top",
});
router.back();
} catch (error) {
console.error(error);
} finally {
setIsSubmitting(false);
}
};
return (
<div>
@ -254,7 +254,7 @@ export default function CreateProfile() {
/>
</div>
<p className="text-base text-center leading-9 whitespace-nowrap">
空间付费设置
开通空间
</p>
</div>
{/* 内容 */}
@ -294,7 +294,7 @@ export default function CreateProfile() {
id="spacePrice"
type="number"
fontSize="22"
placeholder="1~3888仅支持整数"
placeholder="0~3888仅支持整数"
value={formData.spacePrice}
onChange={(value) =>
setFormData((old) => ({ ...old, spacePrice: value }))

View File

@ -123,8 +123,13 @@ const My = () => {
iconUrl: "icons/32DP/editprofile.png",
title: "完善资料",
subTitle: "完善后解锁全部功能",
status: !statuses.data.details_status ? "审核中" : "未通过",
disable: statuses.data.details_status == 2,
status:
statuses.data.details_status == 0
? "审核中"
: statuses.data.details_status == 2
? "未通过"
: null,
// disable: !isInJoinProgress,
},
...currentOld,
];

View File

@ -150,7 +150,7 @@ export default function spacePaymentSetting() {
return;
}
const _spacePrice = parseInt(spacePrice * 100, 10);
if (isNaN(_spacePrice) || _spacePrice < 0) {
if (isNaN(_spacePrice) || _spacePrice < 0 || _spacePrice > 388800) {
Toast.show({
icon: "fail",
content: "请输入有效的解锁空间价格",