|
@@ -7,6 +7,7 @@ import iconConfirm from './icons/confirm.png'
|
|
|
import Content from './content'
|
|
|
import SettingState from '/src/pages/detail/setting-state'
|
|
|
import { IPostMessage, postMessage } from '/src/helpers/native-message'
|
|
|
+import detailState from '/src/pages/detail/state'
|
|
|
export const evaluatingShow = ref<boolean>(false)
|
|
|
const open = ref(false)
|
|
|
|
|
@@ -25,6 +26,14 @@ export type ResultContent = {
|
|
|
score: number
|
|
|
}
|
|
|
|
|
|
+/** 合成音频传伴奏弹窗 */
|
|
|
+const api_openAdjustRecording = (content: any) => {
|
|
|
+ postMessage({
|
|
|
+ api: "openAdjustRecording",
|
|
|
+ content,
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
//效音组件
|
|
|
export default defineComponent({
|
|
|
name: 'ColexiuEvaluating',
|
|
@@ -79,6 +88,23 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /** 评测结果按钮处理 */
|
|
|
+ const handleEvaluatResult = () => {
|
|
|
+ // 如果音频是midi格式,走之前的逻辑
|
|
|
+ if (detailState.isAppPlay) {
|
|
|
+ confirmShow.value = true
|
|
|
+ } else {
|
|
|
+ if (props.data?.recordId) {
|
|
|
+ // 上传云端
|
|
|
+ api_openAdjustRecording({
|
|
|
+ recordId: props.data?.recordId,
|
|
|
+ title: detailState.activeDetail?.musicSheetName || "曲谱演奏",
|
|
|
+ coverImg: detailState.activeDetail?.titleImg || '',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return () => {
|
|
|
return (
|
|
|
<div>
|
|
@@ -93,7 +119,7 @@ export default defineComponent({
|
|
|
{open && (
|
|
|
<Content
|
|
|
data={props.data}
|
|
|
- onUpload={() => (confirmShow.value = true)}
|
|
|
+ onUpload={handleEvaluatResult}
|
|
|
onRestart={() => (evaluatingShow.value = false)}
|
|
|
/>
|
|
|
)}
|