liushengqiang 2 anos atrás
pai
commit
69006fdf69

+ 7 - 0
src/page-instrument/api.ts

@@ -39,3 +39,10 @@ export const sysSuggestionAdd = (data: any) => {
 export const api_musicPracticeRecordDetail = (recordId: string) => {
 	return request.get("/musicPracticeRecord/detail/" + recordId);
 };
+/** 获取曲谱列表 */
+export const api_musicSheetPage = (data: any) => {
+	return request.post("/musicSheet/page", {
+		data,
+		requestType: "json",
+	});
+};

+ 9 - 0
src/page-instrument/component/the-music-list/index.module.less

@@ -72,4 +72,13 @@
 
 .itemActive {
     background: #ECF9FF;
+}
+.noData{
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    height: 100%;
+    font-size: 14px;
+    color: #999999;
+    height: 50vh;
 }

+ 5 - 3
src/page-instrument/component/the-music-list/index.tsx

@@ -19,9 +19,11 @@ export default defineComponent({
 					<div class={styles.tabs}>
 						<Tabs>
 							<Tab title="其他曲谱">
-                                <List />
-                            </Tab>
-							<Tab title="最近练习">内容 2</Tab>
+								<List />
+							</Tab>
+							<Tab title="最近练习">
+								<List recentFlag={true} />
+							</Tab>
 						</Tabs>
 					</div>
 				</Popup>

+ 84 - 4
src/page-instrument/component/the-music-list/list.tsx

@@ -1,13 +1,93 @@
-import { defineComponent } from "vue";
+import { defineComponent, onMounted, reactive } from "vue";
 import styles from "./index.module.less";
+import { api_musicSheetPage } from "../../api";
+import state, { togglePlay } from "/src/state";
+import { List } from "vant";
+import { postMessage } from "/src/utils/native-message";
+import qs from "query-string";
 
 export default defineComponent({
 	name: "TheMusicList-list",
-	setup() {
+	props: {
+		recentFlag: {
+			type: Boolean,
+			default: false,
+		},
+	},
+	setup(props) {
+		const forms = reactive({
+			page: 1,
+			rows: 20,
+			musicSheetCategoriesId: state.musicSheetCategoriesId,
+			recentFlag: props.recentFlag ? true : null,
+		});
+		const data = reactive({
+			list: [] as any[],
+			finished: false,
+			loading: false,
+		});
+		const getList = async () => {
+			data.loading = true;
+			try {
+				const res = await api_musicSheetPage({
+					...forms,
+				});
+				if (res?.code === 200 && Array.isArray(res.data?.rows)) {
+					data.list = [...data.list, ...res.data.rows];
+				}
+				data.finished = res.data?.rows?.length < forms.rows;
+			} catch (error) {
+				console.log(error);
+			}
+
+			data.loading = false;
+		};
+		onMounted(() => {
+			getList();
+		});
+
+		const openAccomapina = (item: any) => {
+			// 暂停播放
+			togglePlay("paused");
+			postMessage({
+				api: "cloudLoading",
+				content: {
+					show: true,
+					type: "fullscreen",
+				},
+			});
+			location.href =
+				location.origin +
+				location.pathname +
+				"?" +
+				qs.stringify({
+					id: item.id,
+					_t: Date.now(),
+				});
+		};
 		return () => (
 			<div class={styles.wrap}>
-				<div class={[styles.item, styles.itemActive]}>请放开我的手</div>
-				<div class={[styles.item, styles.itemActive]}>请放开我的手</div>
+				<List
+					loading={data.loading}
+					finished={data.finished}
+					immediateCheck={false}
+					onLoad={() => {
+						forms.page++;
+						getList();
+					}}
+				>
+					{data.list.map((item: any) => {
+						return (
+							<div
+								class={[styles.item, state.examSongId == item.id && styles.itemActive]}
+								onClick={() => openAccomapina(item)}
+							>
+								{item.musicSheetName}
+							</div>
+						);
+					})}
+					{!data.loading && data.list.length === 0 && <div class={styles.noData}>暂无数据</div>}
+				</List>
 			</div>
 		);
 	},

+ 1 - 1
src/page-instrument/custom-plugins/helper-model/screen-model/index.tsx

@@ -16,7 +16,7 @@ export default defineComponent({
 							<iframe src="https://online.colexiu.com/student/#/guide" />
 						</Tab>
 						<Tab name="帮助" title="帮助">
-							<iframe src="https://online.colexiu.com/student/#/helpCenter?platformType=ANALYSIS" />
+							<iframe src="https://test.lexiaoya.cn/classroom-app/#/help-center?platformType=ANALYSIS" />
 						</Tab>
 					</Tabs>
 				</div>

+ 1 - 1
src/page-instrument/follow-model/index.tsx

@@ -30,7 +30,7 @@ export default defineComponent({
 								onClick={() => {
 									handleFollowEnd();
 								}}
-							/>
+							/>{followData.start + '2'}
 						</div>
 					)}
 				</Transition>

+ 5 - 0
src/page-instrument/header-top/settting/index.module.less

@@ -190,4 +190,9 @@
             opacity: .8;
         }
     }
+}
+
+.disabled{
+    opacity: .3;
+    pointer-events: none;
 }

+ 9 - 6
src/page-instrument/header-top/settting/index.tsx

@@ -25,7 +25,6 @@ import iconTv from "../image/tv.svg";
 import iconYijian from "../image/yijian.svg";
 import ScreenModel from "../../custom-plugins/helper-model/screen-model";
 import Recommendation from "../../custom-plugins/helper-model/recommendation";
-import html2canvas from "html2canvas";
 import { svg2canvas } from "/src/utils/svg2canvas";
 
 export default defineComponent({
@@ -40,8 +39,8 @@ export default defineComponent({
 			setTimeout(async () => {
 				const svg: any = document.getElementById("osmdSvgPage1")?.cloneNode(true);
 				if (!svg) return showToast({ message: "保存失败", type: "fail" });
-				const cw = svg.width.animVal.value
-				const ch = svg.height.animVal.value
+				const cw = svg.width.animVal.value;
+				const ch = svg.height.animVal.value;
 				const rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
 				rect.setAttribute("x", "0");
 				rect.setAttribute("y", "0");
@@ -62,7 +61,7 @@ export default defineComponent({
 						el.dispatchEvent(event);
 						setTimeout(() => {
 							showToast({ message: "保存成功", type: "success" });
-							el = null
+							el = null;
 						}, 300);
 					} else {
 						const base64 = _canvas.toDataURL("image/png", 1);
@@ -118,9 +117,13 @@ export default defineComponent({
 									extra: () => <Switch v-model={state.setting.repeatAutoPlay}></Switch>,
 								}}
 							</Cell>
-							<Cell title="显示指法" center>
+							<Cell class={[state.modeType == "evaluating" && styles.disabled]} title="显示指法" center>
 								{{
-									extra: () => <Switch v-model={state.setting.displayFingering}></Switch>,
+									extra: () => (
+										<Switch
+											v-model={state.setting.displayFingering}
+										></Switch>
+									),
 								}}
 							</Cell>
 						</Tab>

+ 3 - 0
src/page-instrument/view-detail/index.module.less

@@ -55,6 +55,9 @@
             background-color: rgb(255, 159, 88);
         }
     }
+    #osmdCanvasPage1{
+        padding-bottom: 60px;
+    }
 }
 .PC{
     :global{

+ 13 - 6
src/page-instrument/view-detail/index.tsx

@@ -41,7 +41,7 @@ import { mappingVoicePart, subjectFingering } from "/src/view/fingering/fingerin
 import Fingering from "/src/view/fingering";
 import store from "store";
 import Tick, { handleInitTick } from "/src/view/tick";
-import FollowPractice from "/src/view/follow-practice";
+import FollowPractice, { followData } from "/src/view/follow-practice";
 import FollowModel from "../follow-model";
 import RecordingTime from "../custom-plugins/recording-time";
 import WorkIndex from "../custom-plugins/work-index";
@@ -58,7 +58,7 @@ export default defineComponent({
 			paddingLeft: "",
 			headerHide: false,
 			/** 页面显示 */
-			pageShow: true
+			pageShow: true,
 		});
 		const getAPPData = async () => {
 			const screenData = await isSpecialShapedScreen();
@@ -126,13 +126,14 @@ export default defineComponent({
 			state.accompany = data.accompany;
 			state.midiUrl = data.midiUrl;
 			state.parentCategoriesId = data.musicTag;
+			state.musicSheetCategoriesId = data.musicSheetCategoriesId;
 			state.playMode = data.audioType === "MP3" ? "MP3" : "MIDI";
 			state.originSpeed = state.speed = data.playSpeed;
 			state.track = data.code || data.track;
 			state.enableNotation = data.notation ? true : false;
 
 			// 映射声部ID
-			state.subjectId = mappingVoicePart(state.track as any || state.subjectId, "INSTRUMENT");
+			state.subjectId = mappingVoicePart((state.track as any) || state.subjectId, "INSTRUMENT");
 			// console.log("🚀 ~ state.subjectId:", state.subjectId, state.track as any , state.subjectId)
 			// 是否打击乐
 			// state.isPercussion =
@@ -143,7 +144,7 @@ export default defineComponent({
 
 			// 设置指法
 			state.fingeringInfo = subjectFingering(state.subjectId);
-			console.log("🚀 ~ state.fingeringInfo:", state.fingeringInfo, state.subjectId, state.track)
+			console.log("🚀 ~ state.fingeringInfo:", state.fingeringInfo, state.subjectId, state.track);
 
 			// 检测是否原音和伴奏都有
 			if (!state.music || !state.accompany) {
@@ -298,7 +299,7 @@ export default defineComponent({
 					)}
 				</Transition>
 				<div class={[styles.headHeight, detailData.headerHide && styles.headHide]}>
-					{state.musicRendered && <HeaderTop onClose={() => detailData.pageShow = false} />}
+					{state.musicRendered && <HeaderTop onClose={() => (detailData.pageShow = false)} />}
 				</div>
 				<div
 					id="scrollContainer"
@@ -349,8 +350,14 @@ export default defineComponent({
 						<RecordingTime />
 						{/* 作业 */}
 						{query.workRecord && <WorkIndex pageShow={detailData.pageShow} />}
+						{followData.start + ""}
 						{/* 曲谱列表 */}
-						{/* <TheMusicList /> */}
+						{state.playState == "play" ||
+						followData.start ||
+						evaluatingData.startBegin ||
+						query.workRecord ? null : (
+							<TheMusicList />
+						)}
 					</>
 				)}
 			</div>

+ 4 - 1
src/page-instrument/view-evaluat-report/component/share-top/index.module.less

@@ -26,7 +26,10 @@
         height: 24px;
     }
 }
-
+.disabled{
+    opacity: 0;
+    pointer-events: none;
+}
 .left {
     display: flex;
     align-items: center;

+ 2 - 1
src/page-instrument/view-evaluat-report/component/share-top/index.tsx

@@ -12,6 +12,7 @@ import "plyr/dist/plyr.css";
 import Plyr from "plyr";
 import { browser } from "/src/utils";
 import Note from "../note";
+import { storeData } from "/src/store";
 
 type IItemType = "intonation" | "cadence" | "integrity";
 
@@ -72,7 +73,7 @@ export default defineComponent({
 
 		return () => (
 			<div class={[styles.headerTop, browserInfo.android && styles.android]}>
-				<div class={styles.back} onClick={handleBack}>
+				<div class={[styles.back, !storeData.isApp && styles.disabled]} onClick={handleBack}>
 					<img src={iconBack} />
 				</div>
 				<div class={styles.center}>

+ 1 - 1
src/page-orchestra/api.ts

@@ -30,7 +30,7 @@ export const studentLessonTrainingLessonTrainingRecord = (data: any) => {
 export const studentMember = () => {
 	return request.get("/student/member");
 };
-/** 获取学习会员信息 */
+/** 意见反馈 */
 export const sysSuggestionSave = (data: any) => {
 	return request.post("/sysSuggestion/save",  { data, requestType: 'json'});
 };

+ 2 - 0
src/state.ts

@@ -74,6 +74,8 @@ const state = reactive({
 	midiUrl: "",
 	/** 父分ID */
 	parentCategoriesId: 0,
+	/** 分类ID */
+	musicSheetCategoriesId: 0,
 	/** 资源类型: mp3 | midi */
 	playMode: "MP3" as "MP3" | "MIDI",
 	/** 设置的速度 */