Commit 683a34a4 authored by 刘用法's avatar 刘用法
parents a1286b27 d85e03b3
const UNI_APP = {
ucenterUrl: {
apiUrl: 'http://rest-u.yunya.com', //php端域名请求头
xueUrl: 'http://xue.yunya.com', //学院
xueUrl: 'http://rest-xue.yunya.com', //学院
// banshou: 'https://m.banshou.com', //扳手app
},
systemUrl: {
......
......@@ -10,11 +10,12 @@
}
} else if (process.env.NODE_ENV === "production") {
// ENV_VAR = require('./.env.prod.js');
// ENV_VAR = require('./.env.prod.js');
ENV_VAR = require('./.env.test.js');
}
if (ENV_VAR) {
process.uniEnv = {};
process.uniEnv['node_env'] = NODE_ENV;
for (let key in ENV_VAR) {
process.uniEnv[key] = ENV_VAR[key];
}
......
const UNI_APP = {
ucenterUrl: {
apiUrl: 'https://rest-u.banshouhui.com', //php端域名请求头
xueUrl:'https://xue.banshouhui.com', //学院
xueUrl:'https://rest-xue.banshouhui.com', //学院
banshou:'https://m.banshou.com' ,//扳手app
},
systemUrl: {
......
const UNI_APP = {
ucenterUrl: {
apiUrl: 'https://rest-u.test.ibanshou.cn', //php端域名请求头
// xueUrl: 'https://xue.banshouhui.com', //学院
xueUrl: 'https://rest-xue.test.ibanshou.cn', //学院
banshou: 'https://m.test.ibanshou.cn', //扳手app
},
systemUrl: {
......
<template>
<view class="settle-view">
<u-navbar style="position: absolute;" title="考核认证" background="{background: transparent}" :border-bottom="false"
back-icon-color="#333333" title-color="#333333"></u-navbar>
<view :class="['introduction', {'active': type}]">
<slot></slot>
</view>
<view class="settle-bottom">
<slot name="bottom"></slot>
</view>
</view>
</template>
<script>
export default {
props: {
index: {
type: Number,
default: 1
},
// 0: introduction距离底部168rpx 1: introduction距离底部0rpx
type: {
type: Number,
default: 0
}
},
data() {
return {}
},
computed: {
url() {
return process.uniEnv.qn_base_url + 'topl' + this.index + '.png'
}
}
}
</script>
<style lang="scss" scoped>
.settle-view {
::-webkit-scrollbar {
width: 0;
}
}
.introduction {
border-radius: 12rpx;
overflow: auto;
position: fixed;
top: 160rpx;
bottom: 168rpx;
left: 30rpx;
right: 30rpx;
&.active {
bottom: 0rpx;
}
}
.settle-bottom {
position: fixed;
bottom: 44rpx;
width: 100%;
}
</style>
......@@ -75,14 +75,15 @@
{
"path": "answer",
"style": {
"navigationBarTitleText": "考试答题",
"navigationBarTitleText": "考核认证",
"navigationStyle":"custom"
}
},
{
"path":"result",
"style":{
"navigationBarTitleText":"考试答题"
"navigationBarTitleText":"",
"navigationStyle":"custom"
}
},
{
......@@ -100,7 +101,8 @@
{
"path": "curriculum",
"style": {
"navigationBarTitleText": ""
"navigationBarTitleText": "",
"navigationStyle": "custom" // 隐藏系统导航栏
}
},
{
......@@ -116,7 +118,16 @@
"path": "course-detail",
"style": {
"navigationBarTitleText": "培训视频",
"enablePullDownRefresh": false
"enablePullDownRefresh": false,
"navigationStyle": "custom" // 隐藏系统导航栏
}
},
{
"path": "exam-pass",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom" // 隐藏系统导航栏
}
}
]
......
......@@ -12,35 +12,32 @@
style="height: 755rpx;padding-top: 30rpx;">
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height:796rpx;width:100%;" @scrolltolower="onreachBottom">
<view class="currency-class" :style="{'background-image':'url(/static/photo/jianbian@3x.png)'}">
<view class="jf-currency-class">
<view class="class1" @click="goToPrint">
<image class="img" :src="rule.pic" mode=""></image>
<view class="right u-margin-left-30 u-padding-top-10 u-padding-bottom-14 width-360">
<view class="u-font-32 font-bold">
充电桩交付规范
</view>
<view class="u-font-24">
请点击学习
</view>
</view>
<view class="line-percent">
<text class="font-default-color">去查看</text>
<image class="jf-img" :src="rule.pic" mode=""></image>
<view class="right u-padding-top-10 u-padding-bottom-14 jf-right">
<view class="u-font-32 font-bold u-margin-left-30 u-margin-top-30">充电桩交付规范</view>
<view class="u-font-24 u-margin-left-30 u-margin-top-30">请点击学习</view>
</view>
<view class="jf-line u-margin-right-30 u-margin-top-60">去查看</view>
</view>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height:100%;width:100%;" @scrolltolower="onreachBottom">
<view v-for="item in list" :key="item.id" class="notice" @click="bbb(item)">
<view class="n-head">
《{{item.title}}》
{{item.title}}
</view>
<view class="news" v-html="item.body">
<u-parse :html="item.body"></u-parse>
</view>
<u-line color="#F4F5F7" class="content-line"/>
<u-line color="#F4F5F7" class="content-line" />
<view class="notice-bottom">
<view class="notice-bottom-left">{{ item.create_at }}</view>
<view class="notice-bottom-right">查看详情</view>
</view>
</view>
<view v-shou="isLoadMore">
<u-loadmore :status="loadStatus" />
......@@ -52,65 +49,68 @@
<view class="lean">
<view class="top">
<view class="title u-margin-top-10 u-margin-bottom-30">通用课程</view>
<view class="currency-class">
<view class="class1" @click=ccc(courselist[0].sectionId)>
<image class="img" :src="courselist[0].pic" mode=""></image>
<view class="right">
<view class="u-font-32 font-bold">
<view class="learn-currency-class">
<view class="learn-class1" @click=goPlay(courselist[0])>
<image class="learn-img" :src="courselist[0].pic" mode=""></image>
<image class="bofang" :src="bofang" mode=""></image>
<view class="learn-desc">
<view class="u-font-28 font-bold h68">
{{ courselist[0].title }}
</view>
<view class="u-font-24">
<view class="u-font-20 learn-intro h48">
{{ courselist[0].desc }}
</view>
<view class="line-percent">
<u-line-progress active-color="#2979ff" :percent="courselist[0].percent"
:show-percent="false">
</u-line-progress>
<text class="font-default-color"
:class="{'font-active-color':courselist[0].percent}"
v-text="courselist[0].status"></text>
</view>
</view>
<view class="line-percent u-margin-top-35">
<u-line-progress active-color="#2979ff" :percent="courselist[0].percent"
:show-percent="false">
</u-line-progress>
<text class="font-default-color"
:class="{'font-active-color':courselist[0].percent}"
v-text="courselist[0].status"></text>
</view>
</view>
<view class="class1 u-margin-top-40" @click=ccc(courselist[1].sectionId)>
<image class="img" :src="courselist[1].pic" mode=""></image>
<view class="right">
<view class="u-font-32 font-bold">
{{ courselist[1].title }}
<view class="learn-class1 u-margin-left-30" @click=goPlay(courselist[1])>
<image class="learn-img" :src="courselist[1].pic" mode=""></image>
<image class="bofang" :src="bofang" mode=""></image>
<view class="learn-desc">
<view class="u-font-28 font-bold h68">
{{ courselist[1].title }}
</view>
<view class="u-font-24">
{{ courselist[1].desc }}
</view>
<view class="line-percent">
<u-line-progress active-color="#2979ff" :percent="courselist[1].percent"
:show-percent="false">
</u-line-progress>
<text class="font-default-color"
:class="{'font-active-color':courselist[1].percent}"
v-text="courselist[1].status"></text>
<view class="u-font-20 learn-intro h48">
{{ courselist[1].desc }}
</view>
</view>
<view class="line-percent u-margin-top-35">
<u-line-progress active-color="#2979ff" :percent="courselist[1].percent"
:show-percent="false">
</u-line-progress>
<text class="font-default-color"
:class="{'font-active-color':courselist[1].percent}"
v-text="courselist[1].status"></text>
</view>
</view>
</view>
<view class="title u-margin-top-50 u-margin-bottom-30">技能课程</view>
<view class="currency-class">
<view class="class1" @click=ccc(courselist[2].sectionId)>
<image class="img" :src="courselist[2].pic" mode=""></image>
<view class="right">
<view class="u-font-32 font-bold">
<view class="learn-currency-class u-margin-bottom-20">
<view class="learn-class1" @click=goPlay(courselist[2])>
<image class="learn-img" :src="courselist[2].pic" mode=""></image>
<image class="bofang" :src="bofang" mode=""></image>
<view class="learn-desc">
<view class="u-font-28 font-bold h68">
{{ courselist[2].title }}
</view>
<view class="u-font-24">
<view class="u-font-20 learn-intro h48">
{{ courselist[2].desc }}
</view>
<view class="line-percent" style="display:flex;justify-content: space-between;">
<u-line-progress active-color="#2979ff" :percent="courselist[2].percent"
:show-percent="false">
</u-line-progress>
<text class="font-default-color"
:class="{'font-active-color':courselist[2].percent}"
v-text="courselist[2].status"></text>
</view>
</view>
<view class="line-percent u-margin-top-35" style="display:flex;justify-content: space-between;">
<u-line-progress active-color="#2979ff" :percent="courselist[2].percent"
:show-percent="false">
</u-line-progress>
<text class="font-default-color"
:class="{'font-active-color':courselist[2].percent}"
v-text="courselist[2].status"></text>
</view>
</view>
</view>
......@@ -160,7 +160,7 @@
</view>
</view>
</view>
<view class="title u-margin-top-50 u-margin-bottom-30">技能认证</view>
<!-- <view class="title u-margin-top-50 u-margin-bottom-30">技能认证</view>
<view class="currency-class">
<view class="class1" @click="aaa(2)">
<image class="img" :src="examList[2].pic" mode=""></image>
......@@ -179,7 +179,7 @@
</view>
</view>
</view>
</view>
</view> -->
</view>
</view>
</scroll-view>
......@@ -189,6 +189,164 @@
</template>
<script>
import util from '@/utils/util.js'
var json = {
"dev": [
{
"title": "服务规范",
"desc": "为用户提供更好服务,自己赚更多钱",
"percent": 0,
"status": "",
"id": 173,
"sectionId": ""
},
{
"title": "接单操作",
"desc": "快速学习,使用APP 接单、抢单",
"percent": 0,
"status": "",
"id": 173,
"sectionId": ""
},
{
"title": "从0-1学习充电桩安装服务",
"desc": "让你全面了解充电桩市场及服务规范",
"percent": 0,
"status": "",
"id": 173,
"sectionId": ""
}
],
"test": [
{
"title": "服务规范",
"desc": "为用户提供更好服务,自己赚更多钱",
"percent": 0,
"status": "",
"id": 150,
"sectionId": ""
},
{
"title": "接单操作",
"desc": "快速学习,使用APP 接单、抢单",
"percent": 0,
"status": "",
"id": 149,
"sectionId": ""
},
{
"title": "从0-1学习充电桩安装服务",
"desc": "让你全面了解充电桩市场及服务规范",
"percent": 0,
"status": "",
"id": 151,
"sectionId": ""
}
],
"prod": [
{
"title": "服务规范",
"desc": "为用户提供更好服务,自己赚更多钱",
"percent": 0,
"status": "",
"sectionId": ""
},
{
"title": "接单操作",
"desc": "快速学习,使用APP 接单、抢单",
"percent": 0,
"status": "",
"sectionId": ""
},
{
"title": "从0-1学习充电桩安装服务",
"desc": "让你全面了解充电桩市场及服务规范",
"percent": 0,
"status": "",
"sectionId": ""
}
]
}
var examJson = {
"dev": [
{
title: '服务规范',
desc: '通过本认证,是接单的必要条件',
condition: '随机20题,及格20题',
status: '',
pic: process.uniEnv.qn_base_url + "guifan1@3x.png",
id: 2,
examId: '',
examStatus: '',
isComplete: false
},
{
title: '接单操作',
desc: '快速认证,是否具备接单操作能力',
condition: '随机20题,及格16题',
status: '',
pic: process.uniEnv.qn_base_url + "guifan2@3x.png",
id: 2,
examId: '',
examStatus: '',
isComplete: false
}
],
"test": [
{
title: '服务规范',
desc: '通过本认证,是接单的必要条件',
condition: '随机10题,及格10题',
status: '',
pic: process.uniEnv.qn_base_url + "guifan1@3x.png",
id: 3,
examId: '',
examStatus: '',
isComplete: false
},
{
title: '交付规范',
desc: '快速认证,是否具备接单操作能力',
condition: '随机4题,及格4题',
status: '',
pic: process.uniEnv.qn_base_url + "guifan2@3x.png",
id: 4,
examId: '',
examStatus: '',
isComplete: false
}
],
"prod": [
{
title: '服务规范',
desc: '通过本认证,是接单的必要条件',
condition: '随机20题,及格20题',
status: '',
pic: process.uniEnv.qn_base_url + "guifan1@3x.png",
id: 3,
examId: '',
examStatus: '',
isComplete: false
},
{
title: '接单操作',
desc: '快速认证,是否具备接单操作能力',
condition: '随机20题,及格16题',
status: '',
pic: process.uniEnv.qn_base_url + "guifan2@3x.png",
id: 4,
examId: '',
examStatus: '',
isComplete: false
}
]
}
// import aJson from "@/static/json/learn.json";
let env = process.uniEnv.node_env;
let courseListJson = json.[env];
let examListJson = examJson[env];
export default {
data() {
return {
......@@ -206,6 +364,7 @@
name: "考核认证",
},
],
bofang: process.uniEnv.qn_base_url + "bofang@3x.png",
current: 0,
swiperCurrent: 0,
params: {
......@@ -213,77 +372,85 @@
},
list: [],
rule: {
pic: process.uniEnv.qn_base_url + "guifan1@3x.png"
pic: process.uniEnv.qn_base_url + "guifan@3x.png"
},
courselist: [{
title: '服务规范',
desc: '为用户提供更好服务,自己赚更多钱',
percent: 0,
status: '',
pic: process.uniEnv.qn_base_url + "guifan1@3x.png",
id: 173,
sectionId: ''
title: courseListJson[0].title,
desc: courseListJson[0].desc,
percent: courseListJson[0].percent,
status: courseListJson[0].status,
pic: process.uniEnv.qn_base_url + "fwgf@3x.png",
id: courseListJson[0].id,
sectionId: courseListJson[0].sectionId
},
{
title: '接单操作',
desc: '快速学习,使用APP 接单、抢单',
percent: 0,
status: '',
pic: process.uniEnv.qn_base_url + "guifan2@3x.png",
id: 173,
sectionId: ''
title: courseListJson[1].title,
desc: courseListJson[1].desc,
percent: courseListJson[1].percent,
status: courseListJson[1].status,
pic: process.uniEnv.qn_base_url + "jdgf@3x.png",
id: courseListJson[1].id,
sectionId: courseListJson[1].sectionId
},
{
title: '从0-1学习充电桩安装服务',
desc: '让你全面了解充电桩市场及服务规范',
percent: 0,
status: '',
pic: process.uniEnv.qn_base_url + "kecehng1@3x.png",
id: 173,
sectionId: ''
title: courseListJson[2].title,
desc: courseListJson[2].desc,
percent: courseListJson[2].percent,
status: courseListJson[2].status,
pic: process.uniEnv.qn_base_url + "cdz@3x.png",
id: courseListJson[2].id,
sectionId: courseListJson[2].sectionId,
}
],
examList: [{
title: '服务规范',
desc: '通过本认证,是接单的必要条件',
condition: '随机20题,及格20题',
status: '',
pic: process.uniEnv.qn_base_url + "guifan1@3x.png",
id: 2,
examId: '',
examStatus: '',
isComplete: false
title: examListJson[0].title,
desc: examListJson[0].desc,
condition: examListJson[0].condition,
status: examListJson[0].status,
pic: examListJson[0].pic,
id: examListJson[0].id,
examId: examListJson[0].examId,
examStatus: examListJson[0].examStatus,
isComplete: examListJson[0].isComplete
},
{
title: '接单操作',
desc: '快速认证,是否具备接单操作能力',
condition: '随机20题,及格16题',
status: '',
pic: process.uniEnv.qn_base_url + "guifan2@3x.png",
id: 2,
examId: '',
examStatus: '',
isComplete: false
},
{
title: '从0-1学习充电桩安装服务',
desc: '通过本认证后,可接充电桩业务单',
condition: '随机30题,及格25题',
status: '',
pic: process.uniEnv.qn_base_url + "kecehng1@3x.png",
id: 2,
examId: '',
examStatus: '',
isComplete: false
title: examListJson[1].title,
desc: examListJson[1].desc,
condition: examListJson[1].condition,
status: examListJson[1].status,
pic: examListJson[1].pic,
id: examListJson[1].id,
examId: examListJson[1].examId,
examStatus: examListJson[1].examStatus,
isComplete: examListJson[1].isComplete
}
// ,
// {
// title: '从0-1学习充电桩安装服务',
// desc: '通过本认证后,可接充电桩业务单',
// condition: '随机30题,及格25题',
// status: '',
// pic: process.uniEnv.qn_base_url + "kecehng1@3x.png",
// id: 2,
// examId: '',
// examStatus: '',
// isComplete: false
// }
],
loadStatus: "loading", //加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式
isLoadMore: false, //是否加载中
course_id: "course_id_=173",
exam: null,
};
},
onLoad() {
onLoad(param) {
console.log('--node_env--');
console.log(process.uniEnv.node_env);
try{
if(param.tabs){
this.current = param.tabs;
this.swiperCurrent = param.tabs;
}
}catch(e){}
// this.getList();
// this.getCourseList();
// this.getUserExamInfo();
......@@ -293,14 +460,24 @@
return process.uniEnv.qn_base_url + "banner-xx@3x.png";
},
},
onShow: function() {
// this.onLoad();
console.log('--返回也可以执行--');
},
methods: {
getList() {
this.$u.api
.getTrainingNoticeList(this.params)
.then((res) => {
this.timeFormat();
if (res.code == 200) {
if (res.data) {
let length = res.data.length;
for(let i = 0;i<length;i++){
res.data[i].create_at = this.timeFormat(res.data[i].create_at, 'yyyy.MM.dd hh:mm');
}
this.list = this.list.concat(res.data);
if (res.data.length < 5) {
//判断接口返回数据量小于请求数据量,则表示此为最后一页
this.isLoadMore = true;
......@@ -335,6 +512,28 @@
}
});
},
timeFormat(time, format, fromMysql = true) {
let rate = fromMysql ? 1000 : 1;
let dataFmt = format || 'yyyy-MM-dd hh:mm:ss' // 需要格式化的规则
time = typeof(time) == 'number' ? time : new Date(time * rate) // 处理传入的time
let fmt = {
'y+': time.getFullYear(), // 年份
'M+': time.getMonth() + 1, // 月份
'd+': time.getDate(), // 日
'h+': time.getHours(), // 小时
'm+': time.getMinutes(), // 分钟
's+': time.getSeconds() // 秒
}
for(let i in fmt){
if (new RegExp('(' + i + ')').test(dataFmt)){
dataFmt = dataFmt .replace(RegExp.$1, fmt[i].toString().length <= 1 ? '0' + fmt[i] : fmt[i] )
}
}
return dataFmt;
},
getTypeName(percent) {
if (percent == 0) {
return '未开始';
......@@ -400,50 +599,6 @@
this.swiperCurrent = current;
this.current = current;
},
//跳转到assessment页面
aaa(index) {
var examInfo = this.examList[index];
if (examInfo.examStatus == 0) {
console.log("这是申请的考试id", examInfo.examId);
wx.navigateTo({
url: "./answer?userExamId=" + examInfo.examId,
});
} else if (examInfo.examStatus == 1) {
wx.navigateTo({
url: "./result?userExamId=" + examInfo.examId,
});
} else if (examInfo.examStatus == 2) {
wx.navigateTo({
url: "./assessment",
});
}
},
//跳转到课程介绍
ccc(id) {
uni.navigateTo({
url: "./section?section_id=" + 288,
});
},
//跳转到
bbb(e) {
var news = {
body: e.body,
id: e.id,
level: e.level,
title: e.title,
};
// console.log(news)
uni.navigateTo({
url: "./news-details",
});
setTimeout(() => {
uni.$emit("news", news), console.log("发送数据");
}, 500);
console.log("跳转结束11111111");
},
//scroll-view到底部加载更多
onreachBottom() {
console.log("上拉触底函数");
......@@ -486,7 +641,7 @@
.then((res) => {
if (res.code == 200) {
this.examList[i].examId = res.data.id;
this.examList[i].examStatus = res.data.examStatus;
this.examList[i].examStatus = res.data.examStatus;//i;//
let examResult = res.data.examLevelResult;
this.examList[i].status = examResult != '' ? examResult : '未通过';
// examStatus 用户考试状态 0考试中 1考试完成 2未参与
......@@ -498,7 +653,7 @@
}
if (res.data.examStatus == 1) {
console.log("examStatus " + i + " 1");
that.examList[i].isComplete = true;
that.examList[i].isComplete = this.examList[i].status == '通过';
that.examScore = res.data.examScore;
return;
}
......@@ -523,9 +678,62 @@
title: "获取考试信息失败",
});
});
}
}
},
//跳转到assessment页面
aaa(index) {
//examStatus 用户考试状态 0考试中 1考试完成 2未参与
//考试完成分成通过、未通过
var examInfo = this.examList[index];
if (examInfo.examStatus == 0) {
console.log("这是试卷id", examInfo.id);
wx.navigateTo({
url: "/pages/learn/answer?examId=" + examInfo.id,
});
} else if (examInfo.examStatus == 1) {
// debugger;return;
// examInfo.status = '通过';
if(examInfo.status == '通过'){
wx.navigateTo({
url: "/pages/learn/exam-pass?userExamId=" + examInfo.examId,
});
}else{
wx.navigateTo({
url: "/pages/learn/result?userExamId=" + examInfo.examId + "&examId=" + examInfo.id,
});
}
} else if (examInfo.examStatus == 2) {
wx.navigateTo({
url: "/pages/learn/assessment?examId=" + examInfo.id,
});
}
},
//跳转到播放
goPlay(info) {
uni.navigateTo({
url: "/pages/learn/section?section_id=" + info.sectionId + "&course_id=" + info.id,
});
},
//跳转到
bbb(e) {
var news = {
body: e.body,
id: e.id,
level: e.level,
title: e.title,
};
// console.log(news)
setTimeout(() => {
uni.$emit("news", news);
console.log("发送数据");
}, 1000);
uni.navigateTo({
url: "/pages/learn/news-details",
});
console.log("跳转结束11111111");
},
},
};
</script>
......@@ -578,17 +786,18 @@
.n-head {
text-align: left;
font-size: 32rpx;
font-weight: bold;
color: #333333;
}
.news {
height: 168rpx;
overflow: hidden;
margin-top: 30rpx;
/* margin-top: 30rpx;
margin-left: 30rpx;
margin-right: 30rpx;
margin-bottom: 0; */
font-size: 24rpx;
color: #666666;
line-height: 34rpx;
}
/* //在线学习 */
......@@ -600,6 +809,21 @@
/* margin-bottom: 11px; */
border-radius: 12rpx;
}
.learn-currency-class {
width: 100%;
border-radius: 12rpx;
display: flex;
}
.jf-currency-class {
width: 100%;
height: 180rpx;
background: #ffffff;
border-radius: 12rpx;
margin-top: 60rpx;
background: #f4f5f7 url(/static/photo/jianbian@3x.png) no-repeat;
}
.title {
font-size: 32rpx;
......@@ -615,12 +839,37 @@
-webkit-justify-content: space-between;
justify-content: space-between;
}
.learn-class1 {
display: -webkit-box;
display: -webkit-flex;
display: block;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
width: 330rpx;
height: 420rpx;
background-color: #ffffff;
position: relative;
border-radius: 12rpx;
}
.img {
width: 160rpx;
height: 120rpx;
/* display: block; */
/* margin-right: 0rpx; */
}
.learn-img {
width: 330rpx;
height: 194rpx;
}
.jf-img {
width: 160rpx;
height: 200rpx;
position: fixed;
top: 20rpx;
left: 30rpx;
}
.right {
......@@ -659,13 +908,29 @@
.line-percent {
display: flex;
justify-content: space-between;
line-height: 24rpx;
// line-height: 24rpx;
font-size: 24rpx;
color: #999999;
margin: 20rpx;
margin-top: 25rpx;
}
.jf-line {
display: flex;
justify-content: space-between;
width: 120rpx;
height: 52rpx;
border-radius: 26rpx;
background-color: #ffffff;
color: #2272FF;
text-align: center;
padding-left: 20rpx;
padding-top: 6rpx;
margin-top: 20rpx;
}
.u-progress {
width: 280rpx !important;
width: 160rpx !important;
height: 12rpx !important;
background-color: #ececec;
}
......@@ -677,7 +942,7 @@
.font-default-color {
color: #999999;
}
.font-default-exam-color {
color: #FA5A49;
}
......@@ -685,55 +950,81 @@
.font-active-color {
color: #2272FF;
}
.font-color-999999 {
color: #99999;
color: #999999;
}
.content-line {
margin-top: 30rpx;
}
.standard {
}
.standard {}
.standard-img {
width: 160rpx;
height: 120rpx;
}
.standard-body {
.standard-body {
height: 120rpx;
display: flex;
}
.standard-body-title {
font-size: 32rpx;
font-weight: bold;
}
.jf-right {
padding-left: 190rpx;
width: 460rpx;
color: #ffffff;
}
.width-360 {
width: 360rpx;
.notice-bottom {
margin-top: 30rpx;
display: flex;
}
.rule-back {
background-image: process.uniEnv.qn_base_url + "banner-xx@3x.png";
.notice-bottom-left {
/* margin-left: 30rpx; */
font-size: 24rpx;
color: #999999;
}
/* <view class="standard" @click="goToPrint">
<!-- <text>充电桩交付规范</text>
<text>></text> -->
<view class="standard-img"></view>
<view class="standard-body">
<view class="standard-body-title">
充电桩交付规范
</view>
<view class="standard-body-title">
请点击学习
</view>
</view>
<view cl ass="standard-go-look-look">去查看</view>*/
.notice-bottom-right {
margin-left: 330rpx;
font-size: 24rpx;
color: #2272FF;
}
.bofang {
width: 60rpx;
height: 60rpx;
position: absolute;
left: 130rpx;
top: 70rpx;
}
.learn-desc {
height: 138rpx;
margin-top: -10rpx;
padding-top: 20rpx;
padding-left: 20rpx;
padding-right: 20rpx;
}
.learn-intro {
color: #999999;
margin-top: 20rpx;
font-size: 20rpx;
}
.h68 {
// height: 68rpx;
}
.h48 {height: 48rpx;}
</style>
<template>
<view class="answer-box">
<u-navbar
title="考核认证"
:background="background"
:border-bottom="false"
></u-navbar>
<view class="content">
<view class="">
<text class="dx">单选</text>
</view>
<view class="topicView">
<text class="topictext">{{
ExaminationQuestions.question.content
}}</text>
</view>
<view class="">
<view class="list-box">
<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" @click="getNextClick()">下一题</button>
<text class="all">{{ ExaminationQuestions.progress }}</text>
</view>
</view>
<view class="backView">
<Examine :index="3">
<view class="bottom-padding" v-if="currentItem">
<view class="title-view">
<view :class="['title-text', {'radio': currentItem.question ? currentItem.question.answerType == 1 : true}]">
<text>{{ titleText[Math.max(0, currentItem.question ? currentItem.question.answerType - 1 : 0)] }}</text>
</view>
<view class="title-right-view">
<image class="timeIcon" :src="time1Image" mode=""></image>
<text class="timeText">倒计时:</text><text class="time-count-down">{{currentTime}}</text>
</view>
</view>
<view class="topicView">
<text class="topicText">{{currentItem.question.content}}</text>
</view>
<view :class="['itemView',item.isSelect ? 'active':'']" v-for="(item,ikey) in currentItem.answerList" :key="ikey" @click="itemClick(item,ikey)">
<view :class="item.isSelect ? 'itemIndexView' : 'itemIndexView grayBorder' ">
<text
:class="item.isSelect ? 'itemIndexText whiteColor selectBackColor' : 'itemIndexText gray-color' ">
{{alphaArr[ikey]}}
</text>
</view>
<view
:class="item.isSelect ? 'itemText selectedColor' : 'itemText defaultColor' ">{{contentFilter(item.content)}}</view>
</view>
</view>
<!-- </template> -->
<template v-slot:bottom>
<view class="answerBottomView">
<view class="bottom-left-view">
<!-- <image class="bottom-icon" :src="timuImage" mode=""></image> -->
<text class="numberText">{{progress}}</text>
</view>
<view class="bottomRightView">
<view :class="isSelect ? 'nextBtn selectBackColor' : 'nextBtn defaultBackColor' "
@click="handleClick()">
<text class="bottomTitle">{{bottomTitle}}</text>
</view>
</view>
</view>
</template>
</Examine>
<view class="mask" v-show="isComplete">
<view class="box">
<image class="icon" :src="chenggongImage"></image>
<view class="txt">您已成功完成考试</view>
<button class="btn" @click="toSubmit()">
去提交
</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [
{
isRight: false,
content: "",
},
{
isRight: false,
content: "",
import Examine from '@/components/settle/examine.vue'
import utils from '@/utils/util.js'
const globalUrl = process.uniEnv || {}
const systemApiUrl = globalUrl.systemUrl.apiUrl
const ucenterApiUrl = globalUrl.ucenterUrl.apiUrl
export default {
components: {
Examine
},
data() {
return {
examId: null,
userExamId: null,
userAnswerIds: '',
isStart: true,
currentNumber: 1,
currentItem: null,
isSelect: false,
timeDefine: {
"time-id-2": 1800,
"time-id-3": 900,
"time-id-4": 360,
},
{
isRight: false,
content: "",
},
{
isRight: false,
content: "",
},
],
background: {
backgroundColor: "#F4F5F7",
endTime: 0,
currentTime: 100,
everyTime: 90,
progress: '',
bottomTitle: '下一题',
isStop: false,
clock_url: 'https://qn-static.banshouhui.com/clock_exam.png',
examScore: 0,
alphaArr: ['A', 'B', 'C', 'D', 'E'],
timer: null,
isComplete: false, // 是否已经考试完成判定
examInfo: null,
}
},
computed: {
titleText() {
return ['单选', '多选', '问答']
},
time1Image() {
return process.uniEnv.qn_base_url + 'time1.png'
},
chenggongImage() {
return process.uniEnv.qn_base_url + 'chenggong.png'
},
timuImage() {
return process.uniEnv.qn_base_url + 'timu-new.png'
}
},
onLoad(e) {
this.examId = e.examId;
this.applyExam();
// this.getUserExamInfo();
},
methods: {
formatTimeToMini(timestamp) {
let result = timestamp;
let h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600);
let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60));
let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
let res = '';
if(h !== '00') res += `${h}:`;
if(m !== '00') res += `${m}:`;
res += `${s}`;
return res;
},
isSelect: false,
selectId: [],
userExamId: null,
ExaminationQuestions: {
progress: "",
question: {
content: "",
},
},
isQuestion: true,
};
},
onLoad(num) {
this.userExamId = num.userExamId;
this.getExaminationQuestions();
},
onUnload() {
wx.reLaunch({
url: "./index",
});
},
methods: {
abc() {
console.log("11111");
var arr = document.querySelector(".btm");
for (let i = 0; i < arr.length; i++) {
arr[i].onclick = function () {
console.log(this.value);
};
}
},
//选择按钮
choice(index) {
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].id) {
this.selectId.splice(i, 1);
}
}
console.log("选中的值", this.selectId);
} else {
this.list[index].isRight = true;
this.isSelect = true;
console.log(this.isSelect);
this.selectId.push(this.list[index].id);
console.log("选中的值", this.selectId);
}
},
//申请考试题目
getExaminationQuestions() {
this.$u.api.ExaminationQuestions(this.userExamId).then((res) => {
let that = this;
if (res.code == 200) {
console.log("这是个标识符kao", this.ExaminationQuestions);
if (res.data) {
that.ExaminationQuestions = res.data;
console.log(".......", this.ExaminationQuestions);
that.list = res.data.answerList;
console.log("1111111", that);
console.log(
"这是个标识符kao",
this.ExaminationQuestions
);
}
} else {
//接口请求失败
uni.showToast({
title: res.message,
icon: "none",
toSubmit() {
//判断是否通过,通过去成功页,失败去失败页
let examInfo = this.examInfo;
let examId = this.examId;
let status = examInfo.examLevelResult == '通过';
if(status){
wx.navigateTo({
url: "/pages/learn/exam-pass?userExamId=" + this.userExamId + "&examId=" + examId,
});
}else{
wx.navigateTo({
url: "/pages/learn/result?userExamId=" + this.userExamId + "&examId=" + examId,
});
}
});
},
//下一题
getNextClick: function () {
//判断
if (this.isQuestion == "第20题/共20题") {
this.isQuestion = "";
console.log("标识符6666", this.userExamId.userExamId);
wx.navigateTo({
url: "./result?userExamId=" + this.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 +
"&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);
},
});
this.$u.api
.nextClick(
this.userExamId,
this.ExaminationQuestions.question.id,
this.selectId
)
.then((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);
});
},
},
};
},
contentFilter(txt) {
if (!txt) {
return txt
}
let reg = /\w+\.?/;
const result = txt.replace(reg, '')
return result
},
//开始考试 点击
startClick: function() {
this.isStart = true
//this.getData()
//this.applyExam()
this.getUserExamInfo()
},
//获取考试信息
getUserExamInfo: function() {
uni.showLoading({
title: '请稍候'
})
let that = this
uni.request({
url: systemApiUrl +
'/wxh-worker-rest/rest/exam' +
'/serviceRule/userExamInfo/' +
that.vuex_token +
'?examId=' + this.examId,
method: 'POST',
data: {
//examId:this.examId,
},
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
success: (res) => {
uni.hideLoading()
if (!res.data) {
return
}
if (res.data.code == 401 || res.data.code == 403) {
uni.navigateTo({
url: '/pages/login/wxlogin'
})
return
}
if (res.data.code == 200) {
//examStatus 用户考试状态 0考试中 1考试完成 2未参与
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
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: '获取考试信息失败'
})
}
})
},
//申请考试
applyExam: function() {
uni.showLoading({
title: '请稍候'
})
let that = this
uni.request({
url: systemApiUrl +
'/wxh-worker-rest/rest/exam' +
'/serviceRule/' +
that.vuex_token +
'?examId=' + this.examId,
method: 'POST',
data: {
//examId:this.examId,
},
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
success: (res) => {
uni.hideLoading()
if (res.statusCode == 401) {
uni.navigateTo({
url: '/pages/login/wxlogin'
})
return
}
if (res.data.code == 200) {
if (res.data.data.userExamId) {
that.userExamId = res.data.data.userExamId
//申请完考试设置倒计时总时间
let time = parseInt(this.timeDefine['time-id-' + this.examId]);
this.endTime = time;
// let timestamp = new Date().getTime();
// this.endTime = timestamp + time * 1000;
this.currentTime = parseInt(time * 1000);//this.formatTimeToMini(timestamp);//endTime-currentTime再格式化时间显示
that.getNext()
}
} else {
uni.showToast({
icon: 'none',
title: res.data.message
})
}
},
fail: (e) => {
uni.hideLoading()
uni.showToast({
icon: 'none',
title: '申请考试 失败'
})
}
})
},
//获取下一题
getNext: function() {
var questionId = ''
if (this.currentItem &&
this.currentItem.question &&
this.currentItem.question.id) {
questionId = this.currentItem.question.id
}
uni.showLoading({
title: '请稍候'
})
let that = this
uni.request({
url: systemApiUrl +
'/wxh-worker-rest/rest/exam' +
'/serviceRule/next/' +
that.vuex_token +
'?userExamId=' + this.userExamId +
'&questionId=' + questionId +
'&userAnswerIds=' + (this.userAnswerIds || '9999'), // 9999超时自动下一题
method: 'POST',
data: {
// userExamId:this.userExamId,
// questionId:this.currentItem.question.id,
// userAnswerIds:this.userAnswerIds,
},
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
success: (res) => {
uni.hideLoading()
if (res.statusCode == 401) {
uni.navigateTo({
url: '/pages/login/wxlogin'
})
return
}
if (res.data.code == 200) {
that.currentItem = res.data.data
that.progress = res.data.data.progress
if (res.data.data.answerList) {
that.handleData()
// that.currentTime = 100
this.everyTime = 90;//每道题90s
that.isSelect = false
clearTimeout(this.timer)
that.startCounting()
} else {
that.isSelect = true
that.getUserExamInfo()
clearTimeout(this.timer)
this.isComplete = true
//用来考完试判断跳转
this.examInfo = that.currentItem;
// that.bottomTitle = '完成考试,现在签约'
}
} else {
uni.showToast({
icon: 'none',
title: res.data.message
})
}
},
fail: (e) => {
uni.hideLoading()
uni.showToast({
icon: 'none',
title: '获取下一题 失败'
})
}
})
},
handleData: function() {
this.currentItem.answerList.forEach((item, index) => {
item.isSelect = false
this.$set(this.currentItem.answerList, index, item)
})
},
startCounting: function() {
if (this.isStop) {
return
}
this.endTime = this.endTime - 1;
this.currentTime = this.formatTimeToMini(this.endTime)
this.everyTime = this.everyTime - 1;
if (this.everyTime > 0) {
this.timer = setTimeout(this.startCounting, 1000);
} else {
clearTimeout(this.timer)
this.everyTime = 90
this.nextClick()
}
},
itemClick: function(currentItem, ikey) {
this.isSelect = true
// console.log('选点点击--处理前--this.currentItem:')
// console.log(this.currentItem)
// console.log('选点点击--处理前--ikey:')
// console.log(ikey)
// console.log('选点点击--处理前--题目类型,1单选,2多选,3简答:')
// console.log(this.currentItem.question.answerType)
//answerType 题目类型,1单选,2多选,3简答,
for (let i = 0; i < this.currentItem.answerList.length; i++) {
var item = this.currentItem.answerList[i]
if (this.currentItem.question.answerType == 2) { //多选
if (ikey == i) {
item.isSelect = !item.isSelect
}
} else { //单选/简答
if (ikey == i) {
item.isSelect = !item.isSelect
} else {
item.isSelect = false
}
}
this.$set(this.currentItem.answerList[i], isSelect, item.isSelect)
}
var isSelect = false
this.currentItem.answerList.forEach(item => {
if (item.isSelect) {
isSelect = true
}
})
//有选答案
this.isSelect = isSelect
// console.log('选点点击--处理后--this.currentItem.answerList:')
// console.log(this.currentItem.answerList)
},
// 点击下一步
handleClick() {
// 判断有没有选
if (!this.isSelect) {
return
}
this.nextClick()
},
//下一题
nextClick: function() {
clearTimeout(this.timer)
this.currentNumber = this.currentNumber + 1
//this.getData()
this.handleAnswer()
//this.getNext()
},
//上传考试结果
postResult: function() {
uni.showLoading({
title: '请稍候'
})
let that = this
uni.request({
url: ucenterApiUrl + '/v1/settled/update-settled-exam-score' +
'?access-token=' + that.vuex_token,
method: 'POST',
data: {
score: this.examScore || 0,
},
success: (res) => {
uni.hideLoading()
if (res.statusCode == 401) {
uni.navigateTo({
url: '/pages/login/wxlogin'
})
return
}
if (res.statusCode == 200) {
// uni.navigateTo({
// url: '/pages/settle/prompt'
// })
} else {
uni.showToast({
icon: 'none',
title: "上传考试结果失败"
})
}
},
fail: (e) => {
uni.hideLoading()
uni.showToast({
icon: 'none',
title: '上传考试结果失败'
})
}
})
},
//所选答案
handleAnswer: function() {
/*
userAnswerIds
本题回答。
多选题时id按从小到大排序,并英文逗号,分隔;
简答题时直接存问题答案。
如果是第一次答题,不需要传。
*/
//每次清空
this.userAnswerIds = ''
this.currentItem.answerList.forEach(item => {
if (item.isSelect) {
//this.userAnswerIds = item.id + ',' + this.userAnswerIds
//answerType 题目类型,1单选,2多选,3简答,
if (this.currentItem.question.answerType == 2) { //多选
///*
if (this.userAnswerIds.length == 0) {
this.userAnswerIds = item.id
} else { // if(this.userAnswerIds.length == 1)
this.userAnswerIds = item.id + ',' + this.userAnswerIds
}
//*/
} else { //单选
this.userAnswerIds = item.id
}
}
})
this.getNext()
},
}
}
</script>
<style lang="scss">
.answer-box {
width: 750rpx;
height: 100vh;
/* background: #8F8F94; */
margin: 0 auto;
}
.content {
margin: 30rpx 30rpx;
overflow: hidden;
border-radius: 12rpx;
padding: 40rpx 30rpx 40rpx 30rpx;
background-repeat: no-repeat;
background-size: 66%;
background-color: #fff;
background-position: right bottom;
min-height: 800rpx;
}
.dx {
border-radius: 8rpx;
background-color: #ff930d;
font-size: 20rpx;
color: #ffffff;
width: 72rpx;
height: 40rpx;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
.topicView {
margin-top: 40rpx;
width: 100%;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
margin-bottom: 40rpx;
}
.topictext {
color: #333333;
font-size: 32rpx;
line-height: 48rpx;
font-weight: bold;
}
.num {
color: #2b85e4;
}
.all {
color: #8f8f94;
}
.btn {
margin-top: 98rpx;
width: 476rpx;
height: 60rpx;
line-height: 30px;
background: #007aff;
color: #ffffff;
}
.btm {
width: 476rpx;
height: 60rpx;
line-height: 30px;
margin: 34rpx auto;
}
.list-box {
// display: flex;
// flex-wrap: wrap;
padding: 16upx;
border-radius: 10upx;
view {
width: 476rpx;
height: 60upx;
line-height: 60upx;
text-align: center;
margin: 26rpx auto 0;
}
}
/*已选择*/
.selde {
background: #007aff;
color: #ffffff;
border-radius: 20upx;
font-size: 26rpx;
padding: 0 10upx;
}
/*未选择*/
.noselde {
margin-top: 30rpx;
background-color: #f4f5f7;
width: 100%;
padding: 40rpx 30rpx;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: start;
-webkit-align-items: flex-start;
align-items: flex-start;
border-radius: 12rpx;
border: 2rpx solid transparent;
font-size: 28rpx;
}
.backView {
background-color: #F4F5F7;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow-y:auto;
overflow-y:auto;
}
.noticeView {
margin-top: 100rpx;
width: 100%;
display: flex;
}
.noticeText {
font-size: 32rpx;
color: #555555;
padding-left: 40rpx;
padding-right: 40rpx;
}
.numberView {
margin-top: 40rpx;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.numberText {
color: #333333;
font-size: 28rpx;
font-weight: bold;
}
.topicView {
margin-top: 40rpx;
width: 100%;
display: flex;
align-items: center;
margin-bottom: 40rpx;
}
.topicText {
color: #333333;
font-size: 32rpx;
line-height: 48rpx;
font-weight: bold;
}
.itemView {
margin-top: 30rpx;
background-color: #F4F5F7;
width: 100%;
padding: 40rpx 30rpx;
display: flex;
align-items: flex-start;
border-radius: 12rpx;
border: 2rpx solid transparent;
font-size: 28rpx;
&.active {
background-color: #FFFFFF;
border: 2rpx solid #2272FF;
}
}
.itemIndexView {
width: 40rpx;
height: 40rpx;
border-radius: 8rpx;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
flex-shrink:0
}
.grayBorder {
border: 2rpx solid #999999;
}
.gray-color {
color: #999999;
}
.itemIndexText {
border-radius: 8rpx;
width: 36rpx;
height: 36rpx;
display: block;
line-height: 36rpx;
text-align: center;
font-size: 28rpx;
}
.itemText {
margin-left: 20rpx;
font-size: 28rpx;
}
.bottomView {
background-color: #FFFFFF;
width: 100%;
height: 140rpx;
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0;
}
.bottomBtn {
background-color: #007AFF;
width: 60%;
height: 80rpx;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
}
.bottomTitle {
font-size: 32rpx;
color: #FFFFFF;
}
.title-view {
display: flex;
justify-content: space-between;
align-items: center;
.title-text {
border-radius: 8rpx;
background-color: #FF930D;
font-size: 20rpx;
color: #FFFFFF;
width: 72rpx;
height: 40rpx;
display: flex;
align-items: center;
justify-content: center;
&.radio {
background-color: #2272FF;
}
}
.title-right-view {
display: flex;
flex-direction: row;
align-items: center;
.timeIcon {
margin-right: 12rpx;
width: 32rpx;
height: 32rpx;
}
.timeText {
font-size: 28rpx;
color: #333333;
}
.time-count-down {
width: 50rpx;
text-align: right;
}
}
}
.bottomRightView {
display: flex;
flex-direction: row;
align-items: center;
margin-right: 30rpx;
}
.nextBtn {
width: 300rpx;
height: 104rpx;
border-radius: 52rpx;
display: flex;
align-items: center;
justify-content: center;
}
.defaultColor {
color: #333333;
}
.defaultBackColor {
background-color: #D1D4D4;
}
.selectedColor {
color: #2272FF;
}
.whiteColor {
color: #FFFFFF;
}
.selectBackColor {
background-color: #2272FF;
}
.bottom-padding {
// margin-bottom: 188rpx;
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 40rpx 30rpx 40rpx 30rpx;
}
.answerBottomView {
display: flex;
align-items: center;
justify-content: space-between;
.bottom-left-view {
display: flex;
align-items: center;
margin-left: 30rpx;
.bottom-icon {
width: 44rpx;
height: 44rpx;
}
.numberText {
color: #666666;
font-size: 32rpx;
margin-left: 30rpx;
}
}
}
.mask {
position: fixed;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
background: rgba(0, 0, 0, 0.5);
}
.box {
width: 660rpx;
height: 696rpx;
padding: 0 70rpx;
border-radius: 12rpx;
background-color: #fff;
.icon {
margin: 80rpx auto 0;
display: block;
width: 224rpx;
height: 224rpx;
}
.txt {
margin-top: 20rpx;
margin-bottom: 98rpx;
font-weight: bold;
font-size: 40rpx;
line-height: 66rpx;
color: #2272FF;
text-align: center;
}
.btn {
line-height: 104rpx;
border-radius: 52rpx;
background: #2272ff;
font-size: 32rpx;
color: #fff;
}
}
</style>
......@@ -8,21 +8,21 @@
></u-navbar>
<view class="title">考试规则</view>
<view class="test">
<view class="slogan"
>这是一场严肃的考试,请认真查看 规则,预祝您顺利通过考试!</view
>
<view class="slogan">
这是一场严肃的考试,请认真查看 规则,预祝您顺利通过考试!
</view>
<view class="text">
<text class="left">考试科目:</text
><text style="color: #007aff">服务规范</text>
><text style="color: #007aff">{{ desc.title }}</text>
</view>
<view class="text">
<text class="left">合格条件:</text><text>60分</text>
<text class="left">合格条件:</text><text>{{ desc.score }}</text>
</view>
<view class="text">
<text class="left">考试时间:</text><text>30分钟</text>
<text class="left">考试时间:</text><text>{{ desc.time }}</text>
</view>
<view class="text">
<text class="left">题目来源:</text><text>系统随机20题</text>
<text class="left">题目来源:</text><text>系统随机{{ desc.number }}题</text>
</view>
<button @click="getUserExamId()">开始考试</button>
</view>
......@@ -30,50 +30,122 @@
</template>
<script>
let condition = {
"dev": {
"id-2": {
"score": "60分",
"time": "30分钟",
"number": "20",
"title": "服务规范"
},
"id-3": {
"score": "30分",
"time": "15分钟",
"number": "10",
"title": "服务规范"
},
"id-4": {
"score": "15分",
"time": "6分钟",
"number": "4",
"title": "交付规范"
}
},
"test": {
"id-2": {
"score": "60分",
"time": "30分钟",
"number": "20",
"title": "服务规范"
},
"id-3": {
"score": "30分",
"time": "15分钟",
"number": "10",
"title": "服务规范"
},
"id-4": {
"score": "15分",
"time": "6分钟",
"number": "4",
"title": "交付规范"
}
},
"prod": {
"id-2": {
"score": "60分",
"time": "30分钟",
"number": "20",
"title": "服务规范"
},
"id-3": {
"score": "30分",
"time": "15分钟",
"number": "10",
"title": "服务规范"
},
"id-4": {
"score": "15分",
"time": "6分钟",
"number": "4",
"title": "交付规范"
}
}
};
let env = process.uniEnv.node_env;
let desc = condition[env];
export default {
data() {
return {
examId: 2,
desc: null,
examId: null,
exam: null,
userExamId: null,
};
},
onLoad() {
onLoad(param) {
this.examId = param.examId
this.desc = desc["id-" + this.examId]
// this.getUserExamInfo();
},
methods: {
//申请考试获取userExamId
getUserExamId: function () {
var that = this;
console.log("这是一条消息");
let examId = this.examId;
wx.navigateTo({
url: "/pages/learn/answer?examId=" + examId,
});
},
getUserExamInfo() {
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",
},
url:
process.uniEnv.systemUrl.apiUrl +
"/wxh-worker-rest/rest/exam/serviceRule/" +
this.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);
}
}
},
success: (res) => {
console.log("标识符1", res.data);
uni.hideLoading();
if (res.data.code == 200) {
if (res.data.data.userExamId) {
this.userExamId = res.data.data.userExamId;
console.log("这个是个标识符", this.userExamId);
}
}
},
});
setTimeout(() => {
wx.navigateTo({
url: "./answer?userExamId=" + that.userExamId,
});
}, 1000);
wx.navigateTo({
url: "/pages/learn/answer?userExamId=" + this.userExamId,
});
}, 1000);
},
},
};
......
<template>
<view class="content">
<u-navbar
back-icon-color="#FFFFFF"
:background="background"
title-color="#fff"
:border-bottom="false"
></u-navbar>
<view class="title">考试结果</view>
<view class="test">
<view class="result">
<view class="circle">{{ score }}</view>
</view>
<view class="test-explain">
<view class="text1">
您已成功通过本次考试
</view>
<view class="text2">
通过本科目后,可进行其他科目考试
</view>
</view>
<view class="btn">
<button class="btnStyle btn2" @click="toIndex()">我知道了</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
text: "",
examId: 2,
result: null,
is_pass: false,
score: 0,
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:
process.uniEnv.systemUrl.apiUrl +
"/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;
this.score = this.result.examScore;
this.is_pass = this.result.result == '通过';
console.log("标识符55", this.result);
},
});
},
//再次考试
getAgain: function () {
wx.navigateTo({
url: "./assessment",
});
},
//下次再考跳转到学习主界面页面
toIndex: function () {
wx.reLaunch({
url: "/pages/index/learn?tabs=3",
});
// wx.navigateBack({ delta: 1 })//返回上一级页面
},
},
};
</script>
<style lang="scss">
.test {
margin: 0 30rpx;
overflow: hidden;
border-radius: 12rpx;
padding-bottom: 60rpx;
// background-image: url(../../static/photo/examination.png);
background-repeat: no-repeat;
background-size: 66%;
background-color: #fff;
background-position: right bottom;
min-height: 800rpx;
}
.content {
width: 750rpx;
height: 100vh;
overflow: auto;
background-color: #f4f5f7;
background-image: linear-gradient(to top, #f4f5f7 0%, #2272ff 50%);
background-size: 750rpx 600rpx;
background-repeat: no-repeat;
.title {
padding: 30rpx 30rpx 46rpx;
line-height: 40rpx;
font-size: 40rpx;
color: #fff;
font-weight: bold;
}
.result {
width: 320rpx;
height: 320rpx;
margin-top: 80rpx;
margin-left: 186rpx;
// color: red;
// font-size: 66rpx;
// text-align: center;
// // border:
// border-bottom: 1px dashed #000000;
// margin: 74rpx 0;
// padding: 66rpx;
background-image: linear-gradient(#47ABFF, #2272FF) ;
border-radius:50%;
text-align:center;
padding:10rpx;
font-size:28rpx;
box-sizing:border-box;
}
.result .circle{
width:100%;
height:100%;
background:#fff;
border-radius:50%;
font-size: 120rpx;
color: #2272FF;
text-align: center;
padding-top: 20%;
}
.test-explain {
margin-top: 80rpx;
margin-left: 84rpx;
margin-right: 84rpx;
text-align: center;
.text1 {
font-size: 40rpx;
font-weight: bold;
color: #2272FF;
}
.text2 {
font-size: 24rpx;
color: #666666;
margin-top: 30rpx;
}
}
.btn {
margin-top: 100rpx;
display: flex;
font-size: 32rpx;
font-weight: bold;
.btnStyle {
width: 600rpx;
height: 104rpx;
background-color: #ffffff;
color: #2272FF;
line-height: 90rpx;
margin: 20rpx auto;
border: 2rpx solid #2272FF;
border-radius: 52rpx;
}
.btn2 {
background-color: #2272FF;
color: #ffffff;
}
}
}
</style>
<template>
<view class="study">
<u-navbar :is-back="false" background="{background: transparent}" :border-bottom="false" :is-fixed="false">
<text class="title-view">学习</text>
</u-navbar>
<image :src="bannerImage" mode="" class="banner"></image>
<view>
<u-tabs-swiper bg-color="#F4F5F7" inactive-color="#999999" font-size="28" ref="uTabs" :list="tabs"
:current="current" @change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
</view>
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"
style="height: 755rpx;padding-top: 30rpx;">
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height:796rpx;width:100%;" @scrolltolower="onreachBottom">
<view class="currency-class" :style="{'background-image':'url(/static/photo/jianbian@3x.png)'}">
<view class="class1" @click="goToPrint">
<image class="img" :src="rule.pic" mode=""></image>
<view class="right u-margin-left-30 u-padding-top-10 u-padding-bottom-14 width-360">
<view class="u-font-32 font-bold">
充电桩交付规范
</view>
<view class="u-font-24">
请点击学习
</view>
</view>
<view class="line-percent">
<text class="font-default-color">去查看</text>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height:100%;width:100%;" @scrolltolower="onreachBottom">
<view v-for="item in list" :key="item.id" class="notice" @click="bbb(item)">
<view class="n-head">
《{{item.title}}》
</view>
<view class="news" v-html="item.body">
<u-parse :html="item.body"></u-parse>
</view>
<u-line color="#F4F5F7" class="content-line"/>
</view>
<view v-shou="isLoadMore">
<u-loadmore :status="loadStatus" />
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height:100%;width:100%;">
<view class="lean">
<view class="top">
<view class="title u-margin-top-10 u-margin-bottom-30">通用课程</view>
<view class="currency-class">
<view class="class1" @click=ccc(courselist[0].sectionId)>
<image class="img" :src="courselist[0].pic" mode=""></image>
<view class="right">
<view class="u-font-32 font-bold">
{{ courselist[0].title }}
</view>
<view class="u-font-24">
{{ courselist[0].desc }}
</view>
<view class="line-percent">
<u-line-progress active-color="#2979ff" :percent="courselist[0].percent"
:show-percent="false">
</u-line-progress>
<text class="font-default-color"
:class="{'font-active-color':courselist[0].percent}"
v-text="courselist[0].status"></text>
</view>
</view>
</view>
<view class="class1 u-margin-top-40" @click=ccc(courselist[1].sectionId)>
<image class="img" :src="courselist[1].pic" mode=""></image>
<view class="right">
<view class="u-font-32 font-bold">
{{ courselist[1].title }}
</view>
<view class="u-font-24">
{{ courselist[1].desc }}
</view>
<view class="line-percent">
<u-line-progress active-color="#2979ff" :percent="courselist[1].percent"
:show-percent="false">
</u-line-progress>
<text class="font-default-color"
:class="{'font-active-color':courselist[1].percent}"
v-text="courselist[1].status"></text>
</view>
</view>
</view>
</view>
<view class="title u-margin-top-50 u-margin-bottom-30">技能课程</view>
<view class="currency-class">
<view class="class1" @click=ccc(courselist[2].sectionId)>
<image class="img" :src="courselist[2].pic" mode=""></image>
<view class="right">
<view class="u-font-32 font-bold">
{{ courselist[2].title }}
</view>
<view class="u-font-24">
{{ courselist[2].desc }}
</view>
<view class="line-percent" style="display:flex;justify-content: space-between;">
<u-line-progress active-color="#2979ff" :percent="courselist[2].percent"
:show-percent="false">
</u-line-progress>
<text class="font-default-color"
:class="{'font-active-color':courselist[2].percent}"
v-text="courselist[2].status"></text>
</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
<swiper-item>
<scroll-view scroll-y style="height:100%;width:100%;" @scrolltolower="onreachBottom">
<view class="lean">
<view class="top">
<view class="title u-margin-top-10 u-margin-bottom-30">通用认证</view>
<view class="currency-class">
<view class="class1" @click="aaa(0)">
<image class="img" :src="examList[0].pic" mode=""></image>
<view class="right">
<view class="u-font-32 font-bold">
{{ examList[0].title }}
</view>
<view class="u-font-24">
{{ examList[0].desc }}
</view>
<view class="u-font-24" style="display:flex;justify-content: space-between;">
<text class="font-color-999999">{{ examList[0].condition }}</text>
<text class="font-default-exam-color"
:class="{'font-active-color':examList[0].isComplete}">
{{ examList[0].status }}
</text>
</view>
</view>
</view>
<view class="class1 u-margin-top-40" @click="aaa(1)">
<image class="img" :src="examList[1].pic" mode=""></image>
<view class="right">
<view class="u-font-32 font-bold">
{{examList[1].title}}
</view>
<view class="u-font-24">
{{ examList[1].desc }}
</view>
<view class="u-font-24" style="display:flex;justify-content: space-between;">
<text class="font-color-999999">{{ examList[1].condition }}</text>
<text class="font-default-exam-color"
:class="{'font-active-color':examList[1].isComplete}">
{{ examList[1].status }}</text>
</view>
</view>
</view>
</view>
<view class="title u-margin-top-50 u-margin-bottom-30">技能认证</view>
<view class="currency-class">
<view class="class1" @click="aaa(2)">
<image class="img" :src="examList[2].pic" mode=""></image>
<view class="right">
<view class="u-font-32 font-bold">
{{ examList[2].title }}
</view>
<view class="u-font-24">
{{ examList[2].desc }}
</view>
<view class="u-font-24" style="display:flex;justify-content: space-between;">
<text class="font-color-999999">{{ examList[2].condition }}</text>
<text class="font-default-exam-color"
:class="{'font-active-color':examList[2].isComplete}">
{{ examList[2].status }}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
</template>
<script>
export default {
data() {
return {
msg: "赣南吴彦祖",
tabs: [{
name: "交付规范",
},
{
name: "培训通知",
},
{
name: "在线学习",
},
{
name: "考核认证",
},
],
current: 0,
swiperCurrent: 0,
params: {
start: 0,
},
list: [],
rule: {
pic: process.uniEnv.qn_base_url + "guifan1@3x.png"
},
courselist: [{
title: '服务规范',
desc: '为用户提供更好服务,自己赚更多钱',
percent: 0,
status: '',
pic: process.uniEnv.qn_base_url + "guifan1@3x.png",
id: 173,
sectionId: ''
},
{
title: '接单操作',
desc: '快速学习,使用APP 接单、抢单',
percent: 0,
status: '',
pic: process.uniEnv.qn_base_url + "guifan2@3x.png",
id: 173,
sectionId: ''
},
{
title: '从0-1学习充电桩安装服务',
desc: '让你全面了解充电桩市场及服务规范',
percent: 0,
status: '',
pic: process.uniEnv.qn_base_url + "kecehng1@3x.png",
id: 173,
sectionId: ''
}
],
examList: [{
title: '服务规范',
desc: '通过本认证,是接单的必要条件',
condition: '随机20题,及格20题',
status: '',
pic: process.uniEnv.qn_base_url + "guifan1@3x.png",
id: 2,
examId: '',
examStatus: '',
isComplete: false
},
{
title: '接单操作',
desc: '快速认证,是否具备接单操作能力',
condition: '随机20题,及格16题',
status: '',
pic: process.uniEnv.qn_base_url + "guifan2@3x.png",
id: 2,
examId: '',
examStatus: '',
isComplete: false
},
{
title: '从0-1学习充电桩安装服务',
desc: '通过本认证后,可接充电桩业务单',
condition: '随机30题,及格25题',
status: '',
pic: process.uniEnv.qn_base_url + "kecehng1@3x.png",
id: 2,
examId: '',
examStatus: '',
isComplete: false
}
],
loadStatus: "loading", //加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式
isLoadMore: false, //是否加载中
course_id: "course_id_=173",
exam: null,
};
},
onLoad() {
// this.getList();
// this.getCourseList();
// this.getUserExamInfo();
},
computed: {
bannerImage() {
return process.uniEnv.qn_base_url + "banner-xx@3x.png";
},
},
methods: {
getList() {
this.$u.api
.getTrainingNoticeList(this.params)
.then((res) => {
if (res.code == 200) {
if (res.data) {
this.list = this.list.concat(res.data);
if (res.data.length < 5) {
//判断接口返回数据量小于请求数据量,则表示此为最后一页
this.isLoadMore = true;
this.loadStatus = "nomore";
} else {
this.isLoadMore = false;
}
} else {
this.isLoadMore = true;
this.loadStatus = "nomore";
}
} else {
//接口请求失败的处理
uni.showToast({
title: res.message,
icon: "none",
});
this.isLoadMore = false;
if (this.params.start > 0) {
this.page -= 5;
}
}
})
.catch((err) => {
uni.showToast({
title: err,
icon: "none",
});
this.isLoadMore = false;
if (this.params.start > 0) {
this.page -= 5;
}
});
},
getTypeName(percent) {
if (percent == 0) {
return '未开始';
} else if (percent == '100') {
return '已完成';
} else {
return '继续';
}
},
//在线学习通用课程信息
getCourseList() {
let courseLength = this.courselist.length;
for (let i = 0; i < courseLength; i++) {
let param = {
course_id: this.courselist[i].id
};
this.$u.api
.CourseList(param)
.then((res) => {
if (res.code == 200) {
if (res.data) {
res.data.learnedInfo.learnPercent *= 100;
this.courselist[i].status = this.getTypeName(res.data.learnedInfo.learnPercent);
this.courselist[i].percent = res.data.learnedInfo.learnPercent;
this.courselist[i].sectionId = res.data.learnedInfo.nextLearnedSectionId;
}
}
})
.catch((err) => {
uni.showToast({
title: err,
icon: "none",
});
});
}
},
//tabs通知swiper切换
tabsChange(index) {
this.swiperCurrent = index;
switch (index) {
case 1:
this.params.start = 0;
this.list = [];
this.getList();
break;
case 2:
this.getCourseList();
console.log('重新加载学习进度');
break;
case 3:
this.getUserExamInfo();
break;
}
},
//swiper-item左右移动,通知tabs的滑块跟随移动
transition(e) {
let dx = e.detail.dx;
this.$refs.uTabs.setDx(dx);
},
animationfinish(e) {
let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
},
//跳转到assessment页面
aaa(index) {
var examInfo = this.examList[index];
if (examInfo.examStatus == 0) {
console.log("这是申请的考试id", examInfo.examId);
wx.navigateTo({
url: "./answer?userExamId=" + examInfo.examId,
});
} else if (examInfo.examStatus == 1) {
wx.navigateTo({
url: "./result?userExamId=" + examInfo.examId,
});
} else if (examInfo.examStatus == 2) {
wx.navigateTo({
url: "./assessment",
});
}
},
//跳转到课程介绍
ccc(id) {
uni.navigateTo({
url: "./section?section_id=" + 288,
});
},
//跳转到
bbb(e) {
var news = {
body: e.body,
id: e.id,
level: e.level,
title: e.title,
};
// console.log(news)
uni.navigateTo({
url: "./news-details",
});
setTimeout(() => {
uni.$emit("news", news), console.log("发送数据");
}, 500);
console.log("跳转结束11111111");
},
//scroll-view到底部加载更多
onreachBottom() {
console.log("上拉触底函数");
//上拉触底函数
if (!this.isLoadMore) {
this.isLoadMore = true;
this.params.start += 5;
if (this.loadStatus !== "nomore") {
this.getList();
}
}
},
//跳转到拍照小程序首页
goToPrint() {
console.log("111111");
uni.navigateToMiniProgram({
appId: "wxd1d6eede324b0465",
success(res) {
//打开成功
console.log("success", res);
},
fail(err) {
console.log("err", err);
},
});
},
//考核认证,通用认证,考试通过or未通过查询接口请求
getUserExamInfo() {
uni.showLoading({
title: "请稍候",
});
let that = this;
let token = that.vuex_token;
let length = this.examList.length;
for (let i = 0; i < length; i++) {
let examId = this.examList[i].id;
this.$u.api
.getExamResult(examId)
.then((res) => {
if (res.code == 200) {
this.examList[i].examId = res.data.id;
this.examList[i].examStatus = res.data.examStatus;
let examResult = res.data.examLevelResult;
this.examList[i].status = examResult != '' ? examResult : '未通过';
// examStatus 用户考试状态 0考试中 1考试完成 2未参与
that.exam = res.data;
console.log(that.exam);
if (res.data.examStatus == 2) {
console.log("examStatus " + i + " 2");
return;
}
if (res.data.examStatus == 1) {
console.log("examStatus " + i + " 1");
that.examList[i].isComplete = true;
that.examScore = res.data.examScore;
return;
}
if (res.data.examStatus == 0) {
console.log("examStatus " + i + " 0");
that.userExamId = res.data.id;
// that.getNext();
}
} else {
console.log('getUserExamInfo 200 err');
uni.showToast({
icon: "none",
title: '获取考试信息失败',
});
}
})
.catch((err) => {
console.log('getUserExamInfo err' + err);
uni.hideLoading();
uni.showToast({
icon: "none",
title: "获取考试信息失败",
});
});
}
}
},
};
</script>
<style>
.study {
height: 100vh;
background-color: #f4f5f7;
padding: 0rpx 30rpx 0 30rpx;
}
.title-view {
color: #333333;
font-weight: bold;
font-size: 40rpx;
}
.banner {
width: 690rpx;
height: 240rpx;
margin-top: 10rpx;
}
/* //交付规范 */
.standard {
width: 690rpx;
height: 180rpx;
display: flex;
justify-content: space-between;
/* border-bottom: 1rpx solid #82848a; */
/* padding: 0 34rpx; */
/* margin: 72rpx auto; */
border-radius: 12rpx;
padding: 30rpx;
margin-top: 30rpx;
background-color: #FFFFFF;
}
/* //培训通知 */
.notice {
/* border: #808080 solid 2rpx; */
width: 100%;
height: 400rpx;
margin-top: 36rpx;
overflow: hidden;
background-color: #ffffff;
border-radius: 12rpx;
padding: 30rpx;
}
.n-head {
text-align: left;
}
.news {
height: 168rpx;
overflow: hidden;
margin-top: 30rpx;
/* margin-top: 30rpx;
margin-left: 30rpx;
margin-right: 30rpx;
margin-bottom: 0; */
}
/* //在线学习 */
.currency-class {
width: 100%;
/* height: 340rpx; */
background: #ffffff;
padding: 30rpx;
/* margin-bottom: 11px; */
border-radius: 12rpx;
}
.title {
font-size: 32rpx;
font-weight: bold;
font-family: PingFang-SC-Bold, PingFang-SC;
}
.class1 {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
}
.img {
width: 160rpx;
height: 120rpx;
/* display: block; */
/* margin-right: 0rpx; */
}
.right {
width: 434rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.intro {
color: #9999a6;
}
.tab {
background: #fff;
height: 82rpx;
margin: 0 0;
}
.text {
margin: 0 40rpx;
line-height: 82rpx;
color: #667eb5;
}
.content {
margin: 5px 0;
height: 485rpx;
background: #fff;
}
swiper {
height: 691rpx;
}
.line-percent {
display: flex;
justify-content: space-between;
line-height: 24rpx;
font-size: 24rpx;
color: #999999;
}
.u-progress {
width: 280rpx !important;
height: 12rpx !important;
background-color: #ececec;
}
.font-bold {
font-weight: bold;
}
.font-default-color {
color: #999999;
}
.font-default-exam-color {
color: #FA5A49;
}
.font-active-color {
color: #2272FF;
}
.font-color-999999 {
color: #99999;
}
.content-line {
margin-top: 30rpx;
}
.standard {
}
.standard-img {
width: 160rpx;
height: 120rpx;
}
.standard-body {
height: 120rpx;
display: flex;
}
.standard-body-title {
font-size: 32rpx;
font-weight: bold;
}
.width-360 {
width: 360rpx;
}
.rule-back {
background-image: process.uniEnv.qn_base_url + "banner-xx@3x.png";
}
/* <view class="standard" @click="goToPrint">
<!-- <text>充电桩交付规范</text>
<text>></text> -->
<view class="standard-img"></view>
<view class="standard-body">
<view class="standard-body-title">
充电桩交付规范
</view>
<view class="standard-body-title">
请点击学习
</view>
</view>
<view cl ass="standard-go-look-look">去查看</view>*/
</style>
......@@ -2,11 +2,10 @@
<view>
<view class="title">
{{newsInfo.title}}
</view>
<view class="content" v-html="newsInfo.body">
<button @click="add">aaa</button>
{{newsInfo.body}}
</view>
</view>
<view class="u-content">
<u-parse :html="newsInfo.body" :tag-style="style"></u-parse>
</view>
</view>
</template>
......@@ -18,7 +17,10 @@
obj:{
},
newsInfo:null
newsInfo: {
title: '',
body: ''
}
}
},
methods: {
......@@ -28,11 +30,10 @@
},
onShow(){
uni.$on('news',(news)=>{
this.newsInfo = news;
console.log(news,'news')
})
uni.$on('news',(news)=>{
this.newsInfo = news;
console.log(news,'news')
})
},
onLoad() {
this.$u.mpShare.path = ''
......@@ -41,11 +42,17 @@
</script>
<style>
.title{
text-align: center;
margin: 34rpx;
.title{
font-size: 32rpx;
font-weight: bold;
margin-left: 30rpx;
margin-top: 30rpx;
}
.content{
padding: 38rpx;
.content{
font-size: 24rpx;
line-height: 36rpx;
color: #666666;
margin-left: 30rpx;
margin-top: 30rpx;
}
</style>
<template>
<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 class="content">
<u-navbar
back-icon-color="#FFFFFF"
:background="background"
title-color="#fff"
:border-bottom="false"
></u-navbar>
<!-- <u-navbar style="position: absolute;" background="{background: transparent}" :border-bottom="false"
back-icon-color="#ffffff" title-color="#ffffff"></u-navbar> -->
<view class="title">考试成绩</view>
<view class="test">
<view class="result">
<view class="circle">{{ score }}</view>
</view>
<view class="hang">
<text class="text1">考试结果:</text
><text class="text2">答对10题</text>
<view class="test-explain">
<view class="text1">
很遗憾,您未能通过本次考试
</view>
<view class="text2">
您可点击再考一次重新进行考试
</view>
</view>
<view class="hang">
<text class="text1">考试用时:</text
><text class="text2">16分29秒</text>
<view class="btn">
<button class="btnStyle" @click="getAgain()">再答一次</button>
<button class="btnStyle btn2" @click="toIndex()">我知道了</button>
</view>
</view>
<view class="btn">
<button class="btn1" @click="getAgain()">再答一次</button>
<button class="btn2" @click="toIndex">下次再考</button>
</view>
</view>
</template>
......@@ -28,28 +36,30 @@ export default {
data() {
return {
text: "",
examId: 2,
examId: null,
result: null,
score: 0,
userExamId: null,
};
},
onLoad(a) {
this.userExamId = a.userExamId;
this.examId = a.examId;
console.log("userExamId是", this.userExamId);
this.nextClick();
},
onUnload() {
wx.reLaunch({
url: "./index",
});
},
// onUnload() {
// wx.reLaunch({
// url: "./index",
// });
// },
methods: {
//考试结果
nextClick: function () {
console.log("wwwwwwwwww");
uni.request({
url:
"http://192.168.1.22" +
process.uniEnv.systemUrl.apiUrl +
"/wxh-worker-rest/rest/exam" +
"/serviceRule/next/" +
this.vuex_token +
......@@ -63,73 +73,127 @@ export default {
success: (res) => {
this.result = res.data.data;
this.text = res.data.data.examLevelResult;
this.score = this.result.examScore;
console.log("标识符55", this.result);
},
});
},
//再次考试
getAgain: function () {
let examId = this.examId;
wx.navigateTo({
url: "./assessment",
url: "/pages/learn/assessment?examId=" + examId,
});
},
//下次再考跳转到学习主界面页面
toIndex: function () {
wx.reLaunch({
url: "./index",
url: "/pages/index/learn?tabs=3",
});
// wx.navigateBack({ delta: 1 })//返回上一级页面
},
},
};
</script>
<style lang="scss">
.test-result {
width: 610rpx;
height: 965rpx;
margin: 70rpx auto 0;
.test {
margin: 0 30rpx;
overflow: hidden;
border-radius: 12rpx;
padding-bottom: 60rpx;
// background-image: url(../../static/photo/examination.png);
background-repeat: no-repeat;
background-size: 66%;
background-color: #fff;
background-position: right bottom;
min-height: 800rpx;
}
.content {
width: 750rpx;
height: 100vh;
overflow: auto;
background-color: #f4f5f7;
background-image: linear-gradient(to top, #f4f5f7 0%, #2272ff 50%);
background-size: 750rpx 600rpx;
background-repeat: no-repeat;
.title {
margin: 0 44rpx 0;
padding: 30rpx 30rpx 46rpx;
line-height: 40rpx;
font-size: 40rpx;
color: #fff;
font-weight: bold;
}
.result {
color: red;
font-size: 66rpx;
text-align: center;
border-bottom: 1px dashed #000000;
margin: 74rpx 0;
padding: 66rpx;
width: 320rpx;
height: 320rpx;
margin-top: 80rpx;
margin-left: 186rpx;
// color: red;
// font-size: 66rpx;
// text-align: center;
// // border:
// border-bottom: 1px dashed #000000;
// margin: 74rpx 0;
// padding: 66rpx;
background-image: linear-gradient(#FF930D, #FA5A49) ;
border-radius:50%;
text-align:center;
padding:10rpx;
font-size:28rpx;
box-sizing:border-box;
}
.result .circle{
width:100%;
height:100%;
background:#fff;
border-radius:50%;
font-size: 120rpx;
color: #FA5A49;
text-align: center;
padding-top: 20%;
}
.test-explain {
.hang {
margin: 26rpx 26rpx;
.text1 {
color: #a69999;
margin-right: 22rpx;
}
.text2 {
color: #333333;
}
margin-top: 80rpx;
margin-left: 84rpx;
margin-right: 84rpx;
text-align: center;
.text1 {
font-size: 40rpx;
font-weight: bold;
color: #FA5A49;
}
.text2 {
font-size: 24rpx;
color: #666666;
margin-top: 30rpx;
}
}
.btn {
margin-top: 236rpx;
.btn1 {
width: 478rpx;
height: 60rpx;
background: #0079fe;
color: #fff;
font-size: 26rpx;
line-height: 60rpx;
margin-top: 100rpx;
display: flex;
font-size: 32rpx;
font-weight: bold;
.btnStyle {
width: 300rpx;
height: 104rpx;
background-color: #ffffff;
color: #2272FF;
line-height: 90rpx;
margin: 20rpx auto;
border: 2rpx solid #2272FF;
border-radius: 52rpx;
}
.btn2 {
width: 478rpx;
height: 60rpx;
background: #f2f2f2;
color: #333333;
font-size: 26rpx;
line-height: 60rpx;
margin: 0 auto;
background-color: #2272FF;
color: #ffffff;
}
}
}
......
......@@ -9,20 +9,20 @@
<view class="item-content">
<view class="item-st">
<image style="width: 80rpx; height: 36rpx" :src="kcImage"></image>
<text class="item-st-text">5课时</text>
<text class="item-st-text">{{ courseTotal }}课时</text>
</view>
<view class="item-title">服务规范</view>
<view class="item-title">{{ courseTitle }}</view>
</view>
<view>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view>
<view>{{ courseDesc }}</view>
</view>
<view class="learn-view" v-if="courseId >= 0">
<view class="learn-view-title">课程讲师</view>
<view class="learn-view-title color-teacher">课程讲师</view>
<view class="" style="padding-top: 30rpx;display: flex;padding-left: 30rpx;">
<u-avatar :style="{'width':'100rpx', 'height':'100rpx'}" :src="teacher.avatar" mode="circle"></u-avatar>
<u-avatar :style="{'width':'100rpx', 'height':'100rpx'}" :src="teacherImage" mode="circle"></u-avatar>
<view style="height:120rpx;font-size: 30rpx;padding-left:30rpx;">
<view class="" style="display: flex;font-size: 32rpx;">
<view class="" style="font-size: 32rpx;font-weight: bold;">{{ teacher.name }}</view>
<view class="" style="font-size: 24rpx;margin-left: 30rpx;margin-top: 6rpx;">课程讲师</view>
<view class="" style="font-size: 24rpx;margin-left: 30rpx;margin-top: 6rpx;color: #999999;">课程讲师</view>
</view>
<view class="" style="font-size: 24rpx;margin-top: 30rpx;">反正这里就是放老师的简介,只是写啥我也不知道,反正就是写很厉害的简介啦</view>
</view>
......@@ -31,7 +31,7 @@
<view class="learn-view-title">目录</view>
<view class="" style="display: flex;overflow: auto;padding-top: 30rpx;padding-bottom: 30rpx;">
<view v-for="(item, index) in list" :key="index">
<view @click="goNext(item.id)" class="list-cell list-default" :class="{'list-default-active': item.isActive}" style="width:280rpx;height:150rpx;margin-left: 20rpx;padding: 20rpx;border-radius: 12rpx;">
<view @click="goNext(item)" class="list-cell list-default" :class="{'list-default-active': item.isActive}" style="width:280rpx;height:150rpx;margin-left: 20rpx;padding: 20rpx;border-radius: 12rpx;">
<view class="" style="font-size: 24rpx;">{{ item.title }}</view>
<view class="" style="font-size: 26rpx;margin-top: 16rpx;">
{{ item.intro }}
......@@ -59,21 +59,24 @@
export default {
data() {
return {
teacherImage: process.uniEnv.qn_base_url + "avatar.gif",
courseId: "",
courseStatus: 0,
courseSrc: "",
courseTitle: "",
courseDesc: "",
courseTotal: null,
currentIndex: -1, // 第几个视频
section_id: 0,
active_section_id: 0,
isShowVideo: false,
CourseSectionlist: {name: '', content: ''}, //节信息
list: [
{'title': '第一节', 'intro': '考核规则1:接单及 时率', 'isActive': true, "id": 288},
{'title': '第二节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": 288},
{'title': '第三节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": 288},
{'title': '第四节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": 288},
{'title': '第五节', 'intro': '考核规则1:接单及 时率', 'isActive':false, "id": 288},
{'title': '第1节', 'intro': '考核规则1:接单及 时率', 'isActive': true, "id": null},
{'title': '第2节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": null},
{'title': '第3节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": null},
{'title': '第4节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": null},
{'title': '第5节', 'intro': '考核规则1:接单及 时率', 'isActive':false, "id": null},
],
teacher: {
name: "",
......@@ -97,7 +100,7 @@
}
},
params:{
course_id:173,
course_id:null,
},
gklog: '',
videoTotalTime: 0,
......@@ -137,6 +140,8 @@
},
},
onLoad(e) {
this.active_section_id = e.section_id;
this.params.course_id = e.course_id;
this.getCourseSection({
section_id: e.section_id
})
......@@ -148,9 +153,9 @@
// #endif
},
methods: {
goNext(id){
goNext(info){
uni.navigateTo({
url: "./section?section_id=" + id,
url: "./section?section_id=" + info.id + "&course_id=" + info.course_id
});
},
onPlayerTimeupdate(player) {
......@@ -197,7 +202,7 @@
let wareVal = this.CourseSectionlist.ware;
this.isShowVideo = wareVal == "0";
this.courseTitle = res.data.name;
this.courseDesc = res.data.content;
this.courseDesc = res.data.content.replace(/<p.*?>|<\/p>/ig, "");
this.section_id = res.data.id;
this.section_content = res.data.content;
this.teacher.name = res.data.teachers[0].name;
......@@ -277,9 +282,16 @@
.then((res) => {
if (res.code == 200) {
if (res.data) {
// debugger
// this.list = this.list.concat(res.data);
// console.log(this.list)
this.list = res.data[0].section;
this.courseTotal = this.list.length;
let length = this.list.length;
for(let i = 0; i < length; i++){
this.list[i].title = "第" + (i + 1) + "节";
this.list[i].intro = this.list[i].name;
this.list[i].isActive = this.active_section_id == this.list[i].id ? true : false;
}
console.log('--select-list--')
console.log(this.list)
}
} else {
//接口请求失败的处理
......@@ -443,4 +455,8 @@
border: 2rpx solid #2272FF;
box-sizing: border-box;
}
.color-teacher {
color: #999999;
}
</style>
......@@ -583,14 +583,21 @@
return
}
this.$u.api[this.submitType](data, this.order.orderId).then(res => {
let self = this
if ((res.data.code!==undefined && res.data.code === 200)
|| (res.code!==undefined && res.code === 200) ) {
this.$refs.uToast.show({
title: this.centerButtonText + '操作成功',
type: 'success',
url: 'pages/order/detail',
params: {
id: this.order.orderId
// isTab:true,
// url: 'pages/order/detail',
// params: {
// id: this.order.orderId
// }
callback : function(){
uni.redirectTo({
url: 'pages/order/detail?id='+self.order.orderId
});
}
})
} else {
......
src/static/photo/jianbian@3x.png

21.9 KB | W: | H:

src/static/photo/jianbian@3x.png

7.64 KB | W: | H:

src/static/photo/jianbian@3x.png
src/static/photo/jianbian@3x.png
src/static/photo/jianbian@3x.png
src/static/photo/jianbian@3x.png
  • 2-up
  • Swipe
  • Onion skin
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