Ver código fonte

fix: 聊天界面键盘弹窗

王晓东 5 dias atrás
pai
commit
72d7ff2ec7

+ 7 - 0
project.private.config.json

@@ -8,6 +8,13 @@
   "condition": {
     "miniprogram": {
       "list": [
+        {
+          "name": "pages/agent/index",
+          "pathName": "pages/agent/index",
+          "query": "agentId=p_2e73c9d7efaYfDo2-agent_991",
+          "scene": null,
+          "launchMode": "default"
+        },
         {
           "name": "pages/contact/index",
           "pathName": "pages/contact/index",

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

@@ -51,7 +51,7 @@ export default function Index({ agentId }: IProps) {
 
   return (
     <PageCustom styleBg={agent?.avatarUrl} >
-      <NavBarNormal leftColumn={Logo}></NavBarNormal>
+      <NavBarNormal blur scrollFadeIn leftColumn={Logo}></NavBarNormal>
       <View className="blur-rounded-container">
         {(!!agent) ? <SummaryBar isVisitor={false} agent={agent}></SummaryBar> : <></>}
         <View className={`flex flex-col gap-12 w-full p-16`}>

+ 3 - 1
src/components/NavBarNormal/index.module.less

@@ -8,13 +8,15 @@
 .backdropFilter{
   backdrop-filter: blur(10px);
 }
-.navBarBg{
+.navBarBgContainer{
   position: absolute;
   left: 0;
   top: 0;
   z-index: 1;
   height: 100%;
   width: 100%;
+}
+.navBarBg{
   background: url(https://cdn.wehome.cn/cmn/png/104/META-H8UKWHWU-8HXWA0PE7HXUV4QMQUBV2-4TSKCVCM-AD.png) no-repeat;
   background-size: 100%;
   background-position: top left;

+ 5 - 4
src/components/NavBarNormal/index.tsx

@@ -29,7 +29,7 @@ const Index: React.FC<Props> = ({
 }) => {
   const statusBarHeight = useAppStore.getState().statusBarHeight;
   //
-  const [opacity, setOpacity] = useState(scrollFadeIn ? 1 : 0);
+  const [opacity, setOpacity] = useState(scrollFadeIn ? 0 : 1);
   usePageScroll((e) => {
     if (!scrollFadeIn) {
       return;
@@ -90,13 +90,14 @@ const Index: React.FC<Props> = ({
   const renderNavBar = () => {
     return (
       <View
-        className={`${style.navBarContainer} ${blur ? style.backdropFilter : ''}`}
+        className={`${style.navBarContainer}`}
         id="leaf-nav-bar"
         style={{
           paddingTop: statusBarHeight,
         }}
-      >
-        <View className={style.navBarBg} style={{opacity: opacity}}></View>
+      > 
+        {/* 背景毛玻璃与 渐变背景互斥 */}
+        <View className={`${style.navBarBgContainer} ${blur ? style.backdropFilter : style.navBarBg}`} style={{opacity: opacity}}></View>
         <View className={`${style.navBar}`}>
           {renderLeftColumn()}
           <View

+ 1 - 1
src/components/component-list/components/card-mini-program/index.tsx

@@ -107,7 +107,7 @@ export default ({
             <View className={`${style.infoColumn} truncate`}>
               <View className={`${style.nameRow}`}>
                 <View className={`${style.text} truncate`}>
-                  {data.value.name?.length ? data.value.name : data.value.shortLink}
+                  {data.value.name?.length ? data.value.name : (data.value.shortLink ? data.value.shortLink : data.value.placeholder)}
                 </View>
               </View>
             </View>

+ 1 - 2
src/components/page-wrapper/index.module.less

@@ -22,7 +22,6 @@
   bottom: 0;
   width: 100%;
   height: 100%;
-  background-size: 100%!important;
+  background-size: auto 100%!important;
   background-repeat: no-repeat!important;
-  // background-color: var(--color-bg-primary)!important;
 }

+ 1 - 1
src/components/wemeta-input/index.tsx

@@ -77,7 +77,7 @@ const index = ({
           adjustPosition={adjustPosition}
           onInput={(e: any) => handleInput(e.target.value)}
           placeholder={placeholder}
-          placeholderStyle="rgba(0,0,0,.05)"
+          placeholderStyle="rgba(0,0,0,.25)"
           className={style.textInput}
           onFocus={handleFocus}
           onBlur={handleBlur}

+ 0 - 0
src/pages/chat/components/chat-welcome/index.module.less → src/pages/chat/components/ChatGreeting/index.module.less


+ 16 - 16
src/pages/chat/components/chat-welcome/index.tsx → src/pages/chat/components/ChatGreeting/index.tsx

@@ -1,6 +1,5 @@
 import { View } from "@tarojs/components";
 import style from "./index.module.less";
-import PersonalCard from "../personal-card";
 import { TAgentDetail } from "@/types/agent";
 import { useChatInput } from "../input-bar/chatInput";
 interface IProps {
@@ -33,21 +32,22 @@ export default ({ agent }: IProps) => {
 
   return (
     <View className={style.container}>
-      {/* <View className="mb-24">
-        <PersonalCard agent={agent} />
-      </View> */}
-      <View className="flex flex-col gap-8">
-        <View className="text-[#111A34] text-14 leading-28 mb-18">{greeting}</View>
-        {questions.map((q) => {
-          return (
-            <View
-              className="p-12 rounded-8 leading-22 text-12 bg-[#F4F9FF] text-[#414A64]"
-              onClick={() => handleClick(q)}
-            >
-              {q}
-            </View>
-          );
-        })}
+      <View className="flex flex-col gap-16">
+        <View className="text-[#111A34] text-14 leading-28">{greeting}</View>
+        {!!questions.length && (
+          <View className="flex flex-col gap-8">
+            {questions.map((q) => {
+              return (
+                <View
+                  className="p-12 rounded-8 leading-22 text-12 bg-[#F4F9FF] text-[#414A64]"
+                  onClick={() => handleClick(q)}
+                >
+                  {q}
+                </View>
+              );
+            })}
+          </View>
+        )}
       </View>
     </View>
   );

+ 1 - 7
src/pages/chat/components/input-bar/index.tsx

@@ -1,17 +1,11 @@
 import { useState } from "react";
 import TextInputBar from "./TextInputBar";
 import VoiceInputBar from "./VoiceInputBar";
-import { TMessage,TRobotMessage, useTextChat } from "@/store/textChat";
 import { TAgentDetail } from "@/types/agent";
-import { EAI_MODEL } from "@/consts/enum";
-
-
+import { TMessage, TRobotMessage } from "@/types/bot";
 import { useChatInput } from './chatInput'
-
-
 interface Props {
   agent: TAgentDetail | null;
-  aiModel: EAI_MODEL;
   histories: (TMessage|TRobotMessage)[];
   setShowWelcome: (b: boolean) => void;
 }

+ 29 - 7
src/pages/chat/components/keyboard.ts

@@ -1,16 +1,19 @@
 import Taro from "@tarojs/taro";
-import { useEffect, useState } from "react";
-
-export const useKeyboard = (scrollViewRef: React.MutableRefObject<any>, messageList:any[], contentId: string, scrollViewId: string )=> {
+import { useEffect, useState, useCallback } from "react";
+import { useAppStore } from "@/store/appStore";
+export const useKeyboard = (scrollViewRef: React.MutableRefObject<any>, contentId: string, scrollViewId: string ) => {
   
   const [keyboardHeight, setKeyboardHeight] = useState(0);
   const [contentHeight, setContentHeight] = useState(0);
   const [scrollViewHeight, setScrollViewHeight] = useState(0);
+  const [updateTrigger, setUpdateTrigger] = useState(0);
+  const bottomSafeHeight = useAppStore((state) => state.bottomSafeHeight);
+  
   // 计算 marginTopOffset 偏移的距离
   const marginTopOffset = (() => {
     if (keyboardHeight <= 0) return 0;
     // 如果内容超过滚动容器,取键盘弹起高度
-    if (contentHeight > scrollViewHeight) {
+    if (contentHeight >= scrollViewHeight) {
       return -keyboardHeight;
     }
     // 如果内容+键盘弹起高度超过滚动容器, 则取其差值
@@ -21,17 +24,24 @@ export const useKeyboard = (scrollViewRef: React.MutableRefObject<any>, messageL
     return 0
   })();
 
+  useEffect(()=> {
+    console.log('Keyboard state:', keyboardHeight, contentHeight, scrollViewHeight, marginTopOffset)
+  }, [keyboardHeight, contentHeight, scrollViewHeight, marginTopOffset])
+
   useEffect(() => {
     // 监听键盘高度变化
     Taro.onKeyboardHeightChange((res) => {
       if (res.height <= 0) {
         return setKeyboardHeight(0);
       }
-
-      setKeyboardHeight(res.height - 24);
+      console.log(res.height, bottomSafeHeight, 111111)
+      setKeyboardHeight(res.height - bottomSafeHeight + 16);
     });
 
     return () => {
+      setKeyboardHeight(0);
+      setScrollViewHeight(0);
+      setContentHeight(0)
       // 清理监听器
       Taro.offKeyboardHeightChange();
     };
@@ -46,6 +56,7 @@ export const useKeyboard = (scrollViewRef: React.MutableRefObject<any>, messageL
         .select(contentId)
         .boundingClientRect((rect: any) => {
           if (rect) {
+            console.log('Content height:', rect.height)
             setContentHeight(rect.height);
           }
         })
@@ -55,16 +66,27 @@ export const useKeyboard = (scrollViewRef: React.MutableRefObject<any>, messageL
         .select(scrollViewId)
         .boundingClientRect((rect: any) => {
           if (rect) {
+            console.log('ScrollView height:', rect.height)
             setScrollViewHeight(rect.height);
+            if(contentHeight <= 0){
+              setContentHeight(rect.height);
+            }
           }
         })
         .exec();
     }
-  }, [messageList]);
+  }, [updateTrigger, scrollViewRef.current]);
+
+  // 触发高度重新计算的函数 - 使用 useCallback 稳定引用
+  const triggerHeightUpdate = useCallback(() => {
+    setUpdateTrigger(prev => prev + 1);
+  }, []);
+
 
   return {
     marginTopOffset,
     keyboardHeight,
+    triggerHeightUpdate,
     setKeyboardHeight,
     setContentHeight,
     setScrollViewHeight,

+ 39 - 52
src/pages/chat/index.tsx

@@ -3,21 +3,19 @@ import NavBarNormal from "@/components/NavBarNormal/index";
 import PageCustom from "@/components/page-custom/index";
 import Taro, { useDidShow, useRouter, useUnload } from "@tarojs/taro";
 import ChatMessage from "@/components/chat-message";
-import style from "./index.module.less";
 import InputBar from "./components/input-bar";
-import { useEffect, useState, useRef } from "react";
+import { useEffect, useState, useRef, useMemo } from "react";
 import { useTextChat } from "@/store/textChat";
-import { EAI_MODEL } from "@/consts/enum";
-import { EChatRole, TRobotMessage, TMessage, EContentType } from "@/types/bot";
+import { TRobotMessage, TMessage, EContentType } from "@/types/bot";
 
-import ChatWelcome from "./components/chat-welcome";
+import ChatGreeting from "./components/ChatGreeting";
 import IconArrowLeft from "@/components/icon/icon-arrow-left";
 import PersonalCard from "./components/personal-card";
 import { useAgentStore } from "@/store/agentStore";
 
 import { useLoadMoreInfinite, createKey } from "@/utils/loadMoreInfinite";
 import { getMessageHistories } from "@/service/bot";
-// import { useAppStore } from "@/store/appStore";
+
 
 import RecommendQuestions from './components/RecommendQuestions'
 import {useKeyboard} from './components/keyboard'
@@ -25,7 +23,7 @@ import {useKeyboard} from './components/keyboard'
 
 export default function Index() {
   const router = useRouter();
-  // const bottomSafeHeight = useAppStore((state) => state.bottomSafeHeight);
+  
   const { agentId, isVisitor } = router.params;
   if (!agentId) {
     return <View>没有相应的智能体</View>;
@@ -40,10 +38,9 @@ const agent = useAgentStore((state) => {
     return state.agent
   });
   const scrollViewRef = useRef<any>(null);
-  const [deepThink, setDeepThink] = useState(EAI_MODEL.DeepseekChat);
   const messageList = useTextChat((state) => state.list);
   
-  const {keyboardHeight, marginTopOffset} = useKeyboard(scrollViewRef, messageList, '#messageList', '#scrollView')
+  const {keyboardHeight, marginTopOffset, triggerHeightUpdate,} = useKeyboard(scrollViewRef, '#messageList', '#scrollView')
   
 
   
@@ -83,6 +80,9 @@ const agent = useAgentStore((state) => {
     }
     return item
   })
+  const allMessages = useMemo(()=> [...[...parsedList].reverse(), ...messageList], [parsedList, messageList])
+  const messagesLength = useMemo(() => allMessages.length, [allMessages.length]);
+  const prevLengthRef = useRef(messagesLength);
 
   const [showWelcome, setShowWelcome] = useState(!list.length);
 
@@ -112,10 +112,12 @@ const agent = useAgentStore((state) => {
     }
   }, [agentId, isVisitor]);
 
+  // 是否显示欢迎 ui
   useEffect(() => {
     setShowWelcome(!messageList.length && !list.length);
   }, [list, messageList]);
 
+  // 首次进入界面滚动到底
   useEffect(() => {
     if (pageIndex === 1) {
       setTimeout(() => {
@@ -124,21 +126,30 @@ const agent = useAgentStore((state) => {
     }
   }, [pageIndex]);
 
+  // 首次进入聊天生成 session id
   useEffect(() => {
     genSessionId();
   }, []);
 
+  // 监听消息列表变化,触发键盘高度重新计算
+  useEffect(() => {
+    // 只在长度真正变化时才触发
+    if (prevLengthRef.current !== messagesLength) {
+      prevLengthRef.current = messagesLength;
+      
+      // 使用 setTimeout 确保 DOM 更新完成后再计算高度
+      const timer = setTimeout(() => {
+        triggerHeightUpdate();
+      }, 100);
+      
+      return () => clearTimeout(timer);
+    }
+  }, [messagesLength, triggerHeightUpdate]);
+
   useUnload(() => {
     destroy();
   });
 
-  const switchDeepThink = () => {
-    if (deepThink === EAI_MODEL.DeepseekChat) {
-      setDeepThink(EAI_MODEL.DeepseekReasoner);
-      return;
-    }
-    setDeepThink(EAI_MODEL.DeepseekChat);
-  };
 
   const renderNavLeft = () => {
     return (
@@ -154,35 +165,22 @@ const agent = useAgentStore((state) => {
 
   
   // 大背景可以是视频,也可以是图片
-  const renderTopBg = ()=> {
+  const getBgContent = ()=> {
     if(!agent?.avatarUrl || !!!agent?.enabledChatBg){
-      return <></>;
-    }
-    if(agent.avatarUrl.lastIndexOf(".mp4") > -1){
-      return <Video
-        controls={false}
-        showCenterPlayBtn={false}
-        loop={true}
-        muted={true}
-        autoplay
-        objectFit="cover"
-        className={style.topBg}
-        src={agent.avatarUrl}
-      />
+      return ''
     }
-    // 自定义背景样式
-    const bgImageStyle = {
-      backgroundImage: `url(${agent?.avatarUrl})`,
-    };
-    return <View className={style.topBg} style={bgImageStyle}></View>
+    return agent?.avatarUrl
   }
+
+  
+
+
   
   return (
-    <PageCustom fullPage style={{ overflow: "hidden" }}>
+    <PageCustom fullPage style={{ overflow: "hidden" }} styleBg={getBgContent()}>
       <NavBarNormal blur leftColumn={renderNavLeft}>
         {/* <>{`${scrollTop}`}--{autoScroll ? 'true': 'false'}</> */}
       </NavBarNormal>
-      {renderTopBg()}
       <View
         className="flex flex-col w-full h-full relative z-10 flex-1"
         style={{ top: `${marginTopOffset}px` }}
@@ -200,11 +198,11 @@ const agent = useAgentStore((state) => {
           onScrollToUpper={onScrollToUpper}
           onScrollToLower={()=> setAutoScroll(true)}
         >
-          {showWelcome && <ChatWelcome agent={agent} />}
           <View id="messageList" className="flex flex-col gap-8 px-18" onTouchMove={handleTouchMove}>
+            {showWelcome && <ChatGreeting agent={agent} />}
             {/* 复制 histories 再 reverse 否则会影响 state */}
-            {[...[...parsedList].reverse(), ...messageList].map((message) => {
-              const reasoningContent = message.role === EChatRole.Assistant ? message.reasoningContent : ''
+            {allMessages.map((message) => {
+              const reasoningContent = (message as any).reasoningContent || '';
               return (
                 <ChatMessage
                   key={message.msgUk}
@@ -217,7 +215,7 @@ const agent = useAgentStore((state) => {
               );
             })}
           </View>
-          <View className="pb-80 pt-8">
+          <View className="pb-40 pt-8">
           {(agent) &&  <RecommendQuestions agent={agent} />}
           </View>
         </ScrollView>
@@ -231,20 +229,9 @@ const agent = useAgentStore((state) => {
           }}
 
         >
-          {/* <View
-            onClick={switchDeepThink}
-            className={
-              deepThink === EAI_MODEL.DeepseekReasoner
-                ? style.deepMindMarkActive
-                : style.deepMindMark
-            }
-          >
-            深度思考(R1)
-          </View> */}
           <View className="bg-[#F5FAFF]">
           {agent && (
               <InputBar
-                aiModel={deepThink}
                 agent={agent}
                 histories={list}
                 setShowWelcome={setShowWelcome}

+ 2 - 1
src/pages/component-library/components/createComponentData.ts

@@ -90,9 +90,10 @@ export function createComponentData(type: EComponentType): Record<string, any> |
   if(type === EComponentType.miniProgram){
     return  {
       value: {
-        name: '默认小程序',
+        name: '',
         shortLink: '',
         poster: '',
+        placeholder: '默认小程序',
       },
       layout: 'full',
     }

+ 15 - 20
src/pages/editor-pages/editor-channels/index.tsx

@@ -5,13 +5,13 @@ import PageCustom from "@/components/page-custom/index";
 import NavBarNormal from "@/components/NavBarNormal/index";
 import Popup from "@/components/popup/popup";
 import style from './index.module.less'
-import editorStyle from "../editor.module.less";
 
 import { useComponentStore } from "@/store/componentStore";
 import WemetaInput from "@/components/wemeta-input/index";
 import { uploadImage } from "@/utils/http";
 import { EComponentType } from "@/consts/enum";
 import BottomBar from "@/components/BottomBar";
+import ButtonMain from "@/components/buttons/ButtonMain";
 
 export default function Index() {
   
@@ -163,10 +163,10 @@ export default function Index() {
       </NavBarNormal>
       <View className="flex flex-col items-center w-full pt-20">
         <View className="px-16 w-full">
-          <View className={editorStyle.formContainer}>
-            <View className={editorStyle.formItem}>
-              <View className={editorStyle.formItemLabel}>
-                <View className="flex-1">视频号ID</View>
+          <View className="flex flex-col gap-16 w-full">
+            <View className="flex flex-col gap-6 w-full">
+              <View className="flex items-center">
+                <View className="flex-1 text-14 leading-28 font-medium">视频号ID<Text className="text-red">*</Text></View>
                 <View className="text-primary" onClick={showTips(1)}>
                   如何获取?
                 </View>
@@ -177,9 +177,9 @@ export default function Index() {
                 placeholder="请输入视频号ID..."
               />
             </View>
-            <View className={editorStyle.formItem}>
-              <View className={editorStyle.formItemLabel}>
-                <View className="flex-1">视频号视频ID</View>
+            <View className="flex flex-col gap-6 w-full">
+              <View className="flex items-center">
+                <View className="flex-1 text-14 leading-28 font-medium">视频号视频ID<Text className="text-red">*</Text></View>
                 <View className="text-primary" onClick={showTips(2)}>
                   如何获取?
                 </View>
@@ -191,9 +191,9 @@ export default function Index() {
               />
             </View>
 
-            <View className={editorStyle.formItem}>
-              <View className={editorStyle.formItemLabel}>
-                <View className="flex-1">视频描述</View>
+            <View className="flex flex-col gap-6 w-full">
+              <View className="flex items-center">
+                <View className="flex-1 text-14 leading-28 font-medium">视频描述</View>
               </View>
               <WemetaInput
                 value={shipingValue.desc}
@@ -202,9 +202,9 @@ export default function Index() {
               />
             </View>
 
-            <View className={editorStyle.formItem}>
-              <View className={editorStyle.formItemLabel}>
-                <View className="flex-1">封面图 <Text className="text-gray-45">(选填)</Text></View>
+            <View className="flex flex-col gap-6 w-full">
+              <View className="flex items-center">
+                <View className="flex-1 text-14 leading-28 font-medium">封面图</View>
               </View>
               <View className={`${style.coverContainer}`} onClick={handleAddPoster}>
                 {renderPoster(shipingValue.poster)}
@@ -216,12 +216,7 @@ export default function Index() {
       </View>
 
       <BottomBar>
-        <View
-          className="button-rounded button-primary flex-1"
-          onClick={handleSubmit}
-        >
-          保存
-        </View>
+        <ButtonMain className="flex-1" disabled={!shipingValue.videoId.length || !shipingValue.accountId.length} onClick={handleSubmit}>保存</ButtonMain>
       </BottomBar>
 
       <Popup

+ 35 - 31
src/pages/editor-pages/editor-link-social/index.tsx

@@ -4,32 +4,33 @@ import Taro, { useRouter, useUnload } from "@tarojs/taro";
 import PageCustom from "@/components/page-custom/index";
 import NavBarNormal from "@/components/NavBarNormal/index";
 
-import editorStyle from "../editor.module.less";
 import WemetaTextarea from "@/components/wemeta-textarea/index";
 import WemetaInput from "@/components/wemeta-input/index";
 import { useComponentStore } from "@/store/componentStore";
 import { SocialMediaType } from "@/consts/socialMedia";
 import BottomBar from "@/components/BottomBar";
 import { EComponentType } from "@/consts/enum";
+import Popup from "@/components/popup/popup";
+import ButtonMain from "@/components/buttons/ButtonMain";
 export default function Index() {
   const router = useRouter();
   // 社交媒体类型
   const { mediaType } = router.params;
   let mt = mediaType ?? "link";
   let defaultLabel = `${SocialMediaType[mt]?.label} 链接`;
-  if(mediaType === "shiping"){
+  if (mediaType === "shiping") {
     defaultLabel = "视频号";
   }
-  
+
   let currentComponent = useComponentStore((state) => state.currentComponent);
   if (!currentComponent) {
     return <></>;
   }
-
   const { saveComponent } = useComponentStore();
   const loading = useComponentStore((state) => state.loading);
   const data = currentComponent?.data ?? {};
   const { value, text, layout } = data;
+  const [show, setShow] = useState(false);
   const [linkValue, setLinkValue] = useState(value ?? "");
   const [linkText, setLinkText] = useState(text ?? "");
 
@@ -48,7 +49,7 @@ export default function Index() {
       data: {
         value: linkValue,
         text: linkText,
-        layout: layout ?? '',
+        layout: layout ?? "",
         id: data.id,
         index: data.index,
       },
@@ -65,8 +66,17 @@ export default function Index() {
   return (
     <PageCustom bgColor="global-light-green-bg">
       <NavBarNormal>{defaultLabel}</NavBarNormal>
-      <View className="flex flex-col items-center gap-12 w-full px-16 pb-120">
-        <View className="w-full">
+      <View className="flex flex-col items-center gap-16 w-full px-16 pb-120">
+          <View className="flex flex-col gap-6 w-full">
+          <View className="flex w-full items-center ">
+              <View className="flex text-14 leading-28 font-medium flex-1">{isShiping ? '视频号ID': '链接'}<Text className="text-red">*</Text></View>
+              {isShiping && (
+              <View className="text-primary" onClick={() => setShow(true)}>
+                  如何获取?
+                </View>
+              )}
+            </View>
+          
           <WemetaTextarea
             value={linkValue}
             onInput={(value: string) => setLinkValue(value)}
@@ -74,25 +84,9 @@ export default function Index() {
             maxlength={50}
           ></WemetaTextarea>
         </View>
-        {isShiping && (
-          <View className="flex flex-col gap-10 rounded-20 p-12 bg-white mt-48">
-            <View className="text-gray-65">
-              🌟 <Text className="font-medium">小蓝本提示:</Text>
-              <Text>
-                获取视频号ID的需要登录视频号助手,在首页可以查看自己的视频号ID
-              </Text>
-            </View>
-            <Image
-              className="w-full"
-              mode="widthFix"
-              src="https://cdn.wehome.cn/cmn/png/196/META-H8UK0IWU-9NNPJOLLD1MU95DE0NMA3-8W1EZW2M-2B1.png"
-            ></Image>
-          </View>
-        )}
         <View className={`flex flex-col gap-6 w-full`}>
-          <View className="flex gap-4 items-center">
-            <View className={editorStyle.formLabel}>链接描述</View>
-            <View className={editorStyle.formLabelRequired}>(选填)</View>
+          <View className="flex w-full items-center">
+            <View className="flex flex-1 text-14 leading-28 font-medium">链接描述</View>
           </View>
           <WemetaInput
             value={linkText}
@@ -103,13 +97,23 @@ export default function Index() {
         </View>
       </View>
       <BottomBar>
-        <View
-          className="button-rounded button-primary flex-1"
-          onClick={handleSubmit}
-        >
-          保存
-        </View>
+        <ButtonMain className="flex-1" disabled={!linkValue.length} onClick={handleSubmit}>保存</ButtonMain>
       </BottomBar>
+      <Popup title={"获取视频号ID"} show={show} setShow={setShow}>
+        <View className="flex flex-col gap-10 rounded-20 p-12 bg-white">
+          <View className="text-gray-65">
+            🌟 <Text className="font-medium">小蓝本提示:</Text>
+            <Text>
+              获取视频号ID的需要登录视频号助手,在首页可以查看自己的视频号ID
+            </Text>
+          </View>
+          <Image
+            className="w-full"
+            mode="widthFix"
+            src="https://cdn.wehome.cn/cmn/png/196/META-H8UK0IWU-9NNPJOLLD1MU95DE0NMA3-8W1EZW2M-2B1.png"
+          ></Image>
+        </View>
+      </Popup>
     </PageCustom>
   );
 }

+ 13 - 13
src/pages/editor-pages/editor-mini-program/index.tsx

@@ -6,12 +6,12 @@ import NavBarNormal from "@/components/NavBarNormal/index";
 import WemetaInput from "@/components/wemeta-input/index";
 import Popup from "@/components/popup/popup";
 import style from './index.module.less'
-import editorStyle from "../editor.module.less";
 import BottomBar from "@/components/BottomBar";
 
 import { useComponentStore } from "@/store/componentStore";
 import { uploadImage } from "@/utils/http";
 import { EComponentType } from "@/consts/enum";
+import ButtonMain from "@/components/buttons/ButtonMain";
 export default function Index() {
   
   let currentComponent = useComponentStore((state)=>  state.currentComponent);
@@ -139,10 +139,10 @@ export default function Index() {
       <NavBarNormal>小程序链接</NavBarNormal>
       <View className="flex flex-col items-center w-full">
         <View className="px-16 pt-12 pb-120 w-full">
-        <View className={editorStyle.formContainer}>
-            <View className={editorStyle.formItem}>
-              <View className={editorStyle.formItemLabel}>
-                <View className="flex-1">小程序名称</View>
+        <View className="flex flex-col gap-32">
+            <View className="flex flex-col gap-6">
+              <View className="flex w-full items-center">
+                <View className="flex-1 text-14 leading-28 font-medium">小程序名称</View>
               </View>
               <WemetaInput
                 value={linkValue.name}
@@ -151,10 +151,10 @@ export default function Index() {
                 maxlength={50}
               />
             </View>
-            <View className={editorStyle.formItem}>
-              <View className={editorStyle.formItemLabel}>
-                <View className="flex-1">小程序链接</View>
-                <View className="text-green" onClick={()=> setShow(true)}>
+            <View className="flex flex-col gap-6">
+              <View className="flex w-full items-center">
+                <View className="flex-1 text-14 leading-28 font-medium">小程序链接<Text className="text-red">*</Text></View>
+                <View className="text-primary" onClick={()=> setShow(true)}>
                   如何获取?
                 </View>
               </View>
@@ -165,9 +165,9 @@ export default function Index() {
               />
             </View>
 
-            <View className={editorStyle.formItem}>
-              <View className={editorStyle.formItemLabel}>
-                <View className="flex-1">封面图 <Text className="text-gray-45">(选填)</Text></View>
+            <View className="flex flex-col gap-6">
+              <View className="flex text-14 leading-28 font-medium">
+                <View className="flex-1">封面图</View>
               </View>
               <View className={`${style.coverContainer}`} onClick={handleAddPoster}>
                 {RenderPosterCached}
@@ -179,7 +179,7 @@ export default function Index() {
       </View>
 
       <BottomBar>
-          <View className="button-rounded button-primary flex-1" onClick={handleSubmit}>保存</View>
+          <ButtonMain className="flex-1" disabled={!linkValue.shortLink.length} onClick={handleSubmit}>保存</ButtonMain>
         </BottomBar>
 
       <Popup

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

@@ -191,8 +191,8 @@ export default function Index() {
                       <View className="flex-center  h-28">
                         <IconA />
                       </View>
-                      <View className="flex-1 text-12 leading-20 text-gray-45 truncate">
-                        <View className="truncate">{item.answer}</View>
+                      <View className={`flex-1 text-12 leading-20 text-gray-45 ${!isEnt ? 'truncate': ''}`}>
+                        <View className={`${!isEnt ? 'truncate': ''}`}>{item.answer}</View>
 
                         {!!item.links.length && (
                           <View className="pb-12">

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

@@ -154,7 +154,9 @@ export default function Profile() {
       }}>前往访问</View>
     }
     // 下线了
-    return <View className="button-rounded-big">知道了</View>
+    return <View className="button-rounded-big" onClick={()=> {
+      Taro.navigateBack()
+    }}>知道了</View>
   }
 
    // 如果智能体被删除或其它异常情况