Jelajahi Sumber

fix: 裁剪头像完成后显示裁剪完的头像

王晓东 1 bulan lalu
induk
melakukan
62432828be

+ 2 - 2
src/components/AvatarConfirm/index.tsx

@@ -72,7 +72,7 @@ export default function Index({ avatarItem, enabledChatBg, setEnabledChatBg, onC
             <Image
               mode='aspectFill'
               className={style.confirmRoundedAvatar}
-              src={avatarItem?.avatarLogo}
+              src={avatarData?.avatarLogo}
             ></Image>
             <View className={style.cropButton} onClick={handleCrop}>
               <IconCrop />
@@ -80,7 +80,7 @@ export default function Index({ avatarItem, enabledChatBg, setEnabledChatBg, onC
           </View>
           <View className={style.confirmChatAvatarBg}>
             <View className={style.confirmChatAvatarImage}>
-              <AvatarMedia roundedFull={false} source={avatarItem?.avatarUrl} className={style.confirmChatAvatarImage} />
+              <AvatarMedia roundedFull={false} source={avatarData?.avatarUrl} className={style.confirmChatAvatarImage} />
               {!avatarItem.isOriginal && <View className={style.aiTips}>图片由AI生成</View>}
               {/* <Image
                 mode="widthFix"

+ 2 - 2
src/pages/agent-avatar-confirm/index.tsx

@@ -30,7 +30,7 @@ export default function Index({ avatarItem }: IProps) {
           saveAgent()
           Taro.showToast({title: '形象设置成功', icon: 'success'})
           setTimeout(()=> {
-            Taro.navigateBack()
+            Taro.navigateBack({delta:2})
           }, 2000)
         })
         return
@@ -38,7 +38,7 @@ export default function Index({ avatarItem }: IProps) {
       // 如果是新建智能体,只是暂时设置并不更新至服务器
       Taro.showToast({title: '形象设置成功', icon: 'success'})
       setTimeout(()=> {
-        Taro.navigateBack()
+        Taro.navigateBack({delta:2})
       }, 2000)
     }
 

+ 2 - 43
src/pages/agent-gen/components/step/StepConfirm.tsx

@@ -1,4 +1,3 @@
-import { View, Image } from "@tarojs/components";
 import React, { useState } from "react";
 import Taro, { nextTick } from "@tarojs/taro";
 import { TAvatarItem } from "@/service/storage";
@@ -23,7 +22,7 @@ export default React.memo(function Index({prev, pickedAvatar}:IProps) {
           saveAgent()
           Taro.showToast({title: '形象设置成功', icon: 'success'})
           setTimeout(()=> {
-            Taro.navigateBack()
+            Taro.navigateBack({delta:2})
           }, 2000)
         })
         return
@@ -31,7 +30,7 @@ export default React.memo(function Index({prev, pickedAvatar}:IProps) {
       // 如果是新建智能体,只是暂时设置并不更新至服务器
       Taro.showToast({title: '形象设置成功', icon: 'success'})
       setTimeout(()=> {
-        Taro.navigateBack()
+        Taro.navigateBack({delta:2})
       }, 2000)
     }
 
@@ -61,44 +60,4 @@ export default React.memo(function Index({prev, pickedAvatar}:IProps) {
       onConfirm={handleConfirm} />}
   </>
   )
-  // return (
-  //   <View>
-  //     <View className={style.confirmContainer}>
-  //       <View className={style.confirmRoundedAvatarWrap}>
-  //         <Image
-  //           mode='aspectFill'
-  //           className={style.confirmRoundedAvatar}
-  //           src={pickedAvatar?.avatarLogo}
-  //         ></Image>
-  //       </View>
-  //       <View className={style.confirmChatAvatarBg}>
-  //         <View className={style.confirmChatAvatarImage}>
-  //           <AvatarMedia roundedFull={false}  source={pickedAvatar?.avatarUrl} className={style.confirmChatAvatarImage} />
-  //           {!pickedAvatar.isOriginal && <View className={style.aiTips}>图片由AI生成</View> }
-  //           {/* <Image
-  //             mode="widthFix"
-  //             className="w-full"
-  //             src={pickedAvatar.avatarUrl}
-  //           ></Image> */}
-  //         </View>
-  //         <View className={style.confirmChatAvatarBgCover}>
-  //             <View className={style.block1}></View>
-  //             <View className={style.block2}></View>
-  //             <View className={style.block3}></View>
-  //         </View>
-  //       </View>
-  //       <View className="flex-center gap-8 text-14 font-medium leading-22 text-black" onClick={()=> setEnabledChatBg((prev)=> !prev)}>
-  //         <WemetaRadio checked={enabledChatBg} checkbox></WemetaRadio>
-  //         启用聊天背景
-  //       </View>
-  //     </View>
-
-  //     <View className="bottom-bar">
-  //       <View className="grid grid-cols-2 gap-8 px-20 py-12">
-  //         <View className={`button-rounded`} onClick={prev}>更换形象</View>
-  //         <WemetaButton className="flex-1" onClick={handleConfirm}>确定</WemetaButton>
-  //       </View>
-  //     </View>
-  //   </View>
-  // );
 });

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

@@ -27,7 +27,7 @@ const Index = ({data, deleteable, className, refresh, fromContact}: Props)=> {
       });
     }
   }
-  
+
   const handleAvatarClick = (e:any)=>{
     e.stopPropagation();
     Taro.navigateTo({
@@ -44,10 +44,10 @@ const Index = ({data, deleteable, className, refresh, fromContact}: Props)=> {
       {hasPosition && <View className='truncate'>{data.position}</View>}
       {data.isEnt && <View className={style.certificationContainer}><IconCertificateColor></IconCertificateColor></View>}
     </View>
-    
+
   }
-  
-  
+
+
   return (
     <View className={`${style.contactCard} ${className}`} onClick={()=>{handleClick(data)}}>
       <View className={style.avatarContainer} onClick={handleAvatarClick}>
@@ -67,4 +67,4 @@ const Index = ({data, deleteable, className, refresh, fromContact}: Props)=> {
   )
 }
 
-export default Index
+export default Index

+ 1 - 1
src/pages/dashboard/components/DataCard/index.tsx

@@ -20,7 +20,7 @@ export default function Index({
   };
   return (
     <View
-      className="flex p-12 rounded-8 bg-gray-3 text-black"
+      className="flex p-12 rounded-8 bg-gray-1 text-black"
       onClick={handleClick}
     >
       <View className="flex-1">

+ 2 - 2
src/pages/knowledge/components/CompanyList/index.tsx

@@ -86,7 +86,7 @@ const Index = ({ currentEnt, setCurrentEnt, extraEnt = [] }: IProps) => {
   return (
     <>
       <View
-        className="flex items-center gap-2 bg-gray-3 rounded-12 p-12 mb-16"
+        className="flex items-center gap-2 bg-gray-1 rounded-12 p-12 mb-16"
         onClick={() => setShowPicker(true)}
       >
         <View className="flex-1 text-14 leading-22 text-gray-4">
@@ -101,7 +101,7 @@ const Index = ({ currentEnt, setCurrentEnt, extraEnt = [] }: IProps) => {
           {options.map((item) => {
             return (
               <View
-                className="flex items-center rounded-8 bg-gray-3 px-16 py-20"
+                className="flex items-center rounded-8 bg-gray-1 px-16 py-20"
                 onClick={() => handleChange(item)}
               >
                 <View className="flex-1 text-black font-medium text-14 leading-22 font-pingfangSCMedium">