anln_2.4 (#44)
Co-authored-by: al <al@cdhncy.com> Reviewed-on: https://git.wishpal.cn/wishpal_ironfan/tiefen_space_h5/pulls/44
This commit is contained in:
parent
102db693a6
commit
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -434,9 +437,8 @@ export default function MessageDetail({}) {
|
|||
const btns = test[1].split(",");
|
||||
return (
|
||||
<div>
|
||||
<p>{test[0]}</p>
|
||||
<pre>{test[0]}</pre>
|
||||
<div className="my-2">
|
||||
<p>触发按钮:</p>
|
||||
<ul className="grid grid-cols-2 gap-2 mt-2">
|
||||
{btns.map((item, index) => {
|
||||
return (
|
||||
|
|
|
@ -41,7 +41,7 @@ const ListItemWithCheckbox = ({
|
|||
return (
|
||||
<li className="mt-4" onClick={() => {}}>
|
||||
<div onClick={(e) => e.stopPropagation()}>
|
||||
<Radio
|
||||
{/* <Radio
|
||||
value={superSingle.key}
|
||||
onChange={(value) => {
|
||||
const newFormData = { ...formData };
|
||||
|
@ -55,8 +55,8 @@ const ListItemWithCheckbox = ({
|
|||
}}
|
||||
>
|
||||
{superSingle.text}
|
||||
</Radio>
|
||||
{/* <Checkbox
|
||||
</Radio> */}
|
||||
<Checkbox
|
||||
value={superSingle.key}
|
||||
onChange={(value) => {
|
||||
const newFormData = { ...formData };
|
||||
|
@ -67,18 +67,18 @@ const ListItemWithCheckbox = ({
|
|||
}}
|
||||
>
|
||||
{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 != 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)
|
||||
? "mt-0 px-0 py-0 hidden"
|
||||
: ""
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-center">
|
||||
<span className="mr-1 text-[#ffffffae] text-sm">¥</span>
|
||||
|
@ -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}
|
||||
/>
|
||||
</Fragment>
|
||||
));
|
||||
|
@ -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() {
|
|||
</p>
|
||||
</div>
|
||||
<Space direction="vertical" block>
|
||||
<Radio.Group
|
||||
{/* <Radio.Group
|
||||
value={superSingleChecked}
|
||||
// value={superSingleCheckeds}
|
||||
onChange={(values) => {
|
||||
|
@ -496,15 +497,15 @@ export default function CreateProfile() {
|
|||
}}
|
||||
>
|
||||
<ul>{listItemWithCheckboxMemo}</ul>
|
||||
</Radio.Group>
|
||||
{/* <Checkbox.Group
|
||||
</Radio.Group> */}
|
||||
<Checkbox.Group
|
||||
value={superSingleCheckeds}
|
||||
onChange={(values) => {
|
||||
setSuperSingleCheckeds(values);
|
||||
}}
|
||||
>
|
||||
<ul>{listItemWithCheckboxMemo}</ul>
|
||||
</Checkbox.Group> */}
|
||||
</Checkbox.Group>
|
||||
</Space>
|
||||
</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 = {
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue