Commit acfe4382 authored by Facius's avatar Facius

考试首页

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