Browse Source

feat: 内容平台增加参数isCbs

TIANYONG 1 year ago
parent
commit
45fa89506e

+ 2 - 3
src/page-instrument/custom-plugins/guide-page/api.ts

@@ -1,5 +1,5 @@
 import request from "../../../utils/request";
-
+import { storeData } from "/src/store";
 
 export const setGuidance = (params: any) => {
     return request.post('/functionGuidance/save', {
@@ -12,10 +12,9 @@ export const setGuidance = (params: any) => {
    * 获取引导页
    */
   export const getGuidance = (params: any) => {
-    return request.get('/functionGuidance/queryTagDetail', {
+    return storeData.platformApi == "/cbs-app" ? { data: null } : request.get('/functionGuidance/queryTagDetail', {
       data: params,
       params,
-  
     });
   };
   

+ 4 - 1
src/page-instrument/main.ts

@@ -10,8 +10,10 @@ import "../style.css";
 import App from "./App";
 import router from "./router";
 import "./theme.css";
+import { getQuery } from "/src/utils/queryString";
 
 (function () {
+	const query = getQuery();
 	const u = navigator.userAgent;
 	const instance: any =
 	(window as any).DAYA ||
@@ -20,9 +22,10 @@ import "./theme.css";
 	(window as any).webkit?.messageHandlers?.COLEXIU ||
 	(window as any).ORCHESTRA ||
 	(window as any).webkit?.messageHandlers?.ORCHESTRA;
+	const apiPrefix = query.isCbs ? "/cbs-app" : u.includes("COLEXIUSTUDENT") ? "/edu-app" : "/edu-app"
 	setStoreData({
 		isApp: instance ? true : false,
-		platformApi: u.includes("COLEXIUSTUDENT") ? "/edu-app" : "/edu-app",
+		platformApi: apiPrefix,
 		platformType: u.includes("COLEXIUSTUDENT") ? "" : "",
 		proxy: import.meta.env.DEV ? "/instrument" : ""
 	});

+ 2 - 2
src/page-instrument/view-detail/index.tsx

@@ -122,7 +122,7 @@ export default defineComponent({
       // });
       await getMusicDetail(id);
       detailData.isLoading = false;
-      api_setEventTracking();
+      // api_setEventTracking();
     });
 
     /** 渲染完成 */
@@ -159,7 +159,7 @@ export default defineComponent({
       evaluatCreateMusicPlayer();
       resetPlaybackToStart();
 
-      pushAppMusic();
+      // pushAppMusic();
       console.timeEnd("渲染加载耗时");
     };
     /** 指法配置 */

+ 1 - 1
src/page-instrument/view-product-img/index.tsx

@@ -74,7 +74,7 @@ export default defineComponent({
 			}
 
 			closeToast();
-			console.log(detailData.product);
+			console.log(detailData.product,123456);
 			window.parent?.postMessage(
 				{
 					api: "webApi_renderSvg",

+ 1 - 1
src/store.ts

@@ -22,7 +22,7 @@ type IUser = {
 };
 type IStatus = "init" | "login" | "logout" | "error";
 type IPlatformType = "STUDENT" | "TEACHER" | "WEB" | "";
-type IPlatformApi = "/api-student" | "/api-teacher" | "/api-web" | "/api-backend" | "/edu-app";
+type IPlatformApi = "/api-student" | "/api-teacher" | "/api-web" | "/api-backend" | "/edu-app" | "/cbs-app";
 type IProxy = "" | "/gym" | "/colexiu" | "/orchestra" | "/instrument";
 
 export interface IStoreData {

+ 11 - 10
src/view/plugins/move-music-score/index.tsx

@@ -147,16 +147,17 @@ export const filterMoveData = async () => {
 		}
 		extStyleConfigJson[moveData.partIndex] = list;
 		console.log("🚀 ~ extStyleConfigJson", extStyleConfigJson)
-		// const res = await request.post("/sysMusicScore/updateExtStyleConfigJson", {
-		// 	data: {
-		// 		sysMusicScoreId: examSongId,
-		// 		extStyleConfigJson: JSON.stringify(extStyleConfigJson),
-		// 	},
-		// });
-		// if (res && res.code == 200) {
-		// 	showToast("保存成功");
-		// }
-		// clearActiveModel();
+		const res = await request.post("/musicSheet/img", {
+			requestType: "json",
+			data: {
+				id: examSongId,
+				extStyleConfigJson: JSON.stringify(extStyleConfigJson),
+			}
+		});
+		if (res && res.code == 200) {
+			showToast("保存成功");
+		}
+		clearActiveModel();
 	}
 };
 

+ 1 - 1
src/view/selection/index.tsx

@@ -292,7 +292,7 @@ export default defineComponent({
 				})}
 
 				{/* 移动模块 */}
-				{/* {query.isMove == "1" && <MoveMusicScore />} */}
+				{query.isMove == "1" && <MoveMusicScore />}
 			</div>
 		);
 	},

+ 2 - 1
vite.config.ts

@@ -66,7 +66,8 @@ export default defineConfig({
 			"^/instrument/.*": {
 				// target: "https://kt.colexiu.com",
 				// target: "https://test.lexiaoya.cn",
-				target: "https://dev.kt.colexiu.com",
+				// target: "https://dev.kt.colexiu.com",
+				target: "http://dev.resource.colexiu.com", // 内容平台开发环境
 				changeOrigin: true,
 				rewrite: (path) => path.replace(/^\/instrument/, ""),
 			},