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