phongdt:page video

This commit is contained in:
Duong Truong Phong
2024-06-03 12:27:22 +07:00
parent 94ea03f189
commit 0bfbfa7711
19 changed files with 538 additions and 511 deletions
@@ -1,6 +1,9 @@
<script setup lang="ts">
import AudioPlayer from "~/organisms/audioPlayer/AudioPlayer.vue";
const { currentArticle } = storeToRefs(useArticleStore());
import Topic from "@/components/article/Topic.vue";
import Event from "@/components/article/Event.vue";
import Tag from "@/components/article/Tag.vue";
const getSrc = (htmlString: string) => {
const srcRegex = /src="([^"]+)"/;
@@ -19,6 +22,33 @@ const getSrc = (htmlString: string) => {
// handleError(error);
// }
// };
const store = reactive({
tag: useTagStore(),
topic: useTopicStore(),
event: useEventStore()
});
// const listTag = ref([]);
// const listTopic = ref([]);
// const listEvent = ref([])
// const getTagsAndTopicsAndEvents = async () => {
// if (!currentArticle) return;
// const fetchData = async (ids, fetchFn, list) => {
// if (!ids) return;
// const data = await Promise.all(ids.split(",").map(fetchFn));
// if (data.length > 0) list.value = data;
// };
// await Promise.all([
// fetchData(currentArticle.tagIds, store.tag.fetchById, listTag),
// fetchData(currentArticle.topicIds, store.topic.fetchById, listTopic),
// fetchData(currentArticle.eventIds, store.event.fetchById, listEvent)
// ]);
// };
// getTagsAndTopicsAndEvents();
const listArticle = ref([]);
const audioPlay = ref({});
const defaultClass = {
@@ -70,6 +100,9 @@ const defaultClass = {
</div>
<div class="col-span-11">
<AudioPlayer :src="getSrc(currentArticle?.detail)?.[1]" />
<!-- <Topic :topics="listTopic" />
<Event :events="listEvent" />
<Tag :tags="listTag" /> -->
</div>
</div>
</div>