|
|
@@ -8,6 +8,7 @@ import useSWR from 'swr';
|
|
|
import Taro from "@tarojs/taro";
|
|
|
import { isSuccess } from "@/utils";
|
|
|
import WemetaButton from '@/components/buttons/WemetaButton'
|
|
|
+import ResultSwiper from "./ResultSwiper";
|
|
|
interface IProps {
|
|
|
prev: () => void;
|
|
|
next: () => void;
|
|
|
@@ -151,68 +152,68 @@ export default React.memo(function Index({ prev, next, taskId, avatars, videos,
|
|
|
}
|
|
|
|
|
|
|
|
|
- const onSwiperChange = (e: any) => {
|
|
|
- const i = e.detail.current;
|
|
|
- console.log(i)
|
|
|
- setCurrentSwiperIndex(i);
|
|
|
- };
|
|
|
+ // const onSwiperChange = (e: any) => {
|
|
|
+ // const i = e.detail.current;
|
|
|
+ // console.log(i)
|
|
|
+ // setCurrentSwiperIndex(i);
|
|
|
+ // };
|
|
|
|
|
|
- const renderSwipers = () => {
|
|
|
- const renderIndicator = (currentIndex: number) => {
|
|
|
- return (
|
|
|
- <>
|
|
|
- <View className={style.indicatorContainer}>
|
|
|
- {avatarsList.map((_item, index) => {
|
|
|
- return (
|
|
|
- <View
|
|
|
- key={index}
|
|
|
- className={
|
|
|
- index === currentIndex
|
|
|
- ? `${style.indicator} ${style.indicatorActive}`
|
|
|
- : style.indicator
|
|
|
- }
|
|
|
- ></View>
|
|
|
- );
|
|
|
- })}
|
|
|
- </View>
|
|
|
- </>
|
|
|
- );
|
|
|
- };
|
|
|
+ // const renderSwipers = () => {
|
|
|
+ // const renderIndicator = (currentIndex: number) => {
|
|
|
+ // return (
|
|
|
+ // <>
|
|
|
+ // <View className={style.indicatorContainer}>
|
|
|
+ // {avatarsList.map((_item, index) => {
|
|
|
+ // return (
|
|
|
+ // <View
|
|
|
+ // key={index}
|
|
|
+ // className={
|
|
|
+ // index === currentIndex
|
|
|
+ // ? `${style.indicator} ${style.indicatorActive}`
|
|
|
+ // : style.indicator
|
|
|
+ // }
|
|
|
+ // ></View>
|
|
|
+ // );
|
|
|
+ // })}
|
|
|
+ // </View>
|
|
|
+ // </>
|
|
|
+ // );
|
|
|
+ // };
|
|
|
|
|
|
- return (
|
|
|
- <View className={`${style.pickAvatarCard}`}>
|
|
|
- <Swiper
|
|
|
- className={style.mySwiper}
|
|
|
- indicatorColor="#999"
|
|
|
- indicatorActiveColor="#333"
|
|
|
- indicatorDots={false}
|
|
|
- duration={200}
|
|
|
- next-margin="-120rpx"
|
|
|
- current={currentSwiperIndex}
|
|
|
- onChange={(e) => onSwiperChange(e)}
|
|
|
- >
|
|
|
- {avatarsList.map(avatar => {
|
|
|
- return <SwiperItem>
|
|
|
- <View className={style.swiperItem}>
|
|
|
- <AvatarMedia roundedFull={false} source={avatar.avatarUrl} className="w-full h-full" />
|
|
|
- {/* <Image
|
|
|
- mode="widthFix"
|
|
|
- src={avatar.avatarUrl}
|
|
|
- ></Image> */}
|
|
|
- {avatar.isOriginal && <View className={style.pickAvatarOriginal}>
|
|
|
- <View>原图</View>
|
|
|
- </View> }
|
|
|
- {!avatar.isOriginal && <View className={style.aiTips}>图片由AI生成</View> }
|
|
|
+ // return (
|
|
|
+ // <View className={`${style.pickAvatarCard}`}>
|
|
|
+ // <Swiper
|
|
|
+ // className={style.mySwiper}
|
|
|
+ // indicatorColor="#999"
|
|
|
+ // indicatorActiveColor="#333"
|
|
|
+ // indicatorDots={false}
|
|
|
+ // duration={200}
|
|
|
+ // next-margin="-120rpx"
|
|
|
+ // current={currentSwiperIndex}
|
|
|
+ // onChange={(e) => onSwiperChange(e)}
|
|
|
+ // >
|
|
|
+ // {avatarsList.map(avatar => {
|
|
|
+ // return <SwiperItem>
|
|
|
+ // <View className={style.swiperItem}>
|
|
|
+ // <AvatarMedia roundedFull={false} source={avatar.avatarUrl} className="w-full h-full" />
|
|
|
+ // {/* <Image
|
|
|
+ // mode="widthFix"
|
|
|
+ // src={avatar.avatarUrl}
|
|
|
+ // ></Image> */}
|
|
|
+ // {avatar.isOriginal && <View className={style.pickAvatarOriginal}>
|
|
|
+ // <View>原图</View>
|
|
|
+ // </View> }
|
|
|
+ // {!avatar.isOriginal && <View className={style.aiTips}>图片由AI生成</View> }
|
|
|
|
|
|
- </View>
|
|
|
- </SwiperItem>
|
|
|
- })}
|
|
|
- </Swiper>
|
|
|
- {/* <!-- 自定义指示点容器 --> */}
|
|
|
- {renderIndicator(currentSwiperIndex)}
|
|
|
- </View>
|
|
|
- );
|
|
|
- };
|
|
|
+ // </View>
|
|
|
+ // </SwiperItem>
|
|
|
+ // })}
|
|
|
+ // </Swiper>
|
|
|
+ // {/* <!-- 自定义指示点容器 --> */}
|
|
|
+ // {renderIndicator(currentSwiperIndex)}
|
|
|
+ // </View>
|
|
|
+ // );
|
|
|
+ // };
|
|
|
|
|
|
// 生成中提示文本
|
|
|
const renderStatusText = () => {
|
|
|
@@ -249,7 +250,7 @@ export default React.memo(function Index({ prev, next, taskId, avatars, videos,
|
|
|
const renderContent = ()=> {
|
|
|
if((avatars.length && !videoGenerating) || (videos.length)){
|
|
|
|
|
|
- return renderSwipers()
|
|
|
+ return <ResultSwiper avatarsList={avatarsList} />
|
|
|
}
|
|
|
|
|
|
return <View className={`${style.pickAvatarCard} ${style.pickGenCard}`}>
|