Commit 683a34a4 authored by 刘用法's avatar 刘用法
parents a1286b27 d85e03b3
const UNI_APP = { const UNI_APP = {
ucenterUrl: { ucenterUrl: {
apiUrl: 'http://rest-u.yunya.com', //php端域名请求头 apiUrl: 'http://rest-u.yunya.com', //php端域名请求头
xueUrl: 'http://xue.yunya.com', //学院 xueUrl: 'http://rest-xue.yunya.com', //学院
// banshou: 'https://m.banshou.com', //扳手app // banshou: 'https://m.banshou.com', //扳手app
}, },
systemUrl: { systemUrl: {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
} }
if (ENV_VAR) { if (ENV_VAR) {
process.uniEnv = {}; process.uniEnv = {};
process.uniEnv['node_env'] = NODE_ENV;
for (let key in ENV_VAR) { for (let key in ENV_VAR) {
process.uniEnv[key] = ENV_VAR[key]; process.uniEnv[key] = ENV_VAR[key];
} }
......
const UNI_APP = { const UNI_APP = {
ucenterUrl: { ucenterUrl: {
apiUrl: 'https://rest-u.banshouhui.com', //php端域名请求头 apiUrl: 'https://rest-u.banshouhui.com', //php端域名请求头
xueUrl:'https://xue.banshouhui.com', //学院 xueUrl:'https://rest-xue.banshouhui.com', //学院
banshou:'https://m.banshou.com' ,//扳手app banshou:'https://m.banshou.com' ,//扳手app
}, },
systemUrl: { systemUrl: {
......
const UNI_APP = { const UNI_APP = {
ucenterUrl: { ucenterUrl: {
apiUrl: 'https://rest-u.test.ibanshou.cn', //php端域名请求头 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 banshou: 'https://m.test.ibanshou.cn', //扳手app
}, },
systemUrl: { 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 @@ ...@@ -75,14 +75,15 @@
{ {
"path": "answer", "path": "answer",
"style": { "style": {
"navigationBarTitleText": "考试答题", "navigationBarTitleText": "考核认证",
"navigationStyle":"custom" "navigationStyle":"custom"
} }
}, },
{ {
"path":"result", "path":"result",
"style":{ "style":{
"navigationBarTitleText":"考试答题" "navigationBarTitleText":"",
"navigationStyle":"custom"
} }
}, },
{ {
...@@ -100,7 +101,8 @@ ...@@ -100,7 +101,8 @@
{ {
"path": "curriculum", "path": "curriculum",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": "",
"navigationStyle": "custom" // 隐藏系统导航栏
} }
}, },
{ {
...@@ -116,7 +118,16 @@ ...@@ -116,7 +118,16 @@
"path": "course-detail", "path": "course-detail",
"style": { "style": {
"navigationBarTitleText": "培训视频", "navigationBarTitleText": "培训视频",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
"navigationStyle": "custom" // 隐藏系统导航栏
}
},
{
"path": "exam-pass",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom" // 隐藏系统导航栏
} }
} }
] ]
......
...@@ -12,35 +12,32 @@ ...@@ -12,35 +12,32 @@
style="height: 755rpx;padding-top: 30rpx;"> style="height: 755rpx;padding-top: 30rpx;">
<swiper-item class="swiper-item"> <swiper-item class="swiper-item">
<scroll-view scroll-y style="height:796rpx;width:100%;" @scrolltolower="onreachBottom"> <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"> <view class="class1" @click="goToPrint">
<image class="img" :src="rule.pic" mode=""></image> <image class="jf-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="right u-padding-top-10 u-padding-bottom-14 jf-right">
<view class="u-font-32 font-bold"> <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="u-font-24">
请点击学习
</view>
</view>
<view class="line-percent">
<text class="font-default-color">去查看</text>
</view> </view>
<view class="jf-line u-margin-right-30 u-margin-top-60">去查看</view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
<swiper-item class="swiper-item"> <swiper-item class="swiper-item">
<scroll-view scroll-y style="height:100%;width:100%;" @scrolltolower="onreachBottom"> <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 v-for="item in list" :key="item.id" class="notice" @click="bbb(item)">
<view class="n-head"> <view class="n-head">
《{{item.title}}》 {{item.title}}
</view> </view>
<view class="news" v-html="item.body"> <view class="news" v-html="item.body">
<u-parse :html="item.body"></u-parse> <u-parse :html="item.body"></u-parse>
</view> </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>
<view v-shou="isLoadMore"> <view v-shou="isLoadMore">
<u-loadmore :status="loadStatus" /> <u-loadmore :status="loadStatus" />
...@@ -52,17 +49,19 @@ ...@@ -52,17 +49,19 @@
<view class="lean"> <view class="lean">
<view class="top"> <view class="top">
<view class="title u-margin-top-10 u-margin-bottom-30">通用课程</view> <view class="title u-margin-top-10 u-margin-bottom-30">通用课程</view>
<view class="currency-class"> <view class="learn-currency-class">
<view class="class1" @click=ccc(courselist[0].sectionId)> <view class="learn-class1" @click=goPlay(courselist[0])>
<image class="img" :src="courselist[0].pic" mode=""></image> <image class="learn-img" :src="courselist[0].pic" mode=""></image>
<view class="right"> <image class="bofang" :src="bofang" mode=""></image>
<view class="u-font-32 font-bold"> <view class="learn-desc">
<view class="u-font-28 font-bold h68">
{{ courselist[0].title }} {{ courselist[0].title }}
</view> </view>
<view class="u-font-24"> <view class="u-font-20 learn-intro h48">
{{ courselist[0].desc }} {{ courselist[0].desc }}
</view> </view>
<view class="line-percent"> </view>
<view class="line-percent u-margin-top-35">
<u-line-progress active-color="#2979ff" :percent="courselist[0].percent" <u-line-progress active-color="#2979ff" :percent="courselist[0].percent"
:show-percent="false"> :show-percent="false">
</u-line-progress> </u-line-progress>
...@@ -71,17 +70,18 @@ ...@@ -71,17 +70,18 @@
v-text="courselist[0].status"></text> v-text="courselist[0].status"></text>
</view> </view>
</view> </view>
</view> <view class="learn-class1 u-margin-left-30" @click=goPlay(courselist[1])>
<view class="class1 u-margin-top-40" @click=ccc(courselist[1].sectionId)> <image class="learn-img" :src="courselist[1].pic" mode=""></image>
<image class="img" :src="courselist[1].pic" mode=""></image> <image class="bofang" :src="bofang" mode=""></image>
<view class="right"> <view class="learn-desc">
<view class="u-font-32 font-bold"> <view class="u-font-28 font-bold h68">
{{ courselist[1].title }} {{ courselist[1].title }}
</view> </view>
<view class="u-font-24"> <view class="u-font-20 learn-intro h48">
{{ courselist[1].desc }} {{ courselist[1].desc }}
</view> </view>
<view class="line-percent"> </view>
<view class="line-percent u-margin-top-35">
<u-line-progress active-color="#2979ff" :percent="courselist[1].percent" <u-line-progress active-color="#2979ff" :percent="courselist[1].percent"
:show-percent="false"> :show-percent="false">
</u-line-progress> </u-line-progress>
...@@ -91,19 +91,20 @@ ...@@ -91,19 +91,20 @@
</view> </view>
</view> </view>
</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="learn-currency-class u-margin-bottom-20">
<view class="class1" @click=ccc(courselist[2].sectionId)> <view class="learn-class1" @click=goPlay(courselist[2])>
<image class="img" :src="courselist[2].pic" mode=""></image> <image class="learn-img" :src="courselist[2].pic" mode=""></image>
<view class="right"> <image class="bofang" :src="bofang" mode=""></image>
<view class="u-font-32 font-bold"> <view class="learn-desc">
<view class="u-font-28 font-bold h68">
{{ courselist[2].title }} {{ courselist[2].title }}
</view> </view>
<view class="u-font-24"> <view class="u-font-20 learn-intro h48">
{{ courselist[2].desc }} {{ courselist[2].desc }}
</view> </view>
<view class="line-percent" style="display:flex;justify-content: space-between;"> </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" <u-line-progress active-color="#2979ff" :percent="courselist[2].percent"
:show-percent="false"> :show-percent="false">
</u-line-progress> </u-line-progress>
...@@ -115,7 +116,6 @@ ...@@ -115,7 +116,6 @@
</view> </view>
</view> </view>
</view> </view>
</view>
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
<swiper-item> <swiper-item>
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
</view> </view>
</view> </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="currency-class">
<view class="class1" @click="aaa(2)"> <view class="class1" @click="aaa(2)">
<image class="img" :src="examList[2].pic" mode=""></image> <image class="img" :src="examList[2].pic" mode=""></image>
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view> -->
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
...@@ -189,67 +189,142 @@ ...@@ -189,67 +189,142 @@
</template> </template>
<script> <script>
export default { import util from '@/utils/util.js'
data() { var json = {
return { "dev": [
msg: "赣南吴彦祖", {
tabs: [{ "title": "服务规范",
name: "交付规范", "desc": "为用户提供更好服务,自己赚更多钱",
"percent": 0,
"status": "",
"id": 173,
"sectionId": ""
}, },
{ {
name: "培训通知", "title": "接单操作",
"desc": "快速学习,使用APP 接单、抢单",
"percent": 0,
"status": "",
"id": 173,
"sectionId": ""
}, },
{ {
name: "在线学习", "title": "从0-1学习充电桩安装服务",
"desc": "让你全面了解充电桩市场及服务规范",
"percent": 0,
"status": "",
"id": 173,
"sectionId": ""
}
],
"test": [
{
"title": "服务规范",
"desc": "为用户提供更好服务,自己赚更多钱",
"percent": 0,
"status": "",
"id": 150,
"sectionId": ""
}, },
{ {
name: "考核认证", "title": "接单操作",
"desc": "快速学习,使用APP 接单、抢单",
"percent": 0,
"status": "",
"id": 149,
"sectionId": ""
}, },
{
"title": "从0-1学习充电桩安装服务",
"desc": "让你全面了解充电桩市场及服务规范",
"percent": 0,
"status": "",
"id": 151,
"sectionId": ""
}
], ],
current: 0, "prod": [
swiperCurrent: 0, {
params: { "title": "服务规范",
start: 0, "desc": "为用户提供更好服务,自己赚更多钱",
"percent": 0,
"status": "",
"sectionId": ""
}, },
list: [], {
rule: { "title": "接单操作",
pic: process.uniEnv.qn_base_url + "guifan1@3x.png" "desc": "快速学习,使用APP 接单、抢单",
"percent": 0,
"status": "",
"sectionId": ""
}, },
courselist: [{ {
"title": "从0-1学习充电桩安装服务",
"desc": "让你全面了解充电桩市场及服务规范",
"percent": 0,
"status": "",
"sectionId": ""
}
]
}
var examJson = {
"dev": [
{
title: '服务规范', title: '服务规范',
desc: '为用户提供更好服务,自己赚更多钱', desc: '通过本认证,是接单的必要条件',
percent: 0, condition: '随机20题,及格20题',
status: '', status: '',
pic: process.uniEnv.qn_base_url + "guifan1@3x.png", pic: process.uniEnv.qn_base_url + "guifan1@3x.png",
id: 173, id: 2,
sectionId: '' examId: '',
examStatus: '',
isComplete: false
}, },
{ {
title: '接单操作', title: '接单操作',
desc: '快速学习,使用APP 接单、抢单', desc: '快速认证,是否具备接单操作能力',
percent: 0, condition: '随机20题,及格16题',
status: '', status: '',
pic: process.uniEnv.qn_base_url + "guifan2@3x.png", pic: process.uniEnv.qn_base_url + "guifan2@3x.png",
id: 173, id: 2,
sectionId: '' 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: '从0-1学习充电桩安装服务', title: '交付规范',
desc: '让你全面了解充电桩市场及服务规范', desc: '快速认证,是否具备接单操作能力',
percent: 0, condition: '随机4题,及格4题',
status: '', status: '',
pic: process.uniEnv.qn_base_url + "kecehng1@3x.png", pic: process.uniEnv.qn_base_url + "guifan2@3x.png",
id: 173, id: 4,
sectionId: '' examId: '',
examStatus: '',
isComplete: false
} }
], ],
examList: [{ "prod": [
{
title: '服务规范', title: '服务规范',
desc: '通过本认证,是接单的必要条件', desc: '通过本认证,是接单的必要条件',
condition: '随机20题,及格20题', condition: '随机20题,及格20题',
status: '', status: '',
pic: process.uniEnv.qn_base_url + "guifan1@3x.png", pic: process.uniEnv.qn_base_url + "guifan1@3x.png",
id: 2, id: 3,
examId: '', examId: '',
examStatus: '', examStatus: '',
isComplete: false isComplete: false
...@@ -260,30 +335,122 @@ ...@@ -260,30 +335,122 @@
condition: '随机20题,及格16题', condition: '随机20题,及格16题',
status: '', status: '',
pic: process.uniEnv.qn_base_url + "guifan2@3x.png", pic: process.uniEnv.qn_base_url + "guifan2@3x.png",
id: 2, id: 4,
examId: '', examId: '',
examStatus: '', examStatus: '',
isComplete: false 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 {
msg: "赣南吴彦祖",
tabs: [{
name: "交付规范",
}, },
{ {
title: '从0-1学习充电桩安装服务', name: "培训通知",
desc: '通过本认证后,可接充电桩业务单', },
condition: '随机30题,及格25题', {
status: '', name: "在线学习",
pic: process.uniEnv.qn_base_url + "kecehng1@3x.png", },
id: 2, {
examId: '', name: "考核认证",
examStatus: '', },
isComplete: false ],
bofang: process.uniEnv.qn_base_url + "bofang@3x.png",
current: 0,
swiperCurrent: 0,
params: {
start: 0,
},
list: [],
rule: {
pic: process.uniEnv.qn_base_url + "guifan@3x.png"
},
courselist: [{
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: 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: 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: 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: 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-没有数据样式 loadStatus: "loading", //加载样式:loadMore-加载前样式,loading-加载加载中样式,nomore-没有数据样式
isLoadMore: false, //是否加载中 isLoadMore: false, //是否加载中
course_id: "course_id_=173",
exam: null, 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.getList();
// this.getCourseList(); // this.getCourseList();
// this.getUserExamInfo(); // this.getUserExamInfo();
...@@ -293,14 +460,24 @@ ...@@ -293,14 +460,24 @@
return process.uniEnv.qn_base_url + "banner-xx@3x.png"; return process.uniEnv.qn_base_url + "banner-xx@3x.png";
}, },
}, },
onShow: function() {
// this.onLoad();
console.log('--返回也可以执行--');
},
methods: { methods: {
getList() { getList() {
this.$u.api this.$u.api
.getTrainingNoticeList(this.params) .getTrainingNoticeList(this.params)
.then((res) => { .then((res) => {
this.timeFormat();
if (res.code == 200) { if (res.code == 200) {
if (res.data) { 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); this.list = this.list.concat(res.data);
if (res.data.length < 5) { if (res.data.length < 5) {
//判断接口返回数据量小于请求数据量,则表示此为最后一页 //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.isLoadMore = true; this.isLoadMore = true;
...@@ -335,6 +512,28 @@ ...@@ -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) { getTypeName(percent) {
if (percent == 0) { if (percent == 0) {
return '未开始'; return '未开始';
...@@ -400,50 +599,6 @@ ...@@ -400,50 +599,6 @@
this.swiperCurrent = current; this.swiperCurrent = current;
this.current = 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到底部加载更多 //scroll-view到底部加载更多
onreachBottom() { onreachBottom() {
console.log("上拉触底函数"); console.log("上拉触底函数");
...@@ -486,7 +641,7 @@ ...@@ -486,7 +641,7 @@
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.examList[i].examId = res.data.id; 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; let examResult = res.data.examLevelResult;
this.examList[i].status = examResult != '' ? examResult : '未通过'; this.examList[i].status = examResult != '' ? examResult : '未通过';
// examStatus 用户考试状态 0考试中 1考试完成 2未参与 // examStatus 用户考试状态 0考试中 1考试完成 2未参与
...@@ -498,7 +653,7 @@ ...@@ -498,7 +653,7 @@
} }
if (res.data.examStatus == 1) { if (res.data.examStatus == 1) {
console.log("examStatus " + i + " 1"); console.log("examStatus " + i + " 1");
that.examList[i].isComplete = true; that.examList[i].isComplete = this.examList[i].status == '通过';
that.examScore = res.data.examScore; that.examScore = res.data.examScore;
return; return;
} }
...@@ -523,10 +678,63 @@ ...@@ -523,10 +678,63 @@
title: "获取考试信息失败", 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> </script>
...@@ -578,17 +786,18 @@ ...@@ -578,17 +786,18 @@
.n-head { .n-head {
text-align: left; text-align: left;
font-size: 32rpx;
font-weight: bold;
color: #333333;
} }
.news { .news {
height: 168rpx; height: 168rpx;
overflow: hidden; overflow: hidden;
margin-top: 30rpx; margin-top: 30rpx;
/* margin-top: 30rpx; font-size: 24rpx;
margin-left: 30rpx; color: #666666;
margin-right: 30rpx; line-height: 34rpx;
margin-bottom: 0; */
} }
/* //在线学习 */ /* //在线学习 */
...@@ -601,6 +810,21 @@ ...@@ -601,6 +810,21 @@
border-radius: 12rpx; 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 { .title {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
...@@ -616,11 +840,36 @@ ...@@ -616,11 +840,36 @@
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 { .img {
width: 160rpx; width: 160rpx;
height: 120rpx; 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 { .right {
...@@ -659,13 +908,29 @@ ...@@ -659,13 +908,29 @@
.line-percent { .line-percent {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
line-height: 24rpx; // line-height: 24rpx;
font-size: 24rpx; font-size: 24rpx;
color: #999999; 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 { .u-progress {
width: 280rpx !important; width: 160rpx !important;
height: 12rpx !important; height: 12rpx !important;
background-color: #ececec; background-color: #ececec;
} }
...@@ -687,16 +952,14 @@ ...@@ -687,16 +952,14 @@
} }
.font-color-999999 { .font-color-999999 {
color: #99999; color: #999999;
} }
.content-line { .content-line {
margin-top: 30rpx; margin-top: 30rpx;
} }
.standard { .standard {}
}
.standard-img { .standard-img {
width: 160rpx; width: 160rpx;
...@@ -714,26 +977,54 @@ ...@@ -714,26 +977,54 @@
} }
.width-360 { .jf-right {
width: 360rpx; padding-left: 190rpx;
width: 460rpx;
color: #ffffff;
} }
.rule-back { .notice-bottom {
background-image: process.uniEnv.qn_base_url + "banner-xx@3x.png"; margin-top: 30rpx;
display: flex;
} }
/* <view class="standard" @click="goToPrint"> .notice-bottom-left {
<!-- <text>充电桩交付规范</text> /* margin-left: 30rpx; */
<text>></text> --> font-size: 24rpx;
<view class="standard-img"></view> color: #999999;
<view class="standard-body"> }
<view class="standard-body-title">
充电桩交付规范 .notice-bottom-right {
</view> margin-left: 330rpx;
<view class="standard-body-title"> font-size: 24rpx;
请点击学习 color: #2272FF;
</view> }
</view>
<view cl ass="standard-go-look-look">去查看</view>*/ .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> </style>
<template> <template>
<view class="answer-box"> <view class="backView">
<u-navbar <Examine :index="3">
title="考核认证" <view class="bottom-padding" v-if="currentItem">
:background="background" <view class="title-view">
:border-bottom="false" <view :class="['title-text', {'radio': currentItem.question ? currentItem.question.answerType == 1 : true}]">
></u-navbar> <text>{{ titleText[Math.max(0, currentItem.question ? currentItem.question.answerType - 1 : 0)] }}</text>
<view class="content"> </view>
<view class=""> <view class="title-right-view">
<text class="dx">单选</text> <image class="timeIcon" :src="time1Image" mode=""></image>
<text class="timeText">倒计时:</text><text class="time-count-down">{{currentTime}}</text>
</view>
</view> </view>
<view class="topicView"> <view class="topicView">
<text class="topictext">{{ <text class="topicText">{{currentItem.question.content}}</text>
ExaminationQuestions.question.content </view>
}}</text>
<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>
<view class="">
<view class="list-box">
<view <view
v-for="(item, index) in list" :class="item.isSelect ? 'itemText selectedColor' : 'itemText defaultColor' ">{{contentFilter(item.content)}}</view>
:key="index" </view>
@click="choice(index)"
:class="[item.isRight ? 'selde' : 'noselde']"
>
{{ item.content }}
</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> </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>
<button class="btn" @click="getNextClick()">下一题</button>
<text class="all">{{ ExaminationQuestions.progress }}</text>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { 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() { data() {
return { return {
list: [ examId: null,
{ userExamId: null,
isRight: false, userAnswerIds: '',
content: "", isStart: true,
currentNumber: 1,
currentItem: null,
isSelect: false,
timeDefine: {
"time-id-2": 1800,
"time-id-3": 900,
"time-id-4": 360,
}, },
{ endTime: 0,
isRight: false, currentTime: 100,
content: "", 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: {
isRight: false, titleText() {
content: "", return ['单选', '多选', '问答']
}, },
{ time1Image() {
isRight: false, return process.uniEnv.qn_base_url + 'time1.png'
content: "",
}, },
], chenggongImage() {
background: { return process.uniEnv.qn_base_url + 'chenggong.png'
backgroundColor: "#F4F5F7",
},
isSelect: false,
selectId: [],
userExamId: null,
ExaminationQuestions: {
progress: "",
question: {
content: "",
}, },
timuImage() {
return process.uniEnv.qn_base_url + 'timu-new.png'
}
}, },
isQuestion: true, onLoad(e) {
}; this.examId = e.examId;
this.applyExam();
// this.getUserExamInfo();
}, },
onLoad(num) { methods: {
this.userExamId = num.userExamId; formatTimeToMini(timestamp) {
this.getExaminationQuestions(); 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;
}, },
onUnload() { toSubmit() {
wx.reLaunch({ //判断是否通过,通过去成功页,失败去失败页
url: "./index", 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,
});
}
}, },
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()
methods: { this.getUserExamInfo()
abc() { },
console.log("11111");
var arr = document.querySelector(".btm"); //获取考试信息
for (let i = 0; i < arr.length; i++) { getUserExamInfo: function() {
arr[i].onclick = function () {
console.log(this.value); uni.showLoading({
}; title: '请稍候'
} })
},
//选择按钮 let that = this
choice(index) { uni.request({
if (this.list[index].isRight == true) { url: systemApiUrl +
this.list[index].isRight = false; '/wxh-worker-rest/rest/exam' +
this.isSelect = false; '/serviceRule/userExamInfo/' +
console.log(this.isSelect); that.vuex_token +
//取消选中时删除数组中的值 '?examId=' + this.examId,
for (var i = 0; i < this.selectId.length; i++) { method: 'POST',
if (this.selectId[i] === this.list[index].id) { data: {
this.selectId.splice(i, 1); //examId:this.examId,
} },
} header: {
console.log("选中的值", this.selectId); 'Content-Type': 'application/x-www-form-urlencoded'
} else { },
this.list[index].isRight = true; success: (res) => {
this.isSelect = true; uni.hideLoading()
console.log(this.isSelect); if (!res.data) {
this.selectId.push(this.list[index].id); return
console.log("选中的值", this.selectId); }
} if (res.data.code == 401 || res.data.code == 403) {
}, uni.navigateTo({
//申请考试题目 url: '/pages/login/wxlogin'
getExaminationQuestions() { })
this.$u.api.ExaminationQuestions(this.userExamId).then((res) => { return
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
);
} }
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 { } else {
//接口请求失败
uni.showToast({ uni.showToast({
title: res.message, icon: 'none',
icon: "none", title: res.data.message
}); })
} }
});
}, },
//下一题 fail: (e) => {
getNextClick: function () { uni.hideLoading()
//判断 uni.showToast({
if (this.isQuestion == "第20题/共20题") { icon: 'none',
this.isQuestion = ""; title: '获取考试信息失败'
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;
} }
})
},
//申请考试
applyExam: function() {
uni.showLoading({
title: '请稍候'
})
let that = this
uni.request({ uni.request({
url: url: systemApiUrl +
"http://192.168.1.22" + '/wxh-worker-rest/rest/exam' +
"/wxh-worker-rest/rest/exam" + '/serviceRule/' +
"/serviceRule/next/" + that.vuex_token +
this.vuex_token + '?examId=' + this.examId,
"?userExamId=" + method: 'POST',
this.userExamId + data: {
"&questionId=" + //examId:this.examId,
this.ExaminationQuestions.question.id + },
"&userAnswerIds=" +
this.selectId,
method: "POST",
header: { header: {
"Content-Type": "application/x-www-form-urlencoded", 'Content-Type': 'application/x-www-form-urlencoded'
}, },
success: (res) => { success: (res) => {
console.log("sssss", res); uni.hideLoading()
if (res.statusCode == 401) {
uni.navigateTo({
url: '/pages/login/wxlogin'
})
return
}
if (res.data.code == 200) { if (res.data.code == 200) {
this.ExaminationQuestions = res.data.data; if (res.data.data.userExamId) {
this.list = res.data.data.answerList; that.userExamId = res.data.data.userExamId
this.isQuestion = res.data.data.progress;
console.log("uuuuuuuu", this.ExaminationQuestions); //申请完考试设置倒计时总时间
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
})
} }
this.selectId = [];
console.log("zzy", this.selectId);
}, },
}); fail: (e) => {
this.$u.api uni.hideLoading()
.nextClick( uni.showToast({
this.userExamId, icon: 'none',
this.ExaminationQuestions.question.id, title: '申请考试 失败'
this.selectId })
) }
.then((res) => { })
console.log("sssss", res); },
//获取下一题
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) { if (res.data.code == 200) {
this.ExaminationQuestions = res.data.data; that.currentItem = res.data.data
this.list = res.data.data.answerList; that.progress = res.data.data.progress
this.isQuestion = res.data.data.progress; if (res.data.data.answerList) {
console.log("uuuuuuuu", this.ExaminationQuestions); 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 = '完成考试,现在签约'
} }
this.selectId = []; } else {
console.log("zzy", this.selectId); 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> </script>
<style lang="scss"> <style lang="scss">
.answer-box { .backView {
width: 750rpx; background-color: #F4F5F7;
height: 100vh; position: absolute;
/* background: #8F8F94; */ top: 0;
margin: 0 auto; left: 0;
} width: 100%;
.content { height: 100%;
margin: 30rpx 30rpx; display: flex;
overflow: hidden; flex-direction: column;
border-radius: 12rpx; overflow-y:auto;
padding: 40rpx 30rpx 40rpx 30rpx; overflow-y:auto;
background-repeat: no-repeat; }
background-size: 66%;
background-color: #fff; .noticeView {
background-position: right bottom; margin-top: 100rpx;
min-height: 800rpx; width: 100%;
} display: flex;
.dx { }
border-radius: 8rpx;
background-color: #ff930d; .noticeText {
font-size: 20rpx; font-size: 32rpx;
color: #ffffff; color: #555555;
width: 72rpx; padding-left: 40rpx;
height: 40rpx; padding-right: 40rpx;
display: -webkit-box; }
display: -webkit-flex;
.numberView {
margin-top: 40rpx;
width: 100%;
display: 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; justify-content: center;
} align-items: center;
.topicView { }
.numberText {
color: #333333;
font-size: 28rpx;
font-weight: bold;
}
.topicView {
margin-top: 40rpx; margin-top: 40rpx;
width: 100%; width: 100%;
display: -webkit-box;
display: -webkit-flex;
display: flex; display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center; align-items: center;
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }
.topictext {
.topicText {
color: #333333; color: #333333;
font-size: 32rpx; font-size: 32rpx;
line-height: 48rpx; line-height: 48rpx;
font-weight: bold; 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;
} }
}
/*已选择*/ .itemView {
.selde {
background: #007aff;
color: #ffffff;
border-radius: 20upx;
font-size: 26rpx;
padding: 0 10upx;
}
/*未选择*/
.noselde {
margin-top: 30rpx; margin-top: 30rpx;
background-color: #f4f5f7; background-color: #F4F5F7;
width: 100%; width: 100%;
padding: 40rpx 30rpx; padding: 40rpx 30rpx;
display: -webkit-box;
display: -webkit-flex;
display: flex; display: flex;
-webkit-box-align: start;
-webkit-align-items: flex-start;
align-items: flex-start; align-items: flex-start;
border-radius: 12rpx; border-radius: 12rpx;
border: 2rpx solid transparent; border: 2rpx solid transparent;
font-size: 28rpx; 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> </style>
...@@ -8,21 +8,21 @@ ...@@ -8,21 +8,21 @@
></u-navbar> ></u-navbar>
<view class="title">考试规则</view> <view class="title">考试规则</view>
<view class="test"> <view class="test">
<view class="slogan" <view class="slogan">
>这是一场严肃的考试,请认真查看 规则,预祝您顺利通过考试!</view 这是一场严肃的考试,请认真查看 规则,预祝您顺利通过考试!
> </view>
<view class="text"> <view class="text">
<text class="left">考试科目:</text <text class="left">考试科目:</text
><text style="color: #007aff">服务规范</text> ><text style="color: #007aff">{{ desc.title }}</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">合格条件:</text><text>60分</text> <text class="left">合格条件:</text><text>{{ desc.score }}</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">考试时间:</text><text>30分钟</text> <text class="left">考试时间:</text><text>{{ desc.time }}</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">题目来源:</text><text>系统随机20题</text> <text class="left">题目来源:</text><text>系统随机{{ desc.number }}题</text>
</view> </view>
<button @click="getUserExamId()">开始考试</button> <button @click="getUserExamId()">开始考试</button>
</view> </view>
...@@ -30,27 +30,99 @@ ...@@ -30,27 +30,99 @@
</template> </template>
<script> <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 { export default {
data() { data() {
return { return {
examId: 2, desc: null,
examId: null,
exam: null, exam: null,
userExamId: null, userExamId: null,
}; };
}, },
onLoad() { onLoad(param) {
this.examId = param.examId
this.desc = desc["id-" + this.examId]
// this.getUserExamInfo(); // this.getUserExamInfo();
}, },
methods: { methods: {
//申请考试获取userExamId //申请考试获取userExamId
getUserExamId: function () { getUserExamId: function () {
var that = this; let examId = this.examId;
console.log("这是一条消息"); wx.navigateTo({
url: "/pages/learn/answer?examId=" + examId,
});
},
getUserExamInfo() {
uni.request({ uni.request({
url: url:
"http://192.168.1.22" + process.uniEnv.systemUrl.apiUrl +
"/wxh-worker-rest/rest/exam/serviceRule/" + "/wxh-worker-rest/rest/exam/serviceRule/" +
that.vuex_token + this.vuex_token +
"?examId=" + "?examId=" +
this.examId, this.examId,
method: "POST", method: "POST",
...@@ -63,15 +135,15 @@ export default { ...@@ -63,15 +135,15 @@ export default {
uni.hideLoading(); uni.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
if (res.data.data.userExamId) { if (res.data.data.userExamId) {
that.userExamId = res.data.data.userExamId; this.userExamId = res.data.data.userExamId;
console.log("这个是个标识符", that.userExamId); console.log("这个是个标识符", this.userExamId);
} }
} }
}, },
}); });
setTimeout(() => { setTimeout(() => {
wx.navigateTo({ wx.navigateTo({
url: "./answer?userExamId=" + that.userExamId, url: "/pages/learn/answer?userExamId=" + this.userExamId,
}); });
}, 1000); }, 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>
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
<view class="title"> <view class="title">
{{newsInfo.title}} {{newsInfo.title}}
</view> </view>
<view class="content" v-html="newsInfo.body"> <view class="u-content">
<button @click="add">aaa</button> <u-parse :html="newsInfo.body" :tag-style="style"></u-parse>
{{newsInfo.body}}
</view> </view>
</view> </view>
</template> </template>
...@@ -18,7 +17,10 @@ ...@@ -18,7 +17,10 @@
obj:{ obj:{
}, },
newsInfo:null newsInfo: {
title: '',
body: ''
}
} }
}, },
methods: { methods: {
...@@ -32,7 +34,6 @@ ...@@ -32,7 +34,6 @@
this.newsInfo = news; this.newsInfo = news;
console.log(news,'news') console.log(news,'news')
}) })
}, },
onLoad() { onLoad() {
this.$u.mpShare.path = '' this.$u.mpShare.path = ''
...@@ -42,10 +43,16 @@ ...@@ -42,10 +43,16 @@
<style> <style>
.title{ .title{
text-align: center; font-size: 32rpx;
margin: 34rpx; font-weight: bold;
margin-left: 30rpx;
margin-top: 30rpx;
} }
.content{ .content{
padding: 38rpx; font-size: 24rpx;
line-height: 36rpx;
color: #666666;
margin-left: 30rpx;
margin-top: 30rpx;
} }
</style> </style>
<template> <template>
<view class="test-result"> <view class="content">
<text class="title">考试结果</text> <u-navbar
<view class="result"> {{ text }} </view> back-icon-color="#FFFFFF"
<view class="test-explain"> :background="background"
<view class="hang"> title-color="#fff"
<text class="text1">合格条件:</text :border-bottom="false"
><text class="text2">答对20题</text> ></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>
<view class="hang"> <view class="test-explain">
<text class="text1">考试结果:</text <view class="text1">
><text class="text2">答对10题</text> 很遗憾,您未能通过本次考试
</view> </view>
<view class="hang"> <view class="text2">
<text class="text1">考试用时:</text 您可点击再考一次重新进行考试
><text class="text2">16分29秒</text>
</view> </view>
</view> </view>
<view class="btn"> <view class="btn">
<button class="btn1" @click="getAgain()">再答一次</button> <button class="btnStyle" @click="getAgain()">再答一次</button>
<button class="btn2" @click="toIndex">下次再考</button> <button class="btnStyle btn2" @click="toIndex()">我知道了</button>
</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -28,28 +36,30 @@ export default { ...@@ -28,28 +36,30 @@ export default {
data() { data() {
return { return {
text: "", text: "",
examId: 2, examId: null,
result: null, result: null,
score: 0,
userExamId: null, userExamId: null,
}; };
}, },
onLoad(a) { onLoad(a) {
this.userExamId = a.userExamId; this.userExamId = a.userExamId;
this.examId = a.examId;
console.log("userExamId是", this.userExamId); console.log("userExamId是", this.userExamId);
this.nextClick(); this.nextClick();
}, },
onUnload() { // onUnload() {
wx.reLaunch({ // wx.reLaunch({
url: "./index", // url: "./index",
}); // });
}, // },
methods: { methods: {
//考试结果 //考试结果
nextClick: function () { nextClick: function () {
console.log("wwwwwwwwww"); console.log("wwwwwwwwww");
uni.request({ uni.request({
url: url:
"http://192.168.1.22" + process.uniEnv.systemUrl.apiUrl +
"/wxh-worker-rest/rest/exam" + "/wxh-worker-rest/rest/exam" +
"/serviceRule/next/" + "/serviceRule/next/" +
this.vuex_token + this.vuex_token +
...@@ -63,73 +73,127 @@ export default { ...@@ -63,73 +73,127 @@ export default {
success: (res) => { success: (res) => {
this.result = res.data.data; this.result = res.data.data;
this.text = res.data.data.examLevelResult; this.text = res.data.data.examLevelResult;
this.score = this.result.examScore;
console.log("标识符55", this.result); console.log("标识符55", this.result);
}, },
}); });
}, },
//再次考试 //再次考试
getAgain: function () { getAgain: function () {
let examId = this.examId;
wx.navigateTo({ wx.navigateTo({
url: "./assessment", url: "/pages/learn/assessment?examId=" + examId,
}); });
}, },
//下次再考跳转到学习主界面页面 //下次再考跳转到学习主界面页面
toIndex: function () { toIndex: function () {
wx.reLaunch({ wx.reLaunch({
url: "./index", url: "/pages/index/learn?tabs=3",
}); });
// wx.navigateBack({ delta: 1 })//返回上一级页面
}, },
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.test-result { .test {
width: 610rpx; margin: 0 30rpx;
height: 965rpx; overflow: hidden;
margin: 70rpx auto 0; 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 { .title {
margin: 0 44rpx 0; padding: 30rpx 30rpx 46rpx;
line-height: 40rpx;
font-size: 40rpx;
color: #fff;
font-weight: bold;
} }
.result { .result {
color: red; width: 320rpx;
font-size: 66rpx; 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; text-align: center;
border-bottom: 1px dashed #000000; padding-top: 20%;
margin: 74rpx 0;
padding: 66rpx;
} }
.test-explain { .test-explain {
.hang { margin-top: 80rpx;
margin: 26rpx 26rpx; margin-left: 84rpx;
margin-right: 84rpx;
text-align: center;
.text1 { .text1 {
color: #a69999; font-size: 40rpx;
margin-right: 22rpx; font-weight: bold;
color: #FA5A49;
} }
.text2 { .text2 {
color: #333333; font-size: 24rpx;
} color: #666666;
margin-top: 30rpx;
} }
} }
.btn { .btn {
margin-top: 236rpx; margin-top: 100rpx;
.btn1 { display: flex;
width: 478rpx; font-size: 32rpx;
height: 60rpx; font-weight: bold;
background: #0079fe; .btnStyle {
color: #fff; width: 300rpx;
font-size: 26rpx; height: 104rpx;
line-height: 60rpx; background-color: #ffffff;
color: #2272FF;
line-height: 90rpx;
margin: 20rpx auto; margin: 20rpx auto;
border: 2rpx solid #2272FF;
border-radius: 52rpx;
} }
.btn2 { .btn2 {
width: 478rpx; background-color: #2272FF;
height: 60rpx; color: #ffffff;
background: #f2f2f2;
color: #333333;
font-size: 26rpx;
line-height: 60rpx;
margin: 0 auto;
} }
} }
} }
......
...@@ -9,20 +9,20 @@ ...@@ -9,20 +9,20 @@
<view class="item-content"> <view class="item-content">
<view class="item-st"> <view class="item-st">
<image style="width: 80rpx; height: 36rpx" :src="kcImage"></image> <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>
<view class="item-title">服务规范</view> <view class="item-title">{{ courseTitle }}</view>
</view> </view>
<view>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view> <view>{{ courseDesc }}</view>
</view> </view>
<view class="learn-view" v-if="courseId >= 0"> <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;"> <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 style="height:120rpx;font-size: 30rpx;padding-left:30rpx;">
<view class="" style="display: flex;font-size: 32rpx;"> <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: 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>
<view class="" style="font-size: 24rpx;margin-top: 30rpx;">反正这里就是放老师的简介,只是写啥我也不知道,反正就是写很厉害的简介啦</view> <view class="" style="font-size: 24rpx;margin-top: 30rpx;">反正这里就是放老师的简介,只是写啥我也不知道,反正就是写很厉害的简介啦</view>
</view> </view>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<view class="learn-view-title">目录</view> <view class="learn-view-title">目录</view>
<view class="" style="display: flex;overflow: auto;padding-top: 30rpx;padding-bottom: 30rpx;"> <view class="" style="display: flex;overflow: auto;padding-top: 30rpx;padding-bottom: 30rpx;">
<view v-for="(item, index) in list" :key="index"> <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: 24rpx;">{{ item.title }}</view>
<view class="" style="font-size: 26rpx;margin-top: 16rpx;"> <view class="" style="font-size: 26rpx;margin-top: 16rpx;">
{{ item.intro }} {{ item.intro }}
...@@ -59,21 +59,24 @@ ...@@ -59,21 +59,24 @@
export default { export default {
data() { data() {
return { return {
teacherImage: process.uniEnv.qn_base_url + "avatar.gif",
courseId: "", courseId: "",
courseStatus: 0, courseStatus: 0,
courseSrc: "", courseSrc: "",
courseTitle: "", courseTitle: "",
courseDesc: "", courseDesc: "",
courseTotal: null,
currentIndex: -1, // 第几个视频 currentIndex: -1, // 第几个视频
section_id: 0, section_id: 0,
active_section_id: 0,
isShowVideo: false, isShowVideo: false,
CourseSectionlist: {name: '', content: ''}, //节信息 CourseSectionlist: {name: '', content: ''}, //节信息
list: [ list: [
{'title': '第一节', 'intro': '考核规则1:接单及 时率', 'isActive': true, "id": 288}, {'title': '第1节', 'intro': '考核规则1:接单及 时率', 'isActive': true, "id": null},
{'title': '第二节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": 288}, {'title': '第2节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": null},
{'title': '第三节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": 288}, {'title': '第3节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": null},
{'title': '第四节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": 288}, {'title': '第4节', 'intro': '考核规则1:接单及 时率', 'isActive': false, "id": null},
{'title': '第五节', 'intro': '考核规则1:接单及 时率', 'isActive':false, "id": 288}, {'title': '第5节', 'intro': '考核规则1:接单及 时率', 'isActive':false, "id": null},
], ],
teacher: { teacher: {
name: "", name: "",
...@@ -97,7 +100,7 @@ ...@@ -97,7 +100,7 @@
} }
}, },
params:{ params:{
course_id:173, course_id:null,
}, },
gklog: '', gklog: '',
videoTotalTime: 0, videoTotalTime: 0,
...@@ -137,6 +140,8 @@ ...@@ -137,6 +140,8 @@
}, },
}, },
onLoad(e) { onLoad(e) {
this.active_section_id = e.section_id;
this.params.course_id = e.course_id;
this.getCourseSection({ this.getCourseSection({
section_id: e.section_id section_id: e.section_id
}) })
...@@ -148,9 +153,9 @@ ...@@ -148,9 +153,9 @@
// #endif // #endif
}, },
methods: { methods: {
goNext(id){ goNext(info){
uni.navigateTo({ uni.navigateTo({
url: "./section?section_id=" + id, url: "./section?section_id=" + info.id + "&course_id=" + info.course_id
}); });
}, },
onPlayerTimeupdate(player) { onPlayerTimeupdate(player) {
...@@ -197,7 +202,7 @@ ...@@ -197,7 +202,7 @@
let wareVal = this.CourseSectionlist.ware; let wareVal = this.CourseSectionlist.ware;
this.isShowVideo = wareVal == "0"; this.isShowVideo = wareVal == "0";
this.courseTitle = res.data.name; 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_id = res.data.id;
this.section_content = res.data.content; this.section_content = res.data.content;
this.teacher.name = res.data.teachers[0].name; this.teacher.name = res.data.teachers[0].name;
...@@ -277,9 +282,16 @@ ...@@ -277,9 +282,16 @@
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.data) { if (res.data) {
// debugger this.list = res.data[0].section;
// this.list = this.list.concat(res.data); this.courseTotal = this.list.length;
// console.log(this.list) 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 { } else {
//接口请求失败的处理 //接口请求失败的处理
...@@ -443,4 +455,8 @@ ...@@ -443,4 +455,8 @@
border: 2rpx solid #2272FF; border: 2rpx solid #2272FF;
box-sizing: border-box; box-sizing: border-box;
} }
.color-teacher {
color: #999999;
}
</style> </style>
...@@ -583,14 +583,21 @@ ...@@ -583,14 +583,21 @@
return return
} }
this.$u.api[this.submitType](data, this.order.orderId).then(res => { this.$u.api[this.submitType](data, this.order.orderId).then(res => {
let self = this
if ((res.data.code!==undefined && res.data.code === 200) if ((res.data.code!==undefined && res.data.code === 200)
|| (res.code!==undefined && res.code === 200) ) { || (res.code!==undefined && res.code === 200) ) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: this.centerButtonText + '操作成功', title: this.centerButtonText + '操作成功',
type: 'success', type: 'success',
url: 'pages/order/detail', // isTab:true,
params: { // url: 'pages/order/detail',
id: this.order.orderId // params: {
// id: this.order.orderId
// }
callback : function(){
uni.redirectTo({
url: 'pages/order/detail?id='+self.order.orderId
});
} }
}) })
} else { } 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