修复超粉价格设置
This commit is contained in:
parent
adc47c4b26
commit
20537b9f59
|
@ -96,7 +96,7 @@ const ListItemWithCheckbox = ({
|
|||
</div>
|
||||
<div className="flex items-center">
|
||||
<span className="text-[#ffffff26] mr-2">|</span>
|
||||
<Radio
|
||||
<Checkbox
|
||||
block
|
||||
checked={formData.superSingle[superSingle.key].wechatFree}
|
||||
onChange={(value) => {
|
||||
|
@ -106,7 +106,7 @@ const ListItemWithCheckbox = ({
|
|||
}}
|
||||
>
|
||||
<p className="text-sm whitespace-nowrap">赠送微信</p>
|
||||
</Radio>
|
||||
</Checkbox>
|
||||
{/* <Checkbox
|
||||
block
|
||||
checked={formData.superSingle[superSingle.key].wechatFree}
|
||||
|
@ -288,12 +288,21 @@ export default function CreateProfile() {
|
|||
}
|
||||
}
|
||||
if (isPrice) return;
|
||||
const superfan_price_list = superSingle.map((it, index) => ({
|
||||
// 旧版本
|
||||
const superfanList = superSingle.map((it, index) => ({
|
||||
period: index,
|
||||
enable: it.enable ? 1 : 0,
|
||||
price: parseInt(it.price * 100, 10),
|
||||
is_superfanship_give_wechat: it.wechatFree ? 1 : 0,
|
||||
}));
|
||||
const superfanObj = superfanList.filter((it) => it.enable)[0];
|
||||
// 新版本代码
|
||||
// const superfan_price_list = superSingle.map((it, index) => ({
|
||||
// period: index,
|
||||
// enable: it.enable ? 1 : 0,
|
||||
// price: parseInt(it.price * 100, 10),
|
||||
// is_superfanship_give_wechat: it.wechatFree ? 1 : 0,
|
||||
// }));
|
||||
setIsSubmitting(true);
|
||||
try {
|
||||
const body = {
|
||||
|
@ -301,7 +310,14 @@ export default function CreateProfile() {
|
|||
admission_price: parseInt(spacePrice * 100, 10),
|
||||
ironfanship_price: parseInt(ironFanPrice * 100, 10),
|
||||
is_superfanship_enabled: openSuper ? 1 : 0,
|
||||
superfan_price_list,
|
||||
// 旧版本
|
||||
superfanship_price: openSuper ? superfanObj.price : 0,
|
||||
superfanship_valid_period: openSuper ? superfanObj.period : null,
|
||||
is_superfanship_give_wechat: openSuper
|
||||
? superfanObj.is_superfanship_give_wechat
|
||||
: 0,
|
||||
// 新版本
|
||||
// superfan_price_list,
|
||||
};
|
||||
const _data = await requireAPI(
|
||||
"POST",
|
||||
|
|
|
@ -11,11 +11,18 @@ import { get } from "@/utils/storeInfo";
|
|||
import { getStreamerInfo } from "@/api/space";
|
||||
const superSingles = [
|
||||
{ key: 0, text: "永久" },
|
||||
{ key: 1, text: "按年生效" },
|
||||
{ key: 2, text: "按半年生效" },
|
||||
{ key: 3, text: "按季度生效" },
|
||||
{ key: 4, text: "按月生效" },
|
||||
{ key: 1, text: "按月生效" },
|
||||
{ key: 2, text: "按季度生效" },
|
||||
{ key: 3, text: "按半年生效" },
|
||||
{ key: 4, text: "按年生效" },
|
||||
];
|
||||
// const superSingles = [
|
||||
// { key: 0, text: "永久" },
|
||||
// { key: 1, text: "按年生效" },
|
||||
// { key: 2, text: "按半年生效" },
|
||||
// { key: 3, text: "按季度生效" },
|
||||
// { key: 4, text: "按月生效" },
|
||||
// ];
|
||||
const ListItemWithCheckbox = ({
|
||||
superSingle,
|
||||
formData,
|
||||
|
@ -87,7 +94,7 @@ const ListItemWithCheckbox = ({
|
|||
</div>
|
||||
<div className="flex items-center">
|
||||
<span className="text-[#ffffff26] mr-2">|</span>
|
||||
<Radio
|
||||
<Checkbox
|
||||
block
|
||||
checked={formData.superSingle[superSingle.key].wechatFree}
|
||||
onChange={(value) => {
|
||||
|
@ -97,7 +104,7 @@ const ListItemWithCheckbox = ({
|
|||
}}
|
||||
>
|
||||
<p className="text-sm whitespace-nowrap">赠送微信</p>
|
||||
</Radio>
|
||||
</Checkbox>
|
||||
{/* <Checkbox
|
||||
block
|
||||
checked={formData.superSingle[superSingle.key].wechatFree}
|
||||
|
|
Loading…
Reference in New Issue