Bläddra i källkod

build: 删除原项目未用资源

王晓东 3 veckor sedan
förälder
incheckning
819190e78a

+ 0 - 7
src/components/icon/icon-building/index.tsx

@@ -1,7 +0,0 @@
-import { Image } from '@tarojs/components'
-import Icon from '@/images/component-icons/building.svg'
-export default () => {
-  return (
-    <Image src={Icon} mode="widthFix" style={{width: '12px', height: '12px'}}></Image>
-  )
-}

+ 0 - 7
src/components/icon/icon-email/index.tsx

@@ -1,7 +0,0 @@
-import { Image } from '@tarojs/components'
-import Icon from '@/images/component-icons/mail.svg'
-export default () => {
-  return (
-    <Image src={Icon} mode="widthFix" style={{width: '14px', height: '11px'}}></Image>
-  )
-}

+ 0 - 7
src/components/icon/icon-group/index.tsx

@@ -1,7 +0,0 @@
-import { Image } from '@tarojs/components'
-import Icon from '@/images/component-icons/group.svg'
-export default () => {
-  return (
-    <Image src={Icon} mode="widthFix" style={{width: '12px', height: '12px'}}></Image>
-  )
-}

+ 0 - 3
src/images/component-icons/bag.svg

@@ -1,3 +0,0 @@
-<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M8.6 1.4V3H3.4V1.4H8.6ZM2 1.4V3H0V12H12V3H10V1.4V0H8.6H3.4H2V1.4ZM4 6.7V5.3H8V6.7H4Z" fill="black"/>
-</svg>

+ 0 - 3
src/images/component-icons/building.svg

@@ -1,3 +0,0 @@
-<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M8 0H0V12H5H6.4H8H10.6H12V10.6V6L8 3.71429V0ZM8 10.6V5.32674L10.6 6.81245V10.6H8ZM6 4.7H2V3.3H6V4.7ZM2 8.7V7.3H6V8.7H2Z" fill="black"/>
-</svg>

+ 0 - 3
src/images/component-icons/group.svg

@@ -1,3 +0,0 @@
-<svg width="14" height="12" viewBox="0 0 14 12" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M4 0H10V4H7.7V5.3H11H11.7V6V8H14V12H8V8H10.3V6.7H7.7H7H6.3H3.7V8H6V12H0V8H2.3V6V5.3H3H6.3V4H4V0Z" fill="black"/>
-</svg>

BIN
src/images/icon-24-vip.png


BIN
src/images/icon-dir-24.png


BIN
src/images/icon-edit-outline.png


BIN
src/images/icon-eye-24.png


BIN
src/images/icon-pause-12.png


BIN
src/images/icon-people.png


BIN
src/images/icon-play-12.png


BIN
src/images/icon-share.png


BIN
src/images/icon-talk-24.png


BIN
src/images/icon-voice-18.png


BIN
src/images/icon_20_edit.png


BIN
src/images/icon_40_photo.png


+ 0 - 65
src/pages/voice/components/MyVoiceList/components/index.module.less

