|
@@ -19,7 +19,7 @@ import { useIsLogin } from "@/xiaolanbenlib/hooks/data/useAuth";
|
|
export default function Profile() {
|
|
export default function Profile() {
|
|
const { agentProfile, fetchAgentProfile } = useAgentStore();
|
|
const { agentProfile, fetchAgentProfile } = useAgentStore();
|
|
const params = useRouter().params;
|
|
const params = useRouter().params;
|
|
- const isLogin = useIsLogin()
|
|
|
|
|
|
+ const isLogin = useIsLogin();
|
|
|
|
|
|
// 解码
|
|
// 解码
|
|
const decodeSceneValue = async (sceneValue: string) => {
|
|
const decodeSceneValue = async (sceneValue: string) => {
|
|
@@ -31,7 +31,7 @@ export default function Profile() {
|
|
agentId?: string;
|
|
agentId?: string;
|
|
};
|
|
};
|
|
if (originalScene.agentId) {
|
|
if (originalScene.agentId) {
|
|
- console.log(originalScene,111)
|
|
|
|
|
|
+ console.log(originalScene, 111);
|
|
fetchAgentProfile(originalScene.agentId);
|
|
fetchAgentProfile(originalScene.agentId);
|
|
postLog(originalScene.agentId, originalScene.shareKey ?? "");
|
|
postLog(originalScene.agentId, originalScene.shareKey ?? "");
|
|
}
|
|
}
|
|
@@ -43,16 +43,16 @@ export default function Profile() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- console.log(params.scene, '场景值');
|
|
|
|
|
|
+ console.log(params.scene, "场景值");
|
|
// 通过小程序码识别打开的页面
|
|
// 通过小程序码识别打开的页面
|
|
- useEffect(()=> {
|
|
|
|
|
|
+ useEffect(() => {
|
|
const scene = decodeURIComponent(params.scene ?? "");
|
|
const scene = decodeURIComponent(params.scene ?? "");
|
|
if (scene.length <= 32 && scene.length > 0) {
|
|
if (scene.length <= 32 && scene.length > 0) {
|
|
// 有值,且小于 32 位,说明需要解码
|
|
// 有值,且小于 32 位,说明需要解码
|
|
// 判断是否需要解压 shareKey
|
|
// 判断是否需要解压 shareKey
|
|
decodeSceneValue(scene);
|
|
decodeSceneValue(scene);
|
|
}
|
|
}
|
|
- }, [])
|
|
|
|
|
|
+ }, []);
|
|
|
|
|
|
// 正常分享出来的页面
|
|
// 正常分享出来的页面
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -64,21 +64,24 @@ export default function Profile() {
|
|
|
|
|
|
const renderNavBarLeft = () => {
|
|
const renderNavBarLeft = () => {
|
|
const pages = getCurrentPages();
|
|
const pages = getCurrentPages();
|
|
|
|
+ console.log(pages, "当前页面");
|
|
|
|
+ // 有后退页,则不显示 home 按钮
|
|
|
|
+ if (pages.length > 1) {
|
|
|
|
+ return (
|
|
|
|
+ <View className={style.navButtons}>
|
|
|
|
+ <View
|
|
|
|
+ className="flex-center"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ Taro.navigateBack();
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ <IconArrowLeft></IconArrowLeft>
|
|
|
|
+ </View>
|
|
|
|
+ </View>
|
|
|
|
+ );
|
|
|
|
+ }
|
|
return (
|
|
return (
|
|
<View className={style.navButtons}>
|
|
<View className={style.navButtons}>
|
|
- {pages.length > 1 && (
|
|
|
|
- <>
|
|
|
|
- <View
|
|
|
|
- className="flex-center"
|
|
|
|
- onClick={() => {
|
|
|
|
- Taro.navigateBack();
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- <IconArrowLeft></IconArrowLeft>
|
|
|
|
- </View>
|
|
|
|
- <View className={style.navGapLine}></View>
|
|
|
|
- </>
|
|
|
|
- )}
|
|
|
|
<View
|
|
<View
|
|
className="flex-center"
|
|
className="flex-center"
|
|
onClick={() => {
|
|
onClick={() => {
|
|
@@ -91,14 +94,40 @@ export default function Profile() {
|
|
</View>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
);
|
|
);
|
|
|
|
+ // return (
|
|
|
|
+ // <View className={style.navButtons}>
|
|
|
|
+ // {pages.length > 1 && (
|
|
|
|
+ // <>
|
|
|
|
+ // <View
|
|
|
|
+ // className="flex-center"
|
|
|
|
+ // onClick={() => {
|
|
|
|
+ // Taro.navigateBack();
|
|
|
|
+ // }}
|
|
|
|
+ // >
|
|
|
|
+ // <IconArrowLeft></IconArrowLeft>
|
|
|
|
+ // </View>
|
|
|
|
+ // <View className={style.navGapLine}></View>
|
|
|
|
+ // </>
|
|
|
|
+ // )}
|
|
|
|
+
|
|
|
|
+ // <View
|
|
|
|
+ // className="flex-center"
|
|
|
|
+ // onClick={() => {
|
|
|
|
+ // Taro.switchTab({
|
|
|
|
+ // url: "/pages/index/index",
|
|
|
|
+ // });
|
|
|
|
+ // }}
|
|
|
|
+ // >
|
|
|
|
+ // <IconHomeOutline></IconHomeOutline>
|
|
|
|
+ // </View>
|
|
|
|
+ // </View>
|
|
|
|
+ // );
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<PageCustom styleBg={agentProfile?.avatarUrl}>
|
|
<PageCustom styleBg={agentProfile?.avatarUrl}>
|
|
<View className="w-full">
|
|
<View className="w-full">
|
|
- <NavBarNormal
|
|
|
|
- leftColumn={renderNavBarLeft}
|
|
|
|
- ></NavBarNormal>
|
|
|
|
|
|
+ <NavBarNormal leftColumn={renderNavBarLeft}></NavBarNormal>
|
|
<View className="blur-rounded-container">
|
|
<View className="blur-rounded-container">
|
|
{agentProfile && (
|
|
{agentProfile && (
|
|
<>
|
|
<>
|
|
@@ -111,7 +140,6 @@ export default function Profile() {
|
|
</>
|
|
</>
|
|
)}
|
|
)}
|
|
</View>
|
|
</View>
|
|
-
|
|
|
|
</View>
|
|
</View>
|
|
</PageCustom>
|
|
</PageCustom>
|
|
);
|
|
);
|