Commit a033412d authored by 刘用法's avatar 刘用法
parents 8632bcd7 b2c4a442
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
}, },
data() { data() {
return { return {
status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',5=>'已签约',6=>'未支付保证金',7=>'已支付保证金',8=>'已通过考试',9=>'待提交' status: 0, // 入驻状态:0=>'待提交',1=>'待审核',2=>'已通过',3=>'备选',4=>'已驳回',6=>'已签约',7=>'已支付保证金',8=>'已通过考试',9=>'待提交'
location: [116.3896, 39.91917], // 经纬度 location: [116.3896, 39.91917], // 经纬度
title: false, title: false,
title: "Hello", title: "Hello",
......
<template> <template>
<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="num">第1题</text><text class="all">/共30题</text> <text class="dx">多选</text
><text class="all">{{ ExaminationQuestions.progress }}</text>
</view> </view>
<view class="" style="text-align: center;"> <view class="" style="text-align: center">
一下对压缩机故障描述有误的是? {{ ExaminationQuestions.question.content }}
</view> </view>
<view class="" style="margin-top: 130rpx;"> <view class="" style="margin-top: 130rpx">
<view class="list-box"> <view class="list-box">
<view v-for="(item,index) in list" :key="index" @click="choice(index)" :class="[item.selected?'selde':'noselde']"> <view
{{item.selected?item.title:item.title}} v-for="(item, index) in list"
:key="index"
@click="choice(index)"
:class="[item.isRight ? 'selde' : 'noselde']"
>
{{ item.content }}
</view> </view>
</view> </view>
</view> </view>
<button class="btn">下一题</button> <button class="btn" @click="nextClick()">下一题</button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
list: [{ list: [
selected: false, {
title: 'A' isRight: false,
title: "A",
}, },
{ {
selected: false, isRight: false,
title: 'B' title: "B",
}, },
{ {
selected: false, isRight: false,
title: 'C' title: "C",
}, },
{ {
selected: false, isRight: false,
title: 'D' title: "D",
}, },
{ {
selected: false, isRight: false,
title: 'E' title: "E",
} },
], ],
selectId:[], isSelect: false,
selectId: [],
userExamId: null,
ExaminationQuestions: null,
isQuestion: true,
}; };
}, },
onLoad() { onLoad(num) {
this.getUserExamInfo() console.log("标识符4", this.userExamId);
console.log("标识符3" + num);
this.userExamId = num;
this.getExaminationQuestions();
}, },
onUnload() {
wx.reLaunch({
url: "./index",
});
},
methods: { methods: {
abc() { abc() {
console.log("11111") console.log("11111");
var arr = document.querySelector(".btm"); var arr = document.querySelector(".btm");
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
arr[i].onclick = function() { arr[i].onclick = function () {
console.log(this.value) console.log(this.value);
} };
} }
}, },
//选择按钮 //选择按钮
choice(index) { choice(index) {
if (this.list[index].selected == true) { if (this.list[index].isRight == true) {
this.list[index].selected = false; this.list[index].isRight = false;
this.isSelect = false;
console.log(this.isSelect);
//取消选中时删除数组中的值 //取消选中时删除数组中的值
for (var i = 0; i < this.selectId.length; i++) { for (var i = 0; i < this.selectId.length; i++) {
if (this.selectId[i] === this.list[index].title) { if (this.selectId[i] === this.list[index].id) {
this.selectId.splice(i, 1); this.selectId.splice(i, 1);
} }
} }
console.log("选中的值", this.selectId) console.log("选中的值", this.selectId);
} else { } else {
this.list[index].selected = true; this.list[index].isRight = true;
this.selectId.push(this.list[index].title) this.isSelect = true;
console.log("选中的值", this.selectId) console.log(this.isSelect);
this.selectId.push(this.list[index].id);
console.log("选中的值", this.selectId);
} }
}, },
//申请考试题目
getExaminationQuestions: function () {
uni.request({
url:
"http://192.168.1.22" +
"/wxh-worker-rest/rest/exam" +
"/serviceRule/next/" +
this.vuex_token +
"?userExamId=" +
this.userExamId.userExamId,
method: "POST",
header: {
"Content-Type": "application/x-www-form-urlencoded",
}, },
mounted() { success: (res) => {
console.log("111111") if (res.data.code == 200) {
this.ExaminationQuestions = res.data.data;
this.list = res.data.data.answerList;
console.log(this.ExaminationQuestions);
} }
},
});
console.log("answer的userExamId是", this.userExamId);
},
//下一题
nextClick: function () {
//判断
if (this.isQuestion == "第20题/共20题") {
this.isQuestion = "";
console.log("标识符6666", this.userExamId.userExamId);
wx.navigateTo({
url: "./result?userExamId=" + this.userExamId.userExamId,
});
}
//判断有没有选
if (this.selectId.length == 0) {
wx.showToast({
title: "请选择",
icon: "none", //当icon:'none'时,没有图标 只有文字
duration: 2000,
});
return;
}
uni.request({
url:
"http://192.168.1.22" +
"/wxh-worker-rest/rest/exam" +
"/serviceRule/next/" +
this.vuex_token +
"?userExamId=" +
this.userExamId.userExamId +
"&questionId=" +
this.ExaminationQuestions.question.id +
"&userAnswerIds=" +
this.selectId,
method: "POST",
header: {
"Content-Type": "application/x-www-form-urlencoded",
},
success: (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);
},
});
},
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
.content { .content {
width: 600rpx; width: 600rpx;
height: 800rpx; height: 800rpx;
/* background: #8F8F94; */ /* background: #8F8F94; */
margin: 0 auto; margin: 0 auto;
} }
.dx { .dx {
padding: 0rpx; padding: 0rpx;
background: #2979FF; background: #2979ff;
color: #FFFFFF; color: #ffffff;
border-radius: 0px; border-radius: 0px;
} }
.num { .num {
color: #2B85E4; color: #2b85e4;
} }
.all { .all {
color: #8F8F94; color: #8f8f94;
} }
.btn { .btn {
margin-top: 98rpx; margin-top: 98rpx;
width: 476rpx; width: 476rpx;
height: 60rpx; height: 60rpx;
line-height: 30px; line-height: 30px;
background: #007AFF; background: #007aff;
color: #FFFFFF; color: #ffffff;
} }
.btm { .btm {
width: 476rpx; width: 476rpx;
height: 60rpx; height: 60rpx;
line-height: 30px; line-height: 30px;
margin: 34rpx auto; margin: 34rpx auto;
} }
.list-box { .list-box {
// display: flex; // display: flex;
// flex-wrap: wrap; // flex-wrap: wrap;
padding: 16upx; padding: 16upx;
...@@ -139,26 +232,24 @@ ...@@ -139,26 +232,24 @@
line-height: 60upx; line-height: 60upx;
text-align: center; text-align: center;
margin: 26rpx auto 0; margin: 26rpx auto 0;
} }
}
} /*已选择*/
.selde {
/*已选择*/ background: #007aff;
.selde { color: #ffffff;
background: #007AFF;
color: #FFFFFF;
border-radius: 20upx; border-radius: 20upx;
font-size: 26rpx; font-size: 26rpx;
padding: 0 10upx; padding: 0 10upx;
} }
/*未选择*/ /*未选择*/
.noselde { .noselde {
background: #E4E7ED; background: #e4e7ed;
color: #959595; color: #959595;
border-radius: 20upx; border-radius: 20upx;
font-size: 20upx; font-size: 20upx;
padding: 0 10upx; padding: 0 10upx;
} }
</style> </style>
...@@ -3,148 +3,106 @@ ...@@ -3,148 +3,106 @@
<view class="title">考试规则说明</view> <view class="title">考试规则说明</view>
<view class="test"> <view class="test">
<view class="text"> <view class="text">
<text class="left">考试科目:</text><text style="color: #007AFF;">{{exam.examName}}</text> <text class="left">考试科目:</text
><text style="color: #007aff">{{ exam.examName }}</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">合格条件:</text><text>{{exam.ruleDisc}}</text> <text class="left">合格条件:</text
><text>{{ exam.ruleDisc }}</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">考试时间:</text><text>30分钟</text> <text class="left">考试时间:</text><text>30分钟</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">题目规则:</text><text>题库100题,随机抽20题</text> <text class="left">题目规则:</text
><text>题库100题,随机抽20题</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">备注说明:</text><text></text> <text class="left">备注说明:</text><text></text>
</view> </view>
</view> </view>
<button @click="aaa">开始考试</button> <button @click="getUserExamId()">开始考试</button>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
examId:1, examId: 2,
exam:null exam: null,
} userExamId: null,
};
}, },
onLoad() { onLoad() {
this.getUserExamInfo() // this.getUserExamInfo();
}, },
methods: { methods: {
aaa(){ //申请考试获取userExamId
getUserExamId: function () {
wx.navigateTo({ var that = this;
console.log("这是一条消息");
url:'./answer'
})
},
//获取考试信息
getUserExamInfo: function() {
uni.showLoading({
title: '请稍候'
})
let that = this
uni.request({ uni.request({
url: 'https://system.banshouhui.com' + url:
'/wxh-worker-rest/rest/exam' + "http://192.168.1.22" +
'/serviceRule/userExamInfo/' + "/wxh-worker-rest/rest/exam/serviceRule/" +
'RTOKENf86a7c0606ef5ebf36f211ace3466b7f9de56e37' + that.vuex_token +
'?examId=' + this.examId, "?examId=" +
method: 'POST', this.examId,
data: { method: "POST",
//examId:this.examId,
},
header: { header: {
'Content-Type': 'application/x-www-form-urlencoded' "Content-Type": "application/x-www-from-urlencoded",
}, },
success: (res) => { success: (res) => {
console.log(res.data) console.log("标识符1", res.data);
uni.hideLoading() uni.hideLoading();
if (!res.data) {
return
}
if (res.data.code == 401 || res.data.code == 403) {
// uni.navigateTo({
// url: '/pages/login/wxlogin'
// })
// return
console.log('洪塘张学友')
}
if (res.data.code == 200) { if (res.data.code == 200) {
//examStatus 用户考试状态 0考试中 1考试完成 2未参与 if (res.data.data.userExamId) {
that.exam = res.data.data that.userExamId = res.data.data.userExamId;
console.log(that.exam) console.log("这个是个标识符", that.userExamId);
if (res.data.data.examStatus == 2) {
that.applyExam()
return
}
if(res.data.data.examStatus == 1){
console.log('111111111111111111111111111')
that.isComplete = true
that.examScore = res.data.data.examScore
that.postResult()
return
} }
if (res.data.data.examStatus == 0 ) {
that.userExamId = res.data.data.id
that.getNext()
} }
} else {
uni.showToast({
icon: 'none',
title: res.data.message
})
}
}, },
fail: (e) => { });
uni.hideLoading() setTimeout(() => {
uni.showToast({ wx.navigateTo({
icon: 'none', url: "./answer?userExamId=" + that.userExamId,
title: '获取考试信息失败' });
}) }, 1000);
}
})
}, },
},
} };
}
</script> </script>
<style > <style>
.content{ .content {
margin: 187rpx 80rpx; margin: 187rpx 80rpx;
} }
.title{
.title {
font-size: 17px; font-size: 17px;
text-align: center; text-align: center;
} }
.test{
margin: 0 0 ; .test {
} margin: 0 0;
.left{ }
.left {
margin-right: 8rpx; margin-right: 8rpx;
margin-left: 68rpx; margin-left: 68rpx;
}
} .text {
.text{
margin: 50rpx 0; margin: 50rpx 0;
} }
button{
width:364rpx; button {
width: 364rpx;
height: 56rpx; height: 56rpx;
background: #007AFF; background: #007aff;
font-size: 24rpx; font-size: 24rpx;
color: #FFFFFF; color: #ffffff;
} }
</style> </style>
...@@ -3,30 +3,34 @@ ...@@ -3,30 +3,34 @@
<view class="title"> <view class="title">
课程简介 课程简介
</view> </view>
<view class="u-content">
<u-parse :html="courseInfo.intro"></u-parse>
</view>
<view class="lecturer"> <view class="lecturer">
<view class="" v-if="courseInfo.isTeachers">
<view class="" style="font-size: 40rpx;font-weight: bold;margin: 30rpx 0;"> <view class="" style="font-size: 40rpx;font-weight: bold;margin: 30rpx 0;">
讲师 讲师
</view> </view>
<view class="" style="display: flex;"> <view class="" style="display: flex;">
<image src="../../static/logo.png" mode=""></image> <image src="../../static/logo.png" mode=""></image>
<view style="font-size: 30rpx;font-weight:1000;margin: 19px 24px;">扳手卢老师</view> <view style="font-size: 30rpx;font-weight:1000;margin: 19px 24px;">{{ courseInfo.teacher.name }}</view>
</view>
</view> </view>
<view class="" style="margin: 36rpx 0;"> <view class="" style="margin: 36rpx 0;">
<view class="" style="font-size: 40rpx;font-weight:1000"> <view class="" style="font-size: 40rpx;font-weight:1000">
目录 目录
</view> </view>
<view v-for="item in list"> <view v-for="(item,index) in list">
<view class="chapter"> <view class="chapter">
{{item.name}} {{item.name}}
</view> </view>
<view class="video" v-for="key in item.section" @click=details(key.id)> <view class="video" v-for="(section,key) in item.section" @click=details(section.id)>
<view class="video_1" > <view class="video_1" >
<view class="text" v-text="wareType(key.ware)"> <view class="text" v-text="wareType(section.ware)">
</view> </view>
<text>1-{{key.order}}</text> <text class="texts">{{index+1}}-{{key+1}}</text>
<text class="text2">{{key.name}}</text> <text class="text2">{{section.name}}</text>
<text class="text3" v-text="key.isLearned==false?'未开始':'完成'"></text> <text class="text3" v-text="section.isLearned==false?'未开始':'完成'"></text>
</view> </view>
</view> </view>
</view> </view>
...@@ -45,6 +49,11 @@ ...@@ -45,6 +49,11 @@
}, },
list:[], list:[],
examId:1, examId:1,
courseInfo: {
intro: '',
isTeachers: false,
teacher: {}
}
} }
}, },
onLoad(a){ onLoad(a){
...@@ -52,8 +61,31 @@ ...@@ -52,8 +61,31 @@
this.params.course_id=a.course_id this.params.course_id=a.course_id
console.log(this.params.course_id) console.log(this.params.course_id)
this.getCapterDetails() this.getCapterDetails()
this.getCourseInfo()
}, },
methods: { methods: {
getCourseInfo() {
let param = {
course_id: this.params.course_id
};
this.$u.api
.CourseList(param)
.then((res) => {
if (res.code == 200) {
if (res.data) {
this.courseInfo.intro = res.data.course.intro;
this.courseInfo.isTeachers = res.data.course.teachers.length > 0;
this.courseInfo.teacher = this.courseInfo.isTeachers ? res.data.course.teachers[0] : {};
}
}
})
.catch((err) => {
uni.showToast({
title: err,
icon: "none",
});
});
},
//获取章节详情 //获取章节详情
getCapterDetails() { getCapterDetails() {
console.log('获取章节详情') console.log('获取章节详情')
...@@ -133,7 +165,7 @@ ...@@ -133,7 +165,7 @@
<style lang="scss"> <style lang="scss">
.title{ .title{
height: 164rpx; height: 64rpx;
font-size: 40rpx; font-size: 40rpx;
font-weight: bold; font-weight: bold;
margin: 24rpx 34rpx; margin: 24rpx 34rpx;
...@@ -158,6 +190,12 @@ ...@@ -158,6 +190,12 @@
margin: 20rpx 0; margin: 20rpx 0;
position: relative; position: relative;
width: 100%; width: 100%;
.texts{
border:1px solid #8F8F94;
text-align: center;
line-height: 38rpx;
margin-right: 5rpx;
}
.text{ .text{
width: 100rpx; width: 100rpx;
height: 38rpx; height: 38rpx;
...@@ -179,4 +217,7 @@ ...@@ -179,4 +217,7 @@
right: 0; right: 0;
} }
} }
.u-content {
padding: 0rpx 34rpx;
}
</style> </style>
This diff is collapsed.
<template> <template>
<view class="test-result"> <view class="test-result">
<text class="title">考试结果</text> <text class="title">考试结果</text>
<view class="result"> <view class="result"> {{ text }} </view>
未通过
</view>
<view class="test-explain"> <view class="test-explain">
<view class="hang"> <view class="hang">
<text class="text1">合格条件:</text><text class="text2">答对20题</text> <text class="text1">合格条件:</text
><text class="text2">答对20题</text>
</view> </view>
<view class="hang"> <view class="hang">
<text class="text1">考试结果:</text><text class="text2">答对10题</text> <text class="text1">考试结果:</text
><text class="text2">答对10题</text>
</view> </view>
<view class="hang"> <view class="hang">
<text class="text1">考试用时:</text><text class="text2">16分29秒</text> <text class="text1">考试用时:</text
><text class="text2">16分29秒</text>
</view> </view>
</view> </view>
<view class="btn"> <view class="btn">
<button class="btn1">再答一次</button> <button class="btn1" @click="getAgain()">再答一次</button>
<button class="btn2">退出重</button> <button class="btn2" @click="toIndex">下次再</button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
text: "",
} examId: 2,
result: null,
userExamId: null,
};
},
onLoad(a) {
this.userExamId = a.userExamId;
console.log("userExamId是", this.userExamId);
this.nextClick();
},
onUnload() {
wx.reLaunch({
url: "./index",
});
}, },
methods: { methods: {
//考试结果
nextClick: function () {
console.log("wwwwwwwwww");
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) => {
this.result = res.data.data;
this.text = res.data.data.examLevelResult;
console.log("标识符55", this.result);
},
});
},
//再次考试
getAgain: function () {
wx.navigateTo({
url: "./assessment",
});
},
//下次再考跳转到学习主界面页面
toIndex: function () {
wx.reLaunch({
url: "./index",
});
},
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
.test-result{ .test-result {
width: 610rpx; width: 610rpx;
height: 965rpx; height: 965rpx;
margin: 70rpx auto 0; margin: 70rpx auto 0;
.title{ .title {
margin: 0 44rpx 0; margin: 0 44rpx 0;
} }
.result{ .result {
color: red; color: red;
font-size: 66rpx; font-size: 66rpx;
text-align: center; text-align: center;
...@@ -51,21 +99,21 @@ ...@@ -51,21 +99,21 @@
margin: 74rpx 0; margin: 74rpx 0;
padding: 66rpx; padding: 66rpx;
} }
.test-explain{ .test-explain {
.hang{ .hang {
margin: 26rpx 26rpx; margin: 26rpx 26rpx;
.text1{ .text1 {
color: #a69999; color: #a69999;
margin-right: 22rpx; margin-right: 22rpx;
} }
.text2{ .text2 {
color: #333333; color: #333333;
} }
} }
} }
.btn{ .btn {
margin-top: 236rpx; margin-top: 236rpx;
.btn1{ .btn1 {
width: 478rpx; width: 478rpx;
height: 60rpx; height: 60rpx;
background: #0079fe; background: #0079fe;
...@@ -74,16 +122,15 @@ ...@@ -74,16 +122,15 @@
line-height: 60rpx; line-height: 60rpx;
margin: 20rpx auto; margin: 20rpx auto;
} }
.btn2{ .btn2 {
width: 478rpx; width: 478rpx;
height: 60rpx; height: 60rpx;
background: #f2f2f2; background: #f2f2f2;
color: #333333; color: #333333;
font-size: 26rpx; font-size: 26rpx;
line-height: 60rpx; line-height: 60rpx;
margin:0 auto; margin: 0 auto;
}
} }
} }
}
</style> </style>
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