Browse Source

fix: 知识库解析状态修复

王晓东 2 days ago
parent
commit
a374817e6e
45 changed files with 309 additions and 261 deletions
  1. 23 2
      project.private.config.json
  2. 5 12
      src/components/AgentCard/index.module.less
  3. 1 1
      src/components/AgentCard/index.tsx
  4. 0 0
      src/components/AgentPage/components/AgentActionBar/index.module.less
  5. 2 2
      src/components/AgentPage/components/AgentActionBar/index.tsx
  6. 4 4
      src/components/AgentPage/index.tsx
  7. 4 4
      src/components/ChatRecordItem/index.tsx
  8. 5 5
      src/components/DigitalCard/DigitalCardBasic.tsx
  9. 12 11
      src/components/NavBarNormal/index.tsx
  10. 7 0
      src/components/PageTitle/index.tsx
  11. 4 4
      src/components/chat-message/MessageRobot.tsx
  12. 1 1
      src/components/component-list/index.tsx
  13. 1 1
      src/components/custom-share/index.tsx
  14. 3 2
      src/components/page-custom/index.tsx
  15. 44 44
      src/components/page-wrapper/CustomBg.tsx
  16. 1 1
      src/components/search-bar/index.module.less
  17. 4 4
      src/components/wemeta-tabs/index.tsx
  18. 1 1
      src/components/widgets/widget-type-row/index.tsx
  19. 1 2
      src/config/index.ts
  20. 6 6
      src/pages/chat/components/keyboard.ts
  21. 12 0
      src/pages/chat/index.tsx
  22. 5 2
      src/pages/contact/components/contact-card/index.module.less
  23. 1 1
      src/pages/contact/components/contact-card/index.tsx
  24. 0 11
      src/pages/contact/index.module.less
  25. 9 6
      src/pages/contact/index.tsx
  26. 0 8
      src/pages/dashboard/components/AgentList/index.tsx
  27. 5 5
      src/pages/dashboard/components/VisitorCard/index.tsx
  28. 4 26
      src/pages/dashboard/components/VisitorList/index.tsx
  29. 11 8
      src/pages/dashboard/index.tsx
  30. 22 9
      src/pages/knowledge/components/CompanyTab/components/ScrollList.tsx
  31. 9 3
      src/pages/knowledge/components/CompanyTab/components/ScrollListChat.tsx
  32. 1 1
      src/pages/knowledge/components/CompanyTab/index.tsx
  33. 23 13
      src/pages/knowledge/components/CorrectionTab/components/CorrectionList.tsx
  34. 11 5
      src/pages/knowledge/components/CorrectionTab/components/CorrectionListChat.tsx
  35. 1 3
      src/pages/knowledge/components/CorrectionTab/index.tsx
  36. 3 1
      src/pages/knowledge/components/PersonalTab/components/ScrollList.tsx
  37. 3 1
      src/pages/knowledge/components/PersonalTab/components/ScrollListChat.tsx
  38. 5 4
      src/pages/knowledge/index.tsx
  39. 10 0
      src/pages/knowledge/knowledgeUtils.ts
  40. 1 1
      src/pages/profile/index.tsx
  41. 13 4
      src/pages/visiteor-detail/components/VisitorSummary/index.tsx
  42. 1 1
      src/pages/visiteor-detail/index.module.less
  43. 24 35
      src/pages/visiteor-detail/index.tsx
  44. 1 1
      src/types/knowledge.ts
  45. 5 5
      src/utils/loadMoreInfinite.ts

+ 23 - 2
project.private.config.json

