Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
|
5fe91d7df3 | |
|
5b3e196859 | |
|
87cb83ae7a |
|
@ -39,6 +39,11 @@ footer {
|
|||
-ms-user-select: none; /* IE/Edge */
|
||||
user-select: none; /* 标准语法 */
|
||||
}
|
||||
pre {
|
||||
font-family: auto; /* 使用系统默认的等宽字体 */
|
||||
white-space:pre-wrap; /* 保留空白符和换行 */
|
||||
}
|
||||
|
||||
img {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
@ -415,4 +420,4 @@ textarea {
|
|||
|
||||
.notice-toast .adm-toast-main{
|
||||
background-color: rgb(23,22,26)!important;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ export default function MessageDetail({}) {
|
|||
}
|
||||
}, [oldMessages.list, oldMessages.isGetHistory]);
|
||||
useEffect(() => {
|
||||
if (sessionId && userInfo.mid) {
|
||||
if (typeof sessionId === "number" && userInfo.mid) {
|
||||
loadEarlierHistory().then((res) => {
|
||||
setMessages((old) => {
|
||||
toScrollBottom.current = 1;
|
||||
|
@ -156,6 +156,7 @@ export default function MessageDetail({}) {
|
|||
//请求历史记录
|
||||
const loadEarlierHistory = async () => {
|
||||
if (!more) return;
|
||||
|
||||
try {
|
||||
setLoading(true);
|
||||
const data = await requireAPI(
|
||||
|
@ -244,7 +245,6 @@ export default function MessageDetail({}) {
|
|||
return;
|
||||
}
|
||||
// updateLatestHistory();
|
||||
// console.log("oldArr", oldArr);
|
||||
updateMessages(lastId, 0, oldArr).then((res) => {
|
||||
setNewMessage("");
|
||||
toScrollBottom.current = 1;
|
||||
|
@ -267,7 +267,7 @@ export default function MessageDetail({}) {
|
|||
// throw new Error("刷新失败");
|
||||
// }
|
||||
async function loadMore() {
|
||||
if (sessionId && userInfo.mid && offset && more) {
|
||||
if (typeof sessionId === "number" && userInfo.mid && offset && more) {
|
||||
const append = await loadEarlierHistory();
|
||||
if (append) {
|
||||
// setMessages((val) => [...val, ...append]);
|
||||
|
@ -396,8 +396,11 @@ export default function MessageDetail({}) {
|
|||
let newData = data.data.list.filter((element) => {
|
||||
return element.id > lastId;
|
||||
});
|
||||
// console.log("[...messages,...newData]", [...newData]);
|
||||
let mathNewMessages = handleData([...newData, ...oldArr]);
|
||||
// console.log("[...messages,...newData]", newData, oldArr);
|
||||
const newMessages = [...newData, ...oldArr].filter(
|
||||
(item, index, self) => index === self.findIndex((t) => t.id === item.id)
|
||||
);
|
||||
let mathNewMessages = handleData([...newMessages]);
|
||||
setMessages((old) => {
|
||||
toScrollBottom.current = 1;
|
||||
return mathNewMessages;
|
||||
|
@ -430,13 +433,12 @@ export default function MessageDetail({}) {
|
|||
const getAutoMessage = useCallback(
|
||||
(data) => {
|
||||
if (data.m_type === 1) {
|
||||
const test = data.text.split("|");
|
||||
const btns = test[1].split(",");
|
||||
const autoAnswerStrs = data.text.split("|");
|
||||
const btns = autoAnswerStrs[1].split(",");
|
||||
return (
|
||||
<div>
|
||||
<p>{test[0]}</p>
|
||||
<pre>{autoAnswerStrs[0]}</pre>
|
||||
<div className="my-2">
|
||||
<p>触发按钮:</p>
|
||||
<ul className="grid grid-cols-2 gap-2 mt-2">
|
||||
{btns.map((item, index) => {
|
||||
return (
|
||||
|
@ -589,7 +591,9 @@ export default function MessageDetail({}) {
|
|||
}
|
||||
onSend(
|
||||
newMessage,
|
||||
oldMessages.list[0]?.id || -1,
|
||||
typeof oldMessages.list[0]?.id == "number"
|
||||
? oldMessages.list[0]?.id
|
||||
: -1,
|
||||
oldMessages.list
|
||||
);
|
||||
}}
|
||||
|
|
|
@ -8,7 +8,7 @@ import {
|
|||
Button,
|
||||
Toast,
|
||||
TextArea,
|
||||
Radio,
|
||||
Form,
|
||||
} from "antd-mobile";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
|
@ -34,14 +34,15 @@ const superSingles = [
|
|||
// ];
|
||||
const ListItemWithCheckbox = ({
|
||||
superSingle,
|
||||
formData,
|
||||
setFormData,
|
||||
superSinglesContr,
|
||||
setSuperSinglesContr,
|
||||
superSingleCheckeds,
|
||||
index,
|
||||
}) => {
|
||||
return (
|
||||
<li className="mt-4" onClick={() => {}}>
|
||||
<div onClick={(e) => e.stopPropagation()}>
|
||||
<Radio
|
||||
{/* <Radio
|
||||
value={superSingle.key}
|
||||
onChange={(value) => {
|
||||
const newFormData = { ...formData };
|
||||
|
@ -55,40 +56,39 @@ const ListItemWithCheckbox = ({
|
|||
}}
|
||||
>
|
||||
{superSingle.text}
|
||||
</Radio>
|
||||
{/* <Checkbox
|
||||
value={superSingle.key}
|
||||
</Radio> */}
|
||||
<Checkbox
|
||||
value={index}
|
||||
onChange={(value) => {
|
||||
const newFormData = { ...formData };
|
||||
newFormData.superSingle[superSingle.key].enable = value;
|
||||
newFormData.superSingle[superSingle.key].price = 0;
|
||||
newFormData.superSingle[superSingle.key].wechatFree = false;
|
||||
setFormData(newFormData);
|
||||
const newSuperSinglesContr = [...superSinglesContr];
|
||||
newSuperSinglesContr[index].enable = value;
|
||||
// newSuperSinglesContr[index].price = 0;
|
||||
// newSuperSinglesContr[index].wechatFree = false;
|
||||
setSuperSinglesContr(newSuperSinglesContr);
|
||||
}}
|
||||
>
|
||||
{superSingle.text}
|
||||
</Checkbox> */}
|
||||
</Checkbox>
|
||||
<div
|
||||
className={`mt-2 px-4 h-12 py-3 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center ${
|
||||
superSingleCheckeds != superSingle.key
|
||||
? "mt-0 px-0 py-0 hidden"
|
||||
: ""
|
||||
}`}
|
||||
// className={`mt-2 px-4 h-12 py-3 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center ${
|
||||
// !superSingleCheckeds.includes(superSingle.key)
|
||||
// superSingleCheckeds != index
|
||||
// ? "mt-0 px-0 py-0 hidden"
|
||||
// : ""
|
||||
// }`}
|
||||
className={`mt-2 px-4 h-12 py-3 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center ${
|
||||
!superSingleCheckeds.includes(index) ? "mt-0 px-0 py-0 hidden" : ""
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-center">
|
||||
<span className="mr-1 text-[#ffffffae] text-sm">¥</span>
|
||||
<OwnInput
|
||||
type="number"
|
||||
value={formData.superSingle[superSingle.key].price}
|
||||
className="text-2xl"
|
||||
value={superSinglesContr[index].price}
|
||||
onChange={(value) => {
|
||||
const newFormData = { ...formData };
|
||||
newFormData.superSingle[superSingle.key].price = value;
|
||||
setFormData(newFormData);
|
||||
const newSuperSinglesContr = [...superSinglesContr];
|
||||
newSuperSinglesContr[index].price = value;
|
||||
setSuperSinglesContr(newSuperSinglesContr);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
@ -96,26 +96,15 @@ const ListItemWithCheckbox = ({
|
|||
<span className="text-[#ffffff26] mr-2">|</span>
|
||||
<Checkbox
|
||||
block
|
||||
checked={formData.superSingle[superSingle.key].wechatFree}
|
||||
checked={superSinglesContr[index].wechatFree}
|
||||
onChange={(value) => {
|
||||
const newFormData = { ...formData };
|
||||
newFormData.superSingle[superSingle.key].wechatFree = value;
|
||||
setFormData(newFormData);
|
||||
const newSuperSinglesContr = [...superSinglesContr];
|
||||
newSuperSinglesContr[index].wechatFree = value;
|
||||
setSuperSinglesContr(newSuperSinglesContr);
|
||||
}}
|
||||
>
|
||||
<p className="text-sm whitespace-nowrap">赠送微信</p>
|
||||
</Checkbox>
|
||||
{/* <Checkbox
|
||||
block
|
||||
checked={formData.superSingle[superSingle.key].wechatFree}
|
||||
onChange={(value) => {
|
||||
const newFormData = { ...formData };
|
||||
newFormData.superSingle[superSingle.key].wechatFree = value;
|
||||
setFormData(newFormData);
|
||||
}}
|
||||
>
|
||||
<p className="text-sm whitespace-nowrap">赠送微信</p>
|
||||
</Checkbox> */}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -124,52 +113,40 @@ const ListItemWithCheckbox = ({
|
|||
};
|
||||
export default function CreateProfile() {
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
const [formData, setFormData] = useState({
|
||||
spacePrice: "",
|
||||
ironFanPrice: "",
|
||||
openSuper: true,
|
||||
superSingle: [
|
||||
{ enable: true, price: 0, wechatFree: true },
|
||||
{ enable: false, price: 0, wechatFree: true },
|
||||
{ enable: false, price: 0, wechatFree: true },
|
||||
{ enable: false, price: 0, wechatFree: true },
|
||||
{ enable: false, price: 0, wechatFree: true },
|
||||
],
|
||||
spaceIntro: "",
|
||||
});
|
||||
const [spacePriceAble, setSpacePriceAble] = useState(false);
|
||||
const [tiefenPriceAble, setTiefenPriceAble] = useState(false);
|
||||
const [form] = Form.useForm();
|
||||
const [openSuper, setOpenSuper] = useState(false);
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
// const [superSingleCheckeds, setSuperSingleCheckeds] = useState([]);
|
||||
const [superSingleChecked, setSuperSingleChecked] = useState(0);
|
||||
|
||||
const [superSingleCheckeds, setSuperSingleCheckeds] = useState([]);
|
||||
const [superSinglesContr, setSuperSinglesContr] = useState([
|
||||
{ enable: false, price: 0, wechatFree: false, key: 0 },
|
||||
{ enable: false, price: 0, wechatFree: false, key: 4 },
|
||||
{ enable: false, price: 0, wechatFree: false, key: 3 },
|
||||
{ enable: false, price: 0, wechatFree: false, key: 2 },
|
||||
{ enable: false, price: 0, wechatFree: false, key: 1 },
|
||||
]);
|
||||
// const [superSingleChecked, setSuperSingleChecked] = useState(0);
|
||||
const listItemWithCheckboxMemo = useMemo(() => {
|
||||
return superSingles.map((item) => (
|
||||
return superSingles.map((item, index) => (
|
||||
<Fragment key={item.key}>
|
||||
<ListItemWithCheckbox
|
||||
superSingle={item}
|
||||
formData={formData}
|
||||
setFormData={setFormData}
|
||||
superSingleCheckeds={superSingleChecked}
|
||||
// superSingleCheckeds={superSingleCheckeds}
|
||||
superSinglesContr={superSinglesContr}
|
||||
setSuperSinglesContr={setSuperSinglesContr}
|
||||
// superSingleCheckeds={superSingleChecked}
|
||||
superSingleCheckeds={superSingleCheckeds}
|
||||
index={index}
|
||||
/>
|
||||
</Fragment>
|
||||
));
|
||||
}, [formData, superSingleChecked]);
|
||||
}, [superSingleCheckeds, superSinglesContr]);
|
||||
|
||||
const handleSubmit = async () => {
|
||||
const { spaceIntro, spacePrice, ironFanPrice, openSuper, superSingle } =
|
||||
formData;
|
||||
const handleSubmit = async (newFormData) => {
|
||||
const { spaceIntro, spacePrice, ironFanPrice } = newFormData;
|
||||
const superSingle = [...superSinglesContr];
|
||||
const openSuperEveryFalse = Object.values(superSingle).every(
|
||||
(it) => !it.enable
|
||||
);
|
||||
if (
|
||||
!spaceIntro ||
|
||||
!spacePrice ||
|
||||
!ironFanPrice ||
|
||||
(openSuper && openSuperEveryFalse)
|
||||
) {
|
||||
if (openSuper && openSuperEveryFalse) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: "请完善内容后提交",
|
||||
|
@ -178,28 +155,60 @@ export default function CreateProfile() {
|
|||
return;
|
||||
}
|
||||
const _spacePrice = parseInt(spacePrice * 100, 10);
|
||||
if (isNaN(_spacePrice) || _spacePrice < 0 || _spacePrice > 388800) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: "请输入有效的解锁空间价格",
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
const _ironFanPrice = parseInt(ironFanPrice * 100, 10);
|
||||
if (isNaN(_ironFanPrice) || _ironFanPrice < 100 || _ironFanPrice > 388800) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: "请输入有效的铁粉价格",
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
let isPrice = false;
|
||||
if (openSuper) {
|
||||
// Object.values(superSingle).forEach((it) => {
|
||||
// if (it.enable) {
|
||||
// const superFanPrice = it.price;
|
||||
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;
|
||||
// if (!superFanPrice) {
|
||||
// Toast.show({
|
||||
// icon: "fail",
|
||||
|
@ -235,85 +244,37 @@ 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;
|
||||
// 旧版本
|
||||
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 = superSinglesContr.map((it) => ({
|
||||
period: it.key,
|
||||
enable: it.enable ? 1 : 0,
|
||||
price: parseInt(it.price * 100, 10),
|
||||
is_superfanship_give_wechat: it.wechatFree ? 1 : 0,
|
||||
}));
|
||||
setIsSubmitting(true);
|
||||
try {
|
||||
const body = {
|
||||
profile: spaceIntro,
|
||||
admission_price: parseInt(spacePrice * 100, 10),
|
||||
ironfanship_price: parseInt(ironFanPrice * 100, 10),
|
||||
admission_price: _spacePrice,
|
||||
ironfanship_price: _ironFanPrice,
|
||||
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",
|
||||
|
@ -343,6 +304,7 @@ export default function CreateProfile() {
|
|||
setIsSubmitting(false);
|
||||
}
|
||||
};
|
||||
const messageEle = (message) => <p className="text-right">{message}</p>;
|
||||
return (
|
||||
<div>
|
||||
{/* 头部标题 */}
|
||||
|
@ -363,165 +325,272 @@ export default function CreateProfile() {
|
|||
</div>
|
||||
{/* 内容 */}
|
||||
<div className="pt-16 p-4">
|
||||
<div>
|
||||
<div className="flex justify-between items-center">
|
||||
<p className="text-sm">
|
||||
<span className="whitespace-nowrap">空间介绍</span>
|
||||
<span className="text-[#f00]">*</span>
|
||||
</p>
|
||||
<p className="text-[#ffffffae] text-xs"></p>
|
||||
</div>
|
||||
<div className="mt-2 px-4 py-3 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center">
|
||||
<TextArea
|
||||
style={{ "--font-size": `16px` }}
|
||||
value={formData.spaceIntro}
|
||||
placeholder="介绍下你的空间吧~"
|
||||
onChange={(value) =>
|
||||
setFormData((old) => ({ ...old, spaceIntro: value }))
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-6">
|
||||
<div className="flex justify-between items-center">
|
||||
<p className="text-sm whitespace-nowrap">
|
||||
<span>解锁空间价格</span>
|
||||
<span className="text-[#f00]">*</span>
|
||||
</p>
|
||||
<p className="text-[#ffffffae] text-xs">
|
||||
(成为空间成员,可查看免费帖)
|
||||
</p>
|
||||
</div>
|
||||
<div className="mt-2 px-4 py-3 h-12 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center">
|
||||
<div className="flex items-center">
|
||||
<span className="mr-1 text-[#ffffffae] text-sm">¥</span>
|
||||
<OwnInput
|
||||
id="spacePrice"
|
||||
type="number"
|
||||
placeholder="0~3888,仅支持整数"
|
||||
value={formData.spacePrice}
|
||||
onChange={(value) =>
|
||||
setFormData((old) => ({ ...old, spacePrice: value }))
|
||||
}
|
||||
inputClassName="placeholder:text-[14px]"
|
||||
className={!formData.spacePrice ? "pb-1.5" : ""}
|
||||
/>
|
||||
</div>
|
||||
<label
|
||||
htmlFor="spacePrice"
|
||||
className="text-[#ffffffae] text-xs whitespace-nowrap"
|
||||
onClick={() => setSpacePriceAble(true)}
|
||||
>
|
||||
点击编辑
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-3">
|
||||
<div className="flex justify-between items-center">
|
||||
<p className="text-sm whitespace-nowrap">
|
||||
<span>铁粉价格</span>
|
||||
<span className="text-[#f00]">*</span>
|
||||
</p>
|
||||
<p className="text-[#ffffffae] text-xs">
|
||||
(累计消费达成后解锁铁粉权益)
|
||||
</p>
|
||||
</div>
|
||||
<div className="mt-2 px-4 py-3 h-12 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center">
|
||||
<div className="flex items-center">
|
||||
<span className="mr-1 text-[#ffffffae] text-sm">¥</span>
|
||||
<OwnInput
|
||||
id="ironPrice"
|
||||
type="number"
|
||||
placeholder="1~3888,仅支持整数"
|
||||
value={formData.ironFanPrice}
|
||||
onChange={(value) =>
|
||||
setFormData((old) => ({ ...old, ironFanPrice: value }))
|
||||
}
|
||||
inputClassName="placeholder:text-[14px]"
|
||||
className={!formData.ironFanPrice ? "pb-1.5" : ""}
|
||||
/>
|
||||
</div>
|
||||
<label
|
||||
htmlFor="ironPrice"
|
||||
className="text-[#ffffffae] text-xs whitespace-nowrap"
|
||||
onClick={() => setTiefenPriceAble(true)}
|
||||
>
|
||||
点击编辑
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-3">
|
||||
<div className="flex justify-between items-center">
|
||||
<p className="text-sm">
|
||||
<span>超粉功能</span>
|
||||
<span className="text-[#f00]">*</span>
|
||||
</p>
|
||||
<div className="flex items-center">
|
||||
<p className="text-[#ffffffae] text-xs mr-2">是否启用</p>
|
||||
<Switch
|
||||
checked={formData.openSuper}
|
||||
onChange={(value) => {
|
||||
setFormData((old) => ({
|
||||
...old,
|
||||
openSuper: value,
|
||||
}));
|
||||
}}
|
||||
style={{
|
||||
"--checked-color": "#FF669E",
|
||||
"--height": "24px",
|
||||
"--width": "36px",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{formData.openSuper && (
|
||||
<div className="mt-3">
|
||||
<Form
|
||||
requiredMarkStyle="none"
|
||||
form={form}
|
||||
initialValues={{
|
||||
spaceIntro: "",
|
||||
spacePrice: undefined,
|
||||
ironFanPrice: undefined,
|
||||
}}
|
||||
onFinishFailed={(error) => {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: "请检查所填内容",
|
||||
position: "top",
|
||||
});
|
||||
}}
|
||||
onFinish={handleSubmit}
|
||||
onValuesChange={(values) => {
|
||||
// setFormData(values);
|
||||
}}
|
||||
// hasFeedback={false}
|
||||
validateMessages={{
|
||||
required: (name) => {
|
||||
return <p className="text-right">{`请输入${name}`}</p>;
|
||||
},
|
||||
}}
|
||||
>
|
||||
<div className="mt-4">
|
||||
<div className="flex justify-between items-center">
|
||||
<p className="text-sm">
|
||||
<span>超粉单次开通类型</span>
|
||||
<span className="whitespace-nowrap">空间介绍</span>
|
||||
<span className="text-[#f00]">*</span>
|
||||
</p>
|
||||
<p className="text-[#ffffffae] text-xs"></p>
|
||||
</div>
|
||||
<Form.Item
|
||||
required
|
||||
name="spaceIntro"
|
||||
// childElementPosition="left"
|
||||
layout="vertical"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: messageEle("请输入空间介绍"),
|
||||
// 匹配两为小数
|
||||
// pattern: /^[0-9]+(.[0-9]{1,2})?$/,
|
||||
// validator: (rule, value) => {
|
||||
// const regex = /^[0-9]+(.[0-9]{1,2})?$/;
|
||||
// const result = regex.test(value);
|
||||
// if (value < 0 || value > 3888 || !result) {
|
||||
// return Promise.reject(
|
||||
// messageEle("请填写你的空间介绍")
|
||||
// );
|
||||
// }
|
||||
// return Promise.resolve();
|
||||
// },
|
||||
},
|
||||
]}
|
||||
>
|
||||
<div className="mt-2 px-4 py-3 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center">
|
||||
<TextArea
|
||||
id="spaceIntro"
|
||||
style={{ "--font-size": `16px` }}
|
||||
placeholder="介绍下你的空间吧~"
|
||||
/>
|
||||
</div>
|
||||
</Form.Item>
|
||||
</div>
|
||||
<div className="mt-3">
|
||||
<Form.Item
|
||||
required
|
||||
name="spacePrice"
|
||||
// childElementPosition="left"
|
||||
label={
|
||||
<div className="flex justify-between items-center">
|
||||
<p className="text-sm whitespace-nowrap">
|
||||
<span>解锁空间价格</span>
|
||||
<span className="text-[#f00]">*</span>
|
||||
</p>
|
||||
<p className="text-[#ffffffae] text-xs">
|
||||
(成为空间成员,可查看免费帖)
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
layout="vertical"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
// message: messageEle("请填写正确的解锁空间的价格"),
|
||||
// 匹配两为小数
|
||||
// pattern: /^[0-9]+(.[0-9]{1,2})?$/,
|
||||
validator: (rule, value) => {
|
||||
const regex = /^[0-9]+(.[0-9]{1,2})?$/;
|
||||
const result = regex.test(value);
|
||||
if (value < 0 || value > 3888 || !result) {
|
||||
return Promise.reject(
|
||||
messageEle("请输入有效的解锁空间价格")
|
||||
);
|
||||
}
|
||||
return Promise.resolve();
|
||||
},
|
||||
},
|
||||
]}
|
||||
>
|
||||
<div className="mt-2 px-4 py-3 h-12 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center">
|
||||
<div className="flex items-center">
|
||||
<span className="mr-1 text-[#ffffffae] text-sm">¥</span>
|
||||
<Form.Item name="spacePrice">
|
||||
<OwnInput
|
||||
id="spacePriceInput"
|
||||
type="number"
|
||||
placeholder="价格区间为0~3888"
|
||||
inputClassName="placeholder:text-[14px]"
|
||||
/>
|
||||
</Form.Item>
|
||||
</div>
|
||||
<label
|
||||
htmlFor="spacePriceInput"
|
||||
className="text-[#ffffff40] text-xs whitespace-nowrap"
|
||||
>
|
||||
点击编辑
|
||||
</label>
|
||||
</div>
|
||||
</Form.Item>
|
||||
</div>
|
||||
<div className="mt-3">
|
||||
{/* <div className="flex justify-between items-center">
|
||||
<p className="text-sm whitespace-nowrap">
|
||||
<span>铁粉价格</span>
|
||||
<span className="text-[#f00]">*</span>
|
||||
</p>
|
||||
<p className="text-[#ffffffae] text-xs">
|
||||
(付费后解锁对应期限超粉权益)
|
||||
(累计消费达成后解锁铁粉权益)
|
||||
</p>
|
||||
</div>
|
||||
<Space direction="vertical" block>
|
||||
<Radio.Group
|
||||
value={superSingleChecked}
|
||||
// value={superSingleCheckeds}
|
||||
onChange={(values) => {
|
||||
setSuperSingleChecked(values);
|
||||
// setSuperSingleCheckeds(values);
|
||||
}}
|
||||
>
|
||||
<ul>{listItemWithCheckboxMemo}</ul>
|
||||
</Radio.Group>
|
||||
{/* <Checkbox.Group
|
||||
value={superSingleCheckeds}
|
||||
onChange={(values) => {
|
||||
setSuperSingleCheckeds(values);
|
||||
}}
|
||||
>
|
||||
<ul>{listItemWithCheckboxMemo}</ul>
|
||||
</Checkbox.Group> */}
|
||||
</Space>
|
||||
</div> */}
|
||||
<Form.Item
|
||||
name="ironFanPrice"
|
||||
// childElementPosition="left"
|
||||
label={
|
||||
<div className="flex justify-between items-center">
|
||||
<p className="text-sm whitespace-nowrap">
|
||||
<span className="text-white">铁粉价格</span>
|
||||
<span className="text-[#f00]">*</span>
|
||||
</p>
|
||||
<p className="text-[#ffffffb3] text-xs">
|
||||
(累计消费达成后解锁铁粉权益)
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
layout="vertical"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
// message: messageEle("请填写正确的铁粉价格"),
|
||||
// 匹配两为小数
|
||||
// pattern: /^[0-9]+(.[0-9]{1,2})?$/,
|
||||
validator: (rule, value) => {
|
||||
const regex = /^[0-9]+(.[0-9]{1,2})?$/;
|
||||
const result = regex.test(value);
|
||||
if (value < 1 || value > 3888 || !result) {
|
||||
return Promise.reject(messageEle("请输入有效的铁粉价格"));
|
||||
}
|
||||
return Promise.resolve();
|
||||
},
|
||||
},
|
||||
]}
|
||||
>
|
||||
<div className="mt-2 px-4 py-3 h-12 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center">
|
||||
<div className="flex items-center">
|
||||
<span className="mr-1 text-[#ffffffae] text-sm">¥</span>
|
||||
<Form.Item name="ironFanPrice">
|
||||
<OwnInput
|
||||
id="ironPriceInput"
|
||||
type="number"
|
||||
placeholder="价格区间为1~3888"
|
||||
inputClassName="placeholder:text-[14px]"
|
||||
/>
|
||||
</Form.Item>
|
||||
</div>
|
||||
<label
|
||||
htmlFor="ironPriceInput"
|
||||
className="text-[#ffffff40] text-xs whitespace-nowrap"
|
||||
>
|
||||
点击编辑
|
||||
</label>
|
||||
</div>
|
||||
</Form.Item>
|
||||
</div>
|
||||
)}
|
||||
<div className="mt-10 flex justify-center">
|
||||
<Button
|
||||
size="middle"
|
||||
shape="rounded"
|
||||
style={{
|
||||
"--background-color": "#FF669E",
|
||||
paddingLeft: "32px",
|
||||
paddingRight: "32px",
|
||||
}}
|
||||
onClick={handleSubmit}
|
||||
>
|
||||
{isSubmitting ? "正在保存..." : "开通空间"}
|
||||
</Button>
|
||||
</div>
|
||||
<div className="mt-3">
|
||||
<div className="flex justify-between items-center">
|
||||
<p className="text-sm">
|
||||
<span>超粉功能</span>
|
||||
<span className="text-[#f00]">*</span>
|
||||
</p>
|
||||
<div className="flex items-center">
|
||||
<p className="text-[#ffffffae] text-xs mr-2">是否启用</p>
|
||||
<Form.Item>
|
||||
<Switch
|
||||
checked={openSuper}
|
||||
onChange={() => setOpenSuper((old) => !old)}
|
||||
style={{
|
||||
"--checked-color": "#FF669E",
|
||||
"--height": "24px",
|
||||
"--width": "36px",
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{openSuper && (
|
||||
<Form.Item
|
||||
name="superSingleCheckeds"
|
||||
// childElementPosition="left"
|
||||
label={
|
||||
<div className="flex justify-between items-center">
|
||||
<p className="text-sm">
|
||||
<span className="text-white">超粉单次开通类型</span>
|
||||
<span className="text-[#f00]">*</span>
|
||||
</p>
|
||||
<p className="text-[#ffffffb3] text-xs">
|
||||
(付费后解锁对应期限超粉权益)
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
layout="vertical"
|
||||
>
|
||||
<Space direction="vertical" block>
|
||||
{/* <Radio.Group
|
||||
value={superSingleChecked}
|
||||
// value={superSingleCheckeds}
|
||||
onChange={(values) => {
|
||||
setSuperSingleChecked(values);
|
||||
// setSuperSingleCheckeds(values);
|
||||
}}
|
||||
>
|
||||
<ul>{listItemWithCheckboxMemo}</ul>
|
||||
</Radio.Group> */}
|
||||
<Checkbox.Group
|
||||
value={superSingleCheckeds}
|
||||
onChange={(values) => {
|
||||
setSuperSingleCheckeds(values);
|
||||
}}
|
||||
>
|
||||
<ul>{listItemWithCheckboxMemo}</ul>
|
||||
</Checkbox.Group>
|
||||
</Space>
|
||||
</Form.Item>
|
||||
)}
|
||||
<Form.Item label={null} className="mt-10 flex-1 flex justify-center">
|
||||
<Button
|
||||
size="middle"
|
||||
shape="rounded"
|
||||
block
|
||||
style={{
|
||||
"--background-color": "#FF669E",
|
||||
paddingLeft: "32px",
|
||||
paddingRight: "32px",
|
||||
}}
|
||||
type="primary"
|
||||
htmlType="submit"
|
||||
disabled={isSubmitting}
|
||||
>
|
||||
{isSubmitting ? "正在保存..." : "保存设置"}
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -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"
|
||||
>
|
||||
<OwnImage width={54} height={54} roundedFull src={icon} fit="cover" />
|
||||
<div className="flex flex-row justify-between items-center flex-1">
|
||||
<div className="w-full grid grid-cols-[calc(100%-70px-0.75rem)_70px] gap-3 justify-between items-center">
|
||||
<div className="flex flex-col">
|
||||
<div className="flex flex-row items-center mb-2">
|
||||
<span className="text-base text-white font-medium mr-2">
|
||||
{title}
|
||||
</span>
|
||||
</div>
|
||||
<span className="text-xs text-[#FFFFFFB2]">{subtitle}</span>
|
||||
<span className="text-xs text-[#FFFFFFB2] truncate">
|
||||
{subtitle}
|
||||
</span>
|
||||
</div>
|
||||
<div className="w-[70px] flex flex-col justify-end items-end">
|
||||
<span className="text-xs mb-2 text-[#FFFFFF80]">{time}</span>
|
||||
|
@ -228,7 +225,7 @@ const MessageList = ({ mid, changeNoticeCount, refInstance, noticeCount }) => {
|
|||
<div className="flex flex-col rounded-2xl mt-2 mb-24">
|
||||
<div
|
||||
onClick={() => router.push("/messageDetail")}
|
||||
className="flex flex-row items-center p-4 mb-2 rounded-xl"
|
||||
className="grid grid-cols-[54px_calc(100%-54px-0.75rem)] gap-3 items-center p-4 mb-2 rounded-xl"
|
||||
>
|
||||
<div>
|
||||
<OwnIcon
|
||||
|
@ -237,19 +234,18 @@ const MessageList = ({ mid, changeNoticeCount, refInstance, noticeCount }) => {
|
|||
roundedFull
|
||||
fit="cover"
|
||||
className="w-[54px] h-[54px] rounded-md"
|
||||
outClassName="mr-3"
|
||||
src="/images/icon_border.png"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-row justify-between items-center flex-1">
|
||||
<div className="flex flex-col">
|
||||
<div className="w-full flex flex-col">
|
||||
<div className="flex flex-row items-center mb-2">
|
||||
<span className="text-bas font-medium mr-2">铁粉空间客服</span>
|
||||
<div className="font-medium mr-2 px-1 rounded bg-[#FF669E]">
|
||||
<span className="text-xs ">官方</span>
|
||||
</div>
|
||||
</div>
|
||||
<p className="text-xs text-[#FFFFFFB2]">
|
||||
<p className="text-xs text-[#FFFFFFB2] truncate">
|
||||
{(data?.recent_contact_cs_msg?.includes("|")
|
||||
? data?.recent_contact_cs_msg?.split("|")[0]
|
||||
: data?.recent_contact_cs_msg) || "暂无新消息"}
|
||||
|
|
|
@ -84,7 +84,7 @@ export default function PersonSpace() {
|
|||
if (res) {
|
||||
const { isRefunding, noRole } = res;
|
||||
isRefunding && router.push("/");
|
||||
noRole && router.replace("person_space_introduce/" + id);
|
||||
noRole && router.replace("/space/person_space_introduce/" + id);
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
|
@ -130,6 +130,7 @@ export default function PersonSpace() {
|
|||
}
|
||||
};
|
||||
const getPostList = async (zid, activeKey, offset) => {
|
||||
if (streamerInfo.visitor_role === 4) return;
|
||||
try {
|
||||
setLoading(true);
|
||||
let body = {
|
||||
|
@ -679,7 +680,7 @@ export default function PersonSpace() {
|
|||
</div>
|
||||
<div
|
||||
onClick={() => setPopVisible(false)}
|
||||
className="w-[221px] h-[46px] mt-[41px] flex justify-center items-center rounded-full text-[15px] bg-[#FF669E]"
|
||||
className="w-[221px] h-[46px] mt-[41px] font-[500] flex justify-center items-center rounded-full text-[15px] bg-[#FF669E]"
|
||||
>
|
||||
回到空间
|
||||
</div>
|
||||
|
|
|
@ -272,7 +272,7 @@ const SpacesList = forwardRef(({ scrollHeight }, ref) => {
|
|||
</li>
|
||||
))}
|
||||
{spacesList.length > 0 && (
|
||||
<li onClick={() => router.push("/search")}>
|
||||
<li onClick={() => router.push("/found")}>
|
||||
<div
|
||||
// onPress={() => navigation.navigate("Stream")}
|
||||
// onClick={}
|
||||
|
|
|
@ -177,7 +177,7 @@ export default function PersonSpaceIntroduce() {
|
|||
<p className="text-lg font-bold tabPinkLine relative inline-block">
|
||||
空间介绍
|
||||
</p>
|
||||
<p className="my-2 text-base">{data?.profile}</p>
|
||||
<pre className="my-2 text-base">{data?.profile}</pre>
|
||||
<ul className="grid grid-cols-3 gap-1.5">
|
||||
<li
|
||||
className="relative h-[28vw] overflow-hidden"
|
||||
|
|
|
@ -109,7 +109,6 @@ export default function SpacePaymentSetting() {
|
|||
const searchParams = useSearchParams();
|
||||
const [openSuper, setOpenSuper] = useState(false);
|
||||
const [spacePriceAble, setSpacePriceAble] = useState(false);
|
||||
const [tiefenPriceAble, setTiefenPriceAble] = useState(false);
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
const [superSingleCheckeds, setSuperSingleCheckeds] = useState([]);
|
||||
|
||||
|
@ -194,23 +193,7 @@ export default function SpacePaymentSetting() {
|
|||
}
|
||||
|
||||
const _spacePrice = parseInt(spacePrice * 100, 10);
|
||||
if (isNaN(_spacePrice) || _spacePrice < 0 || _spacePrice > 388800) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: "请输入有效的解锁空间价格",
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
const _ironFanPrice = parseInt(ironFanPrice * 100, 10);
|
||||
if (isNaN(_ironFanPrice) || _ironFanPrice < 100 || _ironFanPrice > 388800) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: "请输入有效的铁粉价格",
|
||||
position: "top",
|
||||
});
|
||||
return;
|
||||
}
|
||||
let isPrice = false;
|
||||
if (openSuper) {
|
||||
Object.values(superSingle).forEach((it) => {
|
||||
|
@ -219,7 +202,7 @@ export default function SpacePaymentSetting() {
|
|||
if (!superFanPrice) {
|
||||
Toast.show({
|
||||
icon: "fail",
|
||||
content: "请填写超粉价格",
|
||||
content: "请输入有效的超粉价格",
|
||||
position: "top",
|
||||
});
|
||||
isPrice = true;
|
||||
|
@ -339,8 +322,8 @@ export default function SpacePaymentSetting() {
|
|||
try {
|
||||
const body = {
|
||||
id: parseInt(searchParams.get("zid"), 10),
|
||||
admission_price: parseInt(spacePrice * 100, 10),
|
||||
ironfanship_price: parseInt(ironFanPrice * 100, 10),
|
||||
admission_price: _spacePrice,
|
||||
ironfanship_price: _ironFanPrice,
|
||||
is_superfanship_enabled: openSuper ? 1 : 0,
|
||||
// 旧版本
|
||||
// superfanship_price: superfanObj.price,
|
||||
|
@ -431,43 +414,52 @@ export default function SpacePaymentSetting() {
|
|||
(成为空间成员,可查看免费帖)
|
||||
</p>
|
||||
</div>
|
||||
<div className="mt-2 px-4 py-3 h-12 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center">
|
||||
<div className="flex items-center">
|
||||
<span className="mr-1 text-[#ffffffae] text-sm">¥</span>
|
||||
<Form.Item
|
||||
required
|
||||
name="spacePrice"
|
||||
// childElementPosition="left"
|
||||
layout="vertical"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: messageEle("请填写解锁空间的价格"),
|
||||
pattern: /^[0-9]\d*$/,
|
||||
// validator: (rule, value) => {
|
||||
// if (value.length === 0) {
|
||||
// return Promise.reject(messageEle("请选择性别"));
|
||||
// }
|
||||
// },
|
||||
},
|
||||
]}
|
||||
|
||||
<Form.Item
|
||||
required
|
||||
name="spacePrice"
|
||||
// childElementPosition="left"
|
||||
layout="vertical"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
// message: messageEle("请填写正确的解锁空间的价格"),
|
||||
// 匹配两为小数
|
||||
// pattern: /^[0-9]+(.[0-9]{1,2})?$/,
|
||||
validator: (rule, value) => {
|
||||
const regex = /^[0-9]+(.[0-9]{1,2})?$/;
|
||||
const result = regex.test(value);
|
||||
if (value < 0 || value > 3888 || !result) {
|
||||
return Promise.reject(
|
||||
messageEle("请输入有效的解锁空间价格")
|
||||
);
|
||||
}
|
||||
return Promise.resolve();
|
||||
},
|
||||
},
|
||||
]}
|
||||
>
|
||||
<div className="mt-2 px-4 py-3 h-12 rounded-[0.8rem] bg-[#FFFFFF1a] flex justify-between items-center">
|
||||
<div className="flex items-center">
|
||||
<span className="mr-1 text-[#ffffffae] text-sm">¥</span>
|
||||
<Form.Item name="spacePrice">
|
||||
<OwnInput
|
||||
id="spacePriceInput"
|
||||
type="number"
|
||||
placeholder="价格区间为0~3888"
|
||||
inputClassName="placeholder:text-[14px]"
|
||||
/>
|
||||
</Form.Item>
|
||||
</div>
|
||||
<label
|
||||
htmlFor="spacePriceInput"
|
||||
className="text-[#ffffff40] text-xs whitespace-nowrap"
|
||||
>
|
||||
<OwnInput
|
||||
id="spacePrice"
|
||||
type="number"
|
||||
placeholder="0~3888,仅支持整数"
|
||||
inputClassName="placeholder:text-[14px]"
|
||||
/>
|
||||
</Form.Item>
|
||||
点击编辑
|
||||
</label>
|
||||
</div>
|
||||
<label
|
||||
htmlFor="spacePrice"
|
||||
className="text-[#ffffff40] text-xs whitespace-nowrap"
|
||||
onClick={() => setSpacePriceAble(true)}
|
||||
>
|
||||
点击编辑
|
||||
</label>
|
||||
</div>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="ironFanPrice"
|
||||
// childElementPosition="left"
|
||||
|
@ -486,12 +478,17 @@ export default function SpacePaymentSetting() {
|
|||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: messageEle("请填写铁粉价格"),
|
||||
// validator: (rule, value) => {
|
||||
// if (value.length === 0) {
|
||||
// return Promise.reject(messageEle("请选择性别"));
|
||||
// }
|
||||
// },
|
||||
// message: messageEle("请填写正确的铁粉价格"),
|
||||
// 匹配两为小数
|
||||
// pattern: /^[0-9]+(.[0-9]{1,2})?$/,
|
||||
validator: (rule, value) => {
|
||||
const regex = /^[0-9]+(.[0-9]{1,2})?$/;
|
||||
const result = regex.test(value);
|
||||
if (value < 1 || value > 3888 || !result) {
|
||||
return Promise.reject(messageEle("请输入有效的铁粉价格"));
|
||||
}
|
||||
return Promise.resolve();
|
||||
},
|
||||
},
|
||||
]}
|
||||
>
|
||||
|
@ -500,17 +497,16 @@ export default function SpacePaymentSetting() {
|
|||
<span className="mr-1 text-[#ffffffae] text-sm">¥</span>
|
||||
<Form.Item name="ironFanPrice">
|
||||
<OwnInput
|
||||
id="ironFanPrice"
|
||||
id="ironFanPriceInput"
|
||||
type="number"
|
||||
placeholder="1~3888,仅支持整数"
|
||||
placeholder="价格区间为1~3888"
|
||||
inputClassName="placeholder:text-[14px]"
|
||||
/>
|
||||
</Form.Item>
|
||||
</div>
|
||||
<label
|
||||
htmlFor="ironFanPrice"
|
||||
htmlFor="ironFanPriceInput"
|
||||
className="text-[#ffffff40] text-xs whitespace-nowrap"
|
||||
onClick={() => setTiefenPriceAble(true)}
|
||||
>
|
||||
点击编辑
|
||||
</label>
|
||||
|
|
|
@ -1,12 +1,28 @@
|
|||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import { useRouter, useParams } from "next/navigation";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faAngleLeft } from "@fortawesome/free-solid-svg-icons";
|
||||
|
||||
export default function WebView() {
|
||||
const { src } = useParams();
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
// 添加消息事件监听器
|
||||
const handleMessage = (event) => {
|
||||
if (event.data && event.data.type === "navigation" && event.data.url) {
|
||||
router.push(event.data.url);
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener("message", handleMessage);
|
||||
|
||||
// 清理函数
|
||||
return () => {
|
||||
window.removeEventListener("message", handleMessage);
|
||||
};
|
||||
}, [router]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
{/* <div className="p-4 fixed top-0 z-10 w-full">
|
||||
|
|
Loading…
Reference in New Issue