diff --git a/app/messageDetail/page.js b/app/messageDetail/page.js index f342e0e..d489f66 100644 --- a/app/messageDetail/page.js +++ b/app/messageDetail/page.js @@ -209,7 +209,6 @@ export default function MessageDetail({}) { // }); return; } - //查询历史记录的时候后移一位,防止记录重复 setOffset((prev) => prev + 1); //请求接口发送私信 @@ -277,6 +276,7 @@ export default function MessageDetail({}) { // createdAt: new Date(item.ct * 1000).toISOString(), createdAt: item.ct, text: item.message, + m_type: item.m_type, user: { _id: account?.mid, name: account?.name, @@ -289,6 +289,7 @@ export default function MessageDetail({}) { _id: item.id, createdAt: item.ct, text: item.message, + m_type: item.m_type, user: { _id: 0, name: "客服", @@ -403,6 +404,40 @@ export default function MessageDetail({}) { console.error(error); } }; + const getAutoMessage = useCallback( + (data) => { + if (data.m_type === 1) { + const test = data.text.split("|"); + const btns = test[1].split(","); + return ( +
+

{test[0]}

+
+

触发按钮:

+ +
+
+ ); + } else { + return data?.text; + } + // data.m_type===1?it?.text.split("|")it?.text + }, + [sessionId] + ); return (
@@ -441,43 +476,49 @@ export default function MessageDetail({}) {

{formatDeadline(item[0].createdAt)}

-
diff --git a/components/InfiniteScrollContent/index.jsx b/components/InfiniteScrollContent/index.jsx index f859989..179ea64 100644 --- a/components/InfiniteScrollContent/index.jsx +++ b/components/InfiniteScrollContent/index.jsx @@ -1,11 +1,15 @@ +"use client"; + import React from "react"; import { DotLoading } from "antd-mobile"; import Empty from "@/components/Empty"; +import { useRouter } from "next/navigation"; export default function InfiniteScrollContent({ - hasMore=0, + hasMore = 0, isEmpty, showNoMore = true, }) { + const router = useRouter(); return ( <> {hasMore ? ( @@ -21,6 +25,20 @@ export default function InfiniteScrollContent({ // style={{ height: `${scrollHeight}px` }} > +
+

router.push("/search")} + className="text-base font-medium flex items-center justify-center bg-[#FFFFFF1A] mt-2 rounded-full w-[190px] h-[46px]" + > + 搜索空间 +

+

router.push("/found")} + className="text-base font-medium flex items-center justify-center bg-[#FFFFFF1A] mt-2 rounded-full w-[190px] h-[46px]" + > + 查看推荐 +

+
)} diff --git a/public/icons/newM_pay.png b/public/icons/newM_pay.png new file mode 100644 index 0000000..302fc84 Binary files /dev/null and b/public/icons/newM_pay.png differ diff --git a/public/icons/newM_wechat.png b/public/icons/newM_wechat.png new file mode 100644 index 0000000..5438d13 Binary files /dev/null and b/public/icons/newM_wechat.png differ diff --git a/public/images/newM.png b/public/images/newM.png new file mode 100644 index 0000000..3b8cc6b Binary files /dev/null and b/public/images/newM.png differ