فهرست منبع

feat: 聊天框滚动方式变更

王晓东 4 روز پیش
والد
کامیت
bfb6a32562
3فایلهای تغییر یافته به همراه21 افزوده شده و 13 حذف شده
  1. 7 0
      project.private.config.json
  2. 1 1
      src/pages/chat/components/RecommendQuestions/index.tsx
  3. 13 12
      src/pages/chat/index.tsx

+ 7 - 0
project.private.config.json

@@ -8,6 +8,13 @@
   "condition": {
     "miniprogram": {
       "list": [
+        {
+          "name": "pages/chat/index",
+          "pathName": "pages/chat/index",
+          "query": "agentId=p_8e726e825bagi5Ki-agent_3208&isVisitor=true",
+          "scene": null,
+          "launchMode": "default"
+        },
         {
           "name": "pages/profile/index",
           "pathName": "pages/profile/index",

+ 1 - 1
src/pages/chat/components/RecommendQuestions/index.tsx

@@ -26,7 +26,7 @@ export default function Index({ agent, enableOutputAudioStream, chatInputActions
 
   return (
     <ScrollView scrollX>
-      <View className="flex items-center gap-8 pl-18">
+      <View className="flex items-center gap-8 pl-18 scale-y-[-1]">
         {questions.map((q, index) => {
           if (index < questions.length - 1) {
             return (

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

@@ -157,17 +157,27 @@ export default function Index() {
             flex: 1,
             height: "1px", // 高度自适应
           }}
-          scrollTop={scrollTop}
+          // scrollTop={scrollTop}
           scrollWithAnimation
           onScrollToUpper={onScrollToUpper}
           onScrollToLower={handleScrollToLower}
+          className="scale-y-[-1]"
         >
+          <View className="pb-40 pt-8 scale-y-[-1]">
+            {agent && (
+              <RecommendQuestions
+                enableOutputAudioStream={streamVoiceEnable}
+                agent={agent}
+                chatInputActions={chatInputActions}
+              />
+            )}
+          </View>
           <View
             id="messageList"
-            className="flex flex-col gap-16 px-18"
+            className="flex flex-col gap-16 px-18 scale-y-[-1] min-h-full"
             onTouchMove={handleTouchMove}
           >
-            {isNewChat && <View className="text-white-70 text-12 leading-20 text-center pt-22">聊聊新话题</View>}
+            {isNewChat && <View className="text-white-70 text-12 leading-20 text-center pt-22  scale-y-[-1]">聊聊新话题</View>}
             {showWelcome && <ChatGreeting agent={agent} chatInputActions={chatInputActions} />}
             {groupedMessages.map((group, groupIndex) => {
               return (
@@ -200,15 +210,6 @@ export default function Index() {
               );
             })}
           </View>
-          <View className="pb-40 pt-8">
-            {agent && (
-              <RecommendQuestions
-                enableOutputAudioStream={streamVoiceEnable}
-                agent={agent}
-                chatInputActions={chatInputActions}
-              />
-            )}
-          </View>
         </ScrollView>
 
         <View