Commit acfe4382 authored by Facius's avatar Facius

考试首页

parent 5d47a90d
......@@ -217,6 +217,16 @@
"path": "pages/settle/base", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "在线考试", //模式名称
"path": "pages/learn/exam", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "在线考试-old", //模式名称
"path": "pages/exam/start", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "入驻提示", //模式名称
"path": "pages/settle/prompt", //启动页面,必选
......
<template>
<view class="backView">
<process :process="2" :type="0" title="业务流程"></process>
<template v-if="isStart==false">
<view class="noticeView">
<text class="noticeText">规则:系统随机出现20道考试题目,每道题5分,每题答题时间100秒,在规定时间内答对题目的记分。
......@@ -151,7 +150,7 @@
}
if (res.data.code == 401 || res.data.code == 403) {
uni.navigateTo({
url: '/pages/login/index'
url: '/pages/login/wxlogin'
})
return
}
......@@ -220,7 +219,7 @@
if (res.statusCode == 401) {
uni.navigateTo({
url: '/pages/login/index'
url: '/pages/login/wxlogin'
})
return
}
......@@ -289,7 +288,7 @@
uni.hideLoading()
if (res.statusCode == 401) {
uni.navigateTo({
url: '/pages/login/index'
url: '/pages/login/wxlogin'
})
return
}
......@@ -452,7 +451,7 @@
if (res.statusCode == 401) {
uni.navigateTo({
url: '/pages/login/index'
url: '/pages/login/wxlogin'
})
return
}
......
......@@ -65,7 +65,6 @@ export default {
let that = this
if(that.courseId) {
that.$u.api.saveCourseRate({courseId: that.courseId}).then(res => {
debugger
if(res.code == 200) {
// uni.navigateBack({delta: 1})
uni.navigateTo({
......
<template>
<view class="exam-wrap">
<Settle :index="3">
<view class="exam-tips"><u-alert-tips :show-icon="true" class="exam-tips" type="warning" :title="tipsTitle" :description="tipsDescription"></u-alert-tips></view>
<view class="exam-course">
<u-card margin="20rpx 0rpx 30rpx 0rpx" :border="false" :border-radius="cardRadius">
<view class="exam-head" slot="head">师傅接单教程</view>
<view class="exam-body" slot="body">
<u-cell-group :border="false">
<u-cell-item
v-for="(item, key) in tutorials"
:key="key"
icon="play-circle"
:border-bottom="false"
:title="item.title"
:value="item.value"
:value-style="item.courseActive"
@click="viewCourse(item)"
></u-cell-item>
</u-cell-group>
</view>
</u-card>
</view>
<view class="exam-course">
<u-card margin="0rpx" :border="false" :border-radius="cardRadius">
<view class="exam-head" slot="head">师傅接单考试</view>
<uni-group slot="body">
<view>总共20题,每题5分,答题时间不超过40分钟</view>
<view>请认真对待,预祝顺利通过考试!</view>
</uni-group>
</u-card>
</view>
<view class="content-gap"></view>
</Settle>
<view class="bottom-fix-btn">
<view class="btn-block"><u-button type="primary" shape="circle">去考试</u-button></view>
</view>
</view>
</template>
<script>
import Settle from '@/components/settle/index.vue';
let app = getApp()
export default {
components: {
Settle
},
data() {
return {
cardRadius: 12,
tipsTitle: '提示:',
// 简单使用固定培训视频
tutorials: [
{ id: 'Course1', courseId: 1, title: '', value: '已查看', courseActive: {}, status: 1, url: ''},
{ id: 'Course2', courseId: 2, title: '', value: '未查看', courseActive: {}, status: 0, url: ''},
{ id: 'Course3', courseId: 3, title: '', value: '未查看', courseActive: {}, status: 0, url: ''}
],
tipsDescription: '接单考核可让您快速了解如何使用小程序,建议先查看学习教程'
};
},
computed: {
},
onLoad() {
this.tutorials.map((item, key) => {
item['url'] = app.globalData.service_standard[item.id].url
item['title'] = app.globalData.service_standard[item.id].title
item['value'] = item['status'] ? '已查看' : '未查看';
item['courseActive'] = item['status'] ? {"color": "#2979ff"} : {"color": "#ff0000"}
})
this.loadLearnData();
},
methods: {
loadLearnData() {
let that = this;
that.$u.api
.listOrderingTutorials()
.then(res => {
const results = res.data;
if (res.status == 200 && results && results.length > 0) {
that.tutorials.forEach((data, i) => {
if (results.hasOwnProperty(data.id)) {
data.status = results[data.id];
data.value = data.status ? '已查看' : '未查看';
data.courseActive = data.status ? {"color": "#2979ff"} : {"color": "red"}
that.tutorials[i] = data;
}
});
}
})
.catch(e => {
debugger;
console.log(e, 'loadLearnData');
});
},
viewCourse(e) {
let that = this;
let params = `id=${e.id}&courseId=${e.courseId}&status=${e.status}`
uni.navigateTo({
url: `/pages/learn/course-detail?${params}`
})
},
<template>
<view class="exam-wrap">
<Settle :index="3">
<view class="tip-text">
<image class="tip-image" mode="widthFix" src="../../static/settle/tips1@3x.png"></image>
<text>接单教程可让您快速了解如何使用小程序,建议先查看并学习教程。</text>
</view>
<view class="learn-view">
<view class="learn-view-title">接单操作须知</view>
<view class="learn-list" v-for="(item, key) in tutorials" :key="key">
<view class="learn-list-item">
<view class="item-content">
<view class="item-st"><text
class="item-st-text">{{item.title.split(' ') ? item.title.split(' ')[0] : ''}}</text>
</view>
<view class="item-title">{{item.title.split(' ') ? item.title.split(' ')[1] : ''}}</view>
</view>
<u-button v-if="item.status" type="default" hover-class="none" shape="circle"
:custom-style="learnedStyle" @click="viewCourse(item)">已学习</u-button>
<u-button v-else type="'primary" plain="true" hover-class="none" shape="circle"
:custom-style="learnStyle" @click="viewCourse(item)">去学习</u-button>
</view>
<view class="line-view"></view>
</view>
</view>
<view class="tip-bottom">
<view class="learn-view-title">接单操作考试</view>
<view class="tip-bottom-t">系统随机出20道选择题,每题5分,及格为70分,分数不及格将影响接单。考题来自接单操作须知,请务必认真查看及学习,以便快速通过考试。</view>
<view class="tip-bottom-h">希望您认真对待,祝您能顺利通过考试!</view>
</view>
<!-- <view class="exam-tips">
<u-alert-tips :show-icon="true" class="exam-tips" type="warning" :title="tipsTitle"
:description="tipsDescription"></u-alert-tips>
</view>
<view class="exam-course">
<u-card margin="20rpx 0rpx 30rpx 0rpx" :border="false" :border-radius="cardRadius">
<view class="exam-head" slot="head">师傅接单教程</view>
<view class="exam-body" slot="body">
<u-cell-group :border="false">
<u-cell-item v-for="(item, key) in tutorials" :key="key" icon="play-circle"
:border-bottom="false" :title="item.title" :value="item.value"
:value-style="item.courseActive" @click="viewCourse(item)"></u-cell-item>
</u-cell-group>
</view>
</u-card>
</view>
<view class="exam-course">
<u-card margin="0rpx" :border="false" :border-radius="cardRadius">
<view class="exam-head" slot="head">师傅接单考试</view>
<uni-group slot="body">
<view>总共20题,每题5分,答题时间不超过40分钟</view>
<view>请认真对待,预祝顺利通过考试!</view>
</uni-group>
</u-card>
</view>
<view class="content-gap"></view> -->
<template v-slot:bottom>
<view class="btn-wrap">
<u-button type="primary" :custom-style="buttonStyle" shape="circle">去考试</u-button>
</view>
</template>
</Settle>
</view>
</template>
<script>
import Settle from '@/components/settle/index.vue';
let app = getApp()
export default {
components: {
Settle
},
data() {
return {
cardRadius: 12,
tipsTitle: '提示:',
// 简单使用固定培训视频
tutorials: [{
id: 'Course1',
courseId: 1,
title: '',
value: '已学习',
courseActive: {},
status: 1,
url: ''
},
{
id: 'Course2',
courseId: 2,
title: '',
value: '去学习',
courseActive: {},
status: 0,
url: ''
},
{
id: 'Course3',
courseId: 3,
title: '',
value: '去学习',
courseActive: {},
status: 0,
url: ''
}
],
tipsDescription: '接单考核可让您快速了解如何使用小程序,建议先查看学习教程'
};
},
computed: {
learnStyle() {
return {
'color': '#2272FF',
'width': '120rpx',
'height': '48rpx',
'background-color': '#FFFFFF',
'font-size': '24rpx'
}
},
learnedStyle() {
return {
'color': '#999999',
'width': '120rpx',
'height': '48rpx',
'background-color': '#FFFFFF',
'font-size': '24rpx'
}
},
buttonStyle() {
return {
'color': '#FFFFFF',
'width': '300rpx',
'height': '112rpx',
'background-color': '#2272FF',
'font-size': '32rpx',
'font-weight': 'bold'
}
}
},
onLoad() {
this.tutorials.map((item, key) => {
item['url'] = app.globalData.service_standard[item.id].url
item['title'] = app.globalData.service_standard[item.id].title
item['value'] = item['status'] ? '已学习' : '去学习'
item['courseActive'] = item['status'] ? this.learnStyle : this.learnedStyle
})
this.loadLearnData();
},
methods: {
loadLearnData() {
let that = this;
that.$u.api
.listOrderingTutorials()
.then(res => {
const results = res.data;
if (res.status == 200 && results && results.length > 0) {
that.tutorials.forEach((data, i) => {
if (results.hasOwnProperty(data.id)) {
data.status = results[data.id];
data.value = data.status ? '已学习' : '去学习';
data.courseActive = data.status ? {
"color": "#2979ff"
} : {
"color": "red"
}
that.tutorials[i] = data;
}
});
}
})
.catch(e => {
debugger;
console.log(e, 'loadLearnData');
});
},
viewCourse(e) {
let that = this;
let params = `id=${e.id}&courseId=${e.courseId}&status=${e.status}`
uni.navigateTo({
url: `/pages/learn/course-detail?${params}`
})
},
}
};
</script>
<style lang="scss" scoped>
.exam-tips .u-alert-tips {
border-radius: 12rpx !important;
border: none !important;
.u-alert-title {
font-size: 28rpx !important;
font-weight: bold;
}
}
.exam-wrap {
background-color: #F4F5F7;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.exam-head {
font-size: 36rpx;
font-weight: bold;
}
.content-gap {
height: 1rpx;
margin-bottom: 200rpx;
}
.tip-text {
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx;
height: 140rpx;
margin-bottom: 20rpx;
font-size: 24rpx;
color: #000000;
display: flex;
align-items: flex-start;
}
.tip-image {
width: 28rpx;
margin-right: 10rpx;
margin-top: 2rpx;
}
.learn-view-title {
font-size: 32rpx;
color: #333333;
font-weight: bold;
}
};
</script>
<style lang="scss">
.exam-tips .u-alert-tips {
border-radius: 12rpx !important;
border: none !important;
.u-alert-title {
font-size: 28rpx !important;
font-weight: bold;
}
}
.exam-wrap {
background: #f4f5f7;
}
.exam-head {
font-size: 36rpx;
font-weight: bold;
}
.content-gap {
height: 1rpx;
margin-bottom: 200rpx;
}
.tip-bottom {
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx;
font-size: 28rpx;
color: #333333;
margin-bottom: 188rpx;
.tip-bottom-h {
font-size: 24rpx;
color: #999999;
}
.tip-bottom-t {
margin-top: 30rpx;
margin-bottom: 20rpx;
}
}
.learn-view {
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
color: #333333;
.learn-list {
.learn-list-item {
display: flex;
justify-content: space-between;
margin-top: 30rpx;
margin-bottom: 30rpx;
.item-content {
display: flex;
}
.item-st {
width: 80rpx;
height: 36rpx;
background-image: linear-gradient(to right, #FF930D, #FFC174);
font-size: 16rpx;
border-radius: 6rpx 36rpx 36rpx 6rpx;
padding-top: 8rpx;
padding-right: 2rpx;
text-align: center;
margin-right: 20rpx;
}
.item-title {
color: #333333;
font-size: 28rpx;
}
}
.line-view {
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
}
}
}
</style>
......@@ -103,7 +103,6 @@ export default {
signupLogin(e) {
var that = this
debugger
console.log(e.detail.errMsg)
console.log(e.detail.iv)
console.log(e.detail.encryptedData)
......
......@@ -17,7 +17,7 @@
<u-icon name="arrow-right" color="#2272FF" size="28"></u-icon>
</view>
<view class="tips">可以服务的城市,可选多个</view>
<view v-if="">
<view v-if="cityText">
<view class="line-view-d"></view>
<view class="city-text">{{cityText}}</view>
</view>
......
......@@ -584,7 +584,7 @@
background: #2272FF;
font-size: 32rpx;
color: #fff;
&[disabled] {
background-color: #D1D4D4;
color: #FFFFFF;
......
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