@@ -1,65 +0,0 @@
-.container{
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  flex-direction: column;
-  gap: 4px; 
-}
-.containerInner{
-  padding: 12px 0;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  flex-direction: column;
-  gap: 14px; 
-}
-.add{
-  font-size: 24px;
-  width: 24px;
-  height: 24px;
-  color: rgba(#000, .45);
-}
-.cloneTips{
-  color: rgba(0, 0, 0, 0.45);
-  text-align: center;
-  font-size: 14px;
-  font-style: normal;
-  font-weight: 400;
-  line-height: 24px;
-}
-
-.cloningTips{
-  .cloneTips();
-  color: #000;
-}
-.cloningIcon{
-  width: 48px;
-  height: 48px;
-}
-
-.button{
-  display: flex;
-  padding: 6px 12px;
-  justify-content: center;
-  align-items: center;
-  border-radius: 8px;
-  background: var(--color-primary);
-}
-.playButton{
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  background-color: var(--color-primary);
-  width: 32px;
-  height: 32px;
-  border-radius: 100%;
-}
-
-.voiceWave{
-  width: 232px;
-  height: 16px;
-}
-.icon{
-  width: 12px;
-  height: 12px;
-}

+ 0 - 198
src/pages/voice/components/MyVoiceList/components/index.tsx

@@ -1,198 +0,0 @@
-import IconPause12 from "@/images/icon-pause-12.png";
-import IconPlay12 from "@/images/icon-play-12.png";
-import VoiceWave from "@/images/voice-wave.png";
-import { voiceTryout } from "@/service/audio";
-import { useBase64AudioPlayer } from "@/utils/audioBase64";
-import { Image, Text, View } from "@tarojs/components";
-import Taro, { useUnload } from "@tarojs/taro";
-import { useState } from "react";
-import style from "./index.module.less";
-import PopupRecorder from "./popup-recorder/index";
-
-interface Props {
-  onCloneEnd?: (voice: string) => void;
-  status: number;
-  voice?: string;
-  profileId: string;
-  setStatus: (status: number) => void;
-}
-
-export default ({ onCloneEnd, status, setStatus, voice, profileId }: Props) => {
-  const [show, setShow] = useState(false);
-  const [recording, setRecording] = useState(false);
-  const [playing, setPlaying] = useState(false);
-  const { playAudio, stopAudio, onEnded } = useBase64AudioPlayer();
-
-  const handleCloneStatus = (r: number) => {
-    console.log(r);
-    if (r === 1) {
-      setRecording(true);
-    } else if (r === 2) {
-      setStatus(1);
-    } else {
-      setRecording(false);
-    }
-  };
-
-  // 声音录制完成
-  const onRecordEnd = (r: string) => {
-    console.log("onRecordEnd:", r);
-    if (r) {
-      onCloneEnd && onCloneEnd(r);
-      setStatus(2);
-    } else {
-      Taro.showModal({
-        title: "克隆失败",
-        content: "请检查网络后重试",
-        showCancel: false,
-      });
-      setStatus(0);
-    }
-  };
-  // 播放完毕
-  onEnded(() => {
-    setPlaying(false);
-  });
-
-  // 播放或重新播放
-  const playVoice = async () => {
-    stopAudio();
-    console.log(voice);
-    if (voice && !playing) {
-      setPlaying(true);
-      Taro.showLoading();
-      const res = await voiceTryout(voice);
-      Taro.hideLoading();
-      if (res?.data?.audio) {
-        playAudio(res.data.audio);
-      }
-    } else {
-      setPlaying(false);
-    }
-  };
-
-  const nav2SystemVoice = () => {
-    Taro.navigateTo({
-      url: `/pages/system-voice/index?profileId=${profileId}`,
-    });
-  };
-
-  useUnload(() => {
-    stopAudio();
-  });
-
-  const renderPlayIcon = () => {
-    return playing ? (
-      <Image src={IconPause12} mode='widthFix' className={style.icon} />
-    ) : (
-      <Image src={IconPlay12} mode='widthFix' className={style.icon} />
-    );
-  };
-
-  const renderSystemVoice = () => {
-    return (
-      <View className=''>
-        <View
-          className='text-12 leading-24'
-          style='color: rgba(64, 64, 64, 0.65);'
-        >
-          超出时长后,将自动切换成{" "}
-          <Text className='primary-color-dark' onClick={nav2SystemVoice}>
-            系统声音
-          </Text>{" "}
-          进行对话,升级可获得更多时长
-        </View>
-      </View>
-    );
-  };
-
-  const renderCloneBox = () => {
-    if (status === 0) {
-      return (
-        <View className={style.containerInner} onClick={() => setShow(true)}>
-          <View className={`iconfont icon-icon_20_add ${style.add}`}></View>
-          <View className={style.cloneTips}>
-            克隆你的声音,用真实声音和他人对话
-          </View>
-          {/* {renderSystemVoice()} */}
-        </View>
-      );
-    }
-    if (status === 1) {
-      return (
-        <View className={style.containerInner}>
-
-          <View className={style.cloningTips}>克隆中,请稍候</View>
-        </View>
-      );
-    }
-    if (status === 2) {
-      return (
-        <View className={`${style.containerInner} w-full`}>
-          <View className='flex items-center gap-6 w-full p-4'>
-            <View className='flex-1 flex flex-col gap-6'>
-              <View className='text-14 leading-22 text-black font-medium'>
-                用你的声音和他人对话
-              </View>
-              <View className='text-harsh font-semibold text-14 leading-22'>
-                10 分钟/每天
-              </View>
-            </View>
-            <View className={style.button} onClick={() => {}}>
-              升级时长
-            </View>
-          </View>
-          <View
-            className='px-20 py-12 bg-white items-center flex gap-16 w-full rounded-8'
-            onClick={playVoice}
-          >
-            <View className={style.playButton}>{renderPlayIcon()}</View>
-            <Image
-              src={VoiceWave}
-              mode='widthFix'
-              className={style.voiceWave}
-            ></Image>
-          </View>
-          {renderSystemVoice()}
-        </View>
-      );
-    }
-    if (status === 3) {
-      return (
-        <View className={`${style.containerInner} w-full`}>
-          <View className='flex items-center gap-6 w-full p-4'>
-            <View className='flex-1 flex flex-col gap-6'>
-              <View className='text-harsh font-semibold text-14 leading-22'>
-                克隆失败
-              </View>
-            </View>
-            <View className={style.button} onClick={() => {}}>
-              重新克隆
-            </View>
-          </View>
-
-          {renderSystemVoice()}
-        </View>
-      );
-    }
-  };
-
-  return (
-    <View className={style.container}>
-      {renderCloneBox()}
-      {process.env.TARO_ENV == "h5" ? (
-        <>
-          <div> 待实现</div>
-        </>
-      ) : (
-        <PopupRecorder
-          recording={recording}
-          onRecordEnd={onRecordEnd}
-          setCloneStatus={(r) => handleCloneStatus(r)}
-          show={show}
-          setShow={(s) => setShow(s)}
-        ></PopupRecorder>
-      )}
-    </View>
-  );
-};

+ 0 - 67
src/pages/voice/components/MyVoiceList/components/popup-tryout/index.module.less

@@ -1,67 +0,0 @@
-.container {
-  padding: 32px 16px 48px;
-  height: 100%;
-  background-color: white;
-}
-.content {
-  display: flex;
-  flex-direction: column;
-  height: 100%;
-  align-items: center;
-}
-.title {
-  color: #000;
-  text-align: center;
-  font-size: 24px;
-  font-style: normal;
-  font-weight: 500;
-  line-height: 32px; /* 133.333% */
-}
-.desc {
-  color: var(---45, rgba(0, 0, 0, 0.45));
-  text-align: center;
-  text-overflow: ellipsis;
-  font-size: 12px;
-  font-style: normal;
-  font-weight: 400;
-  line-height: 20px; /* 166.667% */
-  margin-top: 8px;
-}
-.iconBg {
-  border-radius: 24px;
-  background: rgba(231, 254, 85, 0.3);
-  width: 120px;
-  height: 120px;
-  margin-top: 36px;
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  justify-content: center;
-  .icon {
-    height: 40px;
-    width: 40px;
-  }
-}
-
-.button {
-  height: 54px;
-  border-radius: 100px;
-
-  text-align: center;
-  font-size: 15px;
-  font-weight: 500;
-  line-height: 54px; /* 160% */
-  letter-spacing: 1.5px;
-}
-.actionButton {
-  &:extend(.button);
-  background: #cbf706;
-  color: #000;
-  margin-bottom: 8px;
-}
-
-.recloneButton {
-  &:extend(.button);
-  background: #f5f5f2;
-  color: #000;
-}

+ 0 - 94
src/pages/voice/components/MyVoiceList/components/popup-tryout/index.tsx

@@ -1,94 +0,0 @@
-import IconPause from "@/images/svgs/icon_pause.svg";
-import IconPlay from "@/images/svgs/icon_play.svg";
-import { voiceTryout } from "@/service/audio";
-import { useBase64AudioPlayer } from "@/utils/audioBase64";
-import { Image, View } from "@tarojs/components";
-import { useEffect, useState } from "react";
-import { axios } from "taro-axios";
-import popupStyle from "./index.module.less";
-
-interface Props {
-  voiceName: string;
-  showName: string;
-  show: boolean;
-  onSure: () => void;
-  onReclone: () => void;
-}
-
-export default ({ voiceName, showName, onSure, show, onReclone }: Props) => {
-  const { playAudio, stopAudio, onEnded } = useBase64AudioPlayer();
-  const [playing, setPlaying] = useState(false);
-  let cancelTokenSource = axios.CancelToken.source();
-  const playVoice = async (voice: string) => {
-    // 在发起请求前取消之前的请求
-    cancelTokenSource.cancel("Previous request canceled");
-    stopAudio();
-    try {
-      // 重新创建一个新的取消令牌源
-      cancelTokenSource = axios.CancelToken.source();
-
-      const res = await voiceTryout(voice, {
-        cancelToken: cancelTokenSource.token,
-      });
-
-      if (res?.data?.audio) {
-        playAudio(res.data.audio);
-        setPlaying(true);
-      }
-    } catch (e) {
-      setPlaying(false);
-    }
-  };
-  useEffect(() => {
-    if (show) {
-      console.log("voiceName tryOut >>", voiceName);
-      playVoice(voiceName);
-    }
-    return () => {
-      stopAudio();
-    };
-  }, [show, voiceName]);
-  onEnded(() => {
-    setPlaying(false);
-  });
-
-  return (
-    <View className={popupStyle.container}>
-      <View className={popupStyle.content}>
-        <View className={popupStyle.title}>{showName}</View>
-        <View className={popupStyle.desc}>
-          克隆数量有限,确认后将占用一个额度
-        </View>
-        <View
-          className={popupStyle.iconBg}
-          onClick={() => {
-            playVoice(voiceName);
-          }}
-        >
-          <Image
-            src={playing ? IconPlay : IconPause}
-            className={popupStyle.icon}
-          ></Image>
-        </View>
-        <View className="flex flex-col w-full mt-48">
-          <View
-            className={popupStyle.actionButton}
-            onClick={() => {
-              onSure();
-            }}
-          >
-            确认使用
-          </View>
-          <View
-            className={popupStyle.recloneButton}
-            onClick={() => {
-              onReclone();
-            }}
-          >
-            重新克隆
-          </View>
-        </View>
-      </View>
-    </View>
-  );
-};

+ 1 - 1
src/pages/voice/components/MyVoiceList/index.tsx

@@ -228,7 +228,7 @@ export default ({ onPlay, agent }: Props) => {
     //
     const voices = cloning ? [cloning, ...myVoices] : myVoices;
     if (!voices.length) {
-      return <EmptyData></EmptyData>;
+      return <EmptyData type={2}></EmptyData>;
     }
     return (
       <View className="px-16 flex flex-col w-full">