|
@@ -1,4 +1,4 @@
|
|
|
-import { defineComponent, onMounted, watch, reactive, ref, nextTick } from "vue";
|
|
|
+import { defineComponent, onMounted, watch, reactive, ref, nextTick, computed } from "vue";
|
|
|
import styles from "./index.module.less";
|
|
|
import backImg from "./image/icon-back.png";
|
|
|
import titmeImg from "./image/modeTitle.png";
|
|
@@ -6,12 +6,11 @@ import nameImg from "./image/zt.png";
|
|
|
import lxMode from "./image/lxMode.json";
|
|
|
import glMode from "./image/glMode.json";
|
|
|
import pcMode from "./image/pcMode.json";
|
|
|
-// import lxImg from "./image/lxImg.png";
|
|
|
-// import glImg from "./image/glImg.png";
|
|
|
-// import pcImg from "./image/pcImg.png";
|
|
|
-import { headTopData } from "./index";
|
|
|
+import modeTitle from "./image/modeTitle.json";
|
|
|
+import modeVip from "./image/mode_vip.png";
|
|
|
+import modesVip from "./image/mode_svip.png";
|
|
|
+import { headTopData, checkMusicBuy } from "./index";
|
|
|
import { getQuery } from "/src/utils/queryString";
|
|
|
-import { storeData } from "/src/store";
|
|
|
import state from "/src/state";
|
|
|
import { studentQueryUserInfo } from "../api";
|
|
|
import { usePageVisibility } from "@vant/use";
|
|
@@ -21,6 +20,7 @@ import { Popup } from "vant";
|
|
|
import AbnormalPop from "/src/view/abnormal-pop";
|
|
|
import { smoothAnimationState } from "../view-detail/smoothAnimation";
|
|
|
import { browser } from "/src/utils";
|
|
|
+import { stat } from "fs";
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: "modeView",
|
|
@@ -28,6 +28,7 @@ export default defineComponent({
|
|
|
const modeImgDom1 = ref();
|
|
|
const modeImgDom2 = ref();
|
|
|
const modeImgDom3 = ref();
|
|
|
+ const modeImgDom4 = ref();
|
|
|
watch(
|
|
|
() => headTopData.modeType,
|
|
|
(value, oldValue) => {
|
|
@@ -38,10 +39,12 @@ export default defineComponent({
|
|
|
modeImgDom1.value?.pause();
|
|
|
modeImgDom2.value?.pause();
|
|
|
modeImgDom3.value?.pause();
|
|
|
+ modeImgDom4.value?.stop();
|
|
|
} else if (value === "init") {
|
|
|
modeImgDom1.value?.play();
|
|
|
modeImgDom2.value?.play();
|
|
|
modeImgDom3.value?.play();
|
|
|
+ modeImgDom4.value?.goToAndPlay(0);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -58,6 +61,16 @@ export default defineComponent({
|
|
|
);
|
|
|
const browserInfo = browser();
|
|
|
const isPad = navigator?.userAgent?.includes("UAWEIVRD-W09") || browserInfo?.iPad || browserInfo.isTablet;
|
|
|
+
|
|
|
+ // vip图标
|
|
|
+ const showVip = computed(() => {
|
|
|
+ return state.vipType === "NOT_VIP" && state.paymentType !== "FREE" && !state.musicBuyInfo.buyed
|
|
|
+ });
|
|
|
+ // svip图标
|
|
|
+ const showsVip = computed(() => {
|
|
|
+ return !state.vipType?.includes("SVIP") && state.paymentType !== "FREE" && !state.musicBuyInfo.buyed
|
|
|
+ });
|
|
|
+
|
|
|
return () => (
|
|
|
<div class={[styles.modeView, isPad && styles.isiPad, headTopData.modeType !== "init" && styles.hidden]}>
|
|
|
<img
|
|
@@ -76,14 +89,25 @@ export default defineComponent({
|
|
|
headTopData.modeType = "show";
|
|
|
}}
|
|
|
/>
|
|
|
- <img src={titmeImg} class={styles.modeTitle} />
|
|
|
+ {/* <img src={titmeImg} class={styles.modeTitle} /> */}
|
|
|
+ {
|
|
|
+ <Vue3Lottie ref={modeImgDom4} class={styles.modeTitle} animationData={modeTitle} autoPlay={false} loop={false} delay={2000}></Vue3Lottie>
|
|
|
+ }
|
|
|
<div class={[styles.modeBox, ((!state.isPercussion && !state.enableEvaluation) || (state.isPercussion && state.enableEvaluation) || (state.isPercussion && !state.enableEvaluation)) && styles.twoModeBox]}>
|
|
|
- <Vue3Lottie ref={modeImgDom1} class={styles.modeImg} animationData={lxMode} autoPlay={false} loop={true} onClick={() => {
|
|
|
- if(state.isSingleLine){
|
|
|
- smoothAnimationState.isShow.value = state.melodyLine;
|
|
|
- }
|
|
|
- headTopData.handleChangeModeType("practise")
|
|
|
- }}></Vue3Lottie>
|
|
|
+ <div class={styles.modeItem}>
|
|
|
+ <Vue3Lottie ref={modeImgDom1} class={styles.modeImg} animationData={lxMode} autoPlay={false} loop={true} onClick={() => {
|
|
|
+ if (checkMusicBuy(state.musicBuyInfo)) {
|
|
|
+ if(state.isSingleLine){
|
|
|
+ smoothAnimationState.isShow.value = state.melodyLine;
|
|
|
+ }
|
|
|
+ headTopData.handleChangeModeType("practise")
|
|
|
+ }
|
|
|
+ }}></Vue3Lottie>
|
|
|
+ {
|
|
|
+ showVip.value && <img class={styles.vipIcon} src={modeVip} />
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+
|
|
|
{/* <img class={styles.modeImg} src={lxImg}
|
|
|
onClick={() => {
|
|
|
if(state.isSingleLine){
|
|
@@ -92,16 +116,28 @@ export default defineComponent({
|
|
|
headTopData.handleChangeModeType("practise")
|
|
|
}} /> */}
|
|
|
{!state.isPercussion &&
|
|
|
- <Vue3Lottie ref={modeImgDom2} class={styles.modeImg} animationData={glMode} autoPlay={false} loop={true} onClick={() => headTopData.handleChangeModeType("follow")}></Vue3Lottie>
|
|
|
+ <div class={styles.modeItem}>
|
|
|
+ <Vue3Lottie ref={modeImgDom2} class={styles.modeImg} animationData={glMode} autoPlay={false} loop={true} onClick={() => {
|
|
|
+ if (checkMusicBuy(state.musicBuyInfo)) {
|
|
|
+ headTopData.handleChangeModeType("follow")
|
|
|
+ }
|
|
|
+ }}></Vue3Lottie>
|
|
|
+ { showsVip.value && <img class={styles.svipIcon} src={modesVip} /> }
|
|
|
+ </div>
|
|
|
// <img class={styles.modeImg} src={glImg}
|
|
|
// onClick={() => headTopData.handleChangeModeType("follow")} />
|
|
|
}
|
|
|
{state.enableEvaluation &&
|
|
|
- <Vue3Lottie ref={modeImgDom3} class={styles.modeImg} animationData={pcMode} autoPlay={false} loop={true} onClick={() => {
|
|
|
- // 点击评测模式进入评测模块的需要检测耳机状态,通过返回按钮进入评测模块的,不检测耳机状态
|
|
|
- evaluatingData.needCheckErjiStatus = true;
|
|
|
- headTopData.handleChangeModeType("evaluating")
|
|
|
- }}></Vue3Lottie>
|
|
|
+ <div class={styles.modeItem}>
|
|
|
+ <Vue3Lottie ref={modeImgDom3} class={styles.modeImg} animationData={pcMode} autoPlay={false} loop={true} onClick={() => {
|
|
|
+ if (checkMusicBuy(state.musicBuyInfo)) {
|
|
|
+ // 点击评测模式进入评测模块的需要检测耳机状态,通过返回按钮进入评测模块的,不检测耳机状态
|
|
|
+ evaluatingData.needCheckErjiStatus = true;
|
|
|
+ headTopData.handleChangeModeType("evaluating")
|
|
|
+ }
|
|
|
+ }}></Vue3Lottie>
|
|
|
+ { showsVip.value && <img class={styles.svipIcon} src={modesVip} /> }
|
|
|
+ </div>
|
|
|
// <img class={styles.modeImg} src={pcImg}
|
|
|
// onClick={() => {
|
|
|
// // 点击评测模式进入评测模块的需要检测耳机状态,通过返回按钮进入评测模块的,不检测耳机状态
|