From 20537b9f592e8bb9081d423129caf5bd0308f32f Mon Sep 17 00:00:00 2001 From: al Date: Tue, 5 Nov 2024 17:53:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B6=85=E7=B2=89=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/my/createProfile/page.jsx | 24 +++++++++++++++---- .../setting/spacePaymentSetting/page.jsx | 19 ++++++++++----- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/app/my/createProfile/page.jsx b/app/my/createProfile/page.jsx index 96a8dae..9c5fe3a 100644 --- a/app/my/createProfile/page.jsx +++ b/app/my/createProfile/page.jsx @@ -96,7 +96,7 @@ const ListItemWithCheckbox = ({
| - { @@ -106,7 +106,7 @@ const ListItemWithCheckbox = ({ }} >

赠送微信

-
+ {/* ({ + // 旧版本 + 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", diff --git a/app/space/setting/spacePaymentSetting/page.jsx b/app/space/setting/spacePaymentSetting/page.jsx index 4369590..5b5fc12 100644 --- a/app/space/setting/spacePaymentSetting/page.jsx +++ b/app/space/setting/spacePaymentSetting/page.jsx @@ -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 = ({
| - { @@ -97,7 +104,7 @@ const ListItemWithCheckbox = ({ }} >

赠送微信

-
+ {/*