|
@@ -1,41 +1,50 @@
|
|
|
+import {Dialog} from "vant";
|
|
|
+
|
|
|
const myMixin = {
|
|
|
methods: {
|
|
|
goBack() {
|
|
|
this.$router.go('-1');
|
|
|
},
|
|
|
goTestResult(id) {
|
|
|
- this.$http.get(`getRecordById?id=${id}`, {}, (res) => {
|
|
|
- if (res.code == 2001) {
|
|
|
- this.$toast.fail(res.msg);
|
|
|
- return;
|
|
|
- }
|
|
|
- if (res && res.code == 200) {
|
|
|
-
|
|
|
- let versionNo = JSON.parse(res.data?.userRecordEntity?.testResult).versionNo;
|
|
|
- if (versionNo == "2.0.1" || versionNo == "2.0") {
|
|
|
- //跳转新测试结果模版数据暂存本地
|
|
|
- // sessionStorage.setItem("testResult", res.data?.userRecordEntity?.testResult);
|
|
|
- // this.$store.dispatch('setTestResult',JSON.parse(res.data?.userRecordEntity?.testResult));
|
|
|
- this.$store.dispatch('setTestResult',res?.data);
|
|
|
- this.$router.push({
|
|
|
- name: "testResultNew",
|
|
|
- query: {
|
|
|
- id: res.data?.userRecordEntity?.id,
|
|
|
- title: res.data?.userRecordEntity?.name,
|
|
|
- testPlanId: this.$route.query.testPlanId || "",
|
|
|
- come: 1, //1-来自认知任务列表,2-测试记录列表
|
|
|
- },
|
|
|
- });
|
|
|
- } else {
|
|
|
- //跳转旧测试结果模版
|
|
|
- this.$router.push(`/cognitiveTaskOldTestRecord?flag=${res.data?.userRecordEntity?.flag}&id=${id}&from=1&testPlanId=${this.$route.query.testPlanId || ""}`);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- } else {
|
|
|
- this.$toast.fail("获取数据失败!服务器异常");
|
|
|
- }
|
|
|
- });
|
|
|
+ Dialog.alert({
|
|
|
+ title: '测试完成',
|
|
|
+ message: '恭喜你顺利完成测评!若想了解你的具体测评成绩,请与老师联系以获取详细反馈。',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$router.push('/index/cognitionTask')
|
|
|
+ })
|
|
|
+ // this.$http.get(`getRecordById?id=${id}`, {}, (res) => {
|
|
|
+ // if (res.code == 2001) {
|
|
|
+ // this.$toast.fail(res.msg);
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // if (res && res.code == 200) {
|
|
|
+ //
|
|
|
+ // let versionNo = JSON.parse(res.data?.userRecordEntity?.testResult).versionNo;
|
|
|
+ // if (versionNo == "2.0.1" || versionNo == "2.0") {
|
|
|
+ // //跳转新测试结果模版数据暂存本地
|
|
|
+ // // sessionStorage.setItem("testResult", res.data?.userRecordEntity?.testResult);
|
|
|
+ // // this.$store.dispatch('setTestResult',JSON.parse(res.data?.userRecordEntity?.testResult));
|
|
|
+ // this.$store.dispatch('setTestResult',res?.data);
|
|
|
+ // this.$router.push({
|
|
|
+ // name: "testResultNew",
|
|
|
+ // query: {
|
|
|
+ // id: res.data?.userRecordEntity?.id,
|
|
|
+ // title: res.data?.userRecordEntity?.name,
|
|
|
+ // testPlanId: this.$route.query.testPlanId || "",
|
|
|
+ // come: 1, //1-来自认知任务列表,2-测试记录列表
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // //跳转旧测试结果模版
|
|
|
+ // this.$router.push(`/cognitiveTaskOldTestRecord?flag=${res.data?.userRecordEntity?.flag}&id=${id}&from=1&testPlanId=${this.$route.query.testPlanId || ""}`);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // } else {
|
|
|
+ // this.$toast.fail("获取数据失败!服务器异常");
|
|
|
+ // }
|
|
|
+ // });
|
|
|
}
|
|
|
}
|
|
|
}
|