|
@@ -12,102 +12,87 @@ import { usePageVisibility } from "@vant/use";
|
|
import GuideIndex from "../../view-figner/guide/guide-index";
|
|
import GuideIndex from "../../view-figner/guide/guide-index";
|
|
import { getQuery } from "/src/utils/queryString";
|
|
import { getQuery } from "/src/utils/queryString";
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
- name: "modelWraper",
|
|
|
|
|
|
+ name: "modelWraper",
|
|
|
|
|
|
- setup() {
|
|
|
|
- const query = getQuery();
|
|
|
|
- const data = reactive({
|
|
|
|
- showPC: false,
|
|
|
|
- showStudent: false,
|
|
|
|
- showVip: false,
|
|
|
|
- showTip: false,
|
|
|
|
- });
|
|
|
|
- const openGuid = () => {
|
|
|
|
- // 加载后 判断 端口号 加载对应的引导
|
|
|
|
- if (storeData.platformType !== "STUDENT" || storeData.user.clientType !== "STUDENT") {
|
|
|
|
- // PC
|
|
|
|
- data.showPC = true;
|
|
|
|
- } else {
|
|
|
|
- if (storeData.user.vipMember) {
|
|
|
|
- // 学生端
|
|
|
|
- data.showStudent = true;
|
|
|
|
- } else {
|
|
|
|
- // vip
|
|
|
|
- data.showVip = true;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
|
|
+ setup() {
|
|
|
|
+ const query = getQuery();
|
|
|
|
+ const data = reactive({
|
|
|
|
+ showPC: false,
|
|
|
|
+ showStudent: false,
|
|
|
|
+ showVip: false,
|
|
|
|
+ showTip: false,
|
|
|
|
+ });
|
|
|
|
+ const openGuid = () => {
|
|
|
|
+ // 加载后 判断 端口号 加载对应的引导
|
|
|
|
+ if (storeData.platformType !== "STUDENT" || storeData.user.clientType !== "STUDENT") {
|
|
|
|
+ // PC
|
|
|
|
+ data.showPC = true;
|
|
|
|
+ } else {
|
|
|
|
+ // 添加学校上设置【课件解锁】,判断逻辑
|
|
|
|
+ const schoolInfos = storeData.user.schoolInfos;
|
|
|
|
+ const schoolLock = schoolInfos && schoolInfos.length > 0 ? schoolInfos[0].needVipLock : true;
|
|
|
|
+ if (storeData.user.vipMember || !schoolLock) {
|
|
|
|
+ // 学生端
|
|
|
|
+ data.showStudent = true;
|
|
|
|
+ } else {
|
|
|
|
+ // vip
|
|
|
|
+ data.showVip = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
|
|
- const getUserInfo = async () => {
|
|
|
|
- const res = await studentQueryUserInfo();
|
|
|
|
- const student = res?.data || {};
|
|
|
|
- storeData.user.vipMember = student.vipMember;
|
|
|
|
- // console.log("🚀 ~ student:", student);
|
|
|
|
- if (storeData.user.vipMember) {
|
|
|
|
- data.showVip = false;
|
|
|
|
- openGuid();
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
- const pageVisible = usePageVisibility();
|
|
|
|
- watch(
|
|
|
|
- () => pageVisible.value,
|
|
|
|
- (val) => {
|
|
|
|
- if (val === "visible") {
|
|
|
|
- if (storeData.user.vipMember) return;
|
|
|
|
- console.log("页面显示");
|
|
|
|
- getUserInfo();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- watch(
|
|
|
|
- () => headTopData.modeType,
|
|
|
|
- (val) => {
|
|
|
|
- if (val === "init") {
|
|
|
|
- nextTick(() => {
|
|
|
|
- nextTick(() => {
|
|
|
|
- setTimeout(() => {
|
|
|
|
- data.showTip = true;
|
|
|
|
- }, 500);
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- onMounted(() => {
|
|
|
|
- openGuid();
|
|
|
|
- });
|
|
|
|
- return () => (
|
|
|
|
- <>
|
|
|
|
- <div class={[styles.wrap, headTopData.modeType === "init" ? "" : styles.hidden]}>
|
|
|
|
- <div id="modeType-box" class={styles.infoWrap}>
|
|
|
|
- <img
|
|
|
|
- id="modeType-0"
|
|
|
|
- onClick={() => headTopData.handleChangeModeType("practise")}
|
|
|
|
- src={icons.icon_1}
|
|
|
|
- />
|
|
|
|
- <img
|
|
|
|
- id="modeType-1"
|
|
|
|
- style={{ cursor: state.isPercussion ? "not-allowed" : "pointer" }}
|
|
|
|
- onClick={() => headTopData.handleChangeModeType("follow")}
|
|
|
|
- src={state.isPercussion ? icons.icon_5 : icons.icon_2}
|
|
|
|
- />
|
|
|
|
- <img
|
|
|
|
- id="modeType-2"
|
|
|
|
- style={{ cursor: state.enableEvaluation ? "pointer" : "not-allowed" }}
|
|
|
|
- onClick={() => headTopData.handleChangeModeType("evaluating")}
|
|
|
|
- src={state.enableEvaluation ? icons.icon_3 : icons.icon_4}
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- {data.showPC && data.showTip && !query.isCbs ? <TeacherBootom></TeacherBootom> : null}
|
|
|
|
- {data.showStudent && data.showTip && !query.isCbs ? <StudentBottom></StudentBottom> : null}
|
|
|
|
- {data.showVip && <TheVip />}
|
|
|
|
- </div>
|
|
|
|
- {headTopData.modeType &&
|
|
|
|
- headTopData.modeType !== "init" &&
|
|
|
|
- state.modeType == "practise" &&
|
|
|
|
- state.fingeringInfo?.name &&
|
|
|
|
- state.setting.displayFingering && <GuideIndex list={["detail"]} />}
|
|
|
|
- </>
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
|
|
+ const getUserInfo = async () => {
|
|
|
|
+ const res = await studentQueryUserInfo();
|
|
|
|
+ const student = res?.data || {};
|
|
|
|
+ storeData.user.vipMember = student.vipMember;
|
|
|
|
+ // console.log("🚀 ~ student:", student);
|
|
|
|
+ if (storeData.user.vipMember) {
|
|
|
|
+ data.showVip = false;
|
|
|
|
+ openGuid();
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ const pageVisible = usePageVisibility();
|
|
|
|
+ watch(
|
|
|
|
+ () => pageVisible.value,
|
|
|
|
+ (val) => {
|
|
|
|
+ if (val === "visible") {
|
|
|
|
+ if (storeData.user.vipMember) return;
|
|
|
|
+ console.log("页面显示");
|
|
|
|
+ getUserInfo();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ watch(
|
|
|
|
+ () => headTopData.modeType,
|
|
|
|
+ (val) => {
|
|
|
|
+ if (val === "init") {
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ data.showTip = true;
|
|
|
|
+ }, 500);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ onMounted(() => {
|
|
|
|
+ openGuid();
|
|
|
|
+ });
|
|
|
|
+ return () => (
|
|
|
|
+ <>
|
|
|
|
+ <div class={[styles.wrap, headTopData.modeType === "init" ? "" : styles.hidden]}>
|
|
|
|
+ <div id="modeType-box" class={styles.infoWrap}>
|
|
|
|
+ <img id="modeType-0" onClick={() => headTopData.handleChangeModeType("practise")} src={icons.icon_1} />
|
|
|
|
+ <img id="modeType-1" style={{ cursor: state.isPercussion ? "not-allowed" : "pointer" }} onClick={() => headTopData.handleChangeModeType("follow")} src={state.isPercussion ? icons.icon_5 : icons.icon_2} />
|
|
|
|
+ <img id="modeType-2" style={{ cursor: state.enableEvaluation ? "pointer" : "not-allowed" }} onClick={() => headTopData.handleChangeModeType("evaluating")} src={state.enableEvaluation ? icons.icon_3 : icons.icon_4} />
|
|
|
|
+ </div>
|
|
|
|
+ {data.showPC && data.showTip && !query.isCbs ? <TeacherBootom></TeacherBootom> : null}
|
|
|
|
+ {data.showStudent && data.showTip && !query.isCbs ? <StudentBottom></StudentBottom> : null}
|
|
|
|
+ {data.showVip && <TheVip />}
|
|
|
|
+ </div>
|
|
|
|
+ {headTopData.modeType && headTopData.modeType !== "init" && state.modeType == "practise" && state.fingeringInfo?.name && state.setting.displayFingering && <GuideIndex list={["detail"]} />}
|
|
|
|
+ </>
|
|
|
|
+ );
|
|
|
|
+ },
|
|
});
|
|
});
|