From 159943b63eeb0bb16e638d21177d8147527f4fc6 Mon Sep 17 00:00:00 2001
From: yezian <jueweijue@gmail.com>
Date: Sun, 22 Dec 2024 00:31:49 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=88=E4=BC=99=E4=BA=BA?=
 =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=B1=95=E7=A4=BAbug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../setting/collaboratorSetting/page.jsx      | 50 +++++++++++--------
 1 file changed, 28 insertions(+), 22 deletions(-)

diff --git a/app/space/setting/collaboratorSetting/page.jsx b/app/space/setting/collaboratorSetting/page.jsx
index da267a2..343dc85 100644
--- a/app/space/setting/collaboratorSetting/page.jsx
+++ b/app/space/setting/collaboratorSetting/page.jsx
@@ -27,6 +27,8 @@ import requireAPI from "@/utils/requireAPI";
 import { useRouter, useSearchParams } from "next/navigation";
 import OwnInput from "@/components/OwnInput";
 import { get } from "@/utils/storeInfo";
+import baseRequest from "@/utils/baseRequest";
+
 export default function CollaboratorSetting() {
   const [data, setData] = useState(null);
   const [selfMid, setSelfMid] = useState();
@@ -58,7 +60,8 @@ export default function CollaboratorSetting() {
     const visitor_role = Number(searchParams.get("visitor_role"));
     try {
       setIsloading(true);
-      setSelfMid(zid);
+      const base = baseRequest();
+      setSelfMid(base.b_mid);
       const body = {
         zid,
         visitor_role,
@@ -195,16 +198,17 @@ export default function CollaboratorSetting() {
   const selfData = data?.list?.filter(
     (item) => item.collaborator_mid === selfMid
   );
+
+  if (isloading) {
+    return (
+      <div className="bg-[#00000099] fixed top-0 w-full text-center flex items-center justify-center  h-screen">
+        <SpinLoading />
+      </div>
+    );
+  }
+
   return (
     <div>
-      {isloading && (
-        <div
-          className="bg-[#00000099] fixed top-0 w-full text-center flex items-center justify-center  h-screen"
-          // style={{ height: scrollHeight - 60 + "px" }}
-        >
-          <SpinLoading />
-        </div>
-      )}
       {/* 头部标题 */}
       <div className="p-4 fixed top-0 z-10 w-full bg-black">
         <div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full absolute">
@@ -221,19 +225,21 @@ export default function CollaboratorSetting() {
       </div>
       {/* 内容 */}
       <div className="p-4 pt-20">
-        {searchParams.get("visitor_role") === 2 ? (
-          <div className="p-4 pt-20">
-            <div className="flex flex-col border-2 border-[#2c2b2f] rounded-2xl p-4 w-full mt-6">
-              <p>合伙人昵称:{selfData[0]?.collaborator_account?.name}</p>
-              <p>ID:{selfData[0]?.collaborator_account?.user_id}</p>
-              <p>
-                分成比例:
-                {selfData[0]?.sharing_ratio
-                  ? (selfData[0]?.sharing_ratio * 100).toFixed()
-                  : 0}
-                %
-              </p>
-            </div>
+        {searchParams.get("visitor_role") == 2 && selfData ? (
+          <div className="flex flex-col gap-2 border-2 border-[#2c2b2f] rounded-2xl p-4 w-full mt-6">
+            <p className="text-base font-medium whitespace-nowrap">
+              合伙人昵称:{selfData[0]?.collaborator_account?.name}
+            </p>
+            <p className="text-base font-medium whitespace-nowrap">
+              ID:{selfData[0]?.collaborator_account?.user_id}
+            </p>
+            <p className="text-base font-medium whitespace-nowrap">
+              分成比例:
+              {selfData[0]?.sharing_ratio
+                ? (selfData[0]?.sharing_ratio * 100).toFixed()
+                : 0}
+              %
+            </p>
           </div>
         ) : (
           <div className="flex flex-col items-center p-4">