修复报错
This commit is contained in:
parent
b8fa171a65
commit
f563b24ca3
|
@ -38,18 +38,11 @@ const ListItemWithCheckbox = ({
|
||||||
setFormData,
|
setFormData,
|
||||||
superSingleCheckeds,
|
superSingleCheckeds,
|
||||||
}) => {
|
}) => {
|
||||||
const checkboxRef = useRef(null);
|
|
||||||
return (
|
return (
|
||||||
<li
|
<li className="mt-4" onClick={() => {}}>
|
||||||
className="mt-4"
|
|
||||||
onClick={() => {
|
|
||||||
checkboxRef.current?.toggle();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div onClick={(e) => e.stopPropagation()}>
|
<div onClick={(e) => e.stopPropagation()}>
|
||||||
<Radio
|
<Radio
|
||||||
value={superSingle.key}
|
value={superSingle.key}
|
||||||
ref={checkboxRef}
|
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
const newFormData = { ...formData };
|
const newFormData = { ...formData };
|
||||||
newFormData.superSingle.forEach((el) => {
|
newFormData.superSingle.forEach((el) => {
|
||||||
|
@ -65,7 +58,6 @@ const ListItemWithCheckbox = ({
|
||||||
</Radio>
|
</Radio>
|
||||||
{/* <Checkbox
|
{/* <Checkbox
|
||||||
value={superSingle.key}
|
value={superSingle.key}
|
||||||
ref={checkboxRef}
|
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
const newFormData = { ...formData };
|
const newFormData = { ...formData };
|
||||||
newFormData.superSingle[superSingle.key].enable = value;
|
newFormData.superSingle[superSingle.key].enable = value;
|
||||||
|
@ -137,7 +129,7 @@ export default function CreateProfile() {
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
spacePrice: "",
|
spacePrice: "",
|
||||||
ironFanPrice: "",
|
ironFanPrice: "",
|
||||||
openSuper: false,
|
openSuper: true,
|
||||||
superSingle: [
|
superSingle: [
|
||||||
{ enable: false, price: 0, wechatFree: false },
|
{ enable: false, price: 0, wechatFree: false },
|
||||||
{ enable: false, price: 0, wechatFree: false },
|
{ enable: false, price: 0, wechatFree: false },
|
||||||
|
@ -319,7 +311,7 @@ export default function CreateProfile() {
|
||||||
is_superfanship_enabled: openSuper ? 1 : 0,
|
is_superfanship_enabled: openSuper ? 1 : 0,
|
||||||
// 旧版本
|
// 旧版本
|
||||||
superfanship_price: openSuper ? superfanObj.price : 0,
|
superfanship_price: openSuper ? superfanObj.price : 0,
|
||||||
superfanship_valid_period: openSuper ? superfanObj.period : null,
|
superfanship_valid_period: openSuper ? superfanObj.period : 0,
|
||||||
is_superfanship_give_wechat: openSuper
|
is_superfanship_give_wechat: openSuper
|
||||||
? superfanObj.is_superfanship_give_wechat
|
? superfanObj.is_superfanship_give_wechat
|
||||||
: 0,
|
: 0,
|
||||||
|
|
|
@ -29,18 +29,11 @@ const ListItemWithCheckbox = ({
|
||||||
setFormData,
|
setFormData,
|
||||||
superSingleCheckeds,
|
superSingleCheckeds,
|
||||||
}) => {
|
}) => {
|
||||||
const checkboxRef = useRef(null);
|
|
||||||
return (
|
return (
|
||||||
<li
|
<li className="mt-4" onClick={() => {}}>
|
||||||
className="mt-4"
|
|
||||||
onClick={() => {
|
|
||||||
checkboxRef.current?.toggle();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div onClick={(e) => e.stopPropagation()}>
|
<div onClick={(e) => e.stopPropagation()}>
|
||||||
<Radio
|
<Radio
|
||||||
value={superSingle.key}
|
value={superSingle.key}
|
||||||
ref={checkboxRef}
|
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
const newFormData = { ...formData };
|
const newFormData = { ...formData };
|
||||||
newFormData.superSingle.forEach((el) => {
|
newFormData.superSingle.forEach((el) => {
|
||||||
|
@ -56,7 +49,6 @@ const ListItemWithCheckbox = ({
|
||||||
</Radio>
|
</Radio>
|
||||||
{/* <Checkbox
|
{/* <Checkbox
|
||||||
value={superSingle.key}
|
value={superSingle.key}
|
||||||
ref={checkboxRef}
|
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
const newFormData = { ...formData };
|
const newFormData = { ...formData };
|
||||||
newFormData.superSingle[superSingle.key].enable = value;
|
newFormData.superSingle[superSingle.key].enable = value;
|
||||||
|
@ -126,9 +118,9 @@ export default function spacePaymentSetting() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
spacePrice: null,
|
spacePrice: "",
|
||||||
ironFanPrice: null,
|
ironFanPrice: "",
|
||||||
openSuper: false,
|
openSuper: true,
|
||||||
superSingle: [
|
superSingle: [
|
||||||
{ enable: false, price: 0, wechatFree: false },
|
{ enable: false, price: 0, wechatFree: false },
|
||||||
{ enable: false, price: 0, wechatFree: false },
|
{ enable: false, price: 0, wechatFree: false },
|
||||||
|
@ -372,8 +364,8 @@ export default function spacePaymentSetting() {
|
||||||
ironfanship_price: parseInt(ironFanPrice * 100, 10),
|
ironfanship_price: parseInt(ironFanPrice * 100, 10),
|
||||||
is_superfanship_enabled: openSuper ? 1 : 0,
|
is_superfanship_enabled: openSuper ? 1 : 0,
|
||||||
// 旧版本
|
// 旧版本
|
||||||
superfanship_price: openSuper ? superfanObj.price : 0,
|
superfanship_price: superfanObj.price,
|
||||||
superfanship_valid_period: openSuper ? superfanObj.period : null,
|
superfanship_valid_period: openSuper ? superfanObj.period : 0,
|
||||||
is_superfanship_give_wechat: openSuper
|
is_superfanship_give_wechat: openSuper
|
||||||
? superfanObj.is_superfanship_give_wechat
|
? superfanObj.is_superfanship_give_wechat
|
||||||
: 0,
|
: 0,
|
||||||
|
|
Loading…
Reference in New Issue