|
@@ -20,7 +20,7 @@ import { Icon, NoticeBar, Popup, showToast, Swipe, SwipeItem } from "vant";
|
|
|
import iconStudent from "./icons/student.png";
|
|
|
import EvaluatResult from "./evaluat-result";
|
|
|
import EvaluatAudio from "./evaluat-audio";
|
|
|
-import { api_openWebView, api_proxyServiceMessage, api_videoUpdate } from "/src/helpers/communication";
|
|
|
+import { api_proxyServiceMessage, api_videoUpdate } from "/src/helpers/communication";
|
|
|
import EvaluatShare from "./evaluat-share";
|
|
|
|
|
|
// frequency 频率, amplitude 振幅, decibels 分贝
|
|
@@ -180,29 +180,41 @@ export default defineComponent({
|
|
|
evaluatModel.evaluatUpdateAudio = false;
|
|
|
return;
|
|
|
}
|
|
|
- let res = null;
|
|
|
if (state.setting.camera && state.setting.saveToAlbum) {
|
|
|
- console.log(1);
|
|
|
- res = await api_videoUpdate();
|
|
|
- console.log(2);
|
|
|
+ evaluatModel.evaluatUpdateAudio = false;
|
|
|
+ api_videoUpdate((res: any) => {
|
|
|
+ if (res) {
|
|
|
+ if (res?.content?.type === 'success'){
|
|
|
+ handleSaveResult({
|
|
|
+ recordId: evaluatingData.resultData?.recordId,
|
|
|
+ filePath: res?.content?.filePath,
|
|
|
+ })
|
|
|
+ } else if (res?.content?.type === 'error') {
|
|
|
+ showToast({
|
|
|
+ message: res.content?.message || "上传失败",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return;
|
|
|
}
|
|
|
- console.log(3);
|
|
|
+ evaluatModel.evaluatUpdateAudio = false;
|
|
|
+ handleSaveResult({
|
|
|
+ recordId: evaluatingData.resultData?.recordId,
|
|
|
+ });
|
|
|
+ };
|
|
|
+ const handleSaveResult = (_body: any) => {
|
|
|
api_proxyServiceMessage({
|
|
|
header: {
|
|
|
commond: "videoUpload",
|
|
|
status: 200,
|
|
|
type: "SOUND_COMPARE",
|
|
|
},
|
|
|
- body: {
|
|
|
- filePath: res?.content?.filePath,
|
|
|
- recordId: evaluatingData.resultData?.recordId,
|
|
|
- },
|
|
|
+ body: _body,
|
|
|
});
|
|
|
showToast({
|
|
|
- position: "top",
|
|
|
message: "上传成功",
|
|
|
});
|
|
|
- evaluatModel.evaluatUpdateAudio = false;
|
|
|
};
|
|
|
|
|
|
onMounted(() => {
|