¥
@@ -141,7 +141,7 @@ export default function CreateProfile() {
const [spacePriceAble, setSpacePriceAble] = useState(false);
const [tiefenPriceAble, setTiefenPriceAble] = useState(false);
const [isSubmitting, setIsSubmitting] = useState(false);
- // const [superSingleCheckeds, setSuperSingleCheckeds] = useState([]);
+ const [superSingleCheckeds, setSuperSingleCheckeds] = useState([]);
const [superSingleChecked, setSuperSingleChecked] = useState(0);
const listItemWithCheckboxMemo = useMemo(() => {
@@ -151,8 +151,8 @@ export default function CreateProfile() {
superSingle={item}
formData={formData}
setFormData={setFormData}
- superSingleCheckeds={superSingleChecked}
- // superSingleCheckeds={superSingleCheckeds}
+ // superSingleCheckeds={superSingleChecked}
+ superSingleCheckeds={superSingleCheckeds}
/>
));
@@ -197,57 +197,9 @@ export default function CreateProfile() {
}
let isPrice = false;
if (openSuper) {
- // Object.values(superSingle).forEach((it) => {
- // if (it.enable) {
- // const superFanPrice = it.price;
- // if (!superFanPrice) {
- // Toast.show({
- // icon: "fail",
- // content: "请填写超粉价格",
- // position: "top",
- // });
- // isPrice = true;
- // return;
- // } else {
- // const _superFanPrice = parseInt(superFanPrice * 100, 10);
- // if (
- // openSuper &&
- // (isNaN(_superFanPrice) ||
- // _superFanPrice < 100 ||
- // _superFanPrice > 388800)
- // ) {
- // isPrice = true;
- // Toast.show({
- // icon: "fail",
- // content: "请输入有效的超粉价格",
- // position: "top",
- // });
- // return;
- // }
- // if (openSuper && _superFanPrice <= _ironFanPrice) {
- // isPrice = true;
- // Toast.show({
- // icon: "fail",
- // content: "请输入大于铁粉价格的超粉价格",
- // position: "top",
- // });
- // return;
- // }
- // }
- // }
- // });
- if (superSingleChecked == null) {
- Toast.show({
- icon: "fail",
- content: "请选择铁粉类型",
- position: "top",
- });
- } else {
- const superChecked = superSingle.filter(
- (_, index) => index == superSingleChecked
- )[0];
- if (superChecked) {
- const superFanPrice = superChecked.price;
+ Object.values(superSingle).forEach((it) => {
+ if (it.enable) {
+ const superFanPrice = it.price;
if (!superFanPrice) {
Toast.show({
icon: "fail",
@@ -283,24 +235,73 @@ export default function CreateProfile() {
}
}
}
- }
+ });
+ // if (superSingleChecked == null) {
+ // Toast.show({
+ // icon: "fail",
+ // content: "请选择铁粉类型",
+ // position: "top",
+ // });
+ // } else {
+ // const superChecked = superSingle.filter(
+ // (_, index) => index == superSingleChecked
+ // )[0];
+ // if (superChecked) {
+ // const superFanPrice = superChecked.price;
+ // if (!superFanPrice) {
+ // Toast.show({
+ // icon: "fail",
+ // content: "请填写超粉价格",
+ // position: "top",
+ // });
+ // isPrice = true;
+ // return;
+ // } else {
+ // const _superFanPrice = parseInt(superFanPrice * 100, 10);
+ // if (
+ // openSuper &&
+ // (isNaN(_superFanPrice) ||
+ // _superFanPrice < 100 ||
+ // _superFanPrice > 388800)
+ // ) {
+ // isPrice = true;
+ // Toast.show({
+ // icon: "fail",
+ // content: "请输入有效的超粉价格",
+ // position: "top",
+ // });
+ // return;
+ // }
+ // if (openSuper && _superFanPrice <= _ironFanPrice) {
+ // isPrice = true;
+ // Toast.show({
+ // icon: "fail",
+ // content: "请输入大于铁粉价格的超粉价格",
+ // position: "top",
+ // });
+ // return;
+ // }
+ // }
+ // }
+ // }
}
if (isPrice) return;
+ debugger;
// 旧版本
- 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) => ({
+ // 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 = {
@@ -309,11 +310,11 @@ export default function CreateProfile() {
ironfanship_price: parseInt(ironFanPrice * 100, 10),
is_superfanship_enabled: openSuper ? 1 : 0,
// 旧版本
- superfanship_price: superfanObj.price,
- superfanship_valid_period: superfanObj.period,
- is_superfanship_give_wechat: superfanObj.is_superfanship_give_wechat,
+ // superfanship_price: superfanObj.price,
+ // superfanship_valid_period: superfanObj.period,
+ // is_superfanship_give_wechat: superfanObj.is_superfanship_give_wechat,
// 新版本
- // superfan_price_list,
+ superfan_price_list,
};
const _data = await requireAPI(
"POST",
@@ -487,7 +488,7 @@ export default function CreateProfile() {
- {
@@ -496,15 +497,15 @@ export default function CreateProfile() {
}}
>
{listItemWithCheckboxMemo}
-
- {/* */}
+ {
setSuperSingleCheckeds(values);
}}
>
{listItemWithCheckboxMemo}
- */}
+
)}
diff --git a/app/noticeDetail/components/MessageList/index.jsx b/app/noticeDetail/components/MessageList/index.jsx
index 6fe1885..07872a4 100644
--- a/app/noticeDetail/components/MessageList/index.jsx
+++ b/app/noticeDetail/components/MessageList/index.jsx
@@ -94,11 +94,6 @@ const MessageList = ({ mid, changeNoticeCount, refInstance, noticeCount }) => {
},
}));
useEffect(() => {
- // navigation.addListener("focus", () => {
- // getData();
- // getActiveNotice();
- // });
-
getData();
getActiveNotice();
}, [noticeCount]);
@@ -181,17 +176,19 @@ const MessageList = ({ mid, changeNoticeCount, refInstance, noticeCount }) => {
onClick={() =>
router.push(`/noticeDetail/systemNotice/${index}?mid=${mid}`)
}
- className="flex flex-row items-center p-4 mb-2 rounded-xl bg-[#ffffff1a] gap-3"
+ className="grid grid-cols-[54px_calc(100%-54px-0.75rem)] items-center p-4 mb-2 rounded-xl bg-[#ffffff1a] gap-3"
>