Commit ea7284f4 authored by Facius's avatar Facius
parents b727b587 0bf99ddf
const UNI_APP = { const UNI_APP = {
ucenterUrl: { ucenterUrl: {
apiUrl: 'http://rest-u.yunya.com', //php端域名请求头 apiUrl: 'http://192.168.1.46', //php端域名请求头
// xueUrl: 'https://xue.banshouhui.com', //学院 xueUrl: 'http://192.168.1.46:8088', //学院
// banshou: 'https://m.banshou.com', //扳手app // banshou: 'https://m.banshou.com', //扳手app
}, },
systemUrl: { systemUrl: {
......
; ;
(function() { (function() {
let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 let NODE_ENV = 'dev'; // dev:开发环境 | test:测试环境
let ENV_VAR = null; let ENV_VAR = null;
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
if (NODE_ENV === 'dev') { if (NODE_ENV === 'dev') {
......
...@@ -7,7 +7,7 @@ import { ...@@ -7,7 +7,7 @@ import {
import { import {
settledApiFun settledApiFun
} from '@/common/api/settled.js'; } from '@/common/api/settled.js';
import { learnApiFun } from "@/common/api/learn.js"; import {learnApiFun} from "@/common/api/learn.js";
import { orderApiFun } from "@/common/api/order.js"; import { orderApiFun } from "@/common/api/order.js";
let apiFun = function(vm) { let apiFun = function(vm) {
let commonApi = commonApiFun(vm); let commonApi = commonApiFun(vm);
......
const globalUrl = process.uniEnv || {} const globalUrl = process.uniEnv || {}
const ucenterApiUrl = globalUrl.ucenterUrl.apiUrl const ucenterApiUrl = globalUrl.ucenterUrl.apiUrl
const collegeApiUrl = globalUrl.ucenterUrl.xueUrl
let learnApiFun = function(vm){ let learnApiFun = function(vm){
/* 查询用户基本信息 */ /* 通知消息基本信息 */
let getTrainingNoticeList = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/notice/list', params); let getTrainingNoticeList = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/notice/list', params);
/* 获取学习视频基本信息 */
let CourseList = async (params = {}) => await vm.$u.get(collegeApiUrl+'/v1/course-details?course_id=173',params);
/* 获取章节详情 */
let ChapterDetails = async (params = {}) => await vm.$u.get(collegeApiUrl+'/v1/chapter-sections',params);
/* 获取课程节信息*/
let CourseSection = async (params = {}) => await vm.$u.get(collegeApiUrl+'/v1/section-details',params);
const learnApi = { const learnApi = {
getTrainingNoticeList, getTrainingNoticeList,CourseList,ChapterDetails,CourseSection
} }
return learnApi return learnApi
} }
......
...@@ -70,7 +70,8 @@ ...@@ -70,7 +70,8 @@
{ {
"path": "pages/learn/index", "path": "pages/learn/index",
"style": { "style": {
"navigationBarTitleText": "学习" "navigationBarTitleText": "学习",
"navigationStyle":"custom"//隐藏系统导航栏
} }
}, },
{ {
...@@ -85,17 +86,23 @@ ...@@ -85,17 +86,23 @@
"navigationBarTitleText": "考试答题" "navigationBarTitleText": "考试答题"
} }
}, },
{ {
"path": "pages/learn/result", "path":"pages/learn/result",
"style": { "style":{
"navigationBarTitleText": "考试结果页" "navigationBarTitleText":"考试答题"
} }
}, },
{ {
"path": "pages/learn/news-details", "path": "pages/learn/news-details",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
},
{
"path":"pages/learn/section",
"style" :{
"navigationBarTitleText": ""
}
}, },
{ {
"path": "pages/learn/curriculum", "path": "pages/learn/curriculum",
......
...@@ -45,8 +45,12 @@ ...@@ -45,8 +45,12 @@
} }
], ],
selectId:[], selectId:[],
}; };
}, },
onLoad() {
this.getUserExamInfo()
},
methods: { methods: {
abc() { abc() {
console.log("11111") console.log("11111")
...@@ -73,7 +77,10 @@ ...@@ -73,7 +77,10 @@
this.selectId.push(this.list[index].title) this.selectId.push(this.list[index].title)
console.log("选中的值", this.selectId) console.log("选中的值", this.selectId)
} }
} },
}, },
mounted() { mounted() {
console.log("111111") console.log("111111")
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
<view class="title">考试规则说明</view> <view class="title">考试规则说明</view>
<view class="test"> <view class="test">
<view class="text"> <view class="text">
<text class="left">考试科目:</text><text style="color: #007AFF;">服务规范</text> <text class="left">考试科目:</text><text style="color: #007AFF;">{{exam.examName}}</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">合格条件:</text><text>随机20题,答对20题</text> <text class="left">合格条件:</text><text>{{exam.ruleDisc}}</text>
</view> </view>
<view class="text"> <view class="text">
<text class="left">考试时间:</text><text>30分钟</text> <text class="left">考试时间:</text><text>30分钟</text>
...@@ -26,9 +26,13 @@ ...@@ -26,9 +26,13 @@
export default { export default {
data() { data() {
return { return {
examId:1,
exam:null
} }
}, },
onLoad() {
this.getUserExamInfo()
},
methods: { methods: {
aaa(){ aaa(){
...@@ -36,7 +40,83 @@ ...@@ -36,7 +40,83 @@
url:'./answer' url:'./answer'
}) })
} },
//获取考试信息
getUserExamInfo: function() {
uni.showLoading({
title: '请稍候'
})
let that = this
uni.request({
url: 'https://system.banshouhui.com' +
'/wxh-worker-rest/rest/exam' +
'/serviceRule/userExamInfo/' +
'RTOKENf86a7c0606ef5ebf36f211ace3466b7f9de56e37' +
'?examId=' + this.examId,
method: 'POST',
data: {
//examId:this.examId,
},
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
success: (res) => {
console.log(res.data)
uni.hideLoading()
if (!res.data) {
return
}
if (res.data.code == 401 || res.data.code == 403) {
// uni.navigateTo({
// url: '/pages/login/wxlogin'
// })
// return
console.log('洪塘张学友')
}
if (res.data.code == 200) {
//examStatus 用户考试状态 0考试中 1考试完成 2未参与
that.exam = res.data.data
console.log(that.exam)
if (res.data.data.examStatus == 2) {
that.applyExam()
return
}
if(res.data.data.examStatus == 1){
console.log('111111111111111111111111111')
that.isComplete = true
that.examScore = res.data.data.examScore
that.postResult()
return
}
if (res.data.data.examStatus == 0 ) {
that.userExamId = res.data.data.id
that.getNext()
}
} else {
uni.showToast({
icon: 'none',
title: res.data.message
})
}
},
fail: (e) => {
uni.hideLoading()
uni.showToast({
icon: 'none',
title: '获取考试信息失败'
})
}
})
},
} }
} }
</script> </script>
......
...@@ -15,59 +15,22 @@ ...@@ -15,59 +15,22 @@
<view class="" style="font-size: 40rpx;font-weight:1000"> <view class="" style="font-size: 40rpx;font-weight:1000">
目录 目录
</view> </view>
<view class="" style="font-size: 40rpx;font-weight: 1000;"> <view v-for="item in list">
第一章 充电桩常见问题答疑 <view class="chapter">
</view> {{item.name}}
<view class="video" >
<view class="video_1" >
<view class="text" >
视频
</view>
<text class="text2">1-1唯修汇公司简介</text>
</view>
<view class="video_1" >
<view class="text">
视频
</view>
<text class="text2">1-2可接单评定标准</text>
</view>
<view class="video_1" >
<view class="text">
视频
</view>
<text class="text2">1-3结算规则</text>
</view>
<view class="video_1">
<view class="text">
视频
</view>
<text class="text2">1-4充电桩安装开城计划</text>
</view>
<view class="video_1">
<view class="text">
视频
</view>
<text class="text2">1-5缴纳质保金和费用答疑</text>
</view>
<view class="video_1" >
<view class="text" >
视频
</view>
<text class="text2">1-6安装材料品牌答疑1</text>
</view>
<view class="video_1" >
<view class="text">
视频
</view>
<text class="text2">1-7安装材料答疑2</text>
</view> </view>
<view class="video_1"> <view class="video" v-for="key in item.section" @click=details(key.id)>
<view class="text"> <view class="video_1" >
视频 <view class="text" v-text="key.ware=='0'?'视频':'图文'">
</view>
<text>1-{{key.order}}</text>
<text class="text2">{{key.name}}</text>
<text class="text3" v-text="key.isLearned==false?'未开始':'完成'"></text>
</view> </view>
<text class="text2">1-8其他问题答疑</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
...@@ -77,11 +40,72 @@ ...@@ -77,11 +40,72 @@
export default { export default {
data() { data() {
return { return {
params:{
course_id:0,
},
list:[],
examId:1,
} }
}, },
onLoad(a){
console.log(a)
this.params.course_id=a.course_id
console.log(this.params.course_id)
this.getCapterDetails()
},
methods: { methods: {
//获取章节详情
getCapterDetails() {
console.log(1111111)
this.$u.api
.ChapterDetails(this.params)
.then((res) => {
if (res.code == 200) {
if (res.data) {
this.list = this.list.concat(res.data);
console.log(this.list)
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;
}
});
},
//跳转到小节
details(id){
console.log(id)
uni.navigateTo({
url:"./section?section_id=" + id
})
}
} }
} }
</script> </script>
...@@ -101,9 +125,18 @@ ...@@ -101,9 +125,18 @@
width: 128rpx; width: 128rpx;
height: 128rpx; height: 128rpx;
} }
.chapter{
font-size: 37rpx;
font-weight: 700;
}
.video{
width: 100%;
}
.video_1{ .video_1{
display: flex; display: flex;
margin: 20rpx 0; margin: 20rpx 0;
position: relative;
width: 100%;
.text{ .text{
width: 100rpx; width: 100rpx;
height: 38rpx; height: 38rpx;
...@@ -114,8 +147,15 @@ ...@@ -114,8 +147,15 @@
} }
.text2{ .text2{
width: 397rpx;
font-size: 33rpx; font-size: 33rpx;
color: #82848A; color: #82848A;
margin-right: 0rpx;
}
.text3{
float: right;
position: relative;
right: 0;
} }
} }
</style> </style>
This diff is collapsed.
<template> <template>
<view> <view>
<view class="title"> <view class="title">
《关于充电桩xxxx》 {{newsInfo.title}}
</view> </view>
<view class="content"> <view class="content" v-html="newsInfo.body">
于2021年3月23日 10:00 进行《xxx》内容进行培训。 <button @click="add">aaa</button>
{{newsInfo.body}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar sic tempor. Sociis natoque penatibus et magnis dis parturient montes,
nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus 。
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
</view> </view>
</view> </view>
</template> </template>
...@@ -18,10 +14,24 @@ ...@@ -18,10 +14,24 @@
export default { export default {
data() { data() {
return { return {
banner:{},
obj:{
},
newsInfo:null
} }
}, },
methods: { methods: {
},
onLoad() {
},
onShow(){
uni.$on('news',(news)=>{
this.newsInfo = news;
console.log(news,'news')
})
}, },
onLoad() { onLoad() {
......
<template> <template>
<view class="content"> <view class="test-result">
<view class="title"> <text class="title">考试结果</text>
考试结果
</view>
<view class="result"> <view class="result">
未通过 未通过
</view> </view>
<view class="details"> <view class="test-explain">
<view class=""> <view class="hang">
<text class="first">合格条件:</text><text>答对20题</text> <text class="text1">合格条件:</text><text class="text2">答对20题</text>
</view>
<view class="">
<text class="first">考试结果:</text><text>答对10题</text>
</view> </view>
<view class=""> <view class="hang">
<text class="first">考试用时</text><text>16分29秒</text> <text class="text1">考试结果:</text><text class="text2">答对10题</text>
</view> </view>
<view class="btn"> <view class="hang">
<button class="btn1">再答一次</button> <text class="text1">考试用时:</text><text class="text2">16分29秒</text>
<button class="btn2">退出重考</button>
</view> </view>
</view> </view>
<view class="btn">
<button class="btn1">再答一次</button>
<button class="btn2">退出重考</button>
</view>
</view> </view>
</template> </template>
...@@ -32,57 +29,61 @@ ...@@ -32,57 +29,61 @@
} }
}, },
methods:{ methods: {
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.content{ .test-result{
width: 100%; width: 610rpx;
height: 950rpx; height: 965rpx;
background: #DCDFE6; margin: 70rpx auto 0;
padding: 53rpx; .title{
} margin: 0 44rpx 0;
.title{
font-size: 30rpx;
}
.result{
color: red;
font-size: 73rpx;
text-align: center;
margin: 46rpx 0;
}
.details{
border-top: 2rpx dashed #808080;
height: 600rpx;
padding-top: 94rpx;
view{
margin: 26rpx 0 0;
.first{
margin: 0 20rpx 0;
}
} }
} .result{
.btn{ color: red;
.btn1{ font-size: 66rpx;
width: 477rpx; text-align: center;
height: 61rpx; border-bottom: 1px dashed #000000;
border-radius: 27rpx; margin: 74rpx 0;
line-height: 61rpx; padding: 66rpx;
font-size: 29rpx; }
background: #007AFF; .test-explain{
color: #FFFFFF; .hang{
margin: 140rpx auto 34rpx; margin: 26rpx 26rpx;
.text1{
color: #a69999;
margin-right: 22rpx;
}
.text2{
color: #333333;
}
}
} }
.btn2{ .btn{
width: 477rpx; margin-top: 236rpx;
height: 61rpx; .btn1{
border-radius: 27rpx; width: 478rpx;
line-height: 61rpx; height: 60rpx;
font-size: 29rpx; background: #0079fe;
color: #fff;
font-size: 26rpx;
line-height: 60rpx;
margin: 20rpx auto;
}
.btn2{
width: 478rpx;
height: 60rpx;
background: #f2f2f2;
color: #333333;
font-size: 26rpx;
line-height: 60rpx;
margin:0 auto;
}
} }
} }
</style> </style>
\ No newline at end of file
<template>
<view>
<view class="title">
{{CourseSectionlist.name}}
</view>
<view class="content" v-html="CourseSectionlist.content">
{{CourseSectionlist.content}}
</view>
</view>
</template>
<script>
export default {
data() {
return {
CourseSectionlist:null,
section_id:{
section_id:0
}
}
},
onLoad(id) {
this.section_id.section_id = id.section_id
this.getCourseSection()
},
methods: {
getCourseSection() {
this.$u.api
.CourseSection(this.section_id)
.then((res) => {
if (res.code == 200) {
if (res.data) {
this.CourseSectionlist = res.data;
console.log("--------")
console.log(this.CourseSectionlist)
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;
}
});
},
}
}
</script>
<style lang="scss">
.title{
text-align: center;
font-size: 45rpx;
font-weight: 700;
margin: 24rpx;
}
.content{
font-size: 30rpx;
padding: 50rpx;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment