|
@@ -10,7 +10,7 @@ import IconEditBlack from "@/components/icon/icon-edit-black";
|
|
import IconMoreBlack from "@/components/icon/IconMoreBlack";
|
|
import IconMoreBlack from "@/components/icon/IconMoreBlack";
|
|
|
|
|
|
import ContactIcon from '@/components/ContactIcon'
|
|
import ContactIcon from '@/components/ContactIcon'
|
|
-import { useAppStore } from "@/store/appStore";
|
|
|
|
|
|
+import { useIsLogin } from "@/xiaolanbenlib/hooks/data/useAuth";
|
|
import AgentSwap from "../AgentSwap/index";
|
|
import AgentSwap from "../AgentSwap/index";
|
|
import AgentQRCode from "../AgentQRcode/index";
|
|
import AgentQRCode from "../AgentQRcode/index";
|
|
import SharePopup from "@/components/custom-share/SharePopup";
|
|
import SharePopup from "@/components/custom-share/SharePopup";
|
|
@@ -20,22 +20,29 @@ import PopupSheets from "@/components/popup/popup-sheets";
|
|
import { useModalStore } from "@/store/modalStore";
|
|
import { useModalStore } from "@/store/modalStore";
|
|
import { TAgentDetail } from "@/types/agent";
|
|
import { TAgentDetail } from "@/types/agent";
|
|
import { useAgentStore } from "@/store/agentStore";
|
|
import { useAgentStore } from "@/store/agentStore";
|
|
|
|
+import LoginPopup from "@/components/LoginPopup";
|
|
|
|
+
|
|
interface IProps {
|
|
interface IProps {
|
|
agent: TAgentDetail,
|
|
agent: TAgentDetail,
|
|
isVisitor: boolean, // 是否是访问他人智能体
|
|
isVisitor: boolean, // 是否是访问他人智能体
|
|
}
|
|
}
|
|
export default ({agent, isVisitor}: IProps) => {
|
|
export default ({agent, isVisitor}: IProps) => {
|
|
- const headerHeight = useAppStore((state) => state.headerHeight);
|
|
|
|
|
|
+
|
|
const [showAgentSwap, setShowAgentSwap] = useState(false);
|
|
const [showAgentSwap, setShowAgentSwap] = useState(false);
|
|
const [showAgentQRcode, setShowAgentQRcode] = useState(false);
|
|
const [showAgentQRcode, setShowAgentQRcode] = useState(false);
|
|
const [showPopup, setShowPopup] = useState(false);
|
|
const [showPopup, setShowPopup] = useState(false);
|
|
const [showShare, setShowShare] = useState(false);
|
|
const [showShare, setShowShare] = useState(false);
|
|
|
|
+ const [showLogin, setShowLogin] = useState(false);
|
|
const { deleteAgent } = useAgentStore()
|
|
const { deleteAgent } = useAgentStore()
|
|
|
|
|
|
|
|
|
|
const {showModal,} = useModalStore()
|
|
const {showModal,} = useModalStore()
|
|
-
|
|
|
|
|
|
+ const isLogin = useIsLogin();
|
|
const handleClick = ()=> {
|
|
const handleClick = ()=> {
|
|
|
|
+ // 如果是未登录状态下想要去聊天, 则弹窗登录
|
|
|
|
+ if(!isLogin){
|
|
|
|
+ return setShowLogin(true);
|
|
|
|
+ }
|
|
|
|
|
|
// 如果是已经下线的智能体,显示提示信息
|
|
// 如果是已经下线的智能体,显示提示信息
|
|
if(agent.status === 'deleted'){
|
|
if(agent.status === 'deleted'){
|
|
@@ -63,7 +70,7 @@ export default ({agent, isVisitor}: IProps) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- const renderValue = (value?:string)=> {
|
|
|
|
|
|
+ const renderValue = (value?: string | null)=> {
|
|
return value?.length ? value : '--'
|
|
return value?.length ? value : '--'
|
|
}
|
|
}
|
|
|
|
|
|
@@ -73,8 +80,6 @@ export default ({agent, isVisitor}: IProps) => {
|
|
const enableQrcode = !isVisitor || !!agent?.qrCodeUrl?.length
|
|
const enableQrcode = !isVisitor || !!agent?.qrCodeUrl?.length
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
return (
|
|
return (
|
|
<View className="relative w-full">
|
|
<View className="relative w-full">
|
|
<View className={style.topBarContainer}>
|
|
<View className={style.topBarContainer}>
|
|
@@ -176,13 +181,20 @@ export default ({agent, isVisitor}: IProps) => {
|
|
</View>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
|
+ {/* 切换智能体弹窗 */}
|
|
{!isVisitor && <AgentSwap show={showAgentSwap} setShow={setShowAgentSwap}></AgentSwap>}
|
|
{!isVisitor && <AgentSwap show={showAgentSwap} setShow={setShowAgentSwap}></AgentSwap>}
|
|
|
|
+
|
|
|
|
+ {/* 二维码弹窗 */}
|
|
<AgentQRCode isVisitor={isVisitor} show={showAgentQRcode} setShow={setShowAgentQRcode} />
|
|
<AgentQRCode isVisitor={isVisitor} show={showAgentQRcode} setShow={setShowAgentQRcode} />
|
|
|
|
+
|
|
|
|
+ {/* 分享弹窗 */}
|
|
{agent && <SharePopup
|
|
{agent && <SharePopup
|
|
show={showShare}
|
|
show={showShare}
|
|
setShow={setShowShare}
|
|
setShow={setShowShare}
|
|
agent={agent}
|
|
agent={agent}
|
|
></SharePopup>}
|
|
></SharePopup>}
|
|
|
|
+
|
|
|
|
+ {/* 删除弹层 */}
|
|
<PopupSheets
|
|
<PopupSheets
|
|
setShow={setShowPopup}
|
|
setShow={setShowPopup}
|
|
show={showPopup}
|
|
show={showPopup}
|
|
@@ -208,6 +220,9 @@ export default ({agent, isVisitor}: IProps) => {
|
|
]}
|
|
]}
|
|
>
|
|
>
|
|
</PopupSheets>
|
|
</PopupSheets>
|
|
|
|
+
|
|
|
|
+ {/* 登录弹窗 */}
|
|
|
|
+ <LoginPopup showPopup={showLogin} setShowPopup={setShowLogin}></LoginPopup>
|
|
</View>
|
|
</View>
|
|
);
|
|
);
|
|
};
|
|
};
|