This commit is contained in:
@fawn-nine
2024-09-23 13:34:21 +08:00
parent 6ad01b5a89
commit 1a2df86df2
6 changed files with 260 additions and 124 deletions

View File

@@ -774,7 +774,6 @@
if (v.type == 0) {
//免费
this.$http
.request({
url: this.urlList.startStudyForMF,
@@ -795,7 +794,14 @@
}
this.$forceUpdate();
});
} else {
} else if(v.type == 2 && this.userMsg.vip != 1 ){
uni.showModal({
title:'提示',
content:'当前课程目录是超V专享,开通超V可观看',
confirmText:'好的',
showCancel:false
})
}else {
this.$http
.request({
url: this.urlList.goodsList,

View File

@@ -24,24 +24,20 @@
<view :class="['courseItemleve1',userMsg.vip != 0 ? 'isVip' :'']"
v-for="(item1, index1) in item.courseList" :key="index1"
@click="onPageJump('/pages/course/courseDetail',item1.id)">
<view class="vipSee" v-if="userMsg.vip != 0">
<view class="vipSee" v-if="userMsg.vip != 0 && userMsg.vip != 3">
<text>VIP畅学权益生效中</text>
</view>
<view :class="['text','courseItem','flexbox']"><u-icon name="pushpin" color="#2979ff"
size="24"></u-icon><text style="font-size: 32rpx;">{{item1.title}}</text>
</view>
<template v-if="item1.courseCatalogueEntityList && item1.courseCatalogueEntityList.length > 0">
<view class="" v-for="(item2, index2) in item1.courseCatalogueEntityList" :key="index2">
<view :class="['priceItem', item2.isBuy == 1 && userMsg.vip == 0 ? 'isBuy' : '']">
<text class="text mname" v-if="item1.courseCatalogueEntityList.length > 1"
style="font-weight: bold; margin-right: 10rpx;">{{item2.title}}</text>
<view class="pbox flexbox">
<text v-if="item2.type == 2" style="border: #ffb861 1px solid ; border-radius: 40rpx; font-size: 28rpx; display:inline-block; width: 40rpx;
height: 40rpx; text-align: center; line-height: 40rpx; color: #ffb861;">V</text>
<text class="text">半年{{item2.halfFee}} </text><text class="text"
style="margin-left: 20rpx;">整年{{item2.fee}} </text>
<text class="buybtns" @click.stop="goBuy(item2)"
@@ -341,8 +337,17 @@
closePup(e) {
this.pricespop = false
},
goBuy(val) {
goBuy(val) {
console.log(val, 'val')
if(val.type == 2 && this.userMsg.vip != 1){
uni.showModal({
title:'提示',
content:'当前课程目录是超V专享,开通超V可观看',
confirmText:'好的',
showCancel:false
})
return
}
$http.request({
url: "sociology/product/getProductListForCourse",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档

View File

@@ -1,29 +1,33 @@
<template>
<view style="
<view style=" position: relative;
padding: 0 0;
font-size: 28rpx;
;
" class="commonPageeeee commonPageBox">
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<u-icon @click="goSetting" class="setIcon" labelColor="#258feb" labelPos="bottom" label="设置" name="setting"
:style="`top:${(10 + statusBarHeight) * 2}rpx`" color="#258feb" size="28"></u-icon>
<view class="bg_top flex_box flex_between">
<view class="per_mes">
<image @click="goUserInfo" :src="userMes.avatar" v-if="userMes.avatar != null"
class="per_mes_img color_shandow"></image>
<view class="user_vip_box">
<view v-if="userMes.vip == 1" class="user_vip super">超级VIP</view>
<view v-if="userMes.vip == 3" class="user_vip">众妙之门VIP</view>
<view v-if="userMes.vip == 2" class="user_vip">吴门医述VIP</view>
<view class="per_mes_user">
<view class="" style="width: 100rpx; height: 100rpx; display: inline-block;">
<image @click="goUserInfo" :src="userMes.avatar" v-if="userMes.avatar != null"
class="per_mes_img color_shandow"></image>
<image src="@/static/icon/home_icon_logo.png" v-if="userMes.avatar == null"
class="per_mes_img color_shandow"></image>
</view>
<view class="user_vip_box ">
<view v-if="userMes.vip == 1" class="user_vip super">超级VIP</view>
<view v-if="userMes.vip == 3" class="user_vip">众妙之门VIP</view>
<view v-if="userMes.vip == 2" class="user_vip">吴门医述VIP</view>
</view>
</view>
<image src="@/static/icon/home_icon_logo.png" v-if="userMes.avatar == null"
class="per_mes_img color_shandow"></image>
<view class="userInfoBox" style="width: calc(100% - 220rpx)">
<template>
<view class="name">昵称{{ userMes.nickname ? userMes.nickname : "未设置" }}</view>
</template>
<template v-if="userMes.tel">
<view class="phone">手机号({{ userMes.tel }})</view>
</template>
@@ -39,12 +43,11 @@
</view>
<br clear="both" />
</view>
<u-icon @click="goSetting" class="setIcon" labelColor="#258feb" labelPos="bottom" label="设置" name="setting"
:style="`top:${(10 + statusBarHeight) * 2}rpx`" color="#258feb" size="28"></u-icon>
</view>
<view class="mine_box" :style="`top:${(45 + statusBarHeight) * 2}rpx`">
<view style="
padding: 20rpx; overflow: hidden;
@@ -255,7 +258,7 @@
style: "color:#fff;font-size:28rpx"
},
],
roleObj:{},
roleObj: {},
infoShow: false, // 显示电子书相关
showEbook: false, // 显示电子书相关
userMes: {},
@@ -274,9 +277,9 @@
// type: "pageJump",
},
{
name: "我的证书",
url: "/pages/certificate/certificate",
type: "pageJump",
name: "我的证书",
url: "/pages/certificate/certificate",
type: "pageJump",
},
// {
// name: "购物车",
@@ -435,9 +438,9 @@
});
},
// 获取用户的角色信息
getUserRole(){
getUserRole() {
this.$http.post("common/class/getRoleType").then((res) => {
console.log('用户角色信息',res);
console.log('用户角色信息', res);
this.roleObj = res.result
var zhurenIndex = this.pageList.findIndex(item => {
return item.name == '主任教学'
@@ -482,33 +485,33 @@
console.log('班长n找到了么', n);
if (!n) {
var item = {
name: "班级管理",
url: "/pages/miniClass/MonitorClassList?type=mine",
type: "pageJump",
}
this.pageList.splice(3, 0, item);
}
}
// 是学员
if(this.roleObj.isStudent){
}
// 是学员
if (this.roleObj.isStudent) {
var n = this.pageList.find(item => {
return item.name == '我的班级'
})
console.log('我的班级找到了么', n);
if (!n) {
var item = {
name: "我的班级",
url: "/pages/miniClass/myClassList?type=mine",
type: "pageJump",
}
this.pageList.splice(3, 0, item);
}
}
}
}).catch(e => {
console.log('获取角色信息失败');
})
@@ -518,7 +521,7 @@
if (this.userInfo.id != undefined) {
this.$http.post("common/user/getUserInfo").then((res) => {
this.userMes = res.result;
});
}
},
@@ -581,10 +584,12 @@
</script>
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.per_mes_user{display: block !important;}
.per_mes {
width: 100%;
position: relative;
margin: 20rpx 40rpx;
margin: 20rpx 0;
margin-top: 20rpx;
align-items: center;
display: flex;
@@ -593,16 +598,16 @@
.per_mes_img {
// @include themeBorder(10rpx,10rpx,#4E79A3, #A6D8DC);
width: 140rpx;
height: 140rpx;
width: 100rpx;
height: 100rpx;
// background-color: #fff;
border-radius: 140rpx;
border-radius: 100rpx;
margin: 0 0 0 0;
float: left;
}
view {
float: left;
// float: left;
// margin-top: 20rpx;
.name {
@@ -882,22 +887,23 @@
// background: #d8f8e4 !important;
}
.bg_top {
.bg_top {
padding: 0 30rpx;
padding-top: 80rpx;
margin-bottom: 60rpx; overflow: hidden;
margin-bottom: 60rpx;
overflow: hidden;
// position: relative;
.setIcon {
// position: absolute;
// right: 30rpx;
// top: 30rpx;
}
}
.setIcon {
position: absolute;
right: 30rpx;
top: 30rpx;
}
.mine_box {
width: 100%;
padding: 0 0rpx;
}
@@ -986,13 +992,19 @@
}
.user_vip_box {
min-width: 130rpx;
display: block;
// min-width: 100rpx;
position: absolute;
bottom: -20rpx;
display: flex;
// position: absolute;
// bottom: -20rpx;
// display: flex;
align-items: center;
justify-content: center;
view {
font-size: 22rpx;
font-weight: normal;
}
}
.user_vip {

View File

@@ -697,12 +697,12 @@
console.log('this.classId', this.classId);
this.getUserRole()
this.getUserInfo()
uni.$on('refreshData', () => {
console.log('开始刷新列表数据');
this.pPage = 0
this.taskList = []
this.getList()
})
// uni.$on('refreshData', () => {
// console.log('开始刷新列表数据');
// this.pPage = 0
// this.taskList = []
// this.getList()
// })
// uni.$on('refreshUserAnswerList',() => {
// console.log('开始刷新用户提交列表');
@@ -713,8 +713,10 @@
},
onReachBottom() {
if (this.status != 2 && this.status != 3) {
this.getList()
if(this.tijiaoTitleId != 3){
if (this.status != 2 && this.status != 3) {
this.getList()
}
}
},
onPullDownRefresh() {
@@ -723,9 +725,9 @@
console.log('this.tabId------', this.tabId);
this.getClassInfo()
this.getScore()
this.pPage = 0
this.taskList = []
this.getList()
// this.pPage = 0
// this.taskList = []
// this.getList()
uni.stopPullDownRefresh()
},
async onShow() {
@@ -859,7 +861,7 @@
}
// return _list
if (_list.length > 0) {
console.log('是否进入了这里666666666666');
console.log('是否进入了这里666666666666',this.tijiaoTitleIndex);
this.tijiaoTitleList = _list
this.titleClick(this.tijiaoTitleList[this.tijiaoTitleIndex], this.tijiaoTitleIndex)
// this.tijiaoTitleId = this.tijiaoTitleList[0].id
@@ -889,6 +891,7 @@
methods: {
// 获得思考题列表及答案
async getQuestionsList() {
console.log('是否进入了思考题请求????????????');
var list = []
await $http.request({
url: "common/class/getThinkQuestionListStudent",
@@ -1113,7 +1116,7 @@
},
})
.then(res => {
console.log('考试周班状态下,学员的信息', this.classId, res, );
// console.log('考试周班状态下,学员的信息', this.classId, res, );
// this.userMsg = res.user
// list = studentList
if (res.code == 0) {
@@ -1157,7 +1160,7 @@
return
}
uni.navigateTo({
url: `/pages/miniClass/test?classId=${this.thisClass.id}`
url: `/pages/miniClass/test?classId=${this.thisClass.id}&testDuration=${this.classModel.examTime}`
})
},
changeZheDie(item, index) {
@@ -1276,7 +1279,7 @@
.then(async (res) => {
if (res.code == 0) {
this.performanceScore = res.result
console.log('平时成绩e-------', this.performanceScore);
// console.log('平时成绩e-------', this.performanceScore);
if (this.performanceScore.userScore < 60 && this.thisClass.state == '2') {
this.getNewCLassInfo()
} else {
@@ -1486,7 +1489,7 @@
},
getList() {
console.log('进入函数了吗');
console.log('进入函数了吗--------------------------------------');
this.status = 1;
if (this.loadFlag) {
console.log("有未完成的进程");
@@ -1505,7 +1508,9 @@
"myExperience": this.tijiaoTitleId != 2 ? "0" : "1", //0全部心得1我的心得 this.myExperience
"title": ""
}
console.log('data任务/心得', data);
console.log('data任务/心得', this.pPage ,data);
// let that = this
const pp = this.pPage
$http.request({
url: "common/class/getClassTaskListStudent",
method: "POST",
@@ -1516,27 +1521,30 @@
})
.then(res => {
if (res.code == 0) {
// that.pPage = 3
if (res.page.records.length > 0) {
console.log('数据获取成功', res.page.records);
var lis = res.page.records
lis.forEach(item => {
item.zhedie = false
})
this.taskList = this.taskList.concat(lis)
if (res.page.pages > 1) {
this.taskHaveMore = true
}
if (res.page.pages > this.pPage) {
this.taskList = this.taskList.concat(lis)
if (res.page.pages > pp) {
this.status = 0;
} else {
this.status = 2;
}
console.log('res.page.pages > this.pPage',res.page.pages,pp,this.status);
} else {
this.status = 3; // 暂无数据
}
this.loadFlag = false;
console.log('res', res);
uni.hideLoading()
setTimeout(()=>{
this.loadFlag = false;
},400)
} else {
console.log('数据获取失败.......', res);
}
@@ -1551,10 +1559,18 @@
});
},
async titleClick(item, textIndex) {
console.log('进来了吗', item);
if(this.loadFlag){
uni.showToast({
title:'操作太快了,休息一下吧',
icon:'none',
})
return
}
if (item.id == '3') {
this.tijiaoTitleId = item.id
this.tijiaoTitleIndex = textIndex
this.questionsList = await this.getQuestionsList()
if (this.questionsList.length > 0) {
this.curCourseId = this.questionsList[this.curCourseIndex].courseEntity.id
@@ -1562,11 +1578,8 @@
return item.courseEntity
})
}
}
// if (this.tijiaoTitleId == item.id) {
// console.log(5555555555555555, this.tijiaoTitleId,item.id);
// return
// }
return
}
this.tijiaoTitleId = item.id
this.tijiaoTitleIndex = textIndex
console.log('e班内提交子按钮', this.tijiaoTitleId);

View File

@@ -491,12 +491,25 @@
this.severNowTime = severNowTime
console.log('this.endTime',this.endTime);
this.secondTimeDif = this.endTime - severNowTime // 时间差 毫秒
let that = this
if(this.secondTimeDif > 0){
// this.setPaperEndTime({time:this.endTime})
this.timeDif.hour = parseInt((this.secondTimeDif % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
this.timeDif.minutes = parseInt((this.secondTimeDif % (1000 * 60 * 60)) / (1000 * 60))
this.timeDif.second = (this.secondTimeDif % (1000 * 60)) / 1000
console.log('this.endTime',this.timeDif.hour, this.timeDif.minutes, this.timeDif.second);
}else{
uni.showModal({
title:'提示',
content:'您的时间已经结束,即将返回班级',
confirmText:'好的',
showCancel:fals,
success: (res) => {
if(res.confirm){
that.goToClass()
}
}
})
}
this.curQuestion = {
...this.questionList[this.curIndex1]

View File

@@ -1,7 +1,7 @@
<template style="">
<view class="" style="background-color: #d4eaf0; min-height: calc(100vh); padding: 20rpx;">
<public-module></public-module>
<z-nav-bar title="正在考试" backState="2000">
<z-nav-bar :title="pagetitle" backState="2000">
<text slot="right" style="padding-right: 20rpx; font-size: 26rpx; color: #666;"
@click="showPopup = true">考试说明</text>
</z-nav-bar>
@@ -107,6 +107,27 @@
</view>
</view>
</u-popup>
<u-popup :show="protocolShow" mode="center" round="6" :key="3">
<view class="popup_box">
<view class="title">温馨提示</view>
<view class="content">
<view class="center">
用户您好本次考试时间为 <text style="color: red; font-weight: bold; font-size: 30rpx;">{{testDuration}}</text> 分钟<br />
<view style="color: red; font-weight: bold"> : </view>
<view>
<text>每位学员共有两次考试的机会考试成绩以两次成绩的最高分作为最终的卷面成绩请认真对待每次考试;<br />
请在倒计时结束前完成答题倒计时结束后将自动交卷</text>
</view>
</view>
<view class="bottom">
<view class="button_box">
<u-button size="small" text="稍后再考" @click="cancelClick"></u-button>
<u-button text="开始考试" color="#258feb" size="small" @click="onHandleClickBuy"></u-button>
</view>
</view>
</view>
</view>
</u-popup>
</view>
</template>
@@ -118,6 +139,8 @@
export default {
data() {
return {
testDuration:undefined, // 考试时长
protocolShow:false,
showPopup: false,
code: 0, // 英文code
classId: undefined,
@@ -142,17 +165,16 @@
haveAnswerList:[],
exameResult:{},
showQuestIndex:false,
secondTimeDif:undefined
secondTimeDif:undefined,
pagetitle:'', // 页面标题
}
},
async onLoad(e) {
console.log('收到得值');
this.classId = e.classId
// this.examId = e.id
if (this.testPaper.length <= 0) {
this.getTestPage()
}
// this.questIndexList = await this.getNowList('add')
this.testDuration = e.testDuration
this.protocolShow = true
this.pagetitle = '准备考试'
},
onHide() {
if (!this.isOvertime) {}
@@ -178,6 +200,25 @@
},
methods: {
...mapMutations(['setPaperEndTime']),
cancelClick(){
this.protocolShow = false
uni.navigateTo({
url: `/pages/miniClass/classInfo?id=${this.classId}`
})
},
onHandleClickBuy(){ // 确定开始考试
this.protocolShow = false
if (this.testPaper.length <= 0) {
this.pagetitle = '获取试卷'
this.getTestPage()
}else{
uni.showToast({
title:'页面发生错误,请退出后重新进入页面或联系客服人员',
icon:'none',
duration:3000
})
}
},
// 获取服务器时间
async getServerTime() {
var time = 0
@@ -461,37 +502,26 @@
this.endTime = res.planEndTime
var severNowTime = await this.getServerTime()
this.secondTimeDif = this.endTime - severNowTime // 时间差 毫秒
if(this.secondTimeDif > 0){
// this.setPaperEndTime({time:this.endTime})
// uni.setStorage({
// key:'paperEndTime',
// data:{
// time: this.endTime,
// examId: this.examId,
// },
// success: function () {
// console.log('时间存储成功');
// }
// })
let that = this
if(this.secondTimeDif > 0){
this.timeDif.hour = parseInt((this.secondTimeDif % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
this.timeDif.minutes = parseInt((this.secondTimeDif % (1000 * 60 * 60)) / (1000 * 60))
this.timeDif.second = (this.secondTimeDif % (1000 * 60)) / 1000
console.log('this.endTime',this.timeDif.hour, this.timeDif.minutes, this.timeDif.second);
}else{
uni.setStorage({
key:'paperEndTime',
data:{
time: 0,
examId: undefined,
},
success: function () {
console.log('时间存储成功');
}
uni.showModal({
title:'提示',
content:'您的时间已经结束,即将返回班级',
confirmText:'好的',
showCancel:fals,
success: (res) => {
if(res.confirm){
that.goToClass()
}
}
})
}
console.log('本地存储的结束时间', this.$store.state.paperEndTime);
}
this.curQuestion = {
...this.testPaper[this.curIndex1]
}
@@ -501,9 +531,7 @@
icon: 'success'
})
console.log(res, '试卷', this.curQuestion)
// setTimeout(() => {
// this.getClassInfo()
// }, 500)
this.pagetitle = '正在考试'
} else {
uni.showToast({
title: res.errMsg,
@@ -570,7 +598,66 @@
<style lang="scss" scoped>
@import "@/style/mixin.scss";
.popup_box {
padding-bottom: 20rpx;
width: 85vw;
overflow: hidden;
position: relative;
height: auto;
.title {
font-family: PangMenZhengDaoBiaoTiTiMianFeiBan;
font-weight: normal;
font-size: 46rpx;
color: $themeColor;
background-color: #f5f5f5;
// line-height: 46rpx;
padding: 20rpx;
// border-leradius: 6px;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
.content {
font-size: 26rpx;
letter-spacing: 0.15rpx;
padding: 20rpx;
color: #3f3f3f;
.top {
margin: 30rpx 0;
}
.center {
line-height: 40rpx;
// padding:0 10rpx;
}
.bottom {
width: 100%;
margin-top: 60rpx;
font-size: 24rpx;
line-height: 26rpx;
color: #b0b0b0;
}
}
.button_box {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20rpx;
.u-button {
margin-left: 40rpx;
}
.u-button:nth-child(1) {
margin-left: 0;
}
}
}
.questIndx { overflow: hidden;
margin-top: 20rpx;
margin-bottom: 20rpx;