YNUtdPlatform/pages/YNEduApp/learnProj/learnProjDetail.vue

429 lines
12 KiB
Vue
Raw Normal View History

2024-08-08 11:25:33 +08:00
<template>
2024-08-15 17:47:52 +08:00
<view class="page">
<u-navbar title="学习项目" @leftClick="leftClick" placeholder />
2024-08-08 11:25:33 +08:00
<view class="proj-cont">
<h2 style="margin-bottom: 15rpx">这是标题</h2>
2024-08-15 17:47:52 +08:00
<span style="font-size: 12px; color: #b0b0b0">合格标准学习进度完成100%考试及格一场练习通过一场</span>
2024-08-08 11:25:33 +08:00
<view class="user-info">
<view class="info-lef">
<view class="avatar">
<image src="/static/eduImg/avatar.jpg"></image>
<span style="font-size: 18px">马晓峰</span>
</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>6</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>
2024-08-15 17:47:52 +08:00
<view class="tip">已开启进度同步其他途径的学习进度已自动同步</view>
2024-08-08 11:25:33 +08:00
<uni-collapse>
<uni-collapse-item title="理论学习">
<uni-list>
2024-08-19 17:53:53 +08:00
<div
class="list-wrapper"
2024-08-15 17:47:52 +08:00
v-for="(item, index) in theoryLearnList"
2024-08-19 17:53:53 +08:00
:key="index"
2024-08-15 17:47:52 +08:00
@click="toggleTheoryLearn(item.id)"
2024-08-08 14:26:57 +08:00
>
2024-08-19 17:53:53 +08:00
<div class="left-content">
<div class="title">
<u-icon name="/static/images/课程.png" size="15" />
<div style="margin: 0 15px 0 3px">课程</div>
<div>{{ item.time }}</div>
</div>
<div class="note">{{ item.title }}</div>
</div>
<div class="right-content">
<div class="progress">
<u-line-progress :percentage="item.percent" :showText="false" activeColor="#579AF8" height="8" />
</div>
<div>{{ item.percent }}%</div>
</div>
</div>
2024-08-08 11:25:33 +08:00
</uni-list>
</uni-collapse-item>
<uni-collapse-item title="理论练习">
<uni-list>
2024-08-19 17:53:53 +08:00
<div
class="list-wrapper"
2024-08-15 17:47:52 +08:00
v-for="(item, index) in theoryPracList"
2024-08-19 17:53:53 +08:00
:key="index"
2024-08-15 17:47:52 +08:00
@click="toggleTheoryPrac(item.id)"
2024-08-19 17:53:53 +08:00
>
<div class="left-content">
<div class="title">
<u-icon name="/static/images/练习.png" size="15" />
<div style="margin: 0 15px 0 3px">练习</div>
</div>
<div class="note">{{ item.title }}</div>
</div>
<div class="right-content">{{ item.ifExam ? '已练习' : '未练习' }}</div>
</div>
2024-08-08 11:25:33 +08:00
</uni-list>
</uni-collapse-item>
<uni-collapse-item title="理论模拟考试">
<uni-list>
2024-08-19 17:53:53 +08:00
<div
class="list-wrapper"
2024-08-15 17:47:52 +08:00
v-for="(item, index) in theoryExamList"
2024-08-19 17:53:53 +08:00
:key="index"
2024-08-15 17:47:52 +08:00
@click="toggleTheoryExam(item.id)"
2024-08-19 17:53:53 +08:00
>
<div class="left-content">
<div class="title">
<u-icon name="/static/images/考试.png" size="15" />
<div style="margin: 0 15px 0 3px">考试</div>
<div>{{ item.time }}</div>
</div>
<div class="note">{{ item.title }}</div>
</div>
<div class="right-content">{{ item.ifExam ? '已完成' : '未完成' }}</div>
</div>
2024-08-08 11:25:33 +08:00
</uni-list>
</uni-collapse-item>
<uni-collapse-item title="实操题目练习">
<uni-list>
2024-08-15 17:47:52 +08:00
<uni-list-item title="练习" note="高压电取证理论学习" showArrow></uni-list-item>
2024-08-08 11:25:33 +08:00
</uni-list>
</uni-collapse-item>
</uni-collapse>
</view>
<view class="comment-area">
2024-08-08 14:26:57 +08:00
<h2 style="margin-bottom: 15rpx">最新评论 ({{ commentList.length }})</h2>
2024-08-08 11:25:33 +08:00
<view class="write-cmt">
2024-08-19 17:53:53 +08:00
<!-- <uni-icons style="color: #9b9b9b; margin-right: 1vw" type="compose" size="12"></uni-icons>
写评论 -->
<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
/>
2024-08-08 11:25:33 +08:00
</view>
2024-08-15 17:47:52 +08:00
<view class="cmts" v-for="(item, index) in commentList" :key="index">
2024-08-08 11:25:33 +08:00
<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>
2024-08-15 17:47:52 +08:00
<uni-icons style="color: #1989fa; margin-right: 1vw" type="chat-filled" size="24"></uni-icons>
2024-08-08 11:25:33 +08:00
<span>23</span>
</view>
<view>
2024-08-15 17:47:52 +08:00
<uni-icons style="color: #1989fa; margin-right: 1vw" type="hand-up-filled" size="24"></uni-icons>
2024-08-08 11:25:33 +08:00
<span>12</span>
</view>
</view>
<view class="learn-btn">继续学习</view>
</view>
2024-08-15 17:47:52 +08:00
</view>
2024-08-08 11:25:33 +08:00
</template>
<script>
2024-08-15 17:47:52 +08:00
export default {
data() {
return {
projId: '',
starRate: 4,
learnIconObj: { color: '#1A63AC', size: '18', type: 'calendar' },
pracIconObj: { color: '#38B022', size: '18', type: 'compose' },
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: [
2024-08-19 17:53:53 +08:00
{ 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' }
2024-08-15 17:47:52 +08:00
],
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: '我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了我着火了'
}
]
}
},
2024-08-19 17:53:53 +08:00
onLoad(params) {
this.projId = params.id
console.log(this.projId)
},
2024-08-15 17:47:52 +08:00
methods: {
toggleTheoryLearn(id) {
console.log(id)
uni.navigateTo({
url: '/pages/YNEduApp/learn/learn?id=' + id
})
},
toggleTheoryPrac(id) {
console.log(id)
uni.navigateTo({
2024-08-19 17:53:53 +08:00
url: '/pages/YNEduApp/prac/pracDetail?id=' + id
2024-08-15 17:47:52 +08:00
})
2024-08-19 17:53:53 +08:00
uni.removeStorageSync('from')
uni.setStorageSync('from', '/pages/YNEduApp/learnProj/learnProjDetail')
2024-08-08 11:25:33 +08:00
},
2024-08-15 17:47:52 +08:00
toggleTheoryExam(id) {
console.log(id)
uni.navigateTo({
url: '/pages/YNEduApp/exam/beforeExam?id=' + id
})
uni.removeStorageSync('from')
uni.setStorageSync('from', '/pages/YNEduApp/learnProj/learnProjDetail')
},
leftClick() {
uni.navigateTo({
url: '/pages/YNEduApp/learnProj/learnProj'
})
}
}
}
2024-08-08 11:25:33 +08:00
</script>
<style lang="scss">
2024-08-15 17:47:52 +08:00
.page {
width: 100vw;
background-color: #f8f8f8;
box-sizing: border-box;
padding: 5vw;
position: relative;
.proj-cont {
width: 100%;
2024-08-08 11:25:33 +08:00
box-sizing: border-box;
2024-08-15 17:47:52 +08:00
padding: 30rpx 20rpx;
background-color: #fff;
border-radius: 20rpx;
display: flex;
flex-direction: column;
box-shadow: #f4f4f4 2px 2px;
.user-info {
2024-08-08 11:25:33 +08:00
width: 100%;
2024-08-15 17:47:52 +08:00
height: 8vh;
2024-08-08 11:25:33 +08:00
display: flex;
2024-08-15 17:47:52 +08:00
margin-top: 2vh;
2024-08-08 11:25:33 +08:00
2024-08-15 17:47:52 +08:00
.info-lef {
width: 35%;
height: 100%;
2024-08-08 11:25:33 +08:00
display: flex;
2024-08-15 17:47:52 +08:00
flex-direction: column;
justify-content: space-around;
2024-08-08 11:25:33 +08:00
2024-08-15 17:47:52 +08:00
.avatar {
width: 100%;
2024-08-08 11:25:33 +08:00
display: flex;
2024-08-15 17:47:52 +08:00
align-items: center;
2024-08-08 11:25:33 +08:00
2024-08-15 17:47:52 +08:00
image {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
margin-right: 1.5vw;
2024-08-08 11:25:33 +08:00
}
}
2024-08-15 17:47:52 +08:00
}
2024-08-08 11:25:33 +08:00
2024-08-15 17:47:52 +08:00
.info-rig {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-around;
box-sizing: border-box;
color: #b0b0b0;
2024-08-08 11:25:33 +08:00
2024-08-15 17:47:52 +08:00
.rig-up {
2024-08-08 11:25:33 +08:00
display: flex;
2024-08-15 17:47:52 +08:00
align-items: center;
2024-08-08 11:25:33 +08:00
2024-08-15 17:47:52 +08:00
view {
span {
padding: 0 1vw;
2024-08-08 11:25:33 +08:00
}
}
}
}
}
2024-08-15 17:47:52 +08:00
.tip {
width: 100%;
margin: 2vh auto;
background-color: #f7f7f7;
font-size: 12px;
color: #9b9b9b;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
padding: 25rpx 15rpx;
}
2024-08-19 17:53:53 +08:00
.list-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 10px;
border-bottom: 1px solid #f0f0f0;
font-size: 12px;
color: #b0b0b0;
.left-content {
.title {
display: flex;
align-items: center;
}
.note {
margin-top: 10px;
font-size: 14px;
color: #333;
}
}
.right-content {
display: flex;
align-items: center;
.progress {
width: 100px;
margin-right: 5px;
}
}
}
2024-08-15 17:47:52 +08:00
}
2024-08-08 11:25:33 +08:00
2024-08-15 17:47:52 +08:00
.comment-area {
width: 100%;
box-sizing: border-box;
margin: 1vh auto;
padding: 30rpx 20rpx 5vh 20rpx;
background-color: #fff;
border-radius: 20rpx;
display: flex;
flex-direction: column;
box-shadow: #f4f4f4 2px 2px;
.write-cmt {
2024-08-08 11:25:33 +08:00
width: 100%;
2024-08-15 17:47:52 +08:00
margin: 2vh auto;
background-color: #f7f7f7;
font-size: 12px;
color: #9b9b9b;
display: flex;
align-items: center;
2024-08-08 11:25:33 +08:00
box-sizing: border-box;
2024-08-15 17:47:52 +08:00
padding: 15rpx;
}
.cmts {
width: 100%;
2024-08-08 11:25:33 +08:00
display: flex;
flex-direction: column;
2024-08-15 17:47:52 +08:00
margin-bottom: 2vh;
2024-08-08 11:25:33 +08:00
2024-08-15 17:47:52 +08:00
.cmt-up {
2024-08-08 11:25:33 +08:00
display: flex;
align-items: center;
2024-08-15 17:47:52 +08:00
font-weight: bold;
2024-08-08 11:25:33 +08:00
2024-08-15 17:47:52 +08:00
image {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
margin-right: 2vw;
2024-08-08 11:25:33 +08:00
}
}
2024-08-15 17:47:52 +08:00
.cmt-dn {
box-sizing: border-box;
padding-left: calc(60rpx + 2vw);
}
2024-08-08 11:25:33 +08:00
}
2024-08-15 17:47:52 +08:00
}
2024-08-08 11:25:33 +08:00
2024-08-15 17:47:52 +08:00
.btm-sticky {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 8vh;
background-color: #fff;
border-top: 1px solid #d8d8d8;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 0 5vw;
2024-08-08 11:25:33 +08:00
2024-08-15 17:47:52 +08:00
.icons {
width: 40%;
2024-08-08 11:25:33 +08:00
display: flex;
justify-content: space-between;
2024-08-15 17:47:52 +08:00
view {
2024-08-08 11:25:33 +08:00
display: flex;
align-items: center;
2024-08-15 17:47:52 +08:00
span {
font-size: 16px;
color: #1a89fa;
font-weight: bold;
}
2024-08-08 11:25:33 +08:00
}
}
2024-08-15 17:47:52 +08:00
.learn-btn {
width: 30%;
height: 60%;
background-color: #1a89fa;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
font-size: 14px;
border-radius: 50rpx;
}
2024-08-08 11:25:33 +08:00
}
2024-08-15 17:47:52 +08:00
}
2024-08-08 11:25:33 +08:00
</style>