修改消息通知跳转

This commit is contained in:
al 2025-01-16 11:17:49 +08:00
parent 00f98fb9ad
commit 49d0da3f8d
3 changed files with 11 additions and 19 deletions

View File

@ -19,13 +19,13 @@ export default function NoticeItem({ leftIcon, hasLink, data }) {
{/* <Icon type="ionicon" name="megaphone" size={24} color="white" /> */}
{leftIcon}
</div>
<p className="text-lg font-medium mr-2 ">{data?.title}</p>
<p className="text-lg font-medium mr-2 truncate">{data?.title}</p>
</div>
<pre className="text-base font-medium my-2 whitespace-pre-wrap">
{data?.message}
</pre>
{/* 链接跳转 */}
{!!data?.hyperlinks && (
{data?.hyperlinks && data?.hyperlinks[0].action && (
<div
onClick={() => {}}
className="rounded-xl p-2 flex flex-row items-center my-2 bg-[#FFFFFF1A]"
@ -53,17 +53,9 @@ export default function NoticeItem({ leftIcon, hasLink, data }) {
}
const links = data?.hyperlinks;
if (links) {
// const linkAndParams = goToPage(
// links[1]?.params
// );
// if (linkAndParams) {
// typeof linkAndParams === "object"
// ? router.push(...linkAndParams)
// : router.push(linkAndParams);
// }
if (links.length > 1) {
links[1]?.action === "app_router_path";
router.push("/" + links[1]?.params);
router.push(links[1]?.params);
} else {
links[0]?.action === "outward";
router.push(links[0]?.params);

View File

@ -17,7 +17,7 @@ export default function Banner() {
const _data = await requireAPI(
"POST",
"/api/activity_banner/list",
null,
{ body: { device_type: 2 } },
true
);
if (_data.ret === -1) {
@ -39,9 +39,9 @@ export default function Banner() {
}, []);
const items = useCallback(
(item, index) => (
<Swiper.Item key={index}>
<Swiper.Item key={item.id}>
<div
className="w-full h-[200px]"
className="w-full h-[calc(100vw*3/7)]"
onClick={() => {
const links = item?.hyperlinks;
if (links.length > 1) {

View File

@ -39,10 +39,6 @@ export default function HostList() {
}, []);
return (
<div className="flex-1 mt-6">
{/* Banner预留位置 */}
<div className="my-4">
<Banner />
</div>
<div className="flex flex-row justify-between items-center">
<p className="text-xl font-medium">猜你想看</p>
{/* <div
@ -102,7 +98,7 @@ export default function HostList() {
<span className="text-base text-white font-medium whitespace-nowrap truncate max-w-[30%]">
{item.title}
</span>
{item.age && (
{!!item.age && (
<>
<div className="flex flex-row items-center py-0.5 px-2 ml-1 bg-[#FFFFFF1A] rounded-full">
{item?.gender === 1 ? (
@ -142,6 +138,10 @@ export default function HostList() {
</List.Item>
))}
</List>
{/* Banner预留位置 */}
<div className="my-4">
<Banner />
</div>
</div>
);
}