|
@@ -10,7 +10,7 @@
|
|
|
v-loading="loading"
|
|
|
:class="['inner', fullscreen ? 'inner-full' : '']"
|
|
|
>
|
|
|
- <div class="resule-box" v-if="$route.query.ViewMode === 'Result'">
|
|
|
+ <div class="resule-box" v-if="ViewMode === 'Result'">
|
|
|
<span>用时:{{ handleDateTime(this.duration) }}</span>
|
|
|
<span
|
|
|
>答对:<span style="color: #2ca767">{{ rightNumber }}</span>
|
|
@@ -170,6 +170,18 @@ export default {
|
|
|
rightNumber: 0,
|
|
|
errorNumber: 0,
|
|
|
duration: 0,
|
|
|
+ AppID: this.$route.query.AppID ? this.$route.query.AppID : "",
|
|
|
+ AccessToken: this.$route.query.AccessToken
|
|
|
+ ? this.$route.query.AccessToken
|
|
|
+ : "",
|
|
|
+ CoursewareID: this.$route.query.CoursewareID
|
|
|
+ ? this.$route.query.CoursewareID
|
|
|
+ : "",
|
|
|
+ UserID: this.$route.query.UserID ? this.$route.query.UserID : "",
|
|
|
+ ViewMode: this.$route.query.ViewMode ? this.$route.query.ViewMode : "",
|
|
|
+ BusinessID: this.$route.query.BusinessID
|
|
|
+ ? this.$route.query.BusinessID
|
|
|
+ : "",
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -184,19 +196,27 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
const _this = this;
|
|
|
- if (_this.$route.query.AccessToken) {
|
|
|
+ console.log(_this.$route.query);
|
|
|
+ console.log("ViewMode:" + _this.ViewMode);
|
|
|
+ console.log("AppID:" + _this.AppID);
|
|
|
+ console.log("AccessToken:" + _this.AccessToken);
|
|
|
+ console.log("UserID:" + _this.UserID);
|
|
|
+ console.log("BusinessID" + _this.BusinessID);
|
|
|
+ console.log("CoursewareID" + _this.CoursewareID);
|
|
|
+ console.log(_this.ViewMode === "Answer");
|
|
|
+ if (_this.AccessToken) {
|
|
|
const Mname = "login_control-ParseAccessToken";
|
|
|
getStaticContent(Mname, {
|
|
|
- access_token: _this.$route.query.AccessToken,
|
|
|
+ access_token: _this.AccessToken,
|
|
|
}).then((res) => {
|
|
|
setToken(res);
|
|
|
});
|
|
|
}
|
|
|
- if (_this.$route.query.ViewMode === "Answer") {
|
|
|
+ if (_this.ViewMode === "Answer") {
|
|
|
// 答题模式下 显示提交按钮 隐藏查看答案按钮
|
|
|
this.showSaveFlag = true;
|
|
|
this.isAnswerItemShow = false;
|
|
|
- } else if (_this.$route.query.ViewMode === "Result") {
|
|
|
+ } else if (_this.ViewMode === "Result") {
|
|
|
this.isAnswerItemShow = false;
|
|
|
this.TaskModel = "ANSWER";
|
|
|
this.getUserAnswer();
|
|
@@ -214,7 +234,7 @@ export default {
|
|
|
},
|
|
|
changeId(id, name) {
|
|
|
const _this = this;
|
|
|
- _this.chapterId = _this.$route.query.CoursewareID;
|
|
|
+ _this.chapterId = _this.CoursewareID;
|
|
|
_this.isAnswerShow = false;
|
|
|
_this.onGetData();
|
|
|
},
|
|
@@ -234,13 +254,13 @@ export default {
|
|
|
onGetData() {
|
|
|
this.loading = true;
|
|
|
const _this = this;
|
|
|
- const AppID = _this.$route.query.AppID;
|
|
|
- const AccessToken = _this.$route.query.AccessToken;
|
|
|
+ const AppID = _this.AppID;
|
|
|
+ const AccessToken = _this.AccessToken;
|
|
|
const MethodName =
|
|
|
"/TeachingServer/BookIntegrationManager/GetCoursewareContent_View";
|
|
|
const data = {
|
|
|
- courseware_id: _this.$route.query.CoursewareID,
|
|
|
- user_id: _this.$route.query.UserID,
|
|
|
+ courseware_id: _this.CoursewareID,
|
|
|
+ user_id: _this.UserID,
|
|
|
};
|
|
|
getContens(MethodName, data, AccessToken, AppID).then((res) => {
|
|
|
this.category = res.category;
|
|
@@ -261,7 +281,7 @@ export default {
|
|
|
_this.context = JSON.parse(res.content);
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
- if (_this.$route.query.ViewMode === "Answer") {
|
|
|
+ if (_this.ViewMode === "Answer") {
|
|
|
_this.$refs.previewBook.handleAnswerTimeStart();
|
|
|
}
|
|
|
}, 200);
|
|
@@ -269,7 +289,7 @@ export default {
|
|
|
const _this = this;
|
|
|
_this.context = null;
|
|
|
}
|
|
|
- if (_this.$route.query.ViewMode !== "Result") {
|
|
|
+ if (_this.ViewMode !== "Result") {
|
|
|
this.loading = false;
|
|
|
}
|
|
|
});
|
|
@@ -309,14 +329,14 @@ export default {
|
|
|
// console.log("答对个数" + rightNumber);
|
|
|
// console.log("答错个数" + errorNumber);
|
|
|
this.loading = true;
|
|
|
- const AppID = this.$route.query.AppID;
|
|
|
- const AccessToken = this.$route.query.AccessToken;
|
|
|
+ const AppID = this.AppID;
|
|
|
+ const AccessToken = this.AccessToken;
|
|
|
const MethodName =
|
|
|
"/TeachingServer/BookIntegrationManager/SaveCoursewareExamAnswer";
|
|
|
let datas = {
|
|
|
- courseware_id: this.$route.query.CoursewareID,
|
|
|
- user_id: this.$route.query.UserID,
|
|
|
- business_id: this.$route.query.BusinessID,
|
|
|
+ courseware_id: this.CoursewareID,
|
|
|
+ user_id: this.UserID,
|
|
|
+ business_id: this.BusinessID,
|
|
|
exam_answer: {
|
|
|
duration: time,
|
|
|
count_right: rightNumber,
|
|
@@ -341,14 +361,14 @@ export default {
|
|
|
// 获取用户答题信息
|
|
|
getUserAnswer() {
|
|
|
this.loading = true;
|
|
|
- const AppID = this.$route.query.AppID;
|
|
|
- const AccessToken = this.$route.query.AccessToken;
|
|
|
+ const AppID = this.AppID;
|
|
|
+ const AccessToken = this.AccessToken;
|
|
|
const MethodName =
|
|
|
"/TeachingServer/BookIntegrationManager/GetCoursewareExamAnswer";
|
|
|
let datas = {
|
|
|
- courseware_id: this.$route.query.CoursewareID,
|
|
|
- user_id: this.$route.query.UserID,
|
|
|
- business_id: this.$route.query.BusinessID,
|
|
|
+ courseware_id: this.CoursewareID,
|
|
|
+ user_id: this.UserID,
|
|
|
+ business_id: this.BusinessID,
|
|
|
};
|
|
|
getContens(MethodName, datas, AccessToken, AppID)
|
|
|
.then((res) => {
|