|
@@ -19,16 +19,24 @@ export const useFunction = () => {
|
|
|
const loading = ref(false)
|
|
|
|
|
|
/** 跳转云教练 */
|
|
|
- const goToCloud = (musicId: string, partIndex = 0) => {
|
|
|
+ const isPracticeShow = ref(false)
|
|
|
+ const practiceUrl = ref("")
|
|
|
+ function goToCloud(musicId: string, partIndex = 0) {
|
|
|
+ // GYM,GYT,KLX 区分 云教练
|
|
|
const urlObj = {
|
|
|
- GYT: `${URL_TEACH_GYT}?id=${musicId}&modelType=practice&modeType=json&part-index=${partIndex}&Authorization=${getToken()}`,
|
|
|
- GYM: `${URL_TEACH_GYM}?Authorization=${getToken()}&platform=web&part-index=${partIndex}&liveConfig=1#/detail/${musicId}?isHideBack=true`,
|
|
|
- KLX: `${URL_TEACH_KLX}??Authorization=${getToken()}&id=${musicId}&isHideBack=true&part-index=${partIndex}&limitModel=practice`
|
|
|
+ GYT: `${URL_TEACH_GYT}?id=${musicId}&modelType=practice&modeType=json&part-index=${partIndex}&Authorization=${getToken()}&isYjt=1&&isHideBack=false`,
|
|
|
+ GYM: `${URL_TEACH_GYM}#/detail/${musicId}?Authorization=${getToken()}&platform=web&part-index=${partIndex}&liveConfig=1&isYjt=1`,
|
|
|
+ KLX: `${URL_TEACH_KLX}??Authorization=${getToken()}&id=${musicId}&limitModel=practice&part-index=${partIndex}&isYjt=1`
|
|
|
}
|
|
|
- window.open(urlObj[userStoreHook.roles!], "_blank")
|
|
|
+ isPracticeShow.value = true
|
|
|
+ practiceUrl.value = urlObj[userStoreHook.roles!]
|
|
|
+ //window.open(urlObj[userStoreHook.roles!], "_blank")
|
|
|
}
|
|
|
-
|
|
|
- return { loading, goToCloud }
|
|
|
+ function handlePracticeClose() {
|
|
|
+ isPracticeShow.value = false
|
|
|
+ practiceUrl.value = ""
|
|
|
+ }
|
|
|
+ return { loading, goToCloud, isPracticeShow, practiceUrl, handlePracticeClose }
|
|
|
}
|
|
|
|
|
|
// function chunkArray(array: any[], size: number) {
|