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",
......
This diff is collapsed.
<template>
<view class="content">
<view class="title">考试规则说明</view>
<view class="test">
<view class="text">
<text class="left">考试科目:</text><text style="color: #007AFF;">{{exam.examName}}</text>
</view>
<view class="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>
</view>
<view class="text">
<text class="left">备注说明:</text><text></text>
</view>
</view>
<button @click="aaa">开始考试</button>
</view>
<view class="content">
<view class="title">考试规则说明</view>
<view class="test">
<view class="text">
<text class="left">考试科目:</text
><text style="color: #007aff">{{ exam.examName }}</text>
</view>
<view class="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>
</view>
<view class="text">
<text class="left">备注说明:</text><text></text>
</view>
</view>
<button @click="getUserExamId()">开始考试</button>
</view>
</template>
<script>
export default {
data() {
return {
examId:1,
exam:null
}
},
onLoad() {
this.getUserExamInfo()
},
methods: {
aaa(){
wx.navigateTo({
url:'./answer'
})
},
//获取考试信息
getUserExamInfo: function() {
uni.showLoading({
title: '请稍候'
})
let that = this
uni.request({
url: 'https://system.banshouhui.com' +
'/wxh-worker-rest/rest/exam' +
'/serviceRule/userExamInfo/' +
'RTOKENf86a7c0606ef5ebf36f211ace3466b7f9de56e37' +
'?examId=' + this.examId,
method: 'POST',
data: {
//examId:this.examId,
},
header: {
'Content-Type': 'application/x-www-form-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('洪塘张学友')
}
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.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: '获取考试信息失败'
})
}
})
},
}
}
export default {
data() {
return {
examId: 2,
exam: null,
userExamId: null,
};
},
onLoad() {
// this.getUserExamInfo();
},
methods: {
//申请考试获取userExamId
getUserExamId: function () {
var that = this;
console.log("这是一条消息");
uni.request({
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-from-urlencoded",
},
success: (res) => {
console.log("标识符1", res.data);
uni.hideLoading();
if (res.data.code == 200) {
if (res.data.data.userExamId) {
that.userExamId = res.data.data.userExamId;
console.log("这个是个标识符", that.userExamId);
}
}
},
});
setTimeout(() => {
wx.navigateTo({
url: "./answer?userExamId=" + that.userExamId,
});
}, 1000);
},
},
};
</script>
<style >
.content{
margin: 187rpx 80rpx;
}
.title{
font-size: 17px;
text-align: center;
}
.test{
margin: 0 0 ;
}
.left{
margin-right: 8rpx;
margin-left: 68rpx;
}
.text{
margin: 50rpx 0;
}
button{
width:364rpx;
height: 56rpx;
background: #007AFF;
font-size: 24rpx;
color: #FFFFFF;
}
<style>
.content {
margin: 187rpx 80rpx;
}
.title {
font-size: 17px;
text-align: center;
}
.test {
margin: 0 0;
}
.left {
margin-right: 8rpx;
margin-left: 68rpx;
}
.text {
margin: 50rpx 0;
}
button {
width: 364rpx;
height: 56rpx;
background: #007aff;
font-size: 24rpx;
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="" 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 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;">{{ 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="test-explain">
<view class="hang">
<text class="text1">合格条件:</text><text class="text2">答对20题</text>
</view>
<view class="hang">
<text class="text1">考试结果:</text><text class="text2">答对10题</text>
</view>
<view class="hang">
<text class="text1">考试用时:</text><text class="text2">16分29秒</text>
</view>
</view>
<view class="btn">
<button class="btn1">再答一次</button>
<button class="btn2">退出重考</button>
</view>
</view>
<view class="test-result">
<text class="title">考试结果</text>
<view class="result"> {{ text }} </view>
<view class="test-explain">
<view class="hang">
<text class="text1">合格条件:</text
><text class="text2">答对20题</text>
</view>
<view class="hang">
<text class="text1">考试结果:</text
><text class="text2">答对10题</text>
</view>
<view class="hang">
<text class="text1">考试用时:</text
><text class="text2">16分29秒</text>
</view>
</view>
<view class="btn">
<button class="btn1" @click="getAgain()">再答一次</button>
<button class="btn2" @click="toIndex">下次再考</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
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{
width: 610rpx;
height: 965rpx;
margin: 70rpx auto 0;
.title{
margin: 0 44rpx 0;
}
.result{
color: red;
font-size: 66rpx;
text-align: center;
border-bottom: 1px dashed #000000;
margin: 74rpx 0;
padding: 66rpx;
}
.test-explain{
.hang{
margin: 26rpx 26rpx;
.text1{
color: #a69999;
margin-right: 22rpx;
}
.text2{
color: #333333;
}
}
}
.btn{
margin-top: 236rpx;
.btn1{
width: 478rpx;
height: 60rpx;
background: #0079fe;
color: #fff;
font-size: 26rpx;
line-height: 60rpx;
margin: 20rpx auto;
}
.btn2{
width: 478rpx;
height: 60rpx;
background: #f2f2f2;
color: #333333;
font-size: 26rpx;
line-height: 60rpx;
margin:0 auto;
}
}
}
.test-result {
width: 610rpx;
height: 965rpx;
margin: 70rpx auto 0;
.title {
margin: 0 44rpx 0;
}
.result {
color: red;
font-size: 66rpx;
text-align: center;
border-bottom: 1px dashed #000000;
margin: 74rpx 0;
padding: 66rpx;
}
.test-explain {
.hang {
margin: 26rpx 26rpx;
.text1 {
color: #a69999;
margin-right: 22rpx;
}
.text2 {
color: #333333;
}
}
}
.btn {
margin-top: 236rpx;
.btn1 {
width: 478rpx;
height: 60rpx;
background: #0079fe;
color: #fff;
font-size: 26rpx;
line-height: 60rpx;
margin: 20rpx auto;
}
.btn2 {
width: 478rpx;
height: 60rpx;
background: #f2f2f2;
color: #333333;
font-size: 26rpx;
line-height: 60rpx;
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