王晓东 1 mesiac pred
rodič
commit
cb167f7b93

+ 0 - 1
src/app.less

@@ -120,7 +120,6 @@
   background-color: white;
   color: rgba(#000, .85);
   text-align: center;
-  font-size: 12px;
   font-style: normal;
   font-weight: 500;
   line-height: 20px;

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

@@ -23,8 +23,8 @@ const DigitalCardBasic = ({
   }
   return (
     <View className="flex items-start">
-      <View className="flex flex-col flex-1 justify-center min-h-48 gap-8">
-        <View className="flex items-end gap-8">
+      <View className="flex flex-col flex-1 justify-center min-h-40 gap-4">
+        <View className="flex">
           <View className="text-16 max-w-120 font-medium leading-24 font-pingfangSCMedium">{name}</View>
         </View>
         {/* inline-flex flex-nowrap break-normal items-center */}

+ 3 - 1
src/components/wemeta-tabs/index.module.less

@@ -8,12 +8,14 @@
 
 // 矩形填充形
 .buttonTabs{
-  border-radius: 20px;
+  border-radius: 12px;
+  height: 42px;
   // background-color: #F5F6F7;
 }
 .buttonTab{
   font-size: 14px;
   height: 34px;
+  font-family: PingFangSC-Medium;
   line-height: 22px;
   font-weight: 400;
   color: rgba(#000, .65);

+ 3 - 3
src/pages/agent/index.tsx

@@ -51,11 +51,11 @@ export default function Index() {
 
   return (
     <PageCustom>
-      <NavBarNormal scrollFadeIn>创建</NavBarNormal>
+      <NavBarNormal>创建</NavBarNormal>
       <View className="px-16 w-full flex flex-col gap-20">
         <View className="fixed top-0 left-0 right-0 z-10" 
         style={{
-          paddingTop: headerHeight,
+          paddingTop: headerHeight + 12,
         }}
         >
           <View className="flex flex-center px-16">
@@ -66,7 +66,7 @@ export default function Index() {
             ></TabBarButtons>
           </View>
         </View>
-        <View className="pt-40">
+        <View className="pt-52">
           <View className={`${tabIndex === "1" ? "block" : "hidden"}`}>
             <View className="pt-12">
             <AgentSetting></AgentSetting>

+ 15 - 14
src/pages/chat/components/keyboard.ts

@@ -11,15 +11,18 @@ export const useKeyboard = (scrollViewRef: React.MutableRefObject<any>, contentI
   
   // 计算 marginTopOffset 偏移的距离
   const marginTopOffset = (() => {
+    // console.log(contentHeight, keyboardHeight,scrollViewHeight, 9999)
+    // 如果内容高度为 0 则将内容高度视频为 容器高度,用于显示最底部的欢迎消息
+    const _cotentHeight = contentHeight === 0 ? scrollViewHeight : contentHeight
     if (keyboardHeight <= 0) return 0;
     // 如果内容超过滚动容器,取键盘弹起高度
-    if (contentHeight >= scrollViewHeight) {
+    if (_cotentHeight >= scrollViewHeight) {
       return -keyboardHeight;
     }
     // 如果内容+键盘弹起高度超过滚动容器, 则取其差值
-    if (contentHeight + keyboardHeight > scrollViewHeight) {
+    if (_cotentHeight + keyboardHeight > scrollViewHeight) {
       // 内容+键盘弹起高度 - 滚动容器高度
-      return -(contentHeight + keyboardHeight - scrollViewHeight);
+      return -(_cotentHeight + keyboardHeight - scrollViewHeight);
     }
     return 0
   })();
@@ -30,6 +33,7 @@ export const useKeyboard = (scrollViewRef: React.MutableRefObject<any>, contentI
 
   useEffect(() => {
     // 监听键盘高度变化
+    // todo: 需要测试是否在键盘弹起时检测内容与容器高度
     Taro.onKeyboardHeightChange((res) => {
       if (res.height <= 0) {
         return setKeyboardHeight(0);
@@ -51,26 +55,23 @@ export const useKeyboard = (scrollViewRef: React.MutableRefObject<any>, contentI
   useEffect(() => {
     if (scrollViewRef.current) {
       const query = Taro.createSelectorQuery();
-      // 获取聊天内容高度
+      // 获取滚动容器高度
       query
-        .select(contentId)
+        .select(scrollViewId)
         .boundingClientRect((rect: any) => {
           if (rect) {
-            // console.log('Content height:', rect.height)
-            setContentHeight(rect.height);
+            // console.log('ScrollView height:', rect.height)
+            setScrollViewHeight(rect.height);
           }
         })
         .exec();
-      // 获取滚动容器高度
+      // 获取聊天内容高度
       query
-        .select(scrollViewId)
+        .select(contentId)
         .boundingClientRect((rect: any) => {
           if (rect) {
-            // console.log('ScrollView height:', rect.height)
-            setScrollViewHeight(rect.height);
-            if(contentHeight <= 0){
-              setContentHeight(rect.height);
-            }
+            // console.log('Content height:', rect.height, scrollViewHeight)
+            setContentHeight(rect.height);
           }
         })
         .exec();

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

@@ -110,6 +110,7 @@ export default function Index() {
   const prevLengthRef = useRef(messagesLength);
 
   const [showWelcome, setShowWelcome] = useState(!list.length);
+  const haveBg =  (!!agent?.enabledChatBg && !!agent.avatarUrl?.length)
 
   //  加载更多
   const onScrollToUpper = () => {
@@ -175,7 +176,7 @@ export default function Index() {
   });
 
   const renderNavLeft = () => {
-    const haveBg =  (!!agent?.enabledChatBg && !!agent.avatarUrl?.length)
+    
     return (
       <View
         className="flex items-center gap-8"
@@ -197,17 +198,19 @@ export default function Index() {
   };
 
   useEffect(() => {
-    Taro.setNavigationBarColor({
-      frontColor: "#ffffff",
-      backgroundColor: "transparent",
-    });
+    if(haveBg){
+      Taro.setNavigationBarColor({
+        frontColor: "#ffffff",
+        backgroundColor: "transparent",
+      });
+    }
     return () => {
       Taro.setNavigationBarColor({
         frontColor: "#000000",
         backgroundColor: "transparent",
       });
     };
-  }, []);
+  }, [haveBg]);
 
   return (
     <PageCustom

+ 8 - 7
src/pages/dashboard/components/VisitorCard/index.tsx

@@ -20,24 +20,25 @@ 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-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 className="w-40 h-40 bg-gray-3 rounded-full shrink-0">
+            <AvatarMedia source={data.avatarUrl || ''} mode="aspectFill" className="w-40 h-40 bg-gray-3 rounded-full"></AvatarMedia>
           </View>
         </View>
-        <View className="flex flex-col gap-8 flex-1">
+        <View className="flex flex-col flex-1 gap-4">
           <DigitalCardBasic
             name={data.name}
             position={data.position ?? ""}
             entName={data.entName}
             certificated={data.isEnt}
           />
-          <View className="text-14 leading-24">
-            第<Text className="text-primary text-16 font-medium px-6">{data.visitTimes}</Text>
+          <View className="text-12 leading-22">
+            第<Text className="text-primary text-14 font-medium px-6">{data.visitTimes}</Text>
             次访问了你的智能体【{data.myAgentName}】
           </View>
-          <View className="flex-center text-12 leading-20">
+          <View className="flex-center text-12 leading-20 pt-8">
             <View className="flex-1">
-              <Text className="text-primary text-16 font-medium leading-20">{data.chatRound}</Text> 轮对话
+              <Text className="text-primary text-12 font-medium leading-20">{data.chatRound}</Text> 轮对话
+              {data.dislikeCnt > 0 ? <><Text className="text-[#FF4747] font-medium"><Text className="text-gray-45 px-8">|</Text>{data.dislikeCnt}</Text><Text>差评</Text></> : <></>}
             </View>
             <View className="text-gray-45 leading-20">{dayjs(data.lastChatTime).fromNow()}</View>
           </View>

+ 2 - 2
src/pages/knowledge-item/index.tsx

@@ -191,7 +191,7 @@ export default function Index() {
                       <View className="flex-center  h-28">
                         <IconA />
                       </View>
-                      <View className={`flex-1 text-12 leading-20 text-gray-45 ${!isEnt ? 'truncate': ''}`}>
+                      <View className={`flex-1 text-12 leading-20 text-gray-45 pt-4 ${!isEnt ? 'truncate': ''}`}>
                         <View className={`${!isEnt ? 'truncate': ''}`}>{item.answer}</View>
 
                         {!!item.links.length && (
@@ -230,7 +230,7 @@ export default function Index() {
         </View>
         {!isEnt && <BottomBar>
           <View
-            className="button-rounded button-plain button-warn w-88"
+            className="button-rounded button-plain text-14 button-warn w-88"
             onClick={handleDeleteKnowledge}
           >
             删除

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

@@ -6,7 +6,7 @@ export const WelcomeCard = () => {
       <View className="font-medium text-black leading-28 mb-4 text-14">
         Hi~我是你的 AI 小助手!
       </View>
-      <View className="font-normal text-[#414A64] leading-24 text-12">请将资料发送到我的企业微信,我会自动为你解析内容,并同步到这里。</View>
+      <View className="font-normal text-[#414A64] leading-24 text-12 whitespace-normal pb-12">请将资料发送到我的企业微信,我会自动为你解析内容,并同步到这里。</View>
       <WeComQRcode />
     </View>
   );

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

@@ -152,7 +152,6 @@ const Index = ({assistantOnly, setTotalCount}: IProps) => {
         {/* 欢迎语 */}
         {(showAsistantGreeting) && <MessageRobotRich data={DEFAULT_AGENT}><WelcomeCard /></MessageRobotRich>}
 
-
         {reversedList.map((group) => {
           // 渲染自己发送的消息
           if (group.role === "user") {