|
@@ -1,6 +1,6 @@
|
|
|
<script setup lang="ts">
|
|
|
import dataList from "@/data/data";
|
|
|
-import { useStore } from "@/store/index";
|
|
|
+import { Exhibition, Paragraph, Part, useStore } from "@/store/index";
|
|
|
import { showToast } from "vant";
|
|
|
import AudioBoxVue from "@/components/AudioBox.vue";
|
|
|
|
|
@@ -23,11 +23,11 @@ const goBack = () => {
|
|
|
// 上一个
|
|
|
const prev = () => {
|
|
|
// 当前段落下标
|
|
|
- let indexPP = store.currentPart.paragraphs.findIndex((item: any) => {
|
|
|
+ let indexPP = store.currentPart.paragraphs.findIndex((item: Paragraph) => {
|
|
|
return item.paragraphName == currentP.value.paragraphName;
|
|
|
});
|
|
|
// 当前Part的下标
|
|
|
- let indexP = store.currentScene.parts.findIndex((item: any) => {
|
|
|
+ let indexP = store.currentScene.parts.findIndex((item: Part) => {
|
|
|
return item.partName == store.currentPart.partName;
|
|
|
});
|
|
|
//console.log(indexPP, indexP);
|
|
@@ -53,11 +53,11 @@ const prev = () => {
|
|
|
// 下一个
|
|
|
const next = () => {
|
|
|
// 当前段落下标
|
|
|
- let indexPP = store.currentPart.paragraphs.findIndex((item: any) => {
|
|
|
+ let indexPP = store.currentPart.paragraphs.findIndex((item: Paragraph) => {
|
|
|
return item.paragraphName == currentP.value.paragraphName;
|
|
|
});
|
|
|
// 当前Part的下标
|
|
|
- let indexP = store.currentScene.parts.findIndex((item: any) => {
|
|
|
+ let indexP = store.currentScene.parts.findIndex((item: Part) => {
|
|
|
return item.partName == store.currentPart.partName;
|
|
|
});
|
|
|
//console.log(indexPP, indexP);
|
|
@@ -87,7 +87,7 @@ const next = () => {
|
|
|
};
|
|
|
|
|
|
const audiobox = ref(null);
|
|
|
-watch(currentP, (newValue: any) => {
|
|
|
+watch(currentP, () => {
|
|
|
console.log(audiobox.value);
|
|
|
if (audiobox.value == null) {
|
|
|
return;
|
|
@@ -102,15 +102,15 @@ onMounted(() => {
|
|
|
const pNumb = route.query.pNum;
|
|
|
console.log(route.query.sName, route.query.pNum);
|
|
|
if (sName != "" && pNumb) {
|
|
|
- const s = dataList.find((item: any) => {
|
|
|
+ const s = dataList.find((item: Exhibition) => {
|
|
|
// return item.name == sName;
|
|
|
return item.name.indexOf(sName) != -1 || sName.indexOf(item.name) != -1;
|
|
|
});
|
|
|
// console.log(dataList);
|
|
|
// console.log(s);
|
|
|
// 遍历所有的part
|
|
|
- s?.parts.forEach((item: any) => {
|
|
|
- const res = item.paragraphs.find((p: any) => {
|
|
|
+ s?.parts.forEach((item: Part) => {
|
|
|
+ const res = item.paragraphs.find((p: Paragraph) => {
|
|
|
return p.paragraphName.indexOf(pNumb) != -1;
|
|
|
});
|
|
|
if (res) {
|
|
@@ -123,6 +123,8 @@ onMounted(() => {
|
|
|
}
|
|
|
currentP.value = store.currentParagraph;
|
|
|
});
|
|
|
+
|
|
|
+const htmlD = ref("<div>献给所有为了梦想狂奔的人</div><br />你好");
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -202,6 +204,12 @@ onMounted(() => {
|
|
|
font-weight: 500;
|
|
|
white-space: pre-wrap;
|
|
|
margin-top: 10px;
|
|
|
+
|
|
|
+ .html-box {
|
|
|
+ div {
|
|
|
+ text-indent: 2em;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|