@@ -8,12 +8,33 @@
   "condition": {
     "miniprogram": {
       "list": [
+        {
+          "name": "pages/knowledge/index",
+          "pathName": "pages/knowledge/index",
+          "query": "",
+          "scene": null,
+          "launchMode": "default"
+        },
+        {
+          "name": "pages/dashboard/index",
+          "pathName": "pages/dashboard/index",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "pages/visiteor-detail/index",
+          "pathName": "pages/visiteor-detail/index",
+          "query": "visitorId=1391",
+          "launchMode": "default",
+          "scene": null
+        },
         {
           "name": "pages/agent/index",
           "pathName": "pages/agent/index",
           "query": "agentId=p_2e73c9d7efaYfDo2-agent_991",
-          "scene": null,
-          "launchMode": "default"
+          "launchMode": "default",
+          "scene": null
         },
         {
           "name": "contactus",

+ 5 - 12
src/components/AgentCard/index.module.less

@@ -2,11 +2,12 @@
   display: flex;
   align-items: center;
   gap: 12px;
-  border-radius: 12px;
   align-self: stretch;;
-  background: white;
-  color: #262626;
   font-family: "PingFang SC";
+  display: flex;
+  align-items: flex-start;
+  gap: 8px;
+  color: #262626;
 }
 
 .avatar{
@@ -20,15 +21,7 @@
   flex-shrink: 0;
   border: 1px solid rgba(0, 0, 0, 0.04);
 }
-.contactCard{
-  display: flex;
-  padding: 16px;
-  align-items: flex-start;
-  gap: 8px;
-  // border-radius: 12px;
-  color: #262626;
-  font-family: "PingFang SC";
-}
+
 .avatarContainer{
   position: relative;
   width: 48px;

+ 1 - 1
src/components/AgentCard/index.tsx

@@ -12,7 +12,7 @@ interface Props {
 }
 const Index = ({onClick, data, className, renderRight}: Props)=> {
   return (
-    <View className={`${style.contactCard} ${className}`} onClick={()=>{onClick?.(data)}}>
+    <View className={`${style.contactCard} bg-white rounded-12 ${className}`} onClick={()=>{onClick?.(data)}}>
       <View className={style.avatar}>
         <AvatarMedia source={data.avatarUrl ?? ''} className='w-[55px] h-[55px]' mode="aspectFill" />
       </View>

+ 0 - 0
src/components/AgentPage/components/SummaryBar/index.module.less → src/components/AgentPage/components/AgentActionBar/index.module.less


+ 2 - 2
src/components/AgentPage/components/SummaryBar/index.tsx → src/components/AgentPage/components/AgentActionBar/index.tsx

@@ -71,7 +71,7 @@ export default ({agent, isVisitor}: IProps) => {
   }
 
   const renderValue = (value?: string | null)=> {
-    return value?.length ? value :  '--'
+    return value?.length ? value :  '-'
   }
 
   // 允许更多操作,非企业智能体且非访问者身份
@@ -93,7 +93,7 @@ export default ({agent, isVisitor}: IProps) => {
                 </View>
                 <View className="flex items-center gap-2">
                   <View className="text-12 leading-20 truncate max-w-[188px]">
-                    {agent?.entName ?? '--'}
+                    {agent?.entName ?? '暂未填写企业'}
                   </View>
                   {agent?.isEnt && <TagCertificated />}
                 </View>

+ 4 - 4
src/components/AgentPage/index.tsx

@@ -3,7 +3,7 @@ import NavBarNormal from "@/components/NavBarNormal";
 
 import { View } from "@tarojs/components";
 import Logo from "@/components/logo";
-import SummaryBar from "./components/SummaryBar";
+import AgentActionBar from "./components/AgentActionBar";
 import { useAgentStore } from "@/store/agentStore";
 import { useEffect, useState } from "react";
 import { useComponentStore } from "@/store/componentStore";
@@ -55,10 +55,10 @@ export default function Index({ agentId }: IProps) {
   
 
   return (
-    <PageCustom styleBg={bg} >
-      <NavBarNormal blur scrollFadeIn leftColumn={Logo}></NavBarNormal>
+    <PageCustom styleBg={bg}>
+      <NavBarNormal blur scrollFadeIn scrollFadeInDelta={240} leftColumn={Logo}></NavBarNormal>
       <View className="blur-rounded-container">
-        {(!!agent) ? <SummaryBar isVisitor={false} agent={agent}></SummaryBar> : <></>}
+        {(!!agent) ? <AgentActionBar isVisitor={false} agent={agent}></AgentActionBar> : <></>}
         <View className={`flex flex-col gap-12 w-full p-16`}>
           <ComponentList components={components}></ComponentList>
         </View>

+ 4 - 4
src/components/ChatRecordItem/index.tsx

@@ -69,8 +69,8 @@ export default ({ visitorId, sessionId, showMoreButton = false }:IProps) => {
       const links = payload?.links ?? [];
       const pics = payload?.pics ?? [];
       return (
-        <View>
-          <View>{item.content}</View>
+        <View className='break-words'>
+          <View className='break-words'>{item.content}</View>
           <View className="pb-12">
             {pics.map((pic: string) => {
               return (
@@ -82,13 +82,13 @@ export default ({ visitorId, sessionId, showMoreButton = false }:IProps) => {
           </View>
           <View className="pb-12">
             {links.map((link: string) => {
-              return <Text>{link}</Text>;
+              return <Text user-select>{link}</Text>;
             })}
           </View>
         </View>
       );
     }
-    return <View>{item.content}</View>
+    return <View className='break-words'>{item.content}</View>
   }
   
 

+ 5 - 5
src/components/DigitalCard/DigitalCardBasic.tsx

@@ -15,13 +15,13 @@ const DigitalCardBasic = ({
 }: DigitalCardBasicProps) => {
   return (
     <View className="flex items-start">
-      <View className="flex flex-col flex-1">
-        <View className="flex items-end gap-8">
-          <View className="text-16 font-medium leading-32">{name}</View>
-          <View className="text-12 leading-20">{position || ''}</View>
+      <View className="flex flex-col flex-1 truncate">
+        <View className="flex items-end gap-8 truncate">
+          <View className="text-16 max-w-120 font-medium leading-32 truncate">{name}</View>
+          <View className="text-12 leading-20 truncate">{position || ''}</View>
         </View>
         <View className="flex items-center gap-2">
-          <View className="text-12 leading-20 truncate max-w-[188px]">
+          <View className="text-12 leading-20 text-gray-45">
             {entName || ''} {certificated && <IconCertificateColor />}
           </View>
         </View>

+ 12 - 11
src/components/NavBarNormal/index.tsx

@@ -15,6 +15,7 @@ interface Props {
   backButtonRound?: boolean;
   navDelta?: number;
   scrollFadeIn?: boolean; // 上下滚动背景渐变
+  scrollFadeInDelta?: number // 开始背景渐变效果的阈值
 }
 
 const Index: React.FC<Props> = ({
@@ -26,6 +27,7 @@ const Index: React.FC<Props> = ({
   navDelta = 1,
   backText,
   scrollFadeIn = false,
+  scrollFadeInDelta = 0,
 }) => {
   const statusBarHeight = useAppStore.getState().statusBarHeight;
   //
@@ -34,7 +36,14 @@ const Index: React.FC<Props> = ({
     if (!scrollFadeIn) {
       return;
     }
-    const opacity = Math.max(0, e.scrollTop / 50);
+
+    // 如果 scrollTop 小于可变化阈值,则不产生变化
+    if(e.scrollTop < scrollFadeInDelta){
+      setOpacity(0)
+      return;
+    }
+    // 变化时 e.scrollTop  / (阈值 + 88 )
+    const opacity = Math.max(0, e.scrollTop / (scrollFadeInDelta + 88));
     setOpacity(opacity);
     // 如果 setShow 此处打开,滚动页内如果有图片会导致转自跳动 bug
     // setShow(opacity !== 0)
@@ -48,17 +57,10 @@ const Index: React.FC<Props> = ({
       console.log("nav");
       await onNavBack();
       Taro.navigateBack({
-        delta: navDelta,
-        complete: () => {
-          
-        },
+        delta: navDelta
       });
     } else {
-      Taro.navigateBack({
-        complete: () => {
-          
-        },
-      });
+      Taro.navigateBack();
     }
   };
 
@@ -70,7 +72,6 @@ const Index: React.FC<Props> = ({
     return (
       <View className={`${style.navBarBackButtonNormal}`}>
         <IconArrowLeft />
-        {/* <View className={`${style.iconArrowLeftPure}`}></View> */}
         <Text className={style.backText}>{backText}</Text>
       </View>
     );

+ 7 - 0
src/components/PageTitle/index.tsx

@@ -0,0 +1,7 @@
+
+import {Text } from "@tarojs/components";
+
+export default function Index({children}) {
+
+  return <Text className="text-22 font-medium font-pingfangSCMedium text-[#111A34] leading-32">{children}</Text>
+}

+ 4 - 4
src/components/chat-message/MessageRobot.tsx

@@ -104,13 +104,13 @@ export default ({ agent, text, message, showUser=false, textReasoning = "" }: Pr
   // 渲染消息主体
   const renderMessageBody = () => {
     const body = message.body;
-    console.log(body?.contentType, body)
+    // console.log(body?.contentType, body)
     // 渲染 QA 回答
     if (body?.contentType === EContentType.AiseekQA) {
       const payload = body?.content?.answer?.payload ?? {};
       const links = payload.links ?? [];
       const pics = payload.pics ?? [];
-      console.log(body)
+      // console.log(body)
       return (
         <View>
           <View className="pb-12">
@@ -126,7 +126,7 @@ export default ({ agent, text, message, showUser=false, textReasoning = "" }: Pr
             {links.map((link: string) => {
               return (
                 <View onClick={(e) => handleCopy(e, link)}>
-                  <Text className="text-primary">复制链接</Text> <Text>{link}</Text>
+                  <Text className="text-primary">复制链接</Text> <Text user-select>{link}</Text>
                 </View>
               );
             })}
@@ -158,7 +158,7 @@ export default ({ agent, text, message, showUser=false, textReasoning = "" }: Pr
           </View>} */}
 
           {text.length === 0 && <ThinkAnimation></ThinkAnimation>}
-          <Text>{text}</Text>
+          <Text user-select>{text}</Text>
           {renderMessageBody()}
         </View>
         <View className="flex gap-12">

+ 1 - 1
src/components/component-list/index.tsx

@@ -52,7 +52,7 @@ export default ({ components, editMode = false }: Props) => {
   
 
   const showMediaLink = (mediaItem: TSocialMediaItem, link: string, c: TEntityComponent) => {
-    console.log(c,  SocialMediaType.shiping.value)
+    console.log(c,  SocialMediaType.shiping.value, link)
     // 微信公众号直接跳转
     if(c?.type === SocialMediaType.wechat.value){
       // 跳转的公众号需与小程序为同主体或关联主体

+ 1 - 1
src/components/custom-share/index.tsx

@@ -22,7 +22,7 @@ const getCanvasSize = () => {
   // 根据屏幕宽度计算 canvas 宽度
   const windowInfo = Taro.getWindowInfo();
   const screenWidth = windowInfo.windowWidth;
-  console.log(windowInfo, 'WindowInfo');
+  // console.log(windowInfo, 'WindowInfo');
   const designWidth = 375;
   const designHeight = 300;
   // 宽高放大一倍

+ 3 - 2
src/components/page-custom/index.tsx

@@ -11,15 +11,16 @@ interface Props {
   styleBg?: string|null;
   paddingTop?: number;
   fullPage?: boolean;
+  isTabPage?: boolean; // tab 页需要单独去掉 bottomSafeHeight
   onClick?: (e:any)=> void
 }
 
-const Index: React.FC<Props> = ({ children, isflex = true, fullPage = false,  paddingTop, style, styleBg, onClick }) => {
+const Index: React.FC<Props> = ({ children, isTabPage = false, isflex = true, fullPage = false,  paddingTop, style, styleBg, onClick }) => {
   const headerHeight = useAppStore((state) => state.headerHeight);
   const bottomSafeHeight = useAppStore((state) => state.bottomSafeHeight);
   const flexStyle = isflex ? "flex flex-col items-center" : "";
   const offsetTop = paddingTop ?? headerHeight;
-  const pageHeight = fullPage ? `calc(100vh - ${bottomSafeHeight}px)` : 'auto'
+  const pageHeight = fullPage ? `calc(100vh - ${ isTabPage ? 0 : bottomSafeHeight}px)` : 'auto'
   
   return (
     <PageWrapper style={style} styleBg={styleBg} onClick={onClick}>

+ 44 - 44
src/components/page-wrapper/CustomBg.tsx

@@ -5,70 +5,70 @@ import { View, Video } from "@tarojs/components";
 import React, { useEffect, useState } from "react";
 import pageStyle from "./index.module.less";
 import Taro from "@tarojs/taro";
-import { useAppStore } from "@/store/appStore";
+// import { useAppStore } from "@/store/appStore";
 interface Props {
   styleBg?: string|null;
 }
 
 const Index: React.FC<Props> = ({styleBg}) => {
   // 自定义背景样式
-  const {windowHeight, windowWidth} = useAppStore()
+  // const {windowHeight, windowWidth} = useAppStore()
 
-  const [offsetMargin, setOffsetMargin] = useState({ x: 0, y: 0 });
-  const [bgSize, setBgSize] = useState({ width: windowWidth, height: windowHeight });
+  // const [offsetMargin, setOffsetMargin] = useState({ x: 0, y: 0 });
+  // const [bgSize, setBgSize] = useState({ width: windowWidth, height: windowHeight });
 
   const  bg =  styleBg || ''  
   
   const bgImageStyle = {
     backgroundImage: `url(${bg})`,
-    marginLeft: `${offsetMargin.x}px`,
-    marginTop: `${offsetMargin.y}px`,
-    height: `${bgSize.height}px`,
-    width: `${bgSize.width}px`,
-    backgroundSize: '100% 100%',
+    // marginLeft: `${offsetMargin.x}px`,
+    // marginTop: `${offsetMargin.y}px`,
+    // height: `${bgSize.height}px`,
+    // width: `${bgSize.width}px`,
+    backgroundSize: 'auto 100%',
     backgroundPosition: 'center center'
   };
 
   const isMp4 = bg?.lastIndexOf('.mp4') > -1
 
-  useEffect(()=> {
-    if(!bg) {
-      return;
-    }
-    if(isMp4){
-      return 
-    }
-    Taro.getImageInfo({
-      src: bg,
-      success(res) {
-        const imgWidth = res.width;
-        const imgHeight = res.height;
+  // useEffect(()=> {
+  //   if(!bg) {
+  //     return;
+  //   }
+  //   if(isMp4){
+  //     return 
+  //   }
+  //   Taro.getImageInfo({
+  //     src: bg,
+  //     success(res) {
+  //       const imgWidth = res.width;
+  //       const imgHeight = res.height;
 
-        let ratio = windowHeight / imgHeight;
-        let scaledWidth = imgWidth * ratio;
-        let scaledHeight = windowHeight;
-        let offsetX = 0;
-        let offsetY = 0;
+  //       let ratio = windowHeight / imgHeight;
+  //       let scaledWidth = imgWidth * ratio;
+  //       let scaledHeight = windowHeight;
+  //       let offsetX = 0;
+  //       let offsetY = 0;
 
-        if (scaledWidth >= windowWidth) {
-          offsetX = (scaledWidth - windowWidth) / 2;
-          offsetY = 0;
-        } else {
-          ratio = windowWidth / imgWidth;
-          scaledWidth = windowWidth;
-          scaledHeight = imgHeight * ratio;
-          offsetX = 0;
-          offsetY = (scaledHeight - windowHeight) / 2;
-        }
+  //       if (scaledWidth >= windowWidth) {
+  //         offsetX = (scaledWidth - windowWidth) / 2;
+  //         offsetY = 0;
+  //       } else {
+  //         ratio = windowWidth / imgWidth;
+  //         scaledWidth = windowWidth;
+  //         scaledHeight = imgHeight * ratio;
+  //         offsetX = 0;
+  //         offsetY = (scaledHeight - windowHeight) / 2;
+  //       }
 
-        setOffsetMargin({ x: -offsetX, y: -offsetY });
-        setBgSize({ width: scaledWidth, height: scaledHeight });
-      },
-      fail(err) {
-        console.error('获取图片信息失败', err)
-      }
-    })
-  }, [styleBg])
+  //       setOffsetMargin({ x: -offsetX, y: -offsetY });
+  //       setBgSize({ width: scaledWidth, height: scaledHeight });
+  //     },
+  //     fail(err) {
+  //       console.error('获取图片信息失败', err)
+  //     }
+  //   })
+  // }, [styleBg])
 
   if(!bg) {
     return <></>

+ 1 - 1
src/components/search-bar/index.module.less

@@ -15,7 +15,7 @@
   height: 16px;
 }
 .searchBarInput{
-  font-family: PingFang SC;
+  font-family: PingFangSC-Regular;
   font-size: 14px;
   font-weight: 400;
   line-height: 20px;

+ 4 - 4
src/components/wemeta-tabs/index.tsx

@@ -26,12 +26,12 @@ export default function Index({
 
   const renderTabContent = () => {
     return (
-      <View className="h-full">
+      <View className="h-full flex flex-col overflow-hidden">
         {list.map((item) => {
           return (
             <View
               className={
-                `${item.key === tabIndex ? style.visible : style.invisible} h-full helloworld`
+                `${item.key === tabIndex ? style.visible : style.invisible} h-full`
               }
             >
               {item.children}
@@ -44,7 +44,7 @@ export default function Index({
 
   if (tabStyle === "outline") {
     return (
-      <View className="h-full">
+      <View className="h-full flex flex-col  overflow-hidden">
         <View className={`${style.outlineTabButtons} ${className}`}>
           {list.map((item) => {
             return (
@@ -66,7 +66,7 @@ export default function Index({
   }
 
   return (
-    <View className="w-full h-full">
+    <View className="w-full h-full flex flex-col  overflow-hidden">
       <View className={`flex items-center gap-8 ${className}`}>
         {list.map((item) => {
           return (

+ 1 - 1
src/components/widgets/widget-type-row/index.tsx

@@ -37,7 +37,7 @@ const Index: React.FC<Props> = ({
   const handleCopy = (e: any) => {
     if (mediaItem) {
       e.stopPropagation();
-      setShow && setShow(mediaItem, data?.link)
+      setShow && setShow(mediaItem, data?.link ?? data?.value)
       return;
     }
     onClick && onClick(e);

+ 1 - 2
src/config/index.ts

@@ -47,8 +47,7 @@ const IS_MINI_GREEN_LEAF = APP_NAME === 'miniGreenLeaf'
 const ENABLE_UPGRADE_VIP = IS_MINI_GREEN_LEAF
 
 const DEFAULT_AVATAR = defaultAvatar
-// const DEFAULT_AVATAR_BG = 'https://51saas.oss-cn-hangzhou.aliyuncs.com/u260727532/20250731/YYq5ngJESF_d5cdfe5753ff4f86bac2d38dc82df8fa.png'
-const DEFAULT_AVATAR_BG = 'https://51saas.oss-cn-hangzhou.aliyuncs.com/u260727532/20250731/Eej79YOizH_16c3bae6b107493e87fc34717265ef78.png'
+const DEFAULT_AVATAR_BG = 'https://51saas.oss-cn-hangzhou.aliyuncs.com/u260727532/20250801/79GUqImi7Z_5d0c780219ca44d9a673213424366ab1.png'
 const DEFAULT_AGENT = {
     avatar: DEFAULT_AVATAR,
     name: "小蓝本助手",

+ 6 - 6
src/pages/chat/components/keyboard.ts

@@ -24,9 +24,9 @@ export const useKeyboard = (scrollViewRef: React.MutableRefObject<any>, contentI
     return 0
   })();
 
-  useEffect(()=> {
-    console.log('Keyboard state:', keyboardHeight, contentHeight, scrollViewHeight, marginTopOffset)
-  }, [keyboardHeight, contentHeight, scrollViewHeight, marginTopOffset])
+  // useEffect(()=> {
+  //   console.log('Keyboard state:', keyboardHeight, contentHeight, scrollViewHeight, marginTopOffset)
+  // }, [keyboardHeight, contentHeight, scrollViewHeight, marginTopOffset])
 
   useEffect(() => {
     // 监听键盘高度变化
@@ -34,7 +34,7 @@ export const useKeyboard = (scrollViewRef: React.MutableRefObject<any>, contentI
       if (res.height <= 0) {
         return setKeyboardHeight(0);
       }
-      console.log(res.height, bottomSafeHeight, 111111)
+      
       setKeyboardHeight(res.height - bottomSafeHeight + 16);
     });
 
@@ -56,7 +56,7 @@ export const useKeyboard = (scrollViewRef: React.MutableRefObject<any>, contentI
         .select(contentId)
         .boundingClientRect((rect: any) => {
           if (rect) {
-            console.log('Content height:', rect.height)
+            // console.log('Content height:', rect.height)
             setContentHeight(rect.height);
           }
         })
@@ -66,7 +66,7 @@ export const useKeyboard = (scrollViewRef: React.MutableRefObject<any>, contentI
         .select(scrollViewId)
         .boundingClientRect((rect: any) => {
           if (rect) {
-            console.log('ScrollView height:', rect.height)
+            // console.log('ScrollView height:', rect.height)
             setScrollViewHeight(rect.height);
             if(contentHeight <= 0){
               setContentHeight(rect.height);

+ 12 - 0
src/pages/chat/index.tsx

@@ -169,6 +169,18 @@ const agent = useAgentStore((state) => {
     return agent?.avatarUrl
   }
 
+  useEffect(()=> {
+    Taro.setNavigationBarColor({
+      frontColor: '#ffffff',
+      backgroundColor: 'transparent'
+    })
+    return ()=> {
+      Taro.setNavigationBarColor({
+        frontColor: '#000000',
+        backgroundColor: 'transparent'
+      })
+    }
+  })
   
 
 

+ 5 - 2
src/pages/contact/components/contact-card/index.module.less

@@ -33,10 +33,11 @@
   font-style: normal;
 }
 .nickName{
-  font-size: 14px;
+  font-family: PingFangSC-Medium;
+  font-size: 16px;
   font-style: normal;
   font-weight: 500;
-  line-height: 20px;
+  line-height: 24px;
 }
 .tipCnt{
   position: absolute;
@@ -63,11 +64,13 @@
 .subInfo{
   color: #414A64;
   font-size: 12px;
+  font-family: PingFangSC-Regular;
   font-style: normal;
   font-weight: 400;
   line-height: 16px;
 }
 .lastMsg {
   .subInfo();
+  font-family: PingFangSC-Regular;
   color: #A1A7BA;
 }

+ 1 - 1
src/pages/contact/components/contact-card/index.tsx

@@ -45,13 +45,13 @@ const Index = ({data, deleteable, className, refresh, fromContact}: Props)=> {
       <View className={`${style.infoColumn} truncate`}>
         <View className={`${style.nameRow} truncate`}>
           <View className={`${style.nickName} truncate`}>{data.name}</View>
-          {data.isEnt && <View className={style.certificationContainer}><IconCertificateColor></IconCertificateColor></View>}
         </View>
         <View className='flex flex-col w-full gap-8 truncate'>
           <View className={`flex items-center flex-1 ${style.subInfo} truncate`}>
             <View className='max-w-156 truncate'>{!!data.entName?.length ? data.entName : '暂无企业名称'}</View>
             <View className='px-4'>|</View>
             <View className='truncate'>{!!data.position?.length ? data.position : '暂无职位名称'}</View>
+            {data.isEnt && <View className={style.certificationContainer}><IconCertificateColor></IconCertificateColor></View>}
           </View>
           <View className={`flex-1 ${style.lastMsg} truncate`}>{data.lastChatMsg}</View>
         </View>

+ 0 - 11
src/pages/contact/index.module.less

@@ -1,11 +0,0 @@
-.page{
-  padding: 28px;
-}
-.contactContent{
-  display: flex;
-  flex-direction: column;
-  width: 100%;
-  padding: 0 16px;
-  gap: 8px;
-  overflow: hidden;
-}

+ 9 - 6
src/pages/contact/index.tsx

@@ -3,7 +3,6 @@ import { View, Text, ScrollView } from "@tarojs/components";
 import EmptyData from "@/components/EmptyData";
 import NavBarNormal from "@/components/NavBarNormal/index";
 import SearchBar from "@/components/search-bar/index";
-import style from "./index.module.less";
 import { useEffect, useState } from "react";
 import ContactCard from "./components/contact-card/index";
 import { getContactList, setContactToTop } from "@/service/contact";
@@ -15,6 +14,7 @@ import { delContact } from "@/service/contact";
 import CheckLoginPopup from "@/components/CheckLoginPopup";
 import BlurContainer from "@/components/BlurContainer";
 import SliderAction from "@/components/SliderAction";
+import PageTitle from '@/components/PageTitle'
 
 export default function Index() {
   const [searchValue, setSearchValue] = useState("");
@@ -155,12 +155,12 @@ export default function Index() {
   };
 
   return (
-    <PageCustom fullPage>
+    <PageCustom fullPage isTabPage isflex>
       <NavBarNormal
         scrollFadeIn
-        leftColumn={() => <Text className="text-16 font-medium">联系人</Text>}
+        leftColumn={() => <PageTitle>联系人</PageTitle>}
       ></NavBarNormal>
-      <View className="flex flex-col w-full">
+      <View className="w-full h-full flex flex-col overflow-hidden">
         <View className="px-16 pb-14">
           {showSearchBar && (
             <SearchBar
@@ -170,10 +170,11 @@ export default function Index() {
             ></SearchBar>
           )}
         </View>
-        <BlurContainer>
+        <BlurContainer className="flex flex-col overflow-hidden">
           <View className="px-16 text-gray-45 text-12 leading-20 mb-20 pt-16">
             共 {totalCount} 个联系人
           </View>
+          <View className="flex-1 h-full overflow-hidden">
           <ScrollView
             scrollY
             onScrollToUpper={onScrollToUpper}
@@ -182,8 +183,10 @@ export default function Index() {
               height: "100%", // 高度自适应
             }}
           >
-            <View className={`${style.contactContent}`}>{renderContent()}</View>
+            <View className="flex flex-col px-16 gap-8 pb-16">{renderContent()}</View>
           </ScrollView>
+          </View>
+          
         </BlurContainer>
       </View>
       <CheckLoginPopup onEnd={onLoginEnd}></CheckLoginPopup>

+ 0 - 8
src/pages/dashboard/components/AgentList/index.tsx

@@ -5,9 +5,7 @@ import Popup from "@/components/popup/popup";
 import { useEffect, useState } from "react";
 import { useAgentStore } from "@/store/agentStore";
 import WemetaRadio from "@/components/WemetaRadio/index";
-import IconCertificateColor from "@/components/icon/icon-certificate-color";
 import { TAgent } from "@/types/agent";
-import { AvatarMedia } from "@/components/AvatarMedia";
 import AgentCard from "@/components/AgentCard/index";
 
 interface IProps {
@@ -20,12 +18,6 @@ interface IProps {
 export default ({currentAgent,  setCurrentAgent, show, setShow }: IProps) => {
   const { agents, fetchAgents } = useAgentStore();
 
-  // 是否显示选择器
-  
-
-
-  useEffect(() => {}, []);
-
   const fetchInitData = async () => {
     await fetchAgents();
   };

+ 5 - 5
src/pages/dashboard/components/VisitorCard/index.tsx

@@ -18,8 +18,8 @@ const Index = ({ data }: IndexProps) => {
     <View className="bg-white rounded-12 p-12" onClick={handleClick}>
       <View className="flex items-start gap-12">
         <View className="flex items-star rounded-full overflow-hidden">
-          <View className="w-56 h-56 bg-gray-3 rounded-full">
-            <AvatarMedia source={data.avatarUrl || ''} mode="aspectFill" className="w-56 h-56 bg-gray-3 rounded-full"></AvatarMedia>
+          <View className="w-48 h-48 bg-gray-3 rounded-full shrink-0">
+            <AvatarMedia source={data.avatarUrl || ''} mode="aspectFill" className="w-48 h-48 bg-gray-3 rounded-full"></AvatarMedia>
           </View>
         </View>
         <View className="flex flex-col gap-8 flex-1">
@@ -29,13 +29,13 @@ const Index = ({ data }: IndexProps) => {
             entName={data.entName}
             certificated={data.isEnt}
           />
-          <View className="text-14 font-medium leading-22">
-            第 <Text className="text-yellow">{data.visitTimes}</Text>{" "}
+          <View className="text-14 leading-24">
+            第<Text className="text-primary text-16 font-medium px-6">{data.visitTimes}</Text>
             次访问了你的智能体【{data.myAgentName}】
           </View>
           <View className="flex-center text-12 leading-20">
             <View className="flex-1">
-              <Text className="text-primary">{data.chatRound}</Text> 轮对话
+              <Text className="text-primary font-medium leading-20">{data.chatRound}</Text> 轮对话
             </View>
             <View className="text-gray-45 leading-20">{data.lastChatTime}</View>
           </View>

+ 4 - 26
src/pages/dashboard/components/VisitorList/index.tsx

@@ -6,6 +6,7 @@ import { TVisitorAgent } from "@/types/visitor";
 import { getVisitorList } from "@/service/visitor";
 import { useLoadMoreInfinite, createKey } from "@/utils/loadMoreInfinite";
 import { useEffect } from "react";
+import EmptyData from "@/components/EmptyData";
 interface IProps {
   agentId?: string;
   list: TVisitorAgent[]
@@ -13,35 +14,12 @@ interface IProps {
 
 export default ({ agentId, list }: IProps) => {
 
-  
-
-  // useEffect(() => {
-  //   const handler = () => {
-  //     console.log('loadmore', )
-  //     loadMore();
-  //   }
-    
-  //   eventBus.on(BUS_EVENTS.REACH_BOTTOM, handler)
-    
-  //   return () => {
-  //     eventBus.off(BUS_EVENTS.REACH_BOTTOM, handler)
-  //   }
-  // }, [])
-
-  // useDidShow(()=> {
-  //   mutate(undefined, {revalidate: true})
-  // })
-
-  
-
-  if (!list.length) {
-    <View></View>;
-  }
 
   return (
-    <View>
-      <View className="mb-8 text-14 leading-22 font-medium">访问详情</View>
+    <View className="p-16">
+      <View className="mb-16 text-14 leading-22 font-medium font-pingfangSCMedium">访问详情</View>
       <View className="flex flex-col gap-8">
+        {!list.length && <View className="pb-44"><EmptyData type='search'></EmptyData></View>}
         {list.map((item) => {
           return (
             <VisitorCard

+ 11 - 8
src/pages/dashboard/index.tsx

@@ -1,6 +1,7 @@
 import { View, Text, } from "@tarojs/components";
 import Taro, { useDidShow, useReachBottom } from "@tarojs/taro";
 import NavBarNormal from "@/components/NavBarNormal/index";
+import PageTitle from '@/components/PageTitle'
 import PageCustom from "@/components/page-custom/index";
 import IconArrowDownRounded from '@/components/icon/IconArrowDownRounded';
 import DataCard from './components/DataCard'
@@ -16,6 +17,8 @@ import { TVisitorAgent } from "@/types/visitor";
 import { getVisitorList } from "@/service/visitor";
 import { useLoadMoreInfinite, createKey } from "@/utils/loadMoreInfinite";
 import CheckLoginPopup from '@/components/CheckLoginPopup'
+import BlurContainer from '@/components/BlurContainer'
+
 export default () => {
   
   const {agents, fetchAgents} = useAgentStore()
@@ -84,16 +87,16 @@ export default () => {
 
   return (
     <PageCustom>
-      <NavBarNormal scrollFadeIn leftColumn={()=> <Text className="font-medium text-dark leading-22 text-16">数据分析</Text>}>
+      <NavBarNormal scrollFadeIn leftColumn={()=> <PageTitle>数据分析</PageTitle>}>
       </NavBarNormal>
-      <View className="w-full pt-8 px-16 pb-40">
+      <View className="w-full pt-8 px-16 pb-16">
         <View className="flex items-center gap-8 mb-16">
           <View className="bg-white rounded-12 py-12 px-16" onClick={()=> setCurrentAgent(null)}>
             <View className={`${currentAgent?.agentId ? 'text-black' : 'text-gray-45' }`}>全部</View>
           </View>
-          <View className="flex flex-1 items-center gap-2 bg-white rounded-12 p-12" onClick={()=> setShow(true)}>
-              <View className="flex-1 text-14 leading-22">
-                {currentAgent ? <View className="text-black">{currentAgent?.name}</View> : <View className="text-gray-45">请选择智能体</View> }
+          <View className="flex flex-1 items-center gap-2 bg-white rounded-12 p-12 truncate" onClick={()=> setShow(true)}>
+              <View className="flex-1 text-14 leading-22 truncate">
+                {currentAgent ? <View className="text-black truncate">{currentAgent?.name}</View> : <View className="text-gray-45">请选择智能体</View> }
               </View>
               
               <View className="flex-center">
@@ -119,14 +122,14 @@ export default () => {
             
           }} text="待处理差评" unitText="条" value={unprocessedDislikeCnt} arrow />
         </View>
-
-        <VisitorList list={list} agentId={currentAgent?.agentId}></VisitorList>
         
         <AgentList show={show} setShow={setShow} currentAgent={currentAgent} setCurrentAgent={setCurrentAgent}></AgentList>
 
         <CheckLoginPopup onEnd={onLoginEnd}></CheckLoginPopup>
       </View>
-      
+      <BlurContainer>
+        <VisitorList list={list} agentId={currentAgent?.agentId}></VisitorList>
+      </BlurContainer>
     </PageCustom>
   );
 };

+ 22 - 9
src/pages/knowledge/components/CompanyTab/components/ScrollList.tsx

@@ -13,6 +13,11 @@ import IconCorrect from '@/images/svgs/knowledge/IconCorrect.svg'
 import KnowledgeIcon from "@/components/KnowledgeIcon";
 import { getEntKnowledgeList } from "@/service/knowledge";
 import type { TKnowledgeItem } from "@/types/knowledge";
+import {
+  isParsedFail,
+  isParsedSuccess,
+  isParsing
+} from '../../../knowledgeUtils'
 
 import { useLoadMoreInfinite, createKey } from "@/utils/loadMoreInfinite";
 export interface Iprops {
@@ -42,8 +47,11 @@ const Index = ({ entId, setTotalCount }: Iprops) => {
     }
   }, [data, pageIndex]);
 
+  
+
+
   const handleEdit = (item: TKnowledgeItem) => {
-    if (item.parseStatus !== "parsed") {
+    if (item.parseStatus === "parse_fail") {
       return;
     }
     Taro.navigateTo({
@@ -51,7 +59,7 @@ const Index = ({ entId, setTotalCount }: Iprops) => {
     });
   };
   const rightRenderer = (item: TKnowledgeItem) => {
-    if (item.isParsing) {
+    if (isParsing(item)) {
       return (
         <View className="flex items-center gap-4 self-center">
           <RotateLoading />
@@ -59,21 +67,25 @@ const Index = ({ entId, setTotalCount }: Iprops) => {
         </View>
       );
     }
-    if(item.parseStatus === 'parsed'){
+    if(isParsedSuccess(item)){
       return (
         <View className="flex items-center self-center">
           <Image src={IconCorrect} className="w-20 h-20"  />
         </View>
       );
     }
-    return (
-      <View className="flex items-center self-center">
-        <Image src={IconError} className="w-20 h-20"  />
-      </View>
-    );
+    if(isParsedFail(item)){
+      return (
+        <View className="flex items-center self-center">
+          <Image src={IconError} className="w-20 h-20"  />
+        </View>
+      );
+    }
+    return <></>
   };
 
   return (
+    <View className="flex-1 h-full overflow-hidden">
     <ScrollView
       scrollY
       onScrollToLower={onScrollToLower}
@@ -89,7 +101,7 @@ const Index = ({ entId, setTotalCount }: Iprops) => {
       ) : (
         <></>
       )}
-      <FigureList className="mx-16 pb-[240px]">
+      <FigureList className="mx-16 pb-32">
         {list.map((item) => {
           return (
             <FigureListItem
@@ -109,6 +121,7 @@ const Index = ({ entId, setTotalCount }: Iprops) => {
         })}
       </FigureList>
     </ScrollView>
+    </View>
   );
 };
 

+ 9 - 3
src/pages/knowledge/components/CompanyTab/components/ScrollListChat.tsx

@@ -11,7 +11,11 @@ import Taro, { useDidShow } from "@tarojs/taro";
 
 import { useUserStore } from "@/store/userStore";
 import KnowledgeIcon from "@/components/KnowledgeIcon";
-
+import {
+  isParsedFail,
+  isParsedSuccess,
+  isParsing
+} from '../../../knowledgeUtils'
 import {
   getEntKnowledgeStream,
 } from "@/service/knowledge";
@@ -72,6 +76,7 @@ const Index = ({ entId, assistantOnly, setTotalCount }: Iprops) => {
   
 
   return (
+    <View className="flex-1 h-full overflow-hidden">
     <ScrollView
       scrollY
       onScrollToUpper={onScrollToUpper}
@@ -81,7 +86,7 @@ const Index = ({ entId, assistantOnly, setTotalCount }: Iprops) => {
         height: "100%", // 高度自适应
       }}
     >
-      <View className="flex flex-col gap-20 pb-[240px] mx-16">
+      <View className="flex flex-col gap-20 pb-32 mx-16">
         {reversedList.length<=0 ? <View className="pt-46"><EmptyData type={'plane'}/></View> : <></>}
         {reversedList.map((group) => {
           // 渲染自己发送的消息
@@ -122,7 +127,7 @@ const Index = ({ entId, assistantOnly, setTotalCount }: Iprops) => {
                         return <KnowledgeIcon data={item} />;
                       }}
                       underline={index + 1 < group.knowledgeList.length}
-                      arrow={item.parseStatus === "parsed"}
+                      arrow={isParsedSuccess(item)}
                       onClick={() =>
                         Taro.navigateTo({
                           url: `/pages/knowledge-item/index?knowledgeId=${item.knowledgeId}&entId=${entId}`,
@@ -144,6 +149,7 @@ const Index = ({ entId, assistantOnly, setTotalCount }: Iprops) => {
         })}
       </View>
     </ScrollView>
+    </View>
   );
 };
 

+ 1 - 1
src/pages/knowledge/components/CompanyTab/index.tsx

@@ -29,7 +29,7 @@ const Index = () => {
   };
 
   return (
-    <View className="h-full">
+    <View className="h-full flex flex-col">
       <View className="pt-20 pb-20">
         <View className="px-16">
           <CompanyList setCurrentEnt={setEnt} currentEnt={ent}></CompanyList>

+ 23 - 13
src/pages/knowledge/components/CorrectionTab/components/CorrectionList.tsx

@@ -9,7 +9,7 @@ import { useLoadMoreInfinite, createKey } from "@/utils/loadMoreInfinite";
 import { deleteCorrection } from '@/service/correction'
 import { useModalStore } from "@/store/modalStore";
 import { isSuccess } from "@/utils";
-import SliderDeleteAction from "@/components/SliderAction";
+import SliderAction from "@/components/SliderAction";
 
 export interface Iprops {
   entId?: number|string
@@ -34,9 +34,12 @@ const Index = ({entId, setTotalCount}:Iprops) => {
     loadMore()
   }
 
-  useDidShow(()=> {
-    mutate(undefined, { revalidate: true });
-  })
+  // useDidShow(()=> {
+  //   mutate(undefined, { revalidate: true });
+  // })
+  useEffect(()=> {
+    mutate();
+  }, [])
 
   useEffect(() => {
     if(data &&  pageIndex === 1) {
@@ -67,14 +70,20 @@ const Index = ({entId, setTotalCount}:Iprops) => {
     });
   };
 
-  const handleAction = (e:any)=> {
-    const detail = e.detail as { type: string; id: string };
-    if (detail.type === "delete") {
-      handleDeleteItem(detail.id);
-    } 
-  }
+  const createSliderButtons = (item: TCorrectionItem) => {
+    return [
+      {
+        text: "删除",
+        color: "#FF8200",
+        onClick: () => {
+          handleDeleteItem(item.id);
+        },
+      },
+    ];
+  };
   
   return (
+    <View className="flex-1 h-full overflow-hidden">
     <ScrollView
       scrollY
       onScrollToUpper={onScrollToUpper}
@@ -83,19 +92,20 @@ const Index = ({entId, setTotalCount}:Iprops) => {
         height: "100%", // 高度自适应
       }}
     >
-      <View className="flex flex-col gap-8 mx-16 pb-[240px]">
+      <View className="flex flex-col gap-8 mx-16 pb-32">
         {list.map((item) => {
           return (
             <View className="rounded-12 overflow-hidden">
-              <slide-delete pid={item.id} onAction={handleAction}>
+              <SliderAction actions={createSliderButtons(item)}>
                 <View className="bg-white p-16" onClick={() => handleEdit(item.id)}>
                   <View className="text-14 leading-28 font-medium">{item.questions[0]}</View>
                 </View>
-              </slide-delete>
+              </SliderAction>
             </View>)
         })}
       </View>
     </ScrollView>
+    </View>
   );
 };
 

+ 11 - 5
src/pages/knowledge/components/CorrectionTab/components/CorrectionListChat.tsx

@@ -19,7 +19,7 @@ export interface Iprops {
   entId?: number|string
   setTotalCount: (count: number) => void;
 }
-const Index = ({entId, setTotalCount}:Iprops) => {
+const Index = ({entId, setTotalCount}: Iprops) => {
   
   const { showModal } = useModalStore();
 
@@ -40,9 +40,13 @@ const Index = ({entId, setTotalCount}:Iprops) => {
   
 
 
-  useDidShow(()=> {
-    mutate(undefined, { revalidate: true });
-  })
+  // useDidShow(()=> {
+  //   mutate();
+  // })
+
+  useEffect(()=> {
+    mutate();
+  }, [])
 
   useEffect(() => {
     if(data &&  pageIndex === 1) {
@@ -82,6 +86,7 @@ const Index = ({entId, setTotalCount}:Iprops) => {
     ]
   }
   return (
+    <View className="flex-1 h-full overflow-hidden">
     <ScrollView
       scrollY
       onScrollToUpper={onScrollToUpper}
@@ -90,7 +95,7 @@ const Index = ({entId, setTotalCount}:Iprops) => {
         height: "100%", // 高度自适应
       }}
     >
-      <View className="mx-16 pb-[240px]">
+      <View className="mx-16 pb-32">
       {list.map((item) => {
         return (
           <View className="flex flex-col gap-16 mb-16">
@@ -147,6 +152,7 @@ const Index = ({entId, setTotalCount}:Iprops) => {
       })}
     </View>
     </ScrollView>
+    </View>
   );
 };
 

+ 1 - 3
src/pages/knowledge/components/CorrectionTab/index.tsx

@@ -12,8 +12,6 @@ import { TEntItem } from "@/types/user";
 import CompanyList from "../CompanyList";
 
 const Index = () => {
-  // const [checked, setChecked] = useState(false);
-  // const [showPopup, setShowPopup] = useState(false);
   const [listStyle, setListStyle] = useState<TListStyle>("chat");
   const [ent, setEnt] = useState<TEntItem | null>(null);
   const [totalCount, setTotalCount] = useState<number>(0);
@@ -68,7 +66,7 @@ const Index = () => {
   };
 
   return (
-    <View className="h-full">
+    <View className="h-full flex flex-col">
       <View className="pt-20 pb-20">
         <View className="px-16">
           <CompanyList

+ 3 - 1
src/pages/knowledge/components/PersonalTab/components/ScrollList.tsx

@@ -129,6 +129,7 @@ const Index = ({ types, setTotalCount }: IProps) => {
   };
 
   return (
+    <View className="flex-1 h-full overflow-hidden">
     <ScrollView
       scrollY
       onScrollToLower={onScrollToLower}
@@ -145,7 +146,7 @@ const Index = ({ types, setTotalCount }: IProps) => {
         <></>
       )}
       {/* <slide-delete> 如果被嵌套太深,会无法正常执行原生小程序逻辑 */}
-      <View className="flex flex-col gap-8 pb-[240px] mx-16">
+      <View className="flex flex-col gap-8 pb-32 mx-16">
         {list.map((item) => {
           // @ts-ignore
           return (
@@ -172,6 +173,7 @@ const Index = ({ types, setTotalCount }: IProps) => {
         })}
       </View>
     </ScrollView>
+    </View>
   );
 };
 

+ 3 - 1
src/pages/knowledge/components/PersonalTab/components/ScrollListChat.tsx

@@ -138,6 +138,7 @@ const Index = ({assistantOnly, setTotalCount}: IProps) => {
   }, [reversedList])
 
   return (
+    <View className="flex-1 h-full overflow-hidden">
     <ScrollView
       scrollY
       onScrollToUpper={onScrollToUpper}
@@ -147,7 +148,7 @@ const Index = ({assistantOnly, setTotalCount}: IProps) => {
         height: '100%', // 高度自适应
       }}
     >
-      <View className="flex flex-col gap-20 pb-[240px] px-16">
+      <View className="flex flex-col gap-20 pb-32 px-16">
         {/* 欢迎语 */}
         {(showAsistantGreeting) && <MessageRobotRich data={DEFAULT_AGENT}><WelcomeCard /></MessageRobotRich>}
 
@@ -212,6 +213,7 @@ const Index = ({assistantOnly, setTotalCount}: IProps) => {
         })}
       </View>
     </ScrollView>
+    </View>
   );
 };
 

+ 5 - 4
src/pages/knowledge/index.tsx

@@ -5,6 +5,7 @@
 import { View, Text } from "@tarojs/components";
 import PageCustom from "@/components/page-custom/index";
 import NavBarNormal from "@/components/NavBarNormal/index";
+import PageTitle from '@/components/PageTitle'
 import WemetaTabs from "@/components/wemeta-tabs/index";
 import BlurContainer from "@/components/BlurContainer";
 import PersonalTab from "./components/PersonalTab";
@@ -20,7 +21,7 @@ import LoginMutationContext from './LoginMutationContext'
 // !!! 注意,这里层级不能再深嵌套了,否则内部使用的微信自定义组件 slide-delete 将无法编译成功!!!
 const renderTabContainer = (children: JSX.Element) => {
   return (
-    <BlurContainer className={style.tabContent}>
+    <BlurContainer className='mt-12 h-full flex flex-col'>
       {children}
     </BlurContainer>
   );
@@ -62,12 +63,12 @@ export default function Index() {
   
 
   return (
-    <PageCustom fullPage>
+    <PageCustom fullPage isflex isTabPage>
       <NavBarNormal
         scrollFadeIn
-        leftColumn={() => <Text className="text-16 font-medium">知识库</Text>}
+        leftColumn={() => <PageTitle>知识库</PageTitle>}
       ></NavBarNormal>
-      <View className="w-full h-full">
+      <View className="w-full h-full flex flex-col">
         <View className={style.container}>
           <LoginMutationContext.Provider value={{ isMutate, setLoginShow }}>
             <WemetaTabs current="1" list={tabList} className="px-16"></WemetaTabs>

+ 10 - 0
src/pages/knowledge/knowledgeUtils.ts

@@ -0,0 +1,10 @@
+import type { TKnowledgeItem } from "@/types/knowledge";
+export const isParsedSuccess = (item: TKnowledgeItem)=> {
+  return item.parseStatus === 'parsed' || item.parseStatus === 'audit_pass'
+}
+export const isParsing = (item: TKnowledgeItem)=> {
+  return item.isParsing || item.parseStatus === 'wait_transfer' || item.parseStatus === 'unparsed'
+}
+export const isParsedFail = (item: TKnowledgeItem)=> {
+  return item.isParsing || item.parseStatus === 'parse_fail' || item.parseStatus === 'audit_fail'
+}

+ 1 - 1
src/pages/profile/index.tsx

@@ -9,7 +9,7 @@ import { isSuccess } from "@/utils";
 
 import IconArrowLeft from "@/components/icon/icon-arrow-left";
 import IconHomeOutline from "@/components/icon/IconHomeOutline";
-import SummaryBar from "@/components/AgentPage/components/SummaryBar";
+import SummaryBar from "@/components/AgentPage/components/AgentActionBar";
 import { useAgentStore } from "@/store/agentStore";
 import style from "./index.module.less";
 import { sceneUnzip } from "@/service/wechat";

+ 13 - 4
src/pages/visiteor-detail/components/VisitorSummary/index.tsx

@@ -4,6 +4,7 @@ import { TVisitorAgent } from "@/types/visitor";
 import TagCertificated from "@/components/tag-certificated";
 import Taro from "@tarojs/taro";
 import { AvatarMedia } from '@/components/AvatarMedia';
+import AgentCard from "@/components/AgentCard/index";
 export interface IndexProps {
   data: TVisitorAgent;
 }
@@ -11,12 +12,20 @@ export interface IndexProps {
 const VisitorSummary = ({ data }: IndexProps) => {
   return (
     <View className="w-full p-12">
-      <View className="flex items-center gap-12">
-        <View className="flex items-center rounded-full overflow-hidden" onClick={() => {
+      <AgentCard
+        className="bg-opacity-0 p-0 rounded-none"
+        key={data.agentId}
+        data={data}
+        onClick={() => {
           Taro.navigateTo({
             url: `/pages/profile/index?agentId=${data.agentId}`,
           })
-        }}>
+        }}
+      >
+
+      </AgentCard>
+      {/* <View className="flex items-center gap-12">
+        <View className="flex items-center rounded-full overflow-hidden" onClick={}>
           <View className="w-60 h-60 bg-gray-3 rounded-full">
             <AvatarMedia source={data.avatarUrl || ''} mode="aspectFill"
                 className="w-60 h-60 bg-gray-3 rounded-full"></AvatarMedia>
@@ -42,7 +51,7 @@ const VisitorSummary = ({ data }: IndexProps) => {
             <View className="text-gray-45 leading-20">{data.lastChatTime}</View>
           </View>
         </View>
-      </View>
+      </View> */}
     </View>
   );
 };

+ 1 - 1
src/pages/visiteor-detail/index.module.less

@@ -6,7 +6,7 @@
 
 
 .gutterLine{
-  margin: 0 4px;
+  margin: 8px 0 4px;
   display: flex;
   flex-direction: column;
   align-items: center;

+ 24 - 35
src/pages/visiteor-detail/index.tsx

@@ -2,13 +2,11 @@ import { View, ScrollView, Text } from "@tarojs/components";
 import Taro, { useDidShow, useRouter } from "@tarojs/taro";
 import NavBarNormal from "@/components/NavBarNormal/index";
 import PageCustom from "@/components/page-custom/index";
-import IconArrowDownRounded from "@/components/icon/IconArrowDownRounded";
 import { useEffect, useState } from "react";
-import { useAgentStore } from "@/store/agentStore";
 import { isSuccess } from "@/utils";
 import ChatRecordItem from "@/components/ChatRecordItem";
 import { getVisitorInfo } from "@/service/visitor";
-import { TSessionItem, TVisitorAgent, TVisitorMessage } from "@/types/visitor";
+import { TSessionItem, TVisitorAgent } from "@/types/visitor";
 import VisitorSummary from "./components/VisitorSummary";
 
 import { getVisitorSessions } from "@/service/visitor";
@@ -20,13 +18,13 @@ import EmptyData from "@/components/EmptyData";
 export default () => {
   const router = useRouter();
   const { visitorId } = router.params;
+  const [visitor, setVisitor] = useState<TVisitorAgent>();
+  const [totalCount, setTotalCount] = useState(0)
+
   if (!visitorId) {
     return <View>...</View>;
   }
 
-  const [visitor, setVisitor] = useState<TVisitorAgent>();
-
-
   const fetchData = async () => {
     if (visitorId) {
       const response = await getVisitorInfo(visitorId);
@@ -42,34 +40,27 @@ export default () => {
       pageSize,
       visitorId,
     });
-    const _totalCount = res.data.totalCount;
-    
-    if (_totalCount && res.data.data) {
-      // 添加 visitTimes 第几轮访问
-      const data = res.data;
-      data.data = data.data.map((item: TSessionItem) => {
-        let  turns = _totalCount - (pageIndex-1)
-        turns = turns <= 0 ? 1 : turns;
-        return { ...item, visitTimes: turns };
-      });
-      return data;
-    }
 
-    // const data = res.data;
-    // data.data = data.data.map((item: TSessionItem) => {
-    //   let  turns = totalCount - pageIndex
-    //   turns = turns <= 0 ? 1 : turns;
-    //   return { ...item, visitTimes: turns };
-    // });
-
-    // return data;
+    let _totalCount = res.data.totalCount;
+    // 记录 totalCount
+    if (_totalCount && _totalCount !== null) {
+      
+      setTotalCount(_totalCount)
+    }
+    return res.data;
   };
 
-
-
-  const { list, pageIndex, loadMore } = useLoadMoreInfinite<TSessionItem[]>(
+  const { list, loadMore } = useLoadMoreInfinite<TSessionItem[]>(
     createKey(`api/v1/my/visitor/sessions${visitorId}`, 5),
-    fetcher);
+    fetcher
+  );
+  
+
+  const newList = list.map((item: TSessionItem, itemIndex: number) => {
+    let  turns = totalCount - itemIndex
+    turns = turns <= 0 ? 1 : turns;
+    return { ...item, visitTimes: turns };
+  });
 
   const onScrollToLower = () => {
     loadMore();
@@ -78,8 +69,6 @@ export default () => {
   useEffect(() => {
     fetchData();
   }, []);
-
-
   
 
   return (
@@ -98,8 +87,8 @@ export default () => {
         >
           <View>
             <View className="flex flex-col gap-16 px-16 w-full pb-100">
-              {list.length <= 0 && <View className="pt-100"><EmptyData type={'chat'} /></View>}
-              {list.map((item) => {
+              {newList.length <= 0 && <View className="pt-100"><EmptyData type={'chat'} /></View>}
+              {newList.map((item) => {
                 return (
                   <View className="w-full">
                     <View className="text-12 text-black leading-16">
@@ -107,7 +96,7 @@ export default () => {
                     </View>
                     <View className="flex h-full w-full">
                       <View className="text-14 font-normal text-black leading-20 flex flex-col items-end">
-                        <View>{item?.msgTime.slice(10, 16)} </View>
+                        <View className="text-14 leading-24">{item?.msgTime.slice(10, 16)} </View>
                       </View>
                       <View className="flex flex-1 w-full">
                         <View className={style.gutterLine}>

+ 1 - 1
src/types/knowledge.ts

@@ -20,7 +20,7 @@ export type TKnowledgeItem = {
   knowledgeId: number;
   linkUrl?: string;
   parseMsg: string;
-  parseStatus: string;
+  parseStatus: string;  // parseStatus (string, optional): 解析状态 unknown未知/wait_transfer待转存/unparsed待解析/parsing解析中/wait_audit待审核/audit_pass审核通过/parsed解析成功/audit_fail审核未通过/parse_fail解析失败 ,
   parseStatusDesc: string;
   picUrl: string;
   title: string;

+ 5 - 5
src/utils/loadMoreInfinite.ts

@@ -11,6 +11,7 @@ export type TResponseData<D> = {
 
 export const createKey = (query: string, pageSize: number = 10, extra: Record<string, any> = []) => {
   return (pageIndex: number, previousPageData) => {
+    // previousPageData 接口返回的数据结果
     // pageIndex 后端要求是从 1 开始
     if (pageIndex === 0)
       return [
@@ -18,8 +19,7 @@ export const createKey = (query: string, pageSize: number = 10, extra: Record<st
         { nextId: undefined, pageSize, pageIndex: pageIndex + 1 },
         extra,
       ];
-      // 如果是以 pageIndex 作为分页依据, 即有pageIndex 且 没有 nextId
-      // 
+    // 以 pageIndex 作为分页依据, 即有 pageIndex 且 没有 nextId
     if (previousPageData && previousPageData.pageIndex && !previousPageData.nextId) {
       return [
         query,
@@ -27,11 +27,11 @@ export const createKey = (query: string, pageSize: number = 10, extra: Record<st
         extra,
       ];
     }
-    
+    // 以 nextId 作为分页依据
     if (previousPageData && previousPageData.nextId) {
       return [
         query,
-        { pageSize, nextId: previousPageData.nextId},
+        { pageSize, nextId: decodeURIComponent(previousPageData.nextId)},
         extra,
       ];
     }
@@ -71,7 +71,6 @@ export const useLoadMoreInfinite = <T>(getKey, fetcher, params = {}) => {
   const pages = data
   const pageIndex = size
 
-
   const loadMore = () => {
     setSize((size) => size + 1);
   }
@@ -83,6 +82,7 @@ export const useLoadMoreInfinite = <T>(getKey, fetcher, params = {}) => {
     pages,
     mutate,
     setSize,
+    size,
     loadMore,
     error,
   }