|
@@ -10,7 +10,7 @@ import { getNoteByMeasuresSlursStart } from "/src/helpers/formateMusic";
|
|
|
import { Icon, Popup, showToast, closeToast, showLoadingToast } from "vant";
|
|
|
import EvaluatResult from "./evaluat-result";
|
|
|
import EvaluatAudio from "./evaluat-audio";
|
|
|
-import { api_getDeviceDelay, api_openAdjustRecording, api_proxyServiceMessage, api_videoUpdate, getEarphone, api_back, api_startDelayCheck, api_cancelDelayCheck, api_remove_cancelDelayCheck, api_closeDelayCheck, api_finishDelayCheck, api_retryEvaluating, api_remove_finishDelayCheck } from "/src/helpers/communication";
|
|
|
+import { api_getDeviceDelay, api_openAdjustRecording, api_proxyServiceMessage, api_videoUpdate, getEarphone, api_back, api_startDelayCheck, api_cancelDelayCheck, api_remove_cancelDelayCheck, api_closeDelayCheck, api_finishDelayCheck, api_retryEvaluating, api_remove_finishDelayCheck, api_workUpdate } from "/src/helpers/communication";
|
|
|
import EvaluatShare from "./evaluat-share";
|
|
|
import { Vue3Lottie } from "vue3-lottie";
|
|
|
import startData from "./data/start.json";
|
|
@@ -25,6 +25,8 @@ import Countdown from "./countdown";
|
|
|
import { IPostMessage } from "/src/utils/native-message";
|
|
|
import tipErjiBg from "./icons/tip_erji.png"
|
|
|
import tipErjiBtn from "./icons/tip_btn.png"
|
|
|
+import SubmitNoDonePop from "./submit-nodone";
|
|
|
+import { selfSubmitWorkHome } from "../custom-plugins/work-index";
|
|
|
|
|
|
// const DelayCheck = defineAsyncComponent(() =>
|
|
|
// import('./delay-check')
|
|
@@ -59,6 +61,7 @@ export default defineComponent({
|
|
|
evaluatUpdateAudio: false,
|
|
|
isSaveVideo: state.setting.camera && state.setting.saveToAlbum,
|
|
|
shareMode: false,
|
|
|
+ showNoDonePop: false, // 提交作业显示未达标确认弹窗
|
|
|
});
|
|
|
/**
|
|
|
* 检测返回
|
|
@@ -325,7 +328,7 @@ export default defineComponent({
|
|
|
};
|
|
|
|
|
|
/** 评测结果按钮处理 */
|
|
|
- const handleEvaluatResult = (type: "practise" | "tryagain" | "look" | "share" | "update" | "selfCancel") => {
|
|
|
+ const handleEvaluatResult = (type: "practise" | "tryagain" | "look" | "share" | "update" | "selfCancel" | "submitWork") => {
|
|
|
if (type === "update") {
|
|
|
if (state.isAppPlay) {
|
|
|
evaluatModel.evaluatUpdateAudio = true;
|
|
@@ -367,11 +370,56 @@ export default defineComponent({
|
|
|
// evaluatingData.isBeginMask = true;
|
|
|
evaluatingData.evaluatings = {};
|
|
|
state.playState = "paused";
|
|
|
+ } else if (type === "submitWork") {
|
|
|
+ // 作业模式,提交作业,作业没有达标时,提交作业需要弹窗提醒
|
|
|
+ if (!state.isWorkDone) {
|
|
|
+ evaluatModel.showNoDonePop = true;
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ submitWorkHome();
|
|
|
+ }
|
|
|
}
|
|
|
resetPlaybackToStart();
|
|
|
evaluatingData.resulstMode = false;
|
|
|
};
|
|
|
|
|
|
+ // 关闭提交作业确认弹窗
|
|
|
+ const handleCloseSubmitPop = (type: "again" | "confirm") => {
|
|
|
+ evaluatModel.showNoDonePop = false;
|
|
|
+ if (type === "again") {
|
|
|
+ handleEvaluatResult("tryagain");
|
|
|
+ } else {
|
|
|
+ submitWorkHome();
|
|
|
+ resetPlaybackToStart();
|
|
|
+ evaluatingData.resulstMode = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 提交作业
|
|
|
+ const submitWorkHome = async () => {
|
|
|
+ // 分为开了摄像头和没开摄像头的情况
|
|
|
+ if (state.setting.camera) {
|
|
|
+ const res = await api_workUpdate();
|
|
|
+ console.log('提交作业回调',res)
|
|
|
+ if (res) {
|
|
|
+ if (res?.content?.type === "success") {
|
|
|
+ handleSaveResult({
|
|
|
+ id: evaluatingData.resultData?.recordId,
|
|
|
+ videoFilePath: res?.content?.filePath,
|
|
|
+ });
|
|
|
+ // 手动提交评测作业
|
|
|
+ selfSubmitWorkHome();
|
|
|
+ } else if (res?.content?.type === "error") {
|
|
|
+ showToast({
|
|
|
+ message: res.content?.message || "上传失败",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 手动提交评测作业
|
|
|
+ selfSubmitWorkHome();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/** 上传音视频 */
|
|
|
const hanldeUpdateVideoAndAudio = async (update = false) => {
|
|
|
if (!update) {
|
|
@@ -485,11 +533,11 @@ export default defineComponent({
|
|
|
};
|
|
|
|
|
|
const earPhonePopShow = computed(() => {
|
|
|
- return evaluatingData.earphoneMode && !state.isLoading && !state.hasDriverPop;
|
|
|
+ return evaluatingData.earphoneMode && !state.isLoading && !state.hasDriverPop && !evaluatingData.showOpenCameraPop;
|
|
|
});
|
|
|
|
|
|
const tipErjiPopShow = computed(() => {
|
|
|
- return evaluatingData.tipErjiShow && !state.isLoading && !state.hasDriverPop;
|
|
|
+ return evaluatingData.tipErjiShow && !state.isLoading && !state.hasDriverPop && !evaluatingData.showOpenCameraPop;
|
|
|
});
|
|
|
|
|
|
// watch(
|
|
@@ -636,6 +684,10 @@ export default defineComponent({
|
|
|
<Popup teleport="body" class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={evaluatModel.shareMode}>
|
|
|
<EvaluatShare onClose={() => (evaluatModel.shareMode = false)} />
|
|
|
</Popup>
|
|
|
+
|
|
|
+ <Popup teleport="body" class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={evaluatModel.showNoDonePop}>
|
|
|
+ <SubmitNoDonePop onClose={handleCloseSubmitPop} />
|
|
|
+ </Popup>
|
|
|
</div>
|
|
|
);
|
|
|
},
|