This commit is contained in:
binbin_pan 2024-12-19 21:07:42 +08:00
parent 0f2f253b7f
commit c807a13d5e
1 changed files with 40 additions and 112 deletions

View File

@ -2,53 +2,27 @@
<view class="page"> <view class="page">
<u-navbar title="学习项目" @leftClick="leftClick" placeholder /> <u-navbar title="学习项目" @leftClick="leftClick" placeholder />
<view class="proj-cont"> <view class="proj-cont">
<h2 style="margin-bottom: 15rpx">{{ name }}</h2> <h2 style="margin: 0 10px 8px">{{ name }}</h2>
<span style="font-size: 12px; color: #b0b0b0">合格标准学习进度达到{{ eligibility }}%</span> <span style="font-size: 15px; color: #b0b0b0; margin: 0 10px">合格标准学习进度达到{{ eligibility }}%</span>
<view class="user-info"> <view class="user-info">
<div style="font-size: 18px">{{ createUserName }}</div> <div style="font-size: 18px; margin: 0 10px">{{ createUserName }}</div>
<div class="training-content"> <div class="training-content">
<div>培训内容{{ listStageContentNum || '暂无' }}</div> <div>培训内容{{ listStageContentNum || '暂无' }}</div>
</div> </div>
<!-- <view class="info-lef">
<view class="avatar">
<image src="/static/eduImg/avatar.jpg"></image>
<div style="font-size: 18px">{{ createUserName }}</div>
</view>
<view style="display: flex; align-items: center">
<l-starRate v-model="starRate" :disabled="true" style="margin-right: 1vw"></l-starRate>
<span style="color: #ffca3e">{{ starRate }}.0</span>
</view>
</view>
<view class="info-rig">
<view class="rig-up">
<view>
培训内容
<span>{{ 'listStageContentNum' }}</span>
</view>
<view style="margin-left: 2vw">
观看记录
<span>28</span>
<uni-icons style="color: #b0b0b0" type="right" size="12"></uni-icons>
</view>
</view>
<view class="rig-dn">
去评分
<uni-icons style="color: #b0b0b0" type="right" size="12"></uni-icons>
</view>
</view> -->
</view> </view>
<!-- <view class="tip">已开启进度同步其他途径的学习进度已自动同步</view> --> <!-- <view class="tip">已开启进度同步其他途径的学习进度已自动同步</view> -->
<div v-for="(stageItem, stageIndex) in listStage" :key="stageIndex" :title="stageItem.stageName"> <div v-for="(stageItem, stageIndex) in listStage" :key="stageIndex" :title="stageItem.stageName">
<div class="item-stage" @click="handleShow(stageItem)"> <div class="item-stage" @click="handleShow(stageItem)">
<span>{{ stageItem.stageName }}</span> <span style="font-size: 18px; margin: 0 10px">{{ stageItem.stageName }}</span>
<u-icon :name="stageItem.isShow ? 'arrow-down' : 'arrow-up'" size="17" /> <u-icon :name="stageItem.isShow ? 'arrow-down' : 'arrow-up'" size="20" />
</div> </div>
<div v-if="stageItem.isShow"> <div v-if="stageItem.isShow">
<div v-for="(content, conIndex) in stageItem.listStageContent" :key="conIndex"> <div v-for="(content, conIndex) in stageItem.listStageContent" :key="conIndex">
<u-collapse :border="false"> <u-collapse :border="false" :value="[1]">
<u-collapse-item title="素材" v-if="content.stageType == 1" :border="false"> <u-collapse-item v-if="content.stageType == 1" :border="false" :name="1">
<text slot="title" class="u-page__item__title__slot-title slot-item-title">素材</text>
<div <div
class="list-wrapper" class="list-wrapper u-collapse-content"
v-for="(item, index) in content.studyList" v-for="(item, index) in content.studyList"
:key="index" :key="index"
@click="toggleTheoryLearn(item, content)" @click="toggleTheoryLearn(item, content)"
@ -74,9 +48,10 @@
</div> </div>
</div> </div>
</u-collapse-item> </u-collapse-item>
<u-collapse-item title="课程" v-if="content.stageType == 2" :border="false"> <u-collapse-item v-if="content.stageType == 2" :border="false" :name="1">
<text slot="title" class="u-page__item__title__slot-title slot-item-title">课程</text>
<div <div
class="list-wrapper" class="list-wrapper u-collapse-content"
v-for="(item, index) in content.studyList" v-for="(item, index) in content.studyList"
:key="index" :key="index"
@click="toggleTheoryLearn(item, content)" @click="toggleTheoryLearn(item, content)"
@ -103,8 +78,9 @@
</div> </div>
</u-collapse-item> </u-collapse-item>
<u-collapse-item title="练习" v-if="content.stageType == 3" :border="false"> <u-collapse-item v-if="content.stageType == 3" :border="false" :name="1">
<div class="list-wrapper" @click="toggleTheoryPrac(content)"> <text slot="title" class="u-page__item__title__slot-title slot-item-title">练习</text>
<div class="list-wrapper u-collapse-content" @click="toggleTheoryPrac(content)">
<div class="left-content"> <div class="left-content">
<div class="title"> <div class="title">
<u-icon name="/static/images/exercises.png" size="15" /> <u-icon name="/static/images/exercises.png" size="15" />
@ -125,8 +101,9 @@
</div> </div>
</u-collapse-item> </u-collapse-item>
<u-collapse-item title="考试" v-if="content.stageType == 4" :border="false"> <u-collapse-item v-if="content.stageType == 4" :border="false" :name="1">
<div class="list-wrapper" @click="toggleTheoryExam(content)"> <text slot="title" class="u-page__item__title__slot-title slot-item-title">考试</text>
<div class="list-wrapper u-collapse-content" @click="toggleTheoryExam(content)">
<div class="left-content"> <div class="left-content">
<div class="title"> <div class="title">
<u-icon name="/static/images/examine.png" size="15" /> <u-icon name="/static/images/examine.png" size="15" />
@ -157,43 +134,6 @@
</div> </div>
</div> </div>
</view> </view>
<!-- <view class="comment-area">
<h2 style="margin-bottom: 15rpx">最新评论 ({{ commentList.length }})</h2>
<view class="write-cmt">
<u--input
ref="uInput"
placeholder="写评论"
prefixIcon="edit-pen"
prefixIconStyle="font-size: 18px;color: #c0c4cc"
placeholderStyle="font-size: 13px;color: #c0c4cc"
border="none"
maxlength="999"
clearable
/>
</view>
<view class="cmts" v-for="(item, index) in commentList" :key="index">
<view class="cmt-up">
<image :src="item.avatar"></image>
<span>{{ item.username }}</span>
</view>
<view class="cmt-dn">
{{ item.cont }}
</view>
</view>
</view> -->
<!-- <view class="btm-sticky">
<view class="icons">
<view>
<uni-icons style="color: #1989fa; margin-right: 1vw" type="chat-filled" size="24"></uni-icons>
<span>23</span>
</view>
<view>
<uni-icons style="color: #1989fa; margin-right: 1vw" type="hand-up-filled" size="24"></uni-icons>
<span>12</span>
</view>
</view>
<view class="learn-btn">继续学习</view>
</view> -->
</view> </view>
</template> </template>
@ -214,34 +154,6 @@ export default {
learnIconObj: { color: '#1A63AC', size: '18', type: 'calendar' }, learnIconObj: { color: '#1A63AC', size: '18', type: 'calendar' },
pracIconObj: { color: '#38B022', size: '18', type: 'compose' }, pracIconObj: { color: '#38B022', size: '18', type: 'compose' },
listStage: [] listStage: []
// theoryLearnList: [
// { title: '', id: 121, percent: 86 },
// { title: '', id: 122, percent: 42 },
// { title: '', id: 123, percent: 66 },
// { title: '', id: 124, percent: 13 }
// ],
// theoryPracList: [
// { title: '', id: 141, ifPrac: false },
// { title: '', id: 142, ifPrac: true },
// { title: '', id: 143, ifPrac: true },
// { title: '', id: 144, ifPrac: false }
// ],
// theoryExamList: [
// { title: '', id: 161, ifExam: false, time: '00:34:21' },
// { title: '', id: 162, ifExam: true, time: '00:34:21' },
// { title: '', id: 163, ifExam: true, time: '00:34:21' },
// { title: '', id: 164, ifExam: false, time: '00:34:21' }
// ],
// commentList: [
// { username: '', avatar: '/static/eduImg/avatar.jpg', cont: '西' },
// { username: '', avatar: '/static/eduImg/avatar.jpg', cont: '' },
// { username: '', avatar: '/static/eduImg/avatar.jpg', cont: '+3' },
// {
// username: '',
// avatar: '/static/eduImg/avatar.jpg',
// cont: ''
// }
// ]
} }
}, },
onLoad(params) { onLoad(params) {
@ -342,6 +254,9 @@ export default {
const validityDate = item.examMsg.validityDate.split('~') const validityDate = item.examMsg.validityDate.split('~')
const startDate = new Date(validityDate[0].trim()) const startDate = new Date(validityDate[0].trim())
const endDate = new Date(validityDate[1].trim()) const endDate = new Date(validityDate[1].trim())
console.log('🚀 ~ 时间 ~ date:', date)
console.log('🚀 ~ 时间 ~ startDate:', startDate)
console.log('🚀 ~ 时间 ~ endDate:', endDate)
if (date < startDate || date > endDate) { if (date < startDate || date > endDate) {
uni.showToast({ uni.showToast({
title: '当前时间不在考试时间范围内', title: '当前时间不在考试时间范围内',
@ -413,7 +328,7 @@ export default {
::v-deep .u-cell__body { ::v-deep .u-cell__body {
padding: 5px !important; padding: 5px !important;
} }
::v-deep .u-collapse-item__content__text{ ::v-deep .u-collapse-item__content__text {
padding: 0 5px !important; padding: 0 5px !important;
} }
@ -422,10 +337,12 @@ export default {
height: 100vh; height: 100vh;
background-color: #f8f8f8; background-color: #f8f8f8;
box-sizing: border-box; box-sizing: border-box;
padding: 5vw 5px; padding: 5vw 10px;
position: relative; position: relative;
font-style: 20px;
.item-stage { .item-stage {
height: 50px;
margin: 8px 0; margin: 8px 0;
font-size: 16px; font-size: 16px;
display: flex; display: flex;
@ -436,13 +353,20 @@ export default {
.proj-cont { .proj-cont {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
padding: 30rpx 20rpx; padding: 30rpx 0;
background-color: #fff; background-color: #fff;
border-radius: 20rpx; border-radius: 20rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
box-shadow: #f4f4f4 2px 2px; box-shadow: #f4f4f4 2px 2px;
.slot-item-title {
margin-left: 10px;
height: 45px;
line-height: 45px;
font-size: 18px;
}
.user-info { .user-info {
width: 100%; width: 100%;
/* height: 8vh; */ /* height: 8vh; */
@ -452,6 +376,7 @@ export default {
margin-bottom: 2vh; margin-bottom: 2vh;
.training-content { .training-content {
margin: 0 10px;
display: flex; display: flex;
margin-top: 10px; margin-top: 10px;
white-space: normal; white-space: normal;
@ -518,6 +443,8 @@ export default {
} }
.list-wrapper { .list-wrapper {
padding: 10px;
min-height: 90px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
@ -525,11 +452,12 @@ export default {
margin-bottom: 10px; margin-bottom: 10px;
padding-bottom: 5px; padding-bottom: 5px;
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
font-size: 12px;
color: #b0b0b0; color: #b0b0b0;
/* height: 400px; */ /* height: 400px; */
background-color: #e6f0fa;
overflow: auto; overflow: auto;
.left-content { .left-content {
font-size: 18px;
width: 50vw; width: 50vw;
.title { .title {
display: flex; display: flex;
@ -537,8 +465,8 @@ export default {
} }
.note { .note {
/* width: 130px; */ /* width: 130px; */
margin-top: 10px; margin-top: 15px;
font-size: 14px; margin-bottom: 10px;
color: #333; color: #333;
word-wrap: break-word; word-wrap: break-word;
} }