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",
......
This diff is collapsed.
<template> <template>
<view class="content"> <view class="content">
<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
</view> ><text style="color: #007aff">{{ exam.examName }}</text>
<view class="text"> </view>
<text class="left">合格条件:</text><text>{{exam.ruleDisc}}</text> <view class="text">
</view> <text class="left">合格条件:</text
<view class="text"> ><text>{{ exam.ruleDisc }}</text>
<text class="left">考试时间:</text><text>30分钟</text> </view>
</view> <view class="text">
<view class="text"> <text class="left">考试时间:</text><text>30分钟</text>
<text class="left">题目规则:</text><text>题库100题,随机抽20题</text> </view>
</view> <view class="text">
<view class="text"> <text class="left">题目规则:</text
<text class="left">备注说明:</text><text>无</text> ><text>题库100题,随机抽20题</text>
</view> </view>
</view> <view class="text">
<button @click="aaa">开始考试</button> <text class="left">备注说明:</text><text>无</text>
</view> </view>
</view>
<button @click="getUserExamId()">开始考试</button>
</view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
examId:1, examId: 2,
exam:null exam: null,
} userExamId: null,
}, };
onLoad() { },
this.getUserExamInfo() onLoad() {
}, // this.getUserExamInfo();
methods: { },
aaa(){ methods: {
//申请考试获取userExamId
wx.navigateTo({ getUserExamId: function () {
var that = this;
url:'./answer' console.log("这是一条消息");
}) uni.request({
}, url:
//获取考试信息 "http://192.168.1.22" +
getUserExamInfo: function() { "/wxh-worker-rest/rest/exam/serviceRule/" +
that.vuex_token +
uni.showLoading({ "?examId=" +
title: '请稍候' this.examId,
}) method: "POST",
header: {
let that = this "Content-Type": "application/x-www-from-urlencoded",
uni.request({ },
url: 'https://system.banshouhui.com' +
'/wxh-worker-rest/rest/exam' + success: (res) => {
'/serviceRule/userExamInfo/' + console.log("标识符1", res.data);
'RTOKENf86a7c0606ef5ebf36f211ace3466b7f9de56e37' + uni.hideLoading();
'?examId=' + this.examId, if (res.data.code == 200) {
method: 'POST', if (res.data.data.userExamId) {
data: { that.userExamId = res.data.data.userExamId;
//examId:this.examId, console.log("这个是个标识符", that.userExamId);
}, }
header: { }
'Content-Type': 'application/x-www-form-urlencoded' },
}, });
success: (res) => { setTimeout(() => {
console.log(res.data) wx.navigateTo({
uni.hideLoading() url: "./answer?userExamId=" + that.userExamId,
if (!res.data) { });
return }, 1000);
} },
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: '获取考试信息失败'
})
}
})
},
}
}
</script> </script>
<style > <style>
.content{ .content {
margin: 187rpx 80rpx; margin: 187rpx 80rpx;
} }
.title{
font-size: 17px; .title {
text-align: center; font-size: 17px;
} text-align: center;
.test{ }
margin: 0 0 ;
} .test {
.left{ margin: 0 0;
margin-right: 8rpx; }
margin-left: 68rpx;
.left {
} margin-right: 8rpx;
.text{ margin-left: 68rpx;
margin: 50rpx 0; }
}
button{ .text {
width:364rpx; margin: 50rpx 0;
height: 56rpx; }
background: #007AFF;
font-size: 24rpx; button {
color: #FFFFFF; width: 364rpx;
} height: 56rpx;
background: #007aff;
font-size: 24rpx;
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="" style="font-size: 40rpx;font-weight: bold;margin: 30rpx 0;"> <view class="" v-if="courseInfo.isTeachers">
讲师 <view class="" style="font-size: 40rpx;font-weight: bold;margin: 30rpx 0;">
</view> 讲师
<view class="" style="display: flex;"> </view>
<image src="../../static/logo.png" mode=""></image> <view class="" style="display: flex;">
<view style="font-size: 30rpx;font-weight:1000;margin: 19px 24px;">扳手卢老师</view> <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>
<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 class="test-explain">
</view> <view class="hang">
<view class="test-explain"> <text class="text1">合格条件:</text
<view class="hang"> ><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="text1">考试结果:</text><text class="text2">答对10题</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
</view> ><text class="text2">16分29秒</text>
</view> </view>
<view class="btn"> </view>
<button class="btn1">再答一次</button> <view class="btn">
<button class="btn2">退出重考</button> <button class="btn1" @click="getAgain()">再答一次</button>
</view> <button class="btn2" @click="toIndex">下次再考</button>
</view> </view>
</view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
text: "",
} examId: 2,
}, result: null,
methods: { 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> </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;
border-bottom: 1px dashed #000000; border-bottom: 1px dashed #000000;
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;
color: #fff; color: #fff;
font-size: 26rpx; font-size: 26rpx;
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