Commit 1567f586 authored by zhengzy's avatar zhengzy

学习

parent 80cdc868
const globalUrl = process.uniEnv || {}
const ucenterApiUrl = globalUrl.ucenterUrl.apiUrl
const collegeApiUrl = globalUrl.ucenterUrl.xueUrl
const testApiUrl = globalUrl.systemUrl.apiUrl
let assessmentApiFun = function(vm){
//申请考试题目//
let ExaminationQuestions = async (id) =>await vm.$u.post(testApiUrl+'/wxh-worker-rest/rest/exam/serviceRule/next/' + vm.vuex_token + '?userExamId='+id );
let nextClick = async (id,questionId,userAnswerIds) =>await vm.$u.post(testApiUrl+'/wxh-worker-rest/rest/exam/serviceRule/next/' + vm.vuex_token + '?userExamId='+id + '&questionId=' + questionId+'&userAnswerIds=' + userAnswerIds);
const assessmentApi = {
ExaminationQuestions,
nextClick
}
return assessmentApi
}
module.exports = {
assessmentApiFun
}
...@@ -9,11 +9,13 @@ import { ...@@ -9,11 +9,13 @@ import {
} from '@/common/api/settled.js'; } from '@/common/api/settled.js';
import {learnApiFun} from "@/common/api/learn.js"; import {learnApiFun} from "@/common/api/learn.js";
import { orderApiFun } from "@/common/api/order.js"; import { orderApiFun } from "@/common/api/order.js";
import {assessmentApiFun} from"@/common/api/assessment.js"
let apiFun = function(vm) { let apiFun = function(vm) {
let commonApi = commonApiFun(vm); let commonApi = commonApiFun(vm);
let settledApi = settledApiFun(vm) let settledApi = settledApiFun(vm)
let cloudApi = cloudRulesApiFun(vm) let cloudApi = cloudRulesApiFun(vm)
let learnApi=learnApiFun(vm) let learnApi=learnApiFun(vm)
let assessmentApi = assessmentApiFun(vm)
let orderApi=orderApiFun(vm) let orderApi=orderApiFun(vm)
let apiUrl = { let apiUrl = {
...commonApi, ...commonApi,
...@@ -21,6 +23,7 @@ let apiFun = function(vm) { ...@@ -21,6 +23,7 @@ let apiFun = function(vm) {
...cloudApi, ...cloudApi,
...learnApi, ...learnApi,
...orderApi, ...orderApi,
...assessmentApi
} }
return apiUrl return apiUrl
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="content"> <view class="content">
<view class=""> <view class="">
<view class="" style="padding-left: 94rpx; margin: 36rpx 0"> <view class="" style="padding-left: 94rpx; margin: 36rpx 0">
<text class="dx"></text <text class="dx"></text
><text class="all">{{ ExaminationQuestions.progress }}</text> ><text class="all">{{ ExaminationQuestions.progress }}</text>
</view> </view>
<view class="" style="text-align: center"> <view class="" style="text-align: center">
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</view> </view>
</view> </view>
</view> </view>
<button class="btn" @click="nextClick()">下一题</button> <button class="btn" @click="getNextClick()">下一题</button>
</view> </view>
</view> </view>
</template> </template>
...@@ -32,36 +32,34 @@ export default { ...@@ -32,36 +32,34 @@ export default {
list: [ list: [
{ {
isRight: false, isRight: false,
title: "A", content: "",
}, },
{ {
isRight: false, isRight: false,
title: "B", content: "",
}, },
{ {
isRight: false, isRight: false,
title: "C", content: "",
}, },
{ {
isRight: false, isRight: false,
title: "D", content: "",
},
{
isRight: false,
title: "E",
}, },
], ],
isSelect: false, isSelect: false,
selectId: [], selectId: [],
userExamId: null, userExamId: null,
ExaminationQuestions: null, ExaminationQuestions: {
progress: "",
question: {
content: "",
},
},
isQuestion: true, isQuestion: true,
}; };
}, },
onLoad(num) { onLoad(num) {
console.log("标识符4", this.userExamId);
console.log("标识符3" + num);
this.userExamId = num.userExamId; this.userExamId = num.userExamId;
this.getExaminationQuestions(); this.getExaminationQuestions();
}, },
...@@ -103,31 +101,33 @@ export default { ...@@ -103,31 +101,33 @@ export default {
} }
}, },
//申请考试题目 //申请考试题目
getExaminationQuestions: function () { getExaminationQuestions() {
uni.request({ this.$u.api.ExaminationQuestions(this.userExamId).then((res) => {
url: let that = this;
"http://192.168.1.22" + if (res.code == 200) {
"/wxh-worker-rest/rest/exam" + console.log("这是个标识符kao", this.ExaminationQuestions);
"/serviceRule/next/" +
this.vuex_token + if (res.data) {
"?userExamId=" + that.ExaminationQuestions = res.data;
this.userExamId, console.log(".......", this.ExaminationQuestions);
method: "POST", that.list = res.data.answerList;
header: { console.log("1111111", that);
"Content-Type": "application/x-www-form-urlencoded", console.log(
}, "这是个标识符kao",
success: (res) => { this.ExaminationQuestions
if (res.data.code == 200) { );
this.ExaminationQuestions = res.data.data;
this.list = res.data.data.answerList;
console.log(this.ExaminationQuestions);
} }
}, } else {
//接口请求失败
uni.showToast({
title: res.message,
icon: "none",
});
}
}); });
console.log("answer的userExamId是", this.userExamId);
}, },
//下一题 //下一题
nextClick: function () { getNextClick: function () {
//判断 //判断
if (this.isQuestion == "第20题/共20题") { if (this.isQuestion == "第20题/共20题") {
this.isQuestion = ""; this.isQuestion = "";
...@@ -175,6 +175,24 @@ export default { ...@@ -175,6 +175,24 @@ export default {
console.log("zzy", this.selectId); console.log("zzy", this.selectId);
}, },
}); });
this.$u.api
.nextClick(
this.userExamId,
this.ExaminationQuestions.question.id,
this.selectId
)
.then((res) => {
console.log("sssss", res);
if (res.data.code == 200) {
this.ExaminationQuestions = res.data.data;
this.list = res.data.data.answerList;
this.isQuestion = res.data.data.progress;
console.log("uuuuuuuu", this.ExaminationQuestions);
}
this.selectId = [];
console.log("zzy", this.selectId);
});
}, },
}, },
}; };
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
<view class="test"> <view class="test">
<view class="text"> <view class="text">
<text class="left">考试科目:</text <text class="left">考试科目:</text
><text style="color: #007aff">{{ exam.examName }}</text> ><text style="color: #007aff">服务规范</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">合格条件:</text <text class="left">合格条件:</text
><text>{{ exam.ruleDisc }}</text> ><text>随机20题,答对20题</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">考试时间:</text><text>30分钟</text> <text class="left">考试时间:</text><text>30分钟</text>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment