|
@@ -29,8 +29,6 @@ import { getQuery } from "/src/utils/queryString";
|
|
|
import { browser } from "/src/utils";
|
|
|
import { usePageVisibility } from "@vant/use";
|
|
|
import { watch } from "vue";
|
|
|
-import { Vue3Lottie } from "vue3-lottie";
|
|
|
-import refesh_anim from "./refresh_anim.json";
|
|
|
import icon_loading_img from './image/icon_loading_img.png'
|
|
|
|
|
|
export default defineComponent({
|
|
@@ -77,6 +75,7 @@ export default defineComponent({
|
|
|
|
|
|
tnoteShow: false,
|
|
|
loadingSoundFonts: true,
|
|
|
+ loadingSoundProgress: 0,
|
|
|
|
|
|
huaweiPad: navigator?.userAgent?.includes('UAWEIVRD-W09') ? true : false
|
|
|
});
|
|
@@ -85,6 +84,12 @@ export default defineComponent({
|
|
|
subject: null as unknown as ITypeFingering,
|
|
|
fingeringInfo: subjectFingering(data.subject),
|
|
|
});
|
|
|
+
|
|
|
+ if (!props.isComponent){
|
|
|
+ if (fingerData.fingeringInfo.orientation === 0){
|
|
|
+ fingerData.fingeringInfo.orientation = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
const getNotes = () => {
|
|
|
const fignerData = FIGNER_INSTRUMENT_DATA[data.subject as keyof typeof FIGNER_INSTRUMENT_DATA];
|
|
@@ -114,12 +119,8 @@ export default defineComponent({
|
|
|
|
|
|
setTimeout(() => {
|
|
|
if (!props.isComponent){
|
|
|
- console.log(fingerData.fingeringInfo.orientation)
|
|
|
if (fingerData.fingeringInfo.orientation === 1){
|
|
|
api_setRequestedOrientation(fingerData.fingeringInfo.orientation);
|
|
|
- // fingerData.fingeringInfo.orientation = 1
|
|
|
- } else {
|
|
|
- fingerData.fingeringInfo.orientation = 1
|
|
|
}
|
|
|
}
|
|
|
}, 2000)
|
|
@@ -138,6 +139,7 @@ export default defineComponent({
|
|
|
const getSounFonts = async () => {
|
|
|
const pathname = /(192|localhost)/.test(location.origin) ? "/" : location.pathname;
|
|
|
data.loadingSoundFonts = true;
|
|
|
+ data.loadingSoundProgress = 0;
|
|
|
for (let i = 0; i < data.notes.length; i++) {
|
|
|
const note = data.notes[i];
|
|
|
// console.log("🚀 ~ note:", i);
|
|
@@ -145,10 +147,12 @@ export default defineComponent({
|
|
|
url += note.realName;
|
|
|
url += ".mp3";
|
|
|
data.soundFonts[note.realKey] = await createAudio(url);
|
|
|
+ data.loadingSoundProgress = Math.floor(((i + 1) / data.notes.length) * 100);
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
+ data.loadingSoundProgress = 100;
|
|
|
data.loadingSoundFonts = false;
|
|
|
- }, 300);
|
|
|
+ }, 500);
|
|
|
// console.log("🚀 ~ data.soundFonts:", data.soundFonts);
|
|
|
};
|
|
|
onBeforeMount(() => {
|
|
@@ -318,7 +322,7 @@ export default defineComponent({
|
|
|
<div class={styles.head}>
|
|
|
<div class={styles.left}>
|
|
|
<button
|
|
|
- class={[styles.backBtn, data.subject === "pan-flute" && styles.backRight]}
|
|
|
+ class={[styles.backBtn]}
|
|
|
onClick={() => handleBack()}
|
|
|
>
|
|
|
<img src={icons.icon_back} />
|
|
@@ -450,12 +454,8 @@ export default defineComponent({
|
|
|
<div class={styles.loading}>
|
|
|
<div class={styles.loadingWrap}>
|
|
|
<img class={styles.loadingIcon} src={icon_loading_img} />
|
|
|
- <Progress percentage={20} />
|
|
|
+ <Progress percentage={data.loadingSoundProgress} />
|
|
|
</div>
|
|
|
- <Vue3Lottie
|
|
|
- style={{ width: "100px", height: "100px" }}
|
|
|
- animationData={refesh_anim}
|
|
|
- ></Vue3Lottie>
|
|
|
</div>
|
|
|
)}
|
|
|
</div>
|