|
@@ -9,6 +9,7 @@ import iconShiyi from "./image/icon-shiyi.png";
|
|
|
import iconhuifang from "./image/icon-huifang.png";
|
|
|
import { Icon, Popup } from "vant";
|
|
|
import TheVideo from "/src/components/the-video";
|
|
|
+import TheAudio from "/src/components/the-audio";
|
|
|
|
|
|
type IItemType = "intonation" | "cadence" | "integrity";
|
|
|
|
|
@@ -39,6 +40,15 @@ export default defineComponent({
|
|
|
// itemType.value = type;
|
|
|
};
|
|
|
|
|
|
+ // 资源类型
|
|
|
+ const mediaType = computed((): "audio" | "video" => {
|
|
|
+ const subfix = (scoreData.value.videoFilePath || "").split(".").pop();
|
|
|
+ if (subfix === "wav" || subfix === "mp3") {
|
|
|
+ return "audio";
|
|
|
+ }
|
|
|
+ return "video";
|
|
|
+ });
|
|
|
+
|
|
|
return () => (
|
|
|
<div class={styles.headerTop}>
|
|
|
<div class={styles.left}>
|
|
@@ -84,7 +94,7 @@ export default defineComponent({
|
|
|
</div> */}
|
|
|
</div>
|
|
|
<Popup class={["popup-custom", "van-scale", styles.popup]} transition="van-scale" v-model:show={showVideo.value} closeable>
|
|
|
- <TheVideo src={showVideo.value ? scoreData.value.videoFilePath : ''} />
|
|
|
+ {mediaType.value === 'video' ? <TheVideo src={showVideo.value ? scoreData.value.videoFilePath : ""} /> : <TheAudio src={showVideo.value ? scoreData.value.videoFilePath : ""} />}
|
|
|
</Popup>
|
|
|
</div>
|
|
|
);
|