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 {
} from '@/common/api/settled.js';
import {learnApiFun} from "@/common/api/learn.js";
import { orderApiFun } from "@/common/api/order.js";
import {assessmentApiFun} from"@/common/api/assessment.js"
let apiFun = function(vm) {
let commonApi = commonApiFun(vm);
let settledApi = settledApiFun(vm)
let cloudApi = cloudRulesApiFun(vm)
let learnApi=learnApiFun(vm)
let assessmentApi = assessmentApiFun(vm)
let orderApi=orderApiFun(vm)
let apiUrl = {
...commonApi,
......@@ -21,6 +23,7 @@ let apiFun = function(vm) {
...cloudApi,
...learnApi,
...orderApi,
...assessmentApi
}
return apiUrl
}
......
......@@ -2,7 +2,7 @@
<view class="content">
<view class="">
<view class="" style="padding-left: 94rpx; margin: 36rpx 0">
<text class="dx"></text
<text class="dx"></text
><text class="all">{{ ExaminationQuestions.progress }}</text>
</view>
<view class="" style="text-align: center">
......@@ -20,7 +20,7 @@
</view>
</view>
</view>
<button class="btn" @click="nextClick()">下一题</button>
<button class="btn" @click="getNextClick()">下一题</button>
</view>
</view>
</template>
......@@ -32,36 +32,34 @@ export default {
list: [
{
isRight: false,
title: "A",
content: "",
},
{
isRight: false,
title: "B",
content: "",
},
{
isRight: false,
title: "C",
content: "",
},
{
isRight: false,
title: "D",
},
{
isRight: false,
title: "E",
content: "",
},
],
isSelect: false,
selectId: [],
userExamId: null,
ExaminationQuestions: null,
ExaminationQuestions: {
progress: "",
question: {
content: "",
},
},
isQuestion: true,
};
},
onLoad(num) {
console.log("标识符4", this.userExamId);
console.log("标识符3" + num);
this.userExamId = num.userExamId;
this.getExaminationQuestions();
},
......@@ -103,31 +101,33 @@ export default {
}
},
//申请考试题目
getExaminationQuestions: function () {
uni.request({
url:
"http://192.168.1.22" +
"/wxh-worker-rest/rest/exam" +
"/serviceRule/next/" +
this.vuex_token +
"?userExamId=" +
this.userExamId,
method: "POST",
header: {
"Content-Type": "application/x-www-form-urlencoded",
},
success: (res) => {
if (res.data.code == 200) {
this.ExaminationQuestions = res.data.data;
this.list = res.data.data.answerList;
console.log(this.ExaminationQuestions);
getExaminationQuestions() {
this.$u.api.ExaminationQuestions(this.userExamId).then((res) => {
let that = this;
if (res.code == 200) {
console.log("这是个标识符kao", this.ExaminationQuestions);
if (res.data) {
that.ExaminationQuestions = res.data;
console.log(".......", this.ExaminationQuestions);
that.list = res.data.answerList;
console.log("1111111", that);
console.log(
"这是个标识符kao",
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题") {
this.isQuestion = "";
......@@ -175,6 +175,24 @@ export default {
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 @@
<view class="test">
<view class="text">
<text class="left">考试科目:</text
><text style="color: #007aff">{{ exam.examName }}</text>
><text style="color: #007aff">服务规范</text>
</view>
<view class="text">
<text class="left">合格条件:</text
><text>{{ exam.ruleDisc }}</text>
><text>随机20题,答对20题</text>
</view>
<view class="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