|
@@ -1,55 +1,92 @@
|
|
|
-
|
|
|
|
|
|
|
+import { useState } from 'react'
|
|
|
|
|
+import Taro from '@tarojs/taro'
|
|
|
import { Image, View } from '@tarojs/components'
|
|
import { Image, View } from '@tarojs/components'
|
|
|
-
|
|
|
|
|
-import TagCertificated from "@/components/tag-certificated";
|
|
|
|
|
import IconCertificateColor from "@/components/icon/icon-certificate-color";
|
|
import IconCertificateColor from "@/components/icon/icon-certificate-color";
|
|
|
import { TAgentDetail } from '@/types/agent';
|
|
import { TAgentDetail } from '@/types/agent';
|
|
|
import { AvatarMedia } from '@/components/AvatarMedia';
|
|
import { AvatarMedia } from '@/components/AvatarMedia';
|
|
|
|
|
+import IconMicOutline from '@/components/icon/IconMicOutline';
|
|
|
|
|
+import IconArrowRightGray from '@/components/icon/IconArrowRightGray';
|
|
|
|
|
+import IconClean from '@/components/icon/IconClean';
|
|
|
|
|
+import IconArrowVerticalFilled from '@/components/icon/IconArrowVerticalFilled';
|
|
|
|
|
+import { useTextChat } from '@/store/textChatStore';
|
|
|
interface IProps {
|
|
interface IProps {
|
|
|
agent: TAgentDetail|null
|
|
agent: TAgentDetail|null
|
|
|
haveBg: boolean
|
|
haveBg: boolean
|
|
|
|
|
+ onClear: ()=>void
|
|
|
}
|
|
}
|
|
|
-export default ({haveBg, agent}:IProps) => {
|
|
|
|
|
|
|
+export default ({haveBg, agent, onClear}:IProps) => {
|
|
|
const nameStyle = haveBg ? 'text-white' : 'text-black'
|
|
const nameStyle = haveBg ? 'text-white' : 'text-black'
|
|
|
const entStyle = haveBg ? 'text-white' : 'text-black-45'
|
|
const entStyle = haveBg ? 'text-white' : 'text-black-45'
|
|
|
|
|
+ const [show, setShow] = useState(false)
|
|
|
|
|
+ const { setIsNewChat } = useTextChat()
|
|
|
|
|
+
|
|
|
|
|
+ const handleClick = (e:any) => {
|
|
|
|
|
+ e.stopPropagation()
|
|
|
|
|
+ setShow(!show)
|
|
|
|
|
+ }
|
|
|
|
|
+ const handleClean = (e:any) => {
|
|
|
|
|
+ // e.stopPropagation()
|
|
|
|
|
+ console.log('clean')
|
|
|
|
|
+ setIsNewChat(true)
|
|
|
|
|
+ onClear()
|
|
|
|
|
+ }
|
|
|
|
|
+ const handleVoiceChoose = (e:any) => {
|
|
|
|
|
+ Taro.navigateTo({
|
|
|
|
|
+ url: '/pages/voice/index'
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log('handleVoiceChoose')
|
|
|
|
|
+ }
|
|
|
const renderContent = () => {
|
|
const renderContent = () => {
|
|
|
return <>
|
|
return <>
|
|
|
- <View className="rounded-full overflow-hidden w-36 h-36 shrink-0">
|
|
|
|
|
- <AvatarMedia source={agent?.avatarLogo || ''} className='w-36 h-36'></AvatarMedia>
|
|
|
|
|
- </View>
|
|
|
|
|
- <View className="flex flex-col flex-1 gap-6">
|
|
|
|
|
- <View className="flex items-center gap-4">
|
|
|
|
|
- <View className={`text-14 font-medium leading-14 ${nameStyle}`}>{agent?.name}</View>
|
|
|
|
|
- {agent?.isEnt && <View className="text-12 leading-12"><IconCertificateColor/></View>}
|
|
|
|
|
|
|
+ <View className='flex items-center' onClick={handleClick}>
|
|
|
|
|
+ <View className='flex-1 flex items-center mr-16'>
|
|
|
|
|
+ <View className="rounded-full overflow-hidden w-36 h-36 shrink-0 mr-8">
|
|
|
|
|
+ <AvatarMedia source={agent?.avatarLogo || ''} className='w-36 h-36'></AvatarMedia>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ <View className="flex flex-col flex-1 gap-6">
|
|
|
|
|
+ <View className="flex items-center gap-4">
|
|
|
|
|
+ <View className={`text-14 font-medium leading-14 ${nameStyle}`}>{agent?.name}</View>
|
|
|
|
|
+ {agent?.isEnt && <View className="text-12 leading-12"><IconCertificateColor/></View>}
|
|
|
|
|
+ </View>
|
|
|
|
|
+ {agent?.entName && <View className="flex items-center gap-2">
|
|
|
|
|
+ <View className={`text-12 leading-12 truncate max-w-[180px] ${entStyle}`}>
|
|
|
|
|
+ {agent?.entName}
|
|
|
|
|
+ </View>
|
|
|
|
|
+ </View>}
|
|
|
</View>
|
|
</View>
|
|
|
- {agent?.entName && <View className="flex items-center gap-2">
|
|
|
|
|
- <View className={`text-12 leading-12 truncate max-w-[180px] ${entStyle}`}>
|
|
|
|
|
- {agent?.entName}
|
|
|
|
|
|
|
+ </View>
|
|
|
|
|
+ <View className='w-16 h-16'>
|
|
|
|
|
+ <View className='relative w-16 h-16'>
|
|
|
|
|
+ <View>
|
|
|
|
|
+ <IconArrowVerticalFilled color={ haveBg ? 'white' : 'gray' } rotation={show ? 0 : 180} />
|
|
|
</View>
|
|
</View>
|
|
|
- </View>}
|
|
|
|
|
|
|
+ {!!show && <View className="bubble-wrapper">
|
|
|
|
|
+ <View className="bubble flex flex-col gap-8">
|
|
|
|
|
+ <View className='bubble-arrow-wrap'>
|
|
|
|
|
+ <View className='bubble-arrow'></View>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ <View className='flex items-center gap-4' onClick={handleClean}>
|
|
|
|
|
+ <View className='w-16 h-16'>
|
|
|
|
|
+ <IconClean />
|
|
|
|
|
+ </View>
|
|
|
|
|
+ <View className='flex-1'>清除对话</View>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ <View className='h-1' style={{backgroundColor: 'rgba(17,17,17,.15)', width: '100%'}}></View>
|
|
|
|
|
+ <View className='flex items-center gap-4' onClick={handleVoiceChoose}>
|
|
|
|
|
+ <View className='w-16 h-16'><IconMicOutline/></View>
|
|
|
|
|
+ <View className='flex-1'>音色选择</View>
|
|
|
|
|
+ <View className='w-16 h-16'><IconArrowRightGray/></View>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ </View>}
|
|
|
|
|
+ </View>
|
|
|
</View>
|
|
</View>
|
|
|
|
|
+ </View>
|
|
|
</>
|
|
</>
|
|
|
- // return <>
|
|
|
|
|
- // <View className="rounded-full overflow-hidden w-60 h-60">
|
|
|
|
|
- // <AvatarMedia source={agent?.avatarLogo || ''} className='w-60 h-60'></AvatarMedia>
|
|
|
|
|
- // </View>
|
|
|
|
|
- // <View className="flex flex-col flex-1">
|
|
|
|
|
- // <View className="flex items-end gap-8">
|
|
|
|
|
- // <View className="text-24 font-medium leading-32">{agent?.name}</View>
|
|
|
|
|
- // <View className="text-12 leading-20">{agent?.position}</View>
|
|
|
|
|
- // </View>
|
|
|
|
|
- // <View className="flex items-center gap-2">
|
|
|
|
|
- // <View className="text-12 leading-20 truncate max-w-[188px]">
|
|
|
|
|
- // {agent?.entName}
|
|
|
|
|
- // </View>
|
|
|
|
|
- // {agent?.isEnt && <TagCertificated />}
|
|
|
|
|
- // </View>
|
|
|
|
|
- // </View>
|
|
|
|
|
- // </>
|
|
|
|
|
}
|
|
}
|
|
|
return (
|
|
return (
|
|
|
<View className="flex items-center gap-8">
|
|
<View className="flex items-center gap-8">
|
|
|
{renderContent()}
|
|
{renderContent()}
|
|
|
</View>
|
|
</View>
|
|
|
)
|
|
)
|
|
|
-}
|
|
|
|
|
|
|
+}
|