This commit is contained in:
@fawn-nine
2024-09-20 17:32:09 +08:00
parent f8f03010c7
commit 7a87130202
3 changed files with 311 additions and 258 deletions

View File

@@ -6,9 +6,9 @@ if (process.env.NODE_ENV === 'development') {
// socketUrl = "ws://localhost:6001/"; // socketUrl = "ws://localhost:6001/";
// baseUrl = "https://twin-ui.com/demo/"; // baseUrl = "https://twin-ui.com/demo/";
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境 // baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
// baseUrl = "https://api.nuttyreading.com/"; // 线上正式 baseUrl = "https://api.nuttyreading.com/"; // 线上正式
// baseUrl = "http://192.168.110.110:9200/pb/"; // 磊哥 // baseUrl = "http://192.168.110.110:9200/pb/"; // 磊哥
baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑 // baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
// baseUrl = "http://59.110.212.44:9200/pb/"; // baseUrl = "http://59.110.212.44:9200/pb/";
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑 // baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
// baseUrl = "http://192.168.110.110:9200/pb/"; // baseUrl = "http://192.168.110.110:9200/pb/";

View File

@@ -17,7 +17,7 @@
</view> </view>
<view class="mainContent" v-if="thisClass.id"> <view class="mainContent" v-if="thisClass.id">
<view class="className" > <view class="className">
<h3>{{thisClass.title}}</h3> <h3>{{thisClass.title}}</h3>
<text class="tuichu" v-if="thisClass.state == 0 && isHave" @click="outClass()">退出班级</text> <text class="tuichu" v-if="thisClass.state == 0 && isHave" @click="outClass()">退出班级</text>
</view> </view>
@@ -46,55 +46,46 @@
</view> </view>
<!-- v-if="thisClass.state == '2'" --> <!-- v-if="thisClass.state == '2'" -->
<template v-if="isHave"> <template v-if="isHave">
<view class="pingfenBox testBox" v-if="thisClass.state == '2'"> <view class="pingfenBox testBox" v-if="thisClass.state == '3' || thisClass.state == '2'">
<view class="scoreTitle"> <view class="scoreTitle">
<view class="titles flex_box"> <view class="titles flex_box">
<text>成绩</text> <text></text><uni-icons type="help" size="18" color="#fff"
<!-- <uni-icons type="help" size="18" color="#fff" @click="showTestTips = true"></uni-icons>
@click="showTestTips = true"></uni-icons> -->
</view> </view>
</view> </view>
<!-- v-if="thisClass.state == '3'" --> <view class="chengji zong" style="text-align: center;" v-if="this.classModel.isExam == 1 && paperList.length > 0 || this.classModel.isExam == 0 ">
<view class="optionsBox"> <view style="margin-top: 20rpx;">总成绩
<!-- v-show="thisClass.state == '2'" --> <text class="scoreNumber greenScore">{{performanceScore.userScore}}</text>
<view class="chengji zong" style="text-align: center;"> <view class="">
<view style="margin-top: 20rpx;">总成绩 <view class="" style="margin: 10rpx 0;">
<text class="scoreNumber greenScore">{{performanceScore.userScore}}</text> <text class="c999" v-if="performanceScore.examScore">{{performanceScore.examScore}}分考试分 <uni-icons type="eye"
<view class=""> size="20" color="#999" @click="showPaperList = true"></uni-icons></text>
<view class="" style="margin: 20rpx 0;"> <text v-if="performanceScore.examScore && performanceScore.usualScore"></text>
<text class="c999">{{performanceScore.examScore}}分考试 <uni-icons type="eye" <text class="c999" v-if="performanceScore.usualScore"> {{performanceScore.usualScore}}分平时表现</text>
size="20" color="#999" @click="showPaperList = true"></uni-icons></text>
<text class="c999">{{performanceScore.usualScore}}分平时表现分</text>
</view>
</view> </view>
</view> </view>
<view> </view>
<view v-if="performanceScore.userScore >= 60">
恭喜您获得 恭喜您获得
<text class="yellowScore" v-if=" performanceScore.userScore >= 70"> A </text> <text class="yellowScore" v-if=" performanceScore.userScore >= 70"> A </text>
<text class="blueScore" v-else-if="performanceScore.userScore >= 60 && performanceScore.userScore < 70"> B </text> <text class="blueScore"
<text class="small_btn border_radius_10 zhengshu" @click="showSubmit">{{certificate && certificate.id ? '查看证书' : '生成证书'}}</text> v-else-if="performanceScore.userScore >= 60 && performanceScore.userScore < 70"> B
</text>
<text class="small_btn border_radius_10 zhengshu"
@click="showSubmit">{{certificate && certificate.id ? '查看证书' : '生成证书'}}</text>
</view> </view>
<template v-if="performanceScore.userScore < 60"> <template v-if="performanceScore.userScore < 60">
<view class="flex_box flex_center align-items_box"> <view class="flex_box flex_center align-items_box" style="justify-content: center;">
<text style="margin-top: 20rpx; text-align: center;">很遗憾您的成绩未达标</text> <text style="text-align: center;">很遗憾您的成绩未达标</text>
<view class="" style="margin-top: 20rpx; text-align: center;" <view class="" style="text-align: center;"
v-if="newCLass && newCLass.id"> v-if="newCLass && newCLass.id">
<text class="small_btn chongxiu border_radius_10" <text class="small_btn chongxiu border_radius_10"
@click="onPageJump('/pages/miniClass/classInfo',newCLass.id)">加入新班级重修</text> @click="onPageJump('/pages/miniClass/classInfo',newCLass.id)">加入新班级重修</text>
</view> </view>
</view> </view>
</template> </template>
</view>
</view> </view>
</view> <view class="optionsBox" v-if="thisClass.state == '3' && classModel.isExam == 1" style="margin-top: 20rpx;">
<view class="pingfenBox testBox" v-if="(thisClass.state == '3') && classModel.isExam == 1">
<view class="scoreTitle">
<view class="titles flex_box">
<text>笔试分</text><uni-icons type="help" size="18" color="#fff"
@click="showTestTips = true"></uni-icons>
</view>
</view>
<view class="optionsBox" v-if="thisClass.state == '3'">
<view class=" "> <view class=" ">
<view class=""> <view class="">
<!-- --> <!-- -->
@@ -119,23 +110,25 @@
style="color: #666; justify-content: space-around !important"> style="color: #666; justify-content: space-around !important">
<view class="flex_box align-items_box"> <view class="flex_box align-items_box">
<text><text class="PM_font mainTxt" <view class="">
style="font-size: 60rpx; ">{{paperSore}}</text> <h3>笔试成绩</h3>
</text> </view>
<view>
<text class="PM_font mainTxt"
style="font-size: 60rpx; color: #55aaff !important;">{{paperSore}}</text>
</view>
<uni-icons type="eye" size="20" color="#999" <uni-icons type="eye" size="20" color="#999"
@click="showPaperList = true"></uni-icons> @click="showPaperList = true"></uni-icons>
</view> </view>
<view class="" v-if="paperList.length == 1"> <view class="" v-if="paperList.length == 1">
<text class="small_btn retake border_radius_10" @click="goTest()">再考一次</text> <text class="small_btn retake border_radius_10" @click="goTest()">再考一次</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="pingfenBox" <view class="pingfenBox" v-if="thisClass.state != '0' && tijiaoTitleList.length > 0">
v-if="thisClass.state != '0' && tijiaoTitleList.length > 0">
<view class="scoreTitle"> <view class="scoreTitle">
<view class="titles flex_box"> <view class="titles flex_box">
<text>表现分</text><uni-icons type="help" size="18" color="#fff" <text>表现分</text><uni-icons type="help" size="18" color="#fff"
@@ -166,9 +159,10 @@
class="mainTxt PM_font">{{performanceScore.questionScore}}</i></text> class="mainTxt PM_font">{{performanceScore.questionScore}}</i></text>
</view> </view>
<view v-if="classModel.isExam == 1 && thisClass.state == '2'"> <view v-if="classModel.isExam == 1 && thisClass.state == '2'">
<text class="ciyao">考试分</text> <text class="ciyao">考试分</text>
<text class="ciyao"><i class="mainTxt PM_font">{{performanceScore.questionScore}}</i></text> <text class="ciyao"><i
</view> class="mainTxt PM_font">{{performanceScore.questionScore}}</i></text>
</view>
</view> </view>
</view> </view>
</template> </template>
@@ -258,16 +252,16 @@
<view class="courseTab border_radius_10" v-if="questionsList.length > 1"> <view class="courseTab border_radius_10" v-if="questionsList.length > 1">
<view class="flex_box flex_between"> <view class="flex_box flex_between">
<!-- <view > --> <!-- <view > -->
<text <text :class="['item','border_radius_10',curCourseId == item.id ? 'cur' :'']"
:class="['item','border_radius_10',curCourseId == item.id ? 'cur' :'']" @click="clickCourseTab(index,item.id)" v-for="(item, index) in tabCourseList"
@click="clickCourseTab(index,item.id)" :key="index">{{item.title}}</text>
v-for="(item, index) in tabCourseList" :key="index">{{item.title}}</text>
<!-- </view> --> <!-- </view> -->
</view> </view>
</view> </view>
<!-- 班内任务 --><!-- 医案 --> <!-- 心得 --><!-- 思考题 --> <!-- 班内任务 --><!-- 医案 --> <!-- 心得 --><!-- 思考题 -->
<view class="" v-if="tijiaoTitleId != '3'"> <view class="" v-if="tijiaoTitleId != '3'">
<view class="" style="margin-bottom: 20rpx;" v-if="tijiaoTitleId == 2 && thisClass.state == '1' && roleCode.includes('0')"> <view class="" style="margin-bottom: 20rpx;"
v-if="tijiaoTitleId == 2 && thisClass.state == '1' && roleCode.includes('0')">
<view class="noanser"> <view class="noanser">
<view class=""> <view class="">
<text>快来添加一条记录吧~</text> <text>快来添加一条记录吧~</text>
@@ -344,17 +338,21 @@
<u-divider text="暂无数据"></u-divider> <u-divider text="暂无数据"></u-divider>
</view> --> </view> -->
</view> </view>
<template v-if="tijiaoTitleId == '3' && questionsList.length > 0 && questionsList[curCourseIndex].chapterList.length > 0"> <template
<view > v-if="tijiaoTitleId == '3' && questionsList.length > 0 && questionsList[curCourseIndex].chapterList.length > 0">
<view>
<view class="submitRecode questionbox"> <view class="submitRecode questionbox">
<view class="newBox"> <view class="newBox">
<view class="item " v-for="(item, index) in questionsList[curCourseIndex].chapterList" <view class="item "
@click="jumpToVideoPage(item)" v-for="(item, index) in questionsList[curCourseIndex].chapterList"
> @click="jumpToVideoPage(item)">
<view class=" flex_box"> <view class=" flex_box">
<view class="pp" style="flex: 1; font-size: 28rpx;" v-html="item.title"></view> <view class="pp" style="flex: 1; font-size: 28rpx;" v-html="item.title">
<text v-if="item.reply == null" style="color: #ff9277; font-size: 26rpx;">未作答</text> </view>
<text v-else class="" style="padding-left: 10rpx; color: #55aaff; font-size: 26rpx;">已作答</text> <text v-if="item.reply == null"
style="color: #ff9277; font-size: 26rpx;">未作答</text>
<text v-else class=""
style="padding-left: 10rpx; color: #55aaff; font-size: 26rpx;">已作答</text>
</view> </view>
<!-- <view class="questJUmp">前往所在章节</view> --> <!-- <view class="questJUmp">前往所在章节</view> -->
</view> </view>
@@ -362,7 +360,8 @@
</view> </view>
</view> </view>
</template> </template>
<view class="" v-if="tijiaoTitleId == '3' && questionsList.length > 0 && questionsList[curCourseIndex].chapterList.length == 0"> <view class=""
v-if="tijiaoTitleId == '3' && questionsList.length > 0 && questionsList[curCourseIndex].chapterList.length == 0">
<u-divider text="本门课程暂无思考题可提交"></u-divider> <u-divider text="本门课程暂无思考题可提交"></u-divider>
</view> </view>
</view> </view>
@@ -481,22 +480,25 @@
<view class="flex_box align-items_box item"> <view class="flex_box align-items_box item">
<text class="mr20rpx">证书姓名</text> <text class="mr20rpx">证书姓名</text>
<text class="mr20rpx"> <text class="mr20rpx">
{{submitInfo.name && submitInfo.name != '' && submitInfo.name != null ? submitInfo.name : '未设置'}} {{submitInfo.name && submitInfo.name != '' && submitInfo.name != null ? submitInfo.name : '未设置'}}
</text> </text>
<text class="small_btn border_radius_10" <text class="small_btn border_radius_10"
v-if="!submitInfo.name || submitInfo.name != '' || submitInfo.name != null" v-if="!submitInfo.name || submitInfo.name != '' || submitInfo.name != null"
@click="onPageJump('/pages/mine/userInfo/persData')" style="display: block; height: 30px;"> @click="onPageJump('/pages/mine/userInfo/persData')" style="display: block; height: 30px;">
{{submitInfo.name && submitInfo.name != '' && submitInfo.name != null ? '去修改' : '去设置'}} {{submitInfo.name && submitInfo.name != '' && submitInfo.name != null ? '去修改' : '去设置'}}
</text> </text>
</view> </view>
<view class="flex_box align-items_box item"> <view class="flex_box align-items_box item">
<text class="mr20rpx">证书照片</text> <text class="mr20rpx">证书照片</text>
<image @click="preveImg(submitInfo.photo)" class="mr20rpx" v-if="submitInfo.photo && submitInfo.photo != '' && submitInfo.photo != null" <image @click="preveImg(submitInfo.photo)" class="mr20rpx"
:src="submitInfo.photo" mode="widthFix" style="width:100rpx; height:140rpx;"></image> v-if="submitInfo.photo && submitInfo.photo != '' && submitInfo.photo != null"
:src="submitInfo.photo" mode="widthFix" style="width:100rpx; height:140rpx;"></image>
<text class="mr20rpx" v-else>未上传</text> <text class="mr20rpx" v-else>未上传</text>
<text class="small_btn border_radius_10" v-if="!submitInfo.photo || submitInfo.photo != '' || submitInfo.photo != null" <text class="small_btn border_radius_10"
@click="onPageJump('/pages/mine/userInfo/persData')" style="display: block; height: 30px;">{{submitInfo.photo && submitInfo.photo != '' && submitInfo.photo != null ? '去修改' : '去上传'}}</text> v-if="!submitInfo.photo || submitInfo.photo != '' || submitInfo.photo != null"
@click="onPageJump('/pages/mine/userInfo/persData')"
style="display: block; height: 30px;">{{submitInfo.photo && submitInfo.photo != '' && submitInfo.photo != null ? '去修改' : '去上传'}}</text>
</text> </text>
</view> </view>
</view> </view>
@@ -525,12 +527,12 @@
export default { export default {
data() { data() {
return { return {
buyCourseMsg:'', buyCourseMsg: '',
fileList1: [], fileList1: [],
questionsList:[], questionsList: [],
curCourseId:undefined, curCourseId: undefined,
curCourseIndex:0, curCourseIndex: 0,
tabCourseList:[], tabCourseList: [],
showCropper: false, showCropper: false,
submitInfo: { submitInfo: {
img: undefined, // 证件图 img: undefined, // 证件图
@@ -645,13 +647,13 @@
{ {
name: '班内心得', name: '班内心得',
id: '2' id: '2'
},{ }, {
name: '思考题', name: '思考题',
id: '3' id: '3'
}, },
], ],
tijiaoTitleId: '0', tijiaoTitleId: '0',
tijiaoTitleIndex:0, tijiaoTitleIndex: 0,
taskList: [], // 任务列表 taskList: [], // 任务列表
taskHaveMore: false, // 是否还有更多 taskHaveMore: false, // 是否还有更多
myExperience: '1', myExperience: '1',
@@ -665,7 +667,7 @@
firstLoad: true, // 是否是第一次请求 firstLoad: true, // 是否是第一次请求
blankNumber: 0, blankNumber: 0,
paperList: [], paperList: [],
scrollTop:0, scrollTop: 0,
bgiStyle: { bgiStyle: {
background: '#fff' background: '#fff'
}, },
@@ -680,7 +682,7 @@
examId: undefined, examId: undefined,
ingPaper: undefined, // 正在进行中的试卷信息 ingPaper: undefined, // 正在进行中的试卷信息
newCLass: undefined, // 同模型的待开班班级 newCLass: undefined, // 同模型的待开班班级
certificate:undefined, // 证书 certificate: undefined, // 证书
// stickyBgColor:'#ff9277', // stickyBgColor:'#ff9277',
} }
}, },
@@ -693,7 +695,7 @@
plus.screen.lockOrientation("portrait-primary") plus.screen.lockOrientation("portrait-primary")
// #endif // #endif
this.classId = e.id this.classId = e.id
console.log('this.classId',this.classId ); console.log('this.classId', this.classId);
this.getUserRole() this.getUserRole()
this.getUserInfo() this.getUserInfo()
uni.$on('refreshData', () => { uni.$on('refreshData', () => {
@@ -719,7 +721,7 @@
onPullDownRefresh() { onPullDownRefresh() {
// this.curTagIndex = 0 // this.curTagIndex = 0
console.log('this.tabId------',this.tabId); console.log('this.tabId------', this.tabId);
this.getClassInfo() this.getClassInfo()
this.getScore() this.getScore()
this.pPage = 0 this.pPage = 0
@@ -730,11 +732,11 @@
async onShow() { async onShow() {
console.log('this.curTagIndex', this.curTagIndex); console.log('this.curTagIndex', this.curTagIndex);
var ss = await this.getClassInfo() var ss = await this.getClassInfo()
if(this.thisClass.state == '0' && this.isHave){ if (this.thisClass.state == '0' && this.isHave) {
this.buyCourseMsg = await this.checkUserCourse() this.buyCourseMsg = await this.checkUserCourse()
} }
// this.curTagIndex = 0 // this.curTagIndex = 0
if(this.thisClass.state != '0'){ if (this.thisClass.state != '0') {
this.getScore() this.getScore()
} }
if (this.thisClass.state == '3' || this.thisClass.state == '2') { if (this.thisClass.state == '3' || this.thisClass.state == '2') {
@@ -762,14 +764,14 @@
// var planEndTimeDate = new Date(historyPaper.planEndTime) // var planEndTimeDate = new Date(historyPaper.planEndTime)
// paperEndTime = planEndTimeDate.getTime(); // 结束的时间戳 // paperEndTime = planEndTimeDate.getTime(); // 结束的时间戳
paperEndTime = historyPaper.planEndTime paperEndTime = historyPaper.planEndTime
console.log('+++++++++',paperEndTime); console.log('+++++++++', paperEndTime);
this.examId = historyPaper.id this.examId = historyPaper.id
} else { } else {
this.examId = undefined this.examId = undefined
paperEndTime = 0 paperEndTime = 0
} }
severNowTime = await this.getServerTime() severNowTime = await this.getServerTime()
console.log('//////////////', paperEndTime, severNowTime); console.log('//////////////', paperEndTime, severNowTime);
if (severNowTime > -1 && paperEndTime - severNowTime > 0) { if (severNowTime > -1 && paperEndTime - severNowTime > 0) {
var secondTimeDif = paperEndTime - severNowTime var secondTimeDif = paperEndTime - severNowTime
this.timeDif.hour = parseInt((secondTimeDif % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)) this.timeDif.hour = parseInt((secondTimeDif % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
@@ -783,9 +785,9 @@
} }
} }
if(this.thisClass.state == '2'){ if (this.thisClass.state == '2') {
var userObj = await this.getUserData() var userObj = await this.getUserData()
if(userObj){ if (userObj) {
this.submitInfo.name = userObj.name this.submitInfo.name = userObj.name
this.submitInfo.photo = userObj.photo this.submitInfo.photo = userObj.photo
// this.showSubmitInfoBlank = true // this.showSubmitInfoBlank = true
@@ -822,7 +824,7 @@
console.log('是否计算tab了') console.log('是否计算tab了')
var ss = this.getBlankNumber var ss = this.getBlankNumber
var qq = this.blankNumber var qq = this.blankNumber
console.log('ss',ss,qq); console.log('ss', ss, qq);
var list = [] var list = []
if (this.thisClass.state == '0' || !this.isHave || qq == 0) { if (this.thisClass.state == '0' || !this.isHave || qq == 0) {
list = this.tabList01 list = this.tabList01
@@ -854,13 +856,13 @@
_list.push(this.defaultTijiaoTitleList[2]) _list.push(this.defaultTijiaoTitleList[2])
} }
if (this.classModel.isQuestion == 1) { if (this.classModel.isQuestion == 1) {
_list.push(this.defaultTijiaoTitleList[3]) _list.push(this.defaultTijiaoTitleList[3])
} }
// return _list // return _list
if(_list.length > 0){ if (_list.length > 0) {
console.log('是否进入了这里666666666666'); console.log('是否进入了这里666666666666');
this.tijiaoTitleList = _list this.tijiaoTitleList = _list
this.titleClick(this.tijiaoTitleList[this.tijiaoTitleIndex],this.tijiaoTitleIndex) this.titleClick(this.tijiaoTitleList[this.tijiaoTitleIndex], this.tijiaoTitleIndex)
// this.tijiaoTitleId = this.tijiaoTitleList[0].id // this.tijiaoTitleId = this.tijiaoTitleList[0].id
} }
// this.tabId = // this.tabId =
@@ -887,13 +889,13 @@
}, },
methods: { methods: {
// 获得思考题列表及答案 // 获得思考题列表及答案
async getQuestionsList(){ async getQuestionsList() {
var list = [] var list = []
await $http.request({ await $http.request({
url: "common/class/getThinkQuestionListStudent", url: "common/class/getThinkQuestionListStudent",
method: "POST", method: "POST",
data: { data: {
"classId": this.classId "classId": this.classId
}, },
header: { //默认 无 说明:请求头 header: { //默认 无 说明:请求头
'Content-Type': 'application/json' 'Content-Type': 'application/json'
@@ -901,49 +903,49 @@
}) })
.then(async (res) => { .then(async (res) => {
if (res.code == 0) { if (res.code == 0) {
if(res.getThinkQuestionListStudent.length > 0){ if (res.getThinkQuestionListStudent.length > 0) {
list = res.getThinkQuestionListStudent list = res.getThinkQuestionListStudent
} }
}else{ } else {
uni.showToast({ uni.showToast({
title:res.errMsg, title: res.errMsg,
icon:"none" icon: "none"
}) })
} }
}).catch(e => { }).catch(e => {
console.log('获取思考题报错',e); console.log('获取思考题报错', e);
uni.showToast({ uni.showToast({
title:e.errMsg, title: e.errMsg,
icon:"none" icon: "none"
}) })
}); });
return list return list
}, },
async showSubmit() { async showSubmit() {
if(this.certificate && this.certificate.id){ if (this.certificate && this.certificate.id) {
// 已生成 // 已生成
uni.navigateTo({ uni.navigateTo({
url:'/pages/certificate/certificate' url: '/pages/certificate/certificate'
}) })
}else{ // 未生成 } else { // 未生成
this.showSubmitInfoBlank = true this.showSubmitInfoBlank = true
} }
}, },
async getUserData() { async getUserData() {
let that = this; let that = this;
var Ss = undefined var Ss = undefined
// 获取个人信息 // 获取个人信息
if (this.userInfo.id != undefined) { if (this.userInfo.id != undefined) {
await this.$http await this.$http
.post('book/user/info/'+this.userInfo.id) .post('book/user/info/' + this.userInfo.id)
.then(async (res) => { .then(async (res) => {
Ss = res.user; Ss = res.user;
console.log('that.userData at line 698个人中心:', res.user) console.log('that.userData at line 698个人中心:', res.user)
}); });
return Ss return Ss
} }
}, },
chooseImage() { chooseImage() {
let that = this let that = this
@@ -959,45 +961,49 @@
}, },
// 全角字符串转半角 // 全角字符串转半角
async convertToHalfWidth(str) { async convertToHalfWidth(str) {
const fullWidthChars = "!"#$%&'()*+,-./【】0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; const fullWidthChars =
const halfWidthChars = "!\"#$%&'()*+,-./[]0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; "!"#$%&'()*+,-./【】0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
let result = ""; const halfWidthChars =
for (let i = 0; i < str.length; i++) { "!\"#$%&'()*+,-./[]0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
const char = str[i]; let result = "";
const index = fullWidthChars.indexOf(char); for (let i = 0; i < str.length; i++) {
if (index!== -1) { const char = str[i];
result += halfWidthChars[index]; const index = fullWidthChars.indexOf(char);
} else { if (index !== -1) {
result += char; result += halfWidthChars[index];
} } else {
} result += char;
return result; }
}
return result;
}, },
// 检测是否已经购买了全部课程 // 检测是否已经购买了全部课程
async checkUserCourse(){ async checkUserCourse() {
var msg = '' var msg = ''
await $http.request({ await $http.request({
url: "common/class/getUserCourseBuy", url: "common/class/getUserCourseBuy",
method: "POST", method: "POST",
data: {"classId": this.classId}, data: {
"classId": this.classId
},
header: { //默认 无 说明:请求头 header: { //默认 无 说明:请求头
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
}) })
.then(async (res) => { .then(async (res) => {
if (res.code == 0) { if (res.code == 0) {
if(res.msg != ''){ if (res.msg != '') {
msg = res.msg msg = res.msg
var outputStr = await this.convertToHalfWidth(res.msg) var outputStr = await this.convertToHalfWidth(res.msg)
uni.showModal({ uni.showModal({
title:'提示', title: '提示',
content:`${outputStr}课程没有购买,请尽快购买班级内教学需要的课程,逾期您将被系统自动踢出班级,感谢您的理解和支持` content: `${outputStr}课程没有购买,请尽快购买班级内教学需要的课程,逾期您将被系统自动踢出班级,感谢您的理解和支持`
}) })
} }
} }
}).catch(e => { }).catch(e => {
console.log('检测是否已经购买了全部课程报错',e); console.log('检测是否已经购买了全部课程报错', e);
}); });
return msg return msg
}, },
@@ -1186,43 +1192,43 @@
}, },
// 生成证书 // 生成证书
createCertificate(){ createCertificate() {
if(this.submitInfo.name && this.submitInfo.name != null && this.submitInfo.name != '' if (this.submitInfo.name && this.submitInfo.name != null && this.submitInfo.name != '' &&
&& this.submitInfo.photo && this.submitInfo.photo != null && this.submitInfo.photo != ''){ this.submitInfo.photo && this.submitInfo.photo != null && this.submitInfo.photo != '') {
}else{ } else {
uni.showModal({ uni.showModal({
title:'提示', title: '提示',
content:"真实姓名或证书照片未设置,请设置完成后再来生成证书吧", content: "真实姓名或证书照片未设置,请设置完成后再来生成证书吧",
cancelText:'稍后设置', cancelText: '稍后设置',
confirmText:'立即设置', confirmText: '立即设置',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
uni.navigateTo({ uni.navigateTo({
url:'/pages/mine/userInfo/persData' url: '/pages/mine/userInfo/persData'
}) })
} }
} }
}) })
return return
} }
var type = undefined var type = undefined
if(this.performanceScore.userScore >= 60 && this.performanceScore.userScore < 70){ if (this.performanceScore.userScore >= 60 && this.performanceScore.userScore < 70) {
type = 'B' type = 'B'
}else if(this.performanceScore.userScore >= 70){ } else if (this.performanceScore.userScore >= 70) {
type = 'A' type = 'A'
}else{ } else {
uni.showToast({ uni.showToast({
title:'您的成绩未达到证书水平,请继续努力', title: '您的成绩未达到证书水平,请继续努力',
icon: 'none' icon: 'none'
}) })
return return
} }
var data = { var data = {
"type": type, //证书类型A a证 B b证 ZK自考 "type": type, //证书类型A a证 B b证 ZK自考
"relationId": this.classId //小班id、课程id "relationId": this.classId //小班id、课程id
} }
// console.log('证书提交数据',data,this.performanceScore.userScore); // console.log('证书提交数据',data,this.performanceScore.userScore);
$http.request({ $http.request({
url: "common/class/generateCertificateClass", url: "common/class/generateCertificateClass",
method: "POST", method: "POST",
@@ -1234,14 +1240,14 @@
.then(async (res) => { .then(async (res) => {
if (res.code == 0) { if (res.code == 0) {
console.log('证书返回值', res); console.log('证书返回值', res);
uni.showToast({ uni.showToast({
title: '生成成功', title: '生成成功',
icon: 'none' icon: 'none'
}) })
setTimeout(()=>{ setTimeout(() => {
this.closeManager() this.closeManager()
this.getScore() this.getScore()
},300) }, 300)
} else { } else {
uni.showToast({ uni.showToast({
title: res.errMsg, title: res.errMsg,
@@ -1274,15 +1280,15 @@
console.log('平时成绩e-------', this.performanceScore); console.log('平时成绩e-------', this.performanceScore);
if (this.performanceScore.userScore < 60 && this.thisClass.state == '2') { if (this.performanceScore.userScore < 60 && this.thisClass.state == '2') {
this.getNewCLassInfo() this.getNewCLassInfo()
}else{ } else {
// >= 60 // >= 60
if(this.thisClass.state == '2' ){ // if (this.thisClass.state == '2') {
var certificate = await this.getCertificateInfo() var certificate = await this.getCertificateInfo()
if(certificate && certificate.length > 0 && certificate[0].id){ if (certificate && certificate.length > 0 && certificate[0].id) {
this.certificate = certificate[0] this.certificate = certificate[0]
} }
console.log('this.certificate',certificate); console.log('this.certificate', certificate);
} // }
} }
} else { } else {
@@ -1299,20 +1305,20 @@
}); });
}, },
// 查询证书获得情况 // 查询证书获得情况
async getCertificateInfo(){ async getCertificateInfo() {
var _obj = undefined var _obj = undefined
await $http.request({ await $http.request({
url: "common/class/getUserCertificateByClassId", url: "common/class/getUserCertificateByClassId",
method: "POST", method: "POST",
data: { data: {
"classId": this.classId, "classId": this.classId,
"userId": this.userInfo.id "userId": this.userInfo.id
}, },
header: { //默认 无 说明:请求头 header: { //默认 无 说明:请求头
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
}) })
.then( (res) => { .then((res) => {
if (res.code == 0) { if (res.code == 0) {
// this.newCLass = res.result // this.newCLass = res.result
console.log('证书数据', res); console.log('证书数据', res);
@@ -1381,22 +1387,22 @@
url: `${url}?classId=${classId}&type=${type}` url: `${url}?classId=${classId}&type=${type}`
}) })
}, },
clickCourseTab(index, id){ clickCourseTab(index, id) {
if(this.curCourseIndex == index ){ if (this.curCourseIndex == index) {
return return
}else{ } else {
this.curCourseIndex = index this.curCourseIndex = index
this.curCourseId = id this.curCourseId = id
} }
}, },
// 跳转到播放页面 // 跳转到播放页面
jumpToVideoPage(val){ jumpToVideoPage(val) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/course/chapterDetailAndorid?navTitle=${this.questionsList[this.curCourseIndex].courseEntity.title} url: `/pages/course/chapterDetailAndorid?navTitle=${this.questionsList[this.curCourseIndex].courseEntity.title}
&title=${val.title}&courseId=${this.questionsList[this.curCourseIndex].courseEntity.id} &title=${val.title}&courseId=${this.questionsList[this.curCourseIndex].courseEntity.id}
&id=${val.id}&noRecored=false`, &id=${val.id}&noRecored=false`,
}); });
}, },
// 点击作业或者医案,进入详细介绍 // 点击作业或者医案,进入详细介绍
@@ -1548,12 +1554,12 @@
async titleClick(item, textIndex) { async titleClick(item, textIndex) {
console.log('进来了吗', item); console.log('进来了吗', item);
if(item.id=='3'){ if (item.id == '3') {
this.tijiaoTitleId = item.id this.tijiaoTitleId = item.id
this.questionsList = await this.getQuestionsList() this.questionsList = await this.getQuestionsList()
if(this.questionsList.length > 0){ if (this.questionsList.length > 0) {
this.curCourseId = this.questionsList[this.curCourseIndex].courseEntity.id this.curCourseId = this.questionsList[this.curCourseIndex].courseEntity.id
this.tabCourseList = this.questionsList.map( item => { this.tabCourseList = this.questionsList.map(item => {
return item.courseEntity return item.courseEntity
}) })
} }
@@ -1748,11 +1754,11 @@
console.log('taskEdit'.item); console.log('taskEdit'.item);
}, },
// 图片预览 // 图片预览
preveImg(url){ preveImg(url) {
console.log('dianjile fangda tu'); console.log('dianjile fangda tu');
uni.previewImage({ uni.previewImage({
urls: [url], urls: [url],
current: 0 current: 0
}); });
}, },
// 退出班级 // 踢出班级 // 退出班级 // 踢出班级
@@ -1837,7 +1843,7 @@
}, },
}) })
.then(async res => { .then(async res => {
console.log('班级信息', res); console.log('班级信息', res);
this.refresh = false this.refresh = false
if (res.code == 0) { if (res.code == 0) {
this.isHave = res.result.isJoin this.isHave = res.result.isJoin
@@ -1894,7 +1900,7 @@
if (this.thisClass.state != 0 && this.tabId != '3') { if (this.thisClass.state != 0 && this.tabId != '3') {
this.pPage = 0 this.pPage = 0
this.taskList = [] this.taskList = []
if(this.tijiaoTitleList.length > 0){ if (this.tijiaoTitleList.length > 0) {
if (this.firstLoad) { if (this.firstLoad) {
this.firstLoad = false this.firstLoad = false
this.tijiaoTitleId = this.tijiaoTitleList[this.tijiaoTitleIndex].id this.tijiaoTitleId = this.tijiaoTitleList[this.tijiaoTitleIndex].id
@@ -2048,7 +2054,8 @@
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.zhengshu { margin-left: 20rpx; .zhengshu {
margin-left: 20rpx;
color: #ffaa7f; color: #ffaa7f;
font-size: 28rpx; font-size: 28rpx;
border: 1px solid #ffaa7f border: 1px solid #ffaa7f
@@ -2066,9 +2073,11 @@
.blueScore { .blueScore {
color: #00aaff; color: #00aaff;
} }
.yellowScore{
.yellowScore {
color: #ffaa00; color: #ffaa00;
} }
.redScore { .redScore {
color: #ff8a8c; color: #ff8a8c;
} }
@@ -2119,13 +2128,20 @@
} }
} }
} }
.stickyyy{padding: 20rpx; color: #fff; background-color: #ff9277;}
.stickyyy {
padding: 20rpx;
color: #fff;
background-color: #ff9277;
}
.chengji { .chengji {
padding-top: 20rpx; padding-top: 20rpx;
margin-top: 20rpx; margin-top: 20rpx;
border-top: 1px solid #eee; border-top: 1px solid #eee;
} }
.chengji.zong{
.chengji.zong {
margin-top: 0; margin-top: 0;
padding-top: 0; padding-top: 0;
border-top: none; border-top: none;
@@ -2168,7 +2184,12 @@
} }
} }
.questJUmp{font-size: 28rpx; text-align: center; color: #55aaff;} .questJUmp {
font-size: 28rpx;
text-align: center;
color: #55aaff;
}
.submitRecode { .submitRecode {
// padding: 20rpx; // padding: 20rpx;
@@ -2248,9 +2269,13 @@
} }
} }
} }
.questionbox{
.leve1{ border: none !important} .questionbox {
.leve1 {
border: none !important
}
} }
.zhedie { .zhedie {
@include bov(2); @include bov(2);
} }
@@ -2309,15 +2334,32 @@
} }
} }
.courseTab{
margin-bottom: 20rpx; padding: 8rpx; .courseTab {
background:#c6d1d5; line-height: 50rpx; overflow: hidden; margin-bottom: 20rpx;
.item{ display: block; text-align: center; height: 50rpx; font-size: 26rpx; width: 100%; padding: 8rpx;
padding:0 6rpx;@include toe(); box-sizing: border-box; background: #c6d1d5;
line-height: 50rpx;
overflow: hidden;
.item {
display: block;
text-align: center;
height: 50rpx;
font-size: 26rpx;
width: 100%;
padding: 0 6rpx;
@include toe();
box-sizing: border-box;
// text{ } // text{ }
} }
.item.cur{ @include mshadow(6px,1);background-color: #fff; }
.item.cur {
@include mshadow(6px, 1);
background-color: #fff;
}
} }
.mainContent { .mainContent {
color: #333; color: #333;
padding: 0 20rpx; padding: 0 20rpx;
@@ -2500,12 +2542,15 @@
} }
} }
} }
.alcentertt{
.alcentertt {
justify-content: space-around !important; justify-content: space-around !important;
} }
.alcenterss{
justify-content: center !important; .alcenterss {
} justify-content: center !important;
}
.otherItems { .otherItems {
// border: 1px solid #dadada; // border: 1px solid #dadada;
padding: 20rpx; padding: 20rpx;
@@ -2624,6 +2669,7 @@
} }
.optionsBox {} .optionsBox {}
.btn_box_certificate { .btn_box_certificate {
margin-top: 70rpx; margin-top: 70rpx;
padding-bottom: 20rpx; padding-bottom: 20rpx;
@@ -2636,17 +2682,24 @@
border-radius: 50rpx; border-radius: 50rpx;
} }
} }
.retake { .retake {
border: 1px solid #55aa00; border: 1px solid #55aa00;
color: #55aa7f; color: #55aa7f;
} }
.mr20rpx{
.mr20rpx {
margin-right: 20rpx; margin-right: 20rpx;
} }
.userinfoPup{
.tips{ .userinfoPup {
.tips {
// .item{justify-content: space-around;} // .item{justify-content: space-around;}
} }
.small_btn{color: #55aaff; border: #55aaff 1px solid ;}
.small_btn {
color: #55aaff;
border: #55aaff 1px solid;
}
} }
</style> </style>

View File

@@ -75,7 +75,7 @@
</view> </view>
<text class="score">{{item.examScore}}</text> <text class="score">{{item.examScore}}</text>
</view> </view>
<view v-if="thisClass.state == '2'"> <view >
<view class="ciyao"> <view class="ciyao">
总分 总分
</view> </view>
@@ -84,7 +84,7 @@
</template> </template>
</template> </template>
<!-- --> <!-- -->
<template v-if="classModel.isExam == 1 && thisClass.state == '2'" > <template v-if="classModel.isExam == 1 && item.classExamUsers.length > 0" >
<view v-if="item.userScore >= 60 && item.userScore < 70" <view v-if="item.userScore >= 60 && item.userScore < 70"
:class="['PM_font','zhengshu','Bzheng']" :class="['PM_font','zhengshu','Bzheng']"
></view> ></view>