Commit dc719d4d by 李伟康

Merge branch 'SAAS+V5.5.0' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V5.5.0

2 parents e41e0a62 34c2de92
......@@ -461,7 +461,7 @@ module.exports = {
// 新 学习中心 - 开始测评
startExam(data) {
return http.post({
method: 'dj.pad.api.staff.study.exam.start',
method: 'dj.api.pad.learning.center.level.exam',
projectName: 'pad',
...data
})
......@@ -506,4 +506,36 @@ module.exports = {
...data
})
},
// 新学习中心 - 全部课程
getALlCourse(data) {
return http.post({
method: 'dj.pad.api.recommended.course.page',
projectName: 'pad',
...data
})
},
// 新学习中心 - 课程分类树
getCourseCategoryTree(data = {}) {
return http.post({
method: 'dj.pad.api.course.category.list.tree',
projectName: 'pad',
...data
})
},
// 新学习中心 - 员工学习中心剩余时间
getStudyCenterResidueTime(data={}) {
return http.post({
method: 'dj.api.pad.learning.center.residue.time',
projectName: 'pad',
...data
})
},
// 新学习中心 - 查询我的课程页签数量
getMyCourseTabCount(data={}) {
return http.post({
method: 'dj.api.pad.learning.center.myself.course.count',
projectName: 'pad',
...data
})
}
}
......@@ -143,6 +143,8 @@
background-position: calc(100vmin * (1173 / 768) * -0.2659846547314578) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-front-window { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.28601875532821824) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-green-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.16027280477408354) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-home-active { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763);
background-position: calc(100vmin * (1173 / 768) * 0) calc(100vmin * (1173 / 768) * -0.5400682011935208);}
.icon-home { width: calc(100vmin * (1173 / 768) * 0.04774083546462063); height: calc(100vmin * (1173 / 768) * 0.04774083546462063);
......@@ -202,7 +204,7 @@
.icon-logo { width: calc(100vmin * (1173 / 768) * 0.06820119352088662); height: calc(100vmin * (1173 / 768) * 0.06820119352088662);
background-position: calc(100vmin * (1173 / 768) * -0.5647911338448423) calc(100vmin * (1173 / 768) * -0.10017050298380221);}
.icon-lssl-icon { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.16027280477408354) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
background-position: calc(100vmin * (1173 / 768) * -0.17860187553282184) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-mask-del { width: calc(100vmin * (1173 / 768) * 0.03410059676044331); height: calc(100vmin * (1173 / 768) * 0.03410059676044331);
background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.3614663256606991);}
.icon-mask-edit { width: calc(100vmin * (1173 / 768) * 0.03410059676044331); height: calc(100vmin * (1173 / 768) * 0.03410059676044331);
......@@ -219,6 +221,8 @@
background-position: calc(100vmin * (1173 / 768) * -0.15302642796248933) calc(100vmin * (1173 / 768) * 0);}
.icon-no-picture { width: calc(100vmin * (1173 / 768) * 0.021312872975277068); height: calc(100vmin * (1173 / 768) * 0.021312872975277068);
background-position: calc(100vmin * (1173 / 768) * -0.7020460358056266) calc(100vmin * (1173 / 768) * -0.08567774936061381);}
.icon-normal { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.1969309462915601) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-notice-script { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
background-position: calc(100vmin * (1173 / 768) * -0.3312020460358056) calc(100vmin * (1173 / 768) * -0.5907928388746803);}
.icon-notice-study { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
......@@ -310,7 +314,7 @@
.icon-role-2 { width: calc(100vmin * (1173 / 768) * 0.028985507246376812); height: calc(100vmin * (1173 / 768) * 0.028985507246376812);
background-position: calc(100vmin * (1173 / 768) * -0.1466325660699062) calc(100vmin * (1173 / 768) * -0.6381074168797954);}
.icon-rule { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.17860187553282184) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
background-position: calc(100vmin * (1173 / 768) * -0.21526001705029837) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-scan { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.5865302642796248) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-scanIcon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
......@@ -360,7 +364,7 @@
.icon-study-active { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763);
background-position: calc(100vmin * (1173 / 768) * -0.2028985507246377) calc(100vmin * (1173 / 768) * -0.5400682011935208);}
.icon-study-tips { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.1969309462915601) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
background-position: calc(100vmin * (1173 / 768) * -0.23358908780903667) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-study { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763);
background-position: calc(100vmin * (1173 / 768) * -0.2536231884057971) calc(100vmin * (1173 / 768) * -0.5400682011935208);}
.icon-submit { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
......@@ -376,7 +380,7 @@
.icon-tag-checked { width: calc(100vmin * (1173 / 768) * 0.02557544757033248); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.4151747655583973) calc(100vmin * (1173 / 768) * -0.4113384484228474);}
.icon-task-pass { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.21526001705029837) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
background-position: calc(100vmin * (1173 / 768) * -0.25191815856777494) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-tdcj-icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.023444160272804774) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-time-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
......@@ -401,6 +405,11 @@
background-position: calc(100vmin * (1173 / 768) * -0.08013640238704177) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-two-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.010230179028132993);
background-position: calc(100vmin * (1173 / 768) * -0.2885763000852515) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
<<<<<<< HEAD
=======
.icon-up-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.27024722932651324) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
>>>>>>> 34c2de92db21e1379e36b7dc81196e3b65332eee
.icon-upload-play { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.07033248081841433) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-uploadAdd { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986);
......@@ -417,6 +426,7 @@
background-position: calc(100vmin * (1173 / 768) * -0.18414322250639387) calc(100vmin * (1173 / 768) * -0.6751918158567775);}
.icon-zj-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.1402387041773231) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
<<<<<<< HEAD
.icon-green-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.23358908780903667) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
.icon-normal { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
......@@ -424,4 +434,8 @@
.icon-pdf-xl { width: calc(100vmin * (1173 / 768) * 0.04774083546462063); height: calc(100vmin * (1173 / 768) * 0.04774083546462063);
background-position: calc(100vmin * (1173 / 768) * -0.27408354646206307) calc(100vmin * (1173 / 768) * -0.4825234441602728);}
.icon-up-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.27024722932651324) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
\ No newline at end of file
background-position: calc(100vmin * (1173 / 768) * -0.27024722932651324) calc(100vmin * (1173 / 768) * -0.6986359761295823);}
=======
.icon-pdf-xl { width: calc(100vmin * (1173 / 768) * 0.04774083546462063); height: calc(100vmin * (1173 / 768) * 0.04774083546462063);
background-position: calc(100vmin * (1173 / 768) * -0.27408354646206307) calc(100vmin * (1173 / 768) * -0.4825234441602728);}
>>>>>>> 34c2de92db21e1379e36b7dc81196e3b65332eee

3.46 KB | W: | H:

3.11 KB | W: | H:

assets/images/studyCenter/Elective.png
assets/images/studyCenter/Elective.png
assets/images/studyCenter/Elective.png
assets/images/studyCenter/Elective.png
  • 2-up
  • Swipe
  • Onion skin

3.66 KB | W: | H:

3.63 KB | W: | H:

assets/images/studyCenter/Required.png
assets/images/studyCenter/Required.png
assets/images/studyCenter/Required.png
assets/images/studyCenter/Required.png
  • 2-up
  • Swipe
  • Onion skin
<!-- 学习中心首页 - 全部课程 -->
<template>
<view class="recommend-course">
<scroll-view scroll-y ref="scrollViewRef" :scroll-top="scrollTop" @scrolltolower="pageonReachBottom"
......@@ -93,7 +94,7 @@ export default {
}
},
mounted() {
this.getCourseTaskPage()
this.getALlCourse()
this.asyncfindBeiSenSSOToken()
},
methods: {
......@@ -114,19 +115,19 @@ export default {
}
},
// 获取我的任务接口, completeStatus: 完成状态 0=待完成 1=已完成, courseType: 课程类型 1=短课程 2=长课程
async getCourseTaskPage() {
async getALlCourse() {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const params = {
recommendStatus: 1, // 推荐状态 0=无推荐 1=推荐课程
staffPhone: uni.$storage.get('userInfo').phone, // 推荐状态 0=无推荐 1=推荐课程
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getCourseTaskPage(params)
const res = await uni.$api.commonApi.getALlCourse(params)
console.log(res, '全部课程')
// 临时添加测试数据字段
const listWithTestData = res.list.map((item, index) => ({
...item,
......@@ -157,7 +158,7 @@ export default {
let { pageNum, total, nothing = 'nothing', pageSize } = this;
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1;
this.getCourseTaskPage()
this.getALlCourse()
} else {
this.nothing = true;
}
......@@ -178,8 +179,9 @@ export default {
</script>
<style lang="scss" scoped>
.recommend-course {
height: calc(100% - #{toRpx(100)});
padding-bottom: toRpx(100);
height: calc(100% - #{toRpx(300)});
// padding-bottom: toRpx(100);
.scroll-view {
margin-top: toRpx(40);
height: calc(100% - #{toRpx(70)});
......@@ -193,7 +195,7 @@ export default {
&.fixed-width {
grid-template-columns: repeat(4, toRpx(530));
justify-content: center;
.recommend-course-item {
width: toRpx(530) !important;
max-width: toRpx(530);
......@@ -274,6 +276,7 @@ export default {
align-items: center;
font-size: toRpx(24);
color: #666666;
.duration-value {
color: #999ea8;
font-size: toRpx(24);
......@@ -348,7 +351,7 @@ export default {
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(380);
margin-top: toRpx(280);
font-size: toRpx(28);
color: #999999;
......@@ -362,7 +365,7 @@ export default {
.end-text {
color: #999;
text-align: center;
padding: toRpx(30) 0;
padding: toRpx(30) 0 toRpx(50);
font-size: toRpx(24);
}
......
......@@ -6,42 +6,32 @@
<view class="exam-list" :class="{ 'fixed-width': cardWidth > 0 }">
<view class="exam-item" v-for="(item, index) in examList" :key="index"
@click="viewExam(item, index)" :style="cardWidth > 0 ? `width: ${cardWidth}rpx` : ''">
<!-- 左上角:必修/选修标签 -->
<image v-if="item.required !== undefined" class="exam-tag-left"
:src="item.required ? require('@/assets/images/studyCenter/Required.png') : require('@/assets/images/studyCenter/Elective.png')"
mode="aspectFit" />
<!-- 右上角:文档/视频标签 -->
<view v-if="item.examType" class="exam-tag-right">
<text class="tag-text">{{ item.examType === 'video' ? '视频' : '文档' }}</text>
</view>
<image class="exam-item-img"
src="../../../../assets/images/common/recommend-course-default.webp" mode="scaleToFill" />
src="../../../../assets/images/common/course-default-bg.webp" mode="scaleToFill" />
<view class="exam-content">
<view class="exam-item-title">
{{ item.courseName || item.examName }}
{{ item.title }}
</view>
<view class="exam-item-text">
<text class="duration-value">考试时间</text>
<text>{{ (item.totalDuration || item.totalDuration === 0) ?
`${item.totalDuration}min` : '-' }} | 20题</text>
<text>{{ filterValue(item.duration, 'min') }} | {{ filterValue(item.questionCount, '题') }}</text>
</view>
<!-- 考试次数 -->
<view class="exam-times">
<text class="times-value">剩余考试次数</text>
<text>{{ item.examCount || 0 }}次</text>
<text>{{ filterValue(item.remainingTimes) }}/{{ filterValue(item.examTimes) }}次</text>
</view>
<!-- 最高得分 -->
<view class="exam-score">
<text class="score-label">最高得分</text>
<text class="score-value failed">{{ item.highestScore || 0 }}分|未通过</text>
<text class="score-value failed">{{ filterValue(item.highestScore, '分') }}|未通过</text>
</view>
<!-- 重新考试按钮 -->
<view class="retake-btn" @click.stop="retakeExam(item)">
<view v-if="item.remainingTimes > 0" class="retake-btn" @click.stop="retakeExam(item)">
<text class="retake-text">重新考试</text>
</view>
</view>
......@@ -50,7 +40,7 @@
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
<image class="icon" src="../../../../assets/images/common/noData.png" />
暂无数据
</view>
</template>
......@@ -62,6 +52,7 @@
</template>
<script>
import utils from '@/utils/utils'
export default {
name: 'FailedExam',
props: {
......@@ -93,47 +84,33 @@ export default {
this.getExamList()
},
methods: {
// val:判断的值,unit单位
filterValue(val, unit) {
return utils.filterValue(val, unit)
},
async getExamList() {
console.log(22)
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const params = {
examStatus: 'failed', // 未通过
examResult: 2, // 不通过
pageNum,
pageSize
pageSize,
staffPhone: uni.$storage.get('userInfo').phone
}
// TODO: 替换为实际的考试列表接口
// const res = await this.$http.post({ method: 'exam.list', ...params })
// 临时测试数据
const mockData = [
{
id: 3,
examName: '产品知识考试',
courseName: '产品知识考试',
totalDuration: 50,
required: true,
examType: 'document',
examCount: 1,
highestScore: 50
},
{
id: 4,
examName: '销售技巧考试',
courseName: '销售技巧考试',
totalDuration: 40,
required: false,
examType: 'video',
examCount: 2,
highestScore: 45
}
]
this.examList = [...this.examList, ...mockData]
const res = await uni.$api.commonApi.getExamPage(params)
console.log(res)
if (pageNum == 1) {
this.examList = res.list.concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list)
} else {
this.examList = this.examList.concat(res.list)
}
this.total = res.total
this.nothing = this.examList.length >= this.total && this.pageNum > 1
uni.hideLoading()
} catch (err) {
console.log(err)
......@@ -164,17 +141,16 @@ export default {
<style lang="scss" scoped>
.failed-exam {
width: 100%;
height: 100%;
.scroll-view {
height: 100%;
max-height: toRpx(1225);
}
.exam-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(32);
padding: 0 toRpx(40) toRpx(32);
font-size: 0;
&.fixed-width {
grid-template-columns: repeat(4, toRpx(530));
......@@ -197,51 +173,13 @@ export default {
background: #ffffff;
position: relative;
// 左上角标签
.exam-tag-left {
position: absolute;
left: 0;
top: 0;
width: toRpx(94);
height: toRpx(48);
border-radius: toRpx(24) 0 toRpx(20) 0;
z-index: 2;
}
// 右上角标签
.exam-tag-right {
position: absolute;
right: toRpx(16);
top: toRpx(16);
width: toRpx(72);
height: toRpx(40);
border-radius: toRpx(4);
background: rgba(0, 0, 0, 0.35);
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
.tag-text {
width: toRpx(48);
height: toRpx(36);
opacity: 1;
color: #ffffff;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(36);
}
}
.exam-item-img {
width: 100%;
height: toRpx(240);
height: toRpx(180);
}
.exam-content {
padding: toRpx(24) toRpx(24) toRpx(32);
padding: toRpx(32);
.exam-item-title {
width: 100%;
......@@ -249,7 +187,6 @@ export default {
color: #292d33;
font-size: toRpx(30);
font-weight: 500;
font-family: "HarmonyOSSansSC";
line-height: toRpx(36);
display: -webkit-box;
-webkit-box-orient: vertical;
......@@ -265,14 +202,14 @@ export default {
align-items: center;
margin-bottom: toRpx(12);
height: toRpx(36);
color: #999ea8;
color: #666;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
line-height: toRpx(36);
.duration-value {
margin-right: toRpx(8);
margin-right: toRpx(24);
color: #999ea8;
}
}
......@@ -282,14 +219,14 @@ export default {
align-items: center;
margin-bottom: toRpx(12);
height: toRpx(36);
color: #999ea8;
color: #666;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
line-height: toRpx(36);
.times-value {
margin-right: toRpx(8);
margin-right: toRpx(24);
color: #999ea8;
}
}
......@@ -297,28 +234,20 @@ export default {
.exam-score {
display: flex;
align-items: center;
margin-bottom: toRpx(12);
margin-bottom: toRpx(20);
font-size: toRpx(24);
font-weight: 400;
.score-label {
width: toRpx(96);
height: toRpx(36);
opacity: 1;
color: #999ea8;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: left;
line-height: toRpx(36);
margin-right: toRpx(24);
}
.score-value {
width: toRpx(346.5);
height: toRpx(36);
opacity: 1;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: left;
line-height: toRpx(36);
......@@ -341,13 +270,12 @@ export default {
cursor: pointer;
.retake-text {
width: toRpx(104);
// width: toRpx(104);
height: toRpx(32);
opacity: 1;
color: #3b73ff;
font-size: toRpx(26);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(32);
}
......@@ -361,14 +289,13 @@ export default {
align-items: center;
justify-content: center;
flex-direction: column;
height: toRpx(600);
height: toRpx(1000);
color: #999999;
font-size: toRpx(28);
font-size: toRpx(24);
.icon {
width: toRpx(400);
height: toRpx(400);
margin-bottom: toRpx(40);
width: toRpx(344);
height: toRpx(208);
}
}
......
......@@ -6,38 +6,27 @@
<view class="exam-list" :class="{ 'fixed-width': cardWidth > 0 }">
<view class="exam-item" v-for="(item, index) in examList" :key="index"
@click="viewExam(item, index)" :style="cardWidth > 0 ? `width: ${cardWidth}rpx` : ''">
<!-- 左上角:必修/选修标签 -->
<image v-if="item.required !== undefined" class="exam-tag-left"
:src="item.required ? require('@/assets/images/studyCenter/Required.png') : require('@/assets/images/studyCenter/Elective.png')"
mode="aspectFit" />
<!-- 右上角:文档/视频标签 -->
<view v-if="item.examType" class="exam-tag-right">
<text class="tag-text">{{ item.examType === 'video' ? '视频' : '文档' }}</text>
</view>
<image class="exam-item-img"
src="../../../../assets/images/common/recommend-course-default.webp" mode="scaleToFill" />
src="../../../../assets/images/common/course-default-bg.webp" mode="scaleToFill" />
<view class="exam-content">
<view class="exam-item-title">
{{ item.courseName || item.examName }}
{{ item.title }}
</view>
<view class="exam-item-text">
<text class="duration-value">考试时间</text>
<text>{{ (item.totalDuration || item.totalDuration === 0) ?
`${item.totalDuration}min` : '-' }} | 20题</text>
<text>{{ filterValue(item.duration, 'min') }} | {{ filterValue(item.questionCount, '题') }}</text>
</view>
<!-- 考试次数 -->
<view class="exam-times">
<text class="times-value">剩余考试次数</text>
<text>{{ item.examCount || 0 }}次</text>
<text>{{ filterValue(item.remainingTimes) }}/{{ filterValue(item.examTimes) }}次</text>
</view>
<!-- 最高得分 -->
<view class="exam-score">
<text class="score-label">最高得分</text>
<text class="score-value passed">{{ item.highestScore || 0 }}分|已通过</text>
<text class="score-value passed">{{ filterValue(item.highestScore, '分') }}|已通过</text>
</view>
<!-- 重新考试按钮 -->
......@@ -50,7 +39,7 @@
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
<image class="icon" src="../../../../assets/images/common/noData.png" />
暂无数据
</view>
</template>
......@@ -62,6 +51,7 @@
</template>
<script>
import utils from '@/utils/utils'
export default {
name: 'PassedExam',
props: {
......@@ -93,87 +83,33 @@ export default {
this.getExamList()
},
methods: {
// val:判断的值,unit单位
filterValue(val, unit) {
return utils.filterValue(val, unit)
},
async getExamList() {
console.log(11)
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const params = {
examStatus: 'passed', // 已通过
examResult: 1, // 已通过
pageNum,
pageSize
pageSize,
staffPhone: uni.$storage.get('userInfo').phone
}
// TODO: 替换为实际的考试列表接口
// const res = await this.$http.post({ method: 'exam.list', ...params })
// 临时测试数据
const mockData = [
{
id: 1,
examName: '安全生产考试',
courseName: '安全生产考试',
totalDuration: 60,
required: true,
examType: 'document',
examCount: 3,
highestScore: 85
},
{
id: 2,
examName: '服务礼仪考试',
courseName: '服务礼仪考试',
totalDuration: 45,
required: false,
examType: 'video',
examCount: 2,
highestScore: 92
},
{
id: 1,
examName: '安全生产考试',
courseName: '安全生产考试',
totalDuration: 60,
required: true,
examType: 'document',
examCount: 3,
highestScore: 85
},
{
id: 2,
examName: '服务礼仪考试',
courseName: '服务礼仪考试',
totalDuration: 45,
required: false,
examType: 'video',
examCount: 2,
highestScore: 92
},
{
id: 1,
examName: '安全生产考试',
courseName: '安全生产考试',
totalDuration: 60,
required: true,
examType: 'document',
examCount: 3,
highestScore: 85
},
{
id: 2,
examName: '服务礼仪考试',
courseName: '服务礼仪考试',
totalDuration: 45,
required: false,
examType: 'video',
examCount: 2,
highestScore: 92
}
]
this.examList = [...this.examList, ...mockData]
const res = await uni.$api.commonApi.getExamPage(params)
console.log(res)
if (pageNum == 1) {
this.examList = res.list.concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list).concat(res.list)
} else {
this.examList = this.examList.concat(res.list)
}
this.total = res.total
this.nothing = this.examList.length >= this.total && this.pageNum > 1
uni.hideLoading()
} catch (err) {
console.log(err)
......@@ -204,17 +140,18 @@ export default {
<style lang="scss" scoped>
.passed-exam {
width: 100%;
height: 100%;
// max-height: toRpx(1200);
.scroll-view {
height: 100%;
max-height: toRpx(1225);
}
.exam-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(32);
padding: 0 toRpx(40) toRpx(32);
// padding: 0 toRpx(40) toRpx(32);
font-size: 0;
&.fixed-width {
grid-template-columns: repeat(4, toRpx(530));
......@@ -237,51 +174,13 @@ export default {
background: #ffffff;
position: relative;
// 左上角标签
.exam-tag-left {
position: absolute;
left: 0;
top: 0;
width: toRpx(94);
height: toRpx(48);
border-radius: toRpx(24) 0 toRpx(20) 0;
z-index: 2;
}
// 右上角标签
.exam-tag-right {
position: absolute;
right: toRpx(16);
top: toRpx(16);
width: toRpx(72);
height: toRpx(40);
border-radius: toRpx(4);
background: rgba(0, 0, 0, 0.35);
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
.tag-text {
width: toRpx(48);
height: toRpx(36);
opacity: 1;
color: #ffffff;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(36);
}
}
.exam-item-img {
width: 100%;
height: toRpx(240);
height: toRpx(180);
}
.exam-content {
padding: toRpx(24) toRpx(24) toRpx(32);
padding: toRpx(32);
.exam-item-title {
width: 100%;
......@@ -289,7 +188,6 @@ export default {
color: #292d33;
font-size: toRpx(30);
font-weight: 500;
font-family: "HarmonyOSSansSC";
line-height: toRpx(36);
display: -webkit-box;
-webkit-box-orient: vertical;
......@@ -305,14 +203,14 @@ export default {
align-items: center;
margin-bottom: toRpx(12);
height: toRpx(36);
color: #999ea8;
color: #666;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
line-height: toRpx(36);
.duration-value {
margin-right: toRpx(8);
margin-right: toRpx(24);
color: #999ea8;
}
}
......@@ -322,14 +220,14 @@ export default {
align-items: center;
margin-bottom: toRpx(12);
height: toRpx(36);
color: #999ea8;
color: #666;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
line-height: toRpx(36);
.times-value {
margin-right: toRpx(8);
margin-right: toRpx(24);
color: #999ea8;
}
}
......@@ -337,28 +235,22 @@ export default {
.exam-score {
display: flex;
align-items: center;
margin-bottom: toRpx(12);
margin-bottom: toRpx(20);
font-size: toRpx(24);
font-weight: 400;
.score-label {
width: toRpx(96);
// width: toRpx(96);
height: toRpx(36);
opacity: 1;
color: #999ea8;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: left;
line-height: toRpx(36);
margin-right: toRpx(24);
}
.score-value {
width: toRpx(346.5);
// width: toRpx(346.5);
height: toRpx(36);
opacity: 1;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: left;
line-height: toRpx(36);
......@@ -381,13 +273,12 @@ export default {
cursor: pointer;
.retake-text {
width: toRpx(104);
// width: toRpx(104);
height: toRpx(32);
opacity: 1;
color: #3b73ff;
font-size: toRpx(26);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(32);
}
......@@ -401,14 +292,13 @@ export default {
align-items: center;
justify-content: center;
flex-direction: column;
height: toRpx(600);
height: toRpx(1000);
color: #999999;
font-size: toRpx(28);
font-size: toRpx(24);
.icon {
width: toRpx(400);
height: toRpx(400);
margin-bottom: toRpx(40);
width: toRpx(344);
height: toRpx(208);
}
}
......
<!-- 学习中心首页 - 正在学习 -->
<template>
<view class="task-box">
<scroll-view scroll-y ref="scrollViewRef" :scroll-top="scrollTop" @scrolltolower="pageonReachBottom"
class="task-list-box">
<template v-if="taskList.length">
<view class="task-list">
<view class="task-item" v-for="(item, index) in taskList" :key="index" @click="handleTaskItemClick(item)">
<!-- <view class="time-limit-tag"></view> -->
<!-- 左上角:必修/选修标签 -->
<template v-if="item.planCourseType">
<image class="course-tag-left"
:src="item.planCourseType == 1 ? require('@/assets/images/studyCenter/Required.png') : require('@/assets/images/studyCenter/Elective.png')"
mode="aspectFit" />
</template>
<!-- 右上角:文档/视频标签 -->
<view class="course-tag-right" v-if="item.courseFileType">
<text class="tag-text">{{ COURSE_TYPE[item.courseFileType].name}}</text>
</view>
<image class="task-item-img" :src="require(`@/assets/images/common/${COURSE_TYPE[item.courseFileType].image}.webp`)" mode="aspectFill" />
<view class="task-item-content">
<view class="task-item-title">{{ item.title }}</view>
<view class="task-item-text">
<view class="task-item-label">课程时长</view>
<view class="task-item-value">
{{ (item.totalDuration || item.totalDuration === 0) ? `${item.totalDuration}min` : '-' }}
</view>
</view>
<view class="task-item-text">
<view class="task-item-label">任务进度</view>
<view class="task-item-progress">
<view class="task-item-progress-bar" :style="{ width: Math.floor(item.process) + '%' }"></view>
<view class="task-item-progress-text">{{ Math.floor(item.process) }}%</view>
</view>
</view>
</view>
</view>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
暂无数据
</view>
</template>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template>
</scroll-view>
</view>
</template>
<script>
const COURSE_TYPE = {
10: {
name: '视频',
image: 'short-course-default'
},
80: {
name: '音频',
image: 'course-default-bg'
},
20: {
name: '混合',
image: 'short-course-default'
},
30: {
name: '文档',
image: 'course-default-bg'
},
40: {
name: 'H5',
image: 'course-default-bg'
},
70: {
name: 'URL',
image: 'course-default-bg'
},
120: {
name: '图文',
image: 'course-default-bg'
}
}
import dayjs from 'dayjs'
export default {
name: 'MyTask',
data() {
return {
finishIndex: 2,
nothing: false,
total: 0,
pageNum: 1,
pageSize: 12,
scrollTop: 0,
taskList: [],
COURSE_TYPE
}
},
mounted() {
this.getCourseTaskPage(this.tabIndex)
},
beforeDestroy() {
// 移除事件监听,防止内存泄漏
uni.$off && uni.$off('backStudyCenter');
},
methods: {
// 格式化时间
formatTime(time, formatStr) {
if (!time) return '-';
return dayjs(time).format(formatStr);
},
// 获取正在学习接口, learnStatus: 1, // 学习状态 0:待学习 1: 正在学习 2:已学完
async getCourseTaskPage() {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const params = {
learnStatus: 1, // 学习状态 0:待学习 1: 正在学习 2:已学完
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getMyCourseList(params)
let newList = res.list || [];
if (pageNum == 1) {
this.taskList = newList
} else {
this.taskList = this.taskList.concat(newList)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
pageonReachBottom() {
console.log('到底了');
// 解构赋值,设置 nothing 的默认值
let { pageNum, total, pageSize, tabIndex, finishIndex } = this;
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1;
if (tabIndex == 0) {
this.getCourseTaskPage()
} else {
this.getCourseTaskPage()
}
} else {
this.nothing = true;
}
},
handleTaskItemClick(item) {
console.log(item)
},
findBeiSenSSOToken() {
return new Promise(resolve => {
const url = 'https%3A%2F%2Fcloud.italent.cn%2FPageHome%2FIndex%3Fproduct%3DLearning%26keyName%3DNusion%26pageCode%3DLearningNewHomepage%26appCode%3DLearning%26_qsrcapp%3DLearning%26_qrt%3Dhtml%26quark_s%3D5102bff371c00da5b19968ee53a8c3f1499ecd2447a19f72f3e3ba2390cc9617%23%2FviewDynamic%3Fshadow_context%3D%257BappModel%253A%2522italent%2522%252Cuppid%253A%25221%2522%257D%26quark_s%3D028930f1066f8ef8d28790940d53ae64337f44bde3a44cf89a290e4a3611e3e2'
uni.$api.commonApi.findBeiSenSSOToken({}).then(res => {
uni.$storage.set('beisenToken', res.data)
const studyUrl = res.data ? `${res.data}&return_url=${url}` : ''
resolve(studyUrl)
})
})
},
}
}
</script>
<style lang="scss" scoped>
.task-box {
padding-top: toRpx(32);
height: calc(100% - #{toRpx(100)});
}
.tab-list {
display: flex;
width: toRpx(436);
height: toRpx(80);
background-color: #F5F6F7;
border-radius: toRpx(16);
color: #666666;
font-size: toRpx(28);
.tab-item {
box-sizing: border-box;
display: flex;
flex: 1;
align-items: center;
justify-content: center;
margin: toRpx(6);
&.active {
background-color: #fff;
color: #1A1A1A;
border-radius: toRpx(10);
font-weight: 600;
}
}
}
.tips {
display: flex;
align-items: center;
padding: toRpx(8) toRpx(22);
background-color: rgba(255, 243, 224, 0.8);
border-radius: toRpx(8);
font-size: toRpx(24);
color: #FF9D0A;
height: toRpx(48);
margin: toRpx(24) toRpx(40) 0;
&-text {
margin-top: toRpx(4);
}
.icon-study-tips {
margin-right: toRpx(8);
}
}
.tab-box {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 toRpx(40);
}
.finish-tab {
display: flex;
&-item {
width: toRpx(148);
height: toRpx(64);
border-radius: toRpx(48);
background: #f2f2f2;
color: #666666;
font-size: toRpx(28);
line-height: toRpx(68);
text-align: center;
margin-right: toRpx(16);
&:last-child {
margin-right: 0;
}
&.finish-active {
background: #2d66f71a;
font-weight: 500;
color: #2D66F7;
}
}
}
.task-list-box {
// margin-top: toRpx(24);
height: calc(100% - #{toRpx(106)});
}
.task-finish-box {
margin-top: toRpx(24);
height: calc(100% - #{toRpx(138)});
}
.task-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(32);
padding: 0 toRpx(40) toRpx(32);
.task-item {
position: relative;
width: 100%;
// height: toRpx(432);
background-color: #fff;
border-radius: toRpx(24);
font-size: 0;
box-shadow: 0 toRpx(8) toRpx(24) 0 #2a61eb1a;
// 左上角标签
.course-tag-left {
position: absolute;
left: 0;
top: 0;
width: toRpx(94);
height: toRpx(48);
border-radius: toRpx(24) 0 toRpx(20) 0;
z-index: 2;
}
// 右上角标签
.course-tag-right {
position: absolute;
right: toRpx(16);
top: toRpx(16);
width: toRpx(72);
height: toRpx(40);
border-radius: toRpx(4);
background: rgba(0, 0, 0, 0.35);
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
.tag-text {
width: toRpx(48);
height: toRpx(36);
color: #ffffff;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(36);
}
}
.task-item-img {
width: 100%;
height: toRpx(180);
border-radius: toRpx(16) toRpx(16) 0 0;
}
.task-item-content {
padding: toRpx(32);
}
.task-item-title {
font-size: toRpx(30);
color: #292D33;
font-weight: 500;
margin-bottom: toRpx(24);
width: toRpx(340);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.task-item-text {
position: relative;
display: flex;
align-items: center;
font-size: toRpx(24);
margin-bottom: toRpx(24);
&:last-child {
margin-bottom: 0;
}
.task-item-label {
width: toRpx(96);
color: #999EA8;
margin-right: toRpx(24);
}
.task-item-value {
color: #666666;
display: inline-flex;
align-items: center;
justify-content: center;
.dot-value {
width: toRpx(12);
height: toRpx(12);
border-radius: 50%;
background: #2CCA74;
margin-right: toRpx(8);
}
.green {
color: #2CCA74;
}
}
}
.task-item-progress {
width: toRpx(151);
height: toRpx(16);
background: linear-gradient(128.8deg, rgba(117, 188, 255, .35) 0%, rgba(44, 102, 247, .35) 100%);
border-radius: toRpx(8);
.task-item-progress-text {
color: #3B73FF;
font-size: toRpx(24);
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
}
.task-item-progress-bar {
height: 100%;
background: linear-gradient(128.8deg, #75bcff 0%, #2c66f7 100%);
border-radius: toRpx(8);
}
}
}
}
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(270);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(678);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(30) 0 toRpx(50);
font-size: toRpx(24);
}
/deep/ {
.uni-scroll-view-content {
height: calc(100% - #{toRpx(20)});
}
}
</style>
\ No newline at end of file
......@@ -155,7 +155,7 @@ export default {
padding: toRpx(24);
margin: 0 toRpx(32) toRpx(16);
&.big-height {
height: toRpx(764);
height: toRpx(704);
}
&.all-height {
height: calc(100% - #{toRpx(32)});
......
......@@ -73,9 +73,9 @@
<template v-if="firstIndex == 0">
<view class="tips">
<view class="sprite-icon icon-study-tips"></view>
<view class="tips-text">本周学习时长X小时,超过X%的人</view>
<view class="tips-text">本周学习时长{{dataInfo.weekHour == null ? '-' : dataInfo.weekHour}}小时</view>
</view>
<MyTask ref="myTask" />
<Studying ref="myTask" />
</template>
<template v-if="firstIndex == 1">
<!-- 搜索框 -->
......@@ -96,13 +96,18 @@
<view class="filter-container">
<view class="filter-left">
<!-- 综合排序 -->
<view class="filter-item">
<SelectComponent ref="sortSelect" :selectList="sortOptions" @chooseType="handleSortChange" />
<view class="filter-item">
<select-component
ref="sortSelect"
:selectList="sortOptions"
:defaultValue="currentSortValue"
@chooseType="handleSortChange"
/>
</view>
<!-- 全部课程(两级) -->
<view class="filter-item">
<TwoLevelSelectComponent ref="categorySelect" :selectList="categoryOptions"
<TwoLevelSelectComponent ref="categorySelect" labelKey="categoryName" :selectList="categoryOptions"
@chooseType="handleCategoryChange" />
</view>
......@@ -119,7 +124,7 @@
<view class="sprite-icon icon-study-tips"></view>
<view class="tips-text">本周学习时长X小时,超过X%的人</view>
</view> -->
<RecommendCourse ref="recommendCourse" />
<Course ref="recommendCourse" />
</template>
</view>
</view>
......@@ -133,8 +138,8 @@
<script>
import LearnStatistics from './Study/LearnStatistics.vue'
import WeeklyConversionRate from './Study/WeeklyConversionRate.vue'
import MyTask from './Study/MyTask.vue'
import RecommendCourse from './Study/RecommendCourse.vue'
import Studying from './Study/Studying.vue'
import Course from './Study/Course.vue'
import RadarChart from 'pages/common/studyDetail/components/RadarChart.vue'
import SelectComponent from '@/components/SelectComponent.vue'
import TwoLevelSelectComponent from '@/components/TwoLevelSelectComponent.vue'
......@@ -146,8 +151,8 @@ export default {
components: {
LearnStatistics,
WeeklyConversionRate,
MyTask,
RecommendCourse,
Studying,
Course,
RadarChart,
SelectComponent,
TwoLevelSelectComponent,
......@@ -157,8 +162,9 @@ export default {
return {
chartData: {},
dataInfo: {
totalHour: 999.99,
monHour: 12,
totalHour: 0,
monHour: 0,
weekHour: 0,
monHourRatio: null,
unReadCount: 0
},
......@@ -217,6 +223,7 @@ export default {
]
}
],
currentSortValue: 'default',
}
},
created() {
......@@ -229,7 +236,6 @@ export default {
} else {
this.$refs.myTask.getCourseTaskPage(tabIndex, finishIndex)
}
this.getStudyBoard()
})
},
async mounted() {
......@@ -250,6 +256,7 @@ export default {
this.showMyTask = await this.checkStudyCenterPermission()
this.getMyStudyTime();
this.getCourseCategoryTree()
},
methods: {
// 我的学习时长
......@@ -258,9 +265,27 @@ export default {
staffPhone: uni.$storage.get('userInfo').phone
})
console.log(res, 'res')
// if (res) {
// this.dataInfo = res || {}
// }
if (res) {
this.dataInfo = res || {}
}
},
// 新学习中心 - 课程分类树
async getCourseCategoryTree() {
const res = await uni.$api.commonApi.getCourseCategoryTree()
console.log(res, 'res')
if (res) {
const list = Array.isArray(res) ? res : []
const filtered = list
.filter(item => item && item.categoryName !== '未分组')
.map(item => ({
...item,
children: [
{ categoryName: '全部' },
...((item.children && Array.isArray(item.children)) ? item.children : [])
]
}))
this.categoryOptions = filtered
}
},
// 聚焦搜索框
focusSearch() {
......@@ -283,6 +308,7 @@ export default {
// 处理排序变化
handleSortChange({ item, index }) {
console.log('排序变化:', item, index)
this.currentSortValue = item.value
// TODO: 调用课程列表接口,传入排序参数
},
// 处理分类变化
......@@ -363,52 +389,6 @@ export default {
// tab切换
changeType(index, tagIndex) {
this.firstIndex = index
},
async getStudyBoard() {
const res = await uni.$api.commonApi.getStudyBoard({})
console.log(111111, 'res', res)
this.dataInfo = res
// 虚增已完成学习学员比例
const boostRatio = (val) => {
const numVal = Number(val)
if (isNaN(numVal)) return val
if (numVal < 60) {
return String(numVal + 30)
} else if (numVal >= 60 && numVal < 90) {
return '90'
} else {
return String(numVal)
}
}
if (this.dataInfo) {
if (this.dataInfo.shortCourseCompletedLearnRatio !== undefined && this.dataInfo.shortCourseCompletedLearnRatio !== null) {
this.dataInfo.shortCourseCompletedLearnRatio = boostRatio(this.dataInfo.shortCourseCompletedLearnRatio)
}
if (this.dataInfo.longCourseCompletedLearnRatio !== undefined && this.dataInfo.longCourseCompletedLearnRatio !== null) {
this.dataInfo.longCourseCompletedLearnRatio = boostRatio(this.dataInfo.longCourseCompletedLearnRatio)
}
}
const _chartData = {
categories: res.abilityAnalysisTag,
series: [
{
data: res.abilityAnalysisScore
// data: [1, 2, 3, 1, 2, 2, 3, 3, 3]
}
]
}
this.chartData = _chartData
// 设置雷达图标签颜色,1为红色,否则为灰色
if (_chartData.series && _chartData.series[0] && Array.isArray(_chartData.series[0].data)) {
const dataArr = _chartData.series[0].data;
let _labelColors = [];
if (dataArr.every(val => val === 0)) {
_labelColors = [];
} else {
_labelColors = dataArr.map(val => val === 1 ? '#EB4E4E' : '#666666');
}
this.labelColors = _labelColors;
}
}
}
}
......@@ -723,7 +703,8 @@ export default {
.data-container {
background: #ffffff;
border-radius: toRpx(48);
height: calc(100vh - #{toRpx(136)});
// height: calc(100vh - #{toRpx(136)});
height: toRpx(1392);
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border: toRpx(2) solid #fff;
box-sizing: border-box;
......
......@@ -11,21 +11,19 @@
class="pop-box"
v-if="isSelect"
>
<!-- 一级菜单 -->
<view
v-for="(item, index) in selectList"
:key="index"
class="type-item flex"
:class="getItemClass(index, item)"
@click="chooseFirstLevel(index, item)"
>
<view class="item-label">{{ item[labelKey] }}</view>
<view class="first-level-box">
<view
v-for="(item, index) in selectList"
:key="index"
class="type-item flex"
:class="getItemClass(index, item)"
@click="chooseFirstLevel(index, item)"
>
<view class="item-label">{{ item[labelKey] }}</view>
</view>
</view>
<!-- 二级菜单 -->
<view
class="second-level-box"
v-if="showSecondLevel && currentFirstLevel && currentFirstLevel.children"
>
<view
v-for="(child, childIndex) in currentFirstLevel.children"
......@@ -56,8 +54,11 @@ export default {
selectFirstIndex: 0,
selectSecondIndex: -1,
isSelect: false,
showSecondLevel: false,
currentFirstLevel: null
currentFirstLevel: [{
categoryName: '全部分类',
id: 'all',
children: [{ categoryName: '全部', id: 'all_all' }]
}]
}
},
computed: {
......@@ -87,27 +88,24 @@ export default {
},
hideSelect() {
this.isSelect = false
this.showSecondLevel = false
},
chooseFirstLevel(index, item) {
// 如果有二级菜单,显示二级菜单
if (item.children && item.children.length) {
this.showSecondLevel = true
this.currentFirstLevel = item
this.selectFirstIndex = index
// this.selectSecondIndex = -1
} else {
// 没有二级菜单,直接选中
this.selectFirstIndex = index
this.selectSecondIndex = -1
this.isSelect = false
this.showSecondLevel = false
this.$emit('chooseType', { item, index, level: 1 })
}
},
chooseSecondLevel(childIndex, child) {
this.selectSecondIndex = childIndex
this.isSelect = false
this.showSecondLevel = false
this.$emit('chooseType', {
item: child,
index: childIndex,
......@@ -140,14 +138,24 @@ export default {
position: absolute;
top: toRpx(100);
left: 0;
width: 100%;
// width: 100%;
// width: toRpx(592);
background: #ffffff;
box-shadow: 0 0 toRpx(16) 0 #99999933;
border-radius: toRpx(16);
padding: toRpx(16) 0;
text-align: center;
animation: show-view-opacity 0.15s forwards;
display: flex;
.first-level-box {
min-width: toRpx(176);
}
.second-level-box {
width: toRpx(400);
// border-left: 1px solid #f0f0f0;
}
.type-item {
padding: 0 toRpx(28);
margin-bottom: toRpx(8);
......@@ -165,20 +173,6 @@ export default {
}
}
.second-level-box {
position: absolute;
top: 0;
left: 100%;
width: 100%;
background: #ffffff;
box-shadow: 0 0 toRpx(16) 0 #99999933;
border-radius: toRpx(16);
padding: toRpx(16) 0;
.type-item {
justify-content: center;
}
}
}
</style>
......@@ -7,20 +7,22 @@
<view class="completed-course-item" v-for="(item, index) in completedCourseList" :key="index"
@click="startStudy(item, index)" :style="cardWidth > 0 ? `width: ${cardWidth}rpx` : ''">
<!-- 左上角:必修/选修标签 -->
<image v-if="item.required !== undefined" class="course-tag-left"
:src="item.required ? require('@/assets/images/studyCenter/Required.png') : require('@/assets/images/studyCenter/Elective.png')"
<template v-if="item.planCourseType">
<image class="course-tag-left"
:src="item.planCourseType == 1 ? require('@/assets/images/studyCenter/Required.png') : require('@/assets/images/studyCenter/Elective.png')"
mode="aspectFit" />
</template>
<!-- 右上角:文档/视频标签 -->
<view v-if="item.courseType" class="course-tag-right">
<text class="tag-text">{{ item.courseType === 'video' ? '视频' : '文档' }}</text>
<!-- 右上角:文档/视频标签 -->
<view class="course-tag-right" v-if="item.courseFileType">
<text class="tag-text">{{ COURSE_TYPE[item.courseFileType].name}}</text>
</view>
<image class="completed-course-item-img"
src="../../../../assets/images/common/recommend-course-default.webp" mode="scaleToFill" />
src="../../../../assets/images/common/course-default-bg.webp" mode="scaleToFill" />
<view class="completed-course-content">
<view class="completed-course-item-title">
{{ item.taskTitle || item.courseName }}
{{ item.title }}
</view>
<!-- 成功图片 -->
......@@ -42,6 +44,7 @@
</view>
</template>
<script>
import { COURSE_TYPE } from '../contant.js'
export default {
name: 'CompletedCourse',
props: {
......@@ -59,6 +62,7 @@ export default {
pageNum: 1,
pageSize: 12,
scrollTop: 0,
COURSE_TYPE
}
},
computed: {
......@@ -82,23 +86,16 @@ export default {
})
const { pageNum, pageSize } = this
const params = {
completeStatus: 1, // 完成状态 1=已完成
learnStatus: 2, // 学习状态 0:待学习 1: 正在学习 2:已学完
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getCourseTaskPage(params)
// 临时添加测试数据字段
const listWithTestData = res.list.map((item, index) => ({
...item,
required: index % 3 === 0, // 每3个课程第1个是必修
courseType: index % 2 === 0 ? 'video' : 'document', // 交替显示视频/文档
}))
const res = await uni.$api.commonApi.getMyCourseList(params)
if (pageNum == 1) {
this.completedCourseList = listWithTestData
this.completedCourseList = res.list
} else {
this.completedCourseList = this.completedCourseList.concat(listWithTestData)
this.completedCourseList = this.completedCourseList.concat(res.list)
}
uni.hideLoading()
this.total = res.total
......@@ -152,6 +149,7 @@ export default {
width: toRpx(530) !important;
max-width: toRpx(530);
min-width: toRpx(530);
font-size: 0;
}
}
......@@ -209,6 +207,8 @@ export default {
padding: toRpx(32);
position: relative;
min-height: toRpx(196);
background-color: #fff;
border-radius: 0 0 toRpx(16) toRpx(16);
.completed-course-item-title {
font-size: toRpx(30);
......
<template>
<view class="task-box">
<view class="tab-box">
<!-- <view class="tab-list">
<view class="tab-list">
<view @click="handleTabClick(index)" :class="['tab-item', tabIndex === index ? 'active' : '']"
v-for="(item, index) in tabList" :key="index">
<view class="tab-item-title">{{ item }}</view>
......@@ -14,14 +14,17 @@
<view class="finish-tab-item" @click="handleFinishTabClick(1)" :class="{ 'finish-active': finishIndex === 1 }">
短课程
</view>
</view> -->
</view>
</view>
<view class="tips" v-if="tabIndex === 0">
<view class="sprite-icon icon-study-tips"></view>
<view class="tips-text">带有"限时学"标签的课程:规定时间内未完成任务,禁止提单!请按时学习。</view>
</view>
<scroll-view scroll-y ref="scrollViewRef" :scroll-top="scrollTop" @scrolltolower="pageonReachBottom"
:class="[getScrollHeight]">
<template v-if="taskList.length">
<view class="task-list" :class="{ 'fixed-width': cardWidth > 0 }">
<view class="task-item" v-for="(item, index) in taskList" :key="index" @click="handleTaskItemClick(item)" :style="cardWidth > 0 ? `width: ${cardWidth}rpx` : ''">
<view class="task-list">
<view class="task-item" v-for="(item, index) in taskList" :key="index" @click="handleTaskItemClick(item)">
<view class="time-limit-tag" v-if="tabIndex === 0 && item.punishType == 1"></view>
<view v-if="tabIndex === 0 && item.punishType == 1" class="time-limit-countdown ">
<template v-if="item._timeout">
......@@ -58,26 +61,25 @@
/>
<view class="task-item-content">
<view class="task-item-title">{{ item.taskTitle }}</view>
<view class="task-item-text" v-if="item.courseType === 2">
<view class="task-item-label">课程时长</view>
<view class="task-item-value">
{{ (item.totalDuration || item.totalDuration === 0) ? `${item.totalDuration}min` : '-' }}
</view>
</view>
<view class="task-item-text">
<view class="task-item-label">学习进度</view>
<view class="task-item-label">任务进度</view>
<view class="task-item-progress" v-if="item.completeStatus == 0">
<view class="task-item-progress-bar" :style="{ width: Math.floor(item.taskProgress) + '%' }"></view>
<view class="task-item-progress-text">{{ Math.floor(item.taskProgress) }}%</view>
</view>
<view class="task-item-value" v-else><view class="dot-value"></view><view class="green">已完成</view></view>
</view>
<!-- 完成时间 - 暂时隐藏 -->
<!-- <view class="task-item-text">
<view class="task-item-text" v-if="item.courseType === 2">
<view class="task-item-label">课程数</view>
<view class="task-item-value">
{{ item.courseTotalCount }}节 |
{{ (item.totalDuration || item.totalDuration === 0) ? `${item.totalDuration}min` : '-' }}
</view>
</view>
<view class="task-item-text">
<view class="task-item-label">完成时间</view>
<view class="task-item-value">{{ tabIndex === 0 ? formatTime(item.taskDeadline, 'YYYY-MM-DD HH:mm') : formatTime(item.finishDate, 'YYYY-MM-DD HH:mm') }}</view>
</view> -->
</view>
<view class="task-item-status">{{ item.status }}</view>
</view>
</view>
......@@ -93,21 +95,12 @@
<view class="end-text">到底了!</view>
</template>
</scroll-view>
</view>
</template>
<script>
import dayjs from 'dayjs'
export default {
name: 'MyTask',
props: {
// 卡片宽度,不传则使用默认的响应式布局
cardWidth: {
type: Number,
default: 0
}
},
data() {
return {
tabList: ['待完成', '已完成'],
......@@ -293,20 +286,12 @@ export default {
const res = await uni.$api.commonApi.getCourseTaskPage(params)
// 处理倒计时相关字段
let newList = res.list || [];
// 临时添加测试数据字段
newList = newList.map((item, index) => ({
...item,
required: index % 3 === 0, // 每3个任务第1个是必修
courseTypeLabel: index % 2 === 0 ? 'video' : 'document' // 交替显示视频/文档
}))
// 对新获取的数据初始化倒计时字段
if (completeStatus === 0) {
this.initCountdownFieldsForList(newList);
}
if (pageNum == 1) {
this.taskList = newList
this.taskList = newList.concat(newList)
} else {
// 合并新数据到已有数据
this.taskList = this.taskList.concat(newList)
......@@ -314,7 +299,6 @@ export default {
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
// 只在tabIndex为0时处理倒计时
if (completeStatus === 0) {
// 启动定时器(不管是第一页还是翻页都要)
......@@ -404,9 +388,8 @@ export default {
<style lang="scss" scoped>
.task-box {
padding-top: toRpx(32);
height: calc(100% + #{toRpx(72)});
height: calc(100% - #{toRpx(100)});
}
.tab-list {
display: flex;
width: toRpx(436);
......@@ -415,7 +398,6 @@ export default {
border-radius: toRpx(16);
color: #666666;
font-size: toRpx(28);
.tab-item {
box-sizing: border-box;
display: flex;
......@@ -423,7 +405,6 @@ export default {
align-items: center;
justify-content: center;
margin: toRpx(6);
&.active {
background-color: #fff;
color: #1A1A1A;
......@@ -432,7 +413,6 @@ export default {
}
}
}
.tips {
display: flex;
align-items: center;
......@@ -443,26 +423,21 @@ export default {
color: #FF9D0A;
height: toRpx(48);
margin: toRpx(24) toRpx(40) 0;
&-text {
margin-top: toRpx(4);
}
.icon-study-tips {
margin-right: toRpx(8);
}
}
.tab-box {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 toRpx(40);
}
.finish-tab {
display: flex;
&-item {
width: toRpx(148);
height: toRpx(64);
......@@ -473,11 +448,9 @@ export default {
line-height: toRpx(68);
text-align: center;
margin-right: toRpx(16);
&:last-child {
margin-right: 0;
}
&.finish-active {
background: #2d66f71a;
font-weight: 500;
......@@ -485,34 +458,19 @@ export default {
}
}
}
.task-list-box {
margin-top: toRpx(24);
height: calc(100% - #{toRpx(210)});
}
.task-finish-box {
margin-top: toRpx(24);
height: calc(100% - #{toRpx(138)});
}
.task-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(32);
padding: 0 toRpx(40) toRpx(32);
&.fixed-width {
grid-template-columns: repeat(4, toRpx(530));
justify-content: center;
.task-item {
width: toRpx(530) !important;
max-width: toRpx(530);
min-width: toRpx(530);
}
}
.task-item {
position: relative;
width: 100%;
......@@ -521,44 +479,6 @@ export default {
border-radius: toRpx(24);
font-size: 0;
box-shadow: 0 toRpx(8) toRpx(24) 0 #2a61eb1a;
// 左上角:必修/选修标签
.course-tag-left {
position: absolute;
left: 0;
top: 0;
width: toRpx(94);
height: toRpx(48);
border-radius: toRpx(24) 0 toRpx(20) 0;
z-index: 2;
}
// 右上角:文档/视频标签
.course-tag-right {
position: absolute;
right: toRpx(16);
top: toRpx(16);
width: toRpx(72);
height: toRpx(40);
border-radius: toRpx(4);
background: rgba(0, 0, 0, 0.35);
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
.tag-text {
width: toRpx(48);
height: toRpx(36);
color: #ffffff;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(36);
}
}
.time-limit-tag {
position: absolute;
top: 0;
......@@ -572,7 +492,6 @@ export default {
z-index: 1;
color: #fff;
}
.time-limit-countdown {
position: absolute;
right: toRpx(18);
......@@ -582,7 +501,6 @@ export default {
justify-content: center;
font-size: toRpx(24);
z-index: 1;
.countdown-num {
display: flex;
align-items: center;
......@@ -613,17 +531,14 @@ export default {
font-size: toRpx(24);
}
}
.task-item-img {
width: 100%;
height: toRpx(180);
border-radius: toRpx(16) toRpx(16) 0 0;
}
.task-item-content {
padding: toRpx(32);
}
.task-item-title {
font-size: toRpx(30);
color: #292D33;
......@@ -634,20 +549,17 @@ export default {
text-overflow: ellipsis;
white-space: nowrap;
}
.task-item-text {
position: relative;
display: flex;
align-items: center;
font-size: toRpx(24);
margin-bottom: toRpx(24);
.task-item-label {
width: toRpx(96);
color: #999EA8;
margin-right: toRpx(24);
}
.task-item-value {
color: #666666;
display: inline-flex;
......@@ -665,13 +577,11 @@ export default {
}
}
}
.task-item-progress {
width: toRpx(151);
height: toRpx(16);
background: linear-gradient(128.8deg, rgba(117, 188, 255, .35) 0%, rgba(44, 102, 247, .35) 100%);
border-radius: toRpx(8);
.task-item-progress-text {
color: #3B73FF;
font-size: toRpx(24);
......@@ -680,7 +590,6 @@ export default {
right: 0;
transform: translateY(-50%);
}
.task-item-progress-bar {
height: 100%;
background: linear-gradient(128.8deg, #75bcff 0%, #2c66f7 100%);
......@@ -689,28 +598,24 @@ export default {
}
}
}
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(270);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(678);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(30) 0;
font-size: toRpx(24);
}
/deep/ {
.uni-scroll-view-content {
height: calc(100% - #{toRpx(20)});
......
<template>
<view class="recommend-course">
<scroll-view scroll-y ref="scrollViewRef" :scroll-top="scrollTop" @scrolltolower="pageonReachBottom"
:class="getScrollHeight">
<template v-if="recommendCourseList.length">
<view class="recommend-course-list">
<view class="recommend-course-item" v-for="(item, index) in recommendCourseList" :key="index" @click="startStudy(item, index)">
<image
class="recommend-course-item-img"
src="../../../../assets/images/common/recommend-course-default.webp"
mode="scaleToFill"
/>
<view class="recommend-course-content">
<view class="recommend-course-item-title">
{{ item.courseName }}
</view>
<view class="recommend-course-item-text">{{ (item.totalDuration || item.totalDuration === 0) ? `${item.totalDuration}min` : '-' }}</view>
</view>
</view>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
暂无数据
</view>
</template>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template>
</scroll-view>
</view>
</template>
<script>
export default {
name: 'RecommendCourse',
data() {
return {
recommendCourseList: [],
nothing: false,
total: 0,
pageNum: 1,
pageSize: 12,
scrollTop: 0,
}
},
computed: {
getScrollHeight() {
const list = this.recommendCourseList;
if (!list || list.length === 0) {
return '';
}
return 'scroll-view'
}
},
mounted() {
this.getCourseTaskPage()
this.asyncfindBeiSenSSOToken()
},
methods: {
// 获取我的任务接口, completeStatus: 完成状态 0=待完成 1=已完成, courseType: 课程类型 1=短课程 2=长课程
async getCourseTaskPage() {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const params = {
recommendStatus: 1, // 推荐状态 0=无推荐 1=推荐课程
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getCourseTaskPage(params)
if (pageNum == 1) {
this.recommendCourseList = res.list
} else {
this.recommendCourseList = this.recommendCourseList.concat(res.list)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
pageonReachBottom() {
console.log('到底了');
// 解构赋值,设置 nothing 的默认值
let { pageNum, total, nothing = 'nothing', pageSize } = this;
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1;
this.getCourseTaskPage()
} else {
this.nothing = true;
}
},
startStudy(item, index) {
let { pageNum, total, nothing = 'nothing', pageSize } = this;
uni.$track.add({eventCode: 'app_recommend_course', businessId: item.id, pagePath: '/pages/equity/index'})
uni.navigateTo({
url: `/pages/common/studyDetail/detail?type=recommendation&index=${index}&recommendCourseList=${encodeURIComponent(JSON.stringify(this.recommendCourseList))}&pageNum=${pageNum}&pageSize=${pageSize}&total=${total}`
})
},
async asyncfindBeiSenSSOToken () {
const res = await uni.$api.commonApi.findBeiSenSSOToken({})
uni.$storage.set('beisenToken', res.data)
},
}
}
</script>
<style lang="scss" scoped>
.recommend-course {
height: calc(100% - #{toRpx(100)});
.scroll-view {
margin-top: toRpx(40);
height: calc(100% - #{toRpx(70)});
.recommend-course-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(32);
padding: 0 toRpx(40) toRpx(32);
.recommend-course-item {
width: 100%;
height: toRpx(376);
box-shadow: 0 toRpx(8) toRpx(24) 0 #2a61eb1a;
border-radius: toRpx(24);
.recommend-course-item-img {
width: 100%;
height: toRpx(180);
border-radius: toRpx(16) toRpx(16) 0 0;
}
.recommend-course-content {
padding: toRpx(32);
.recommend-course-item-title {
font-size: toRpx(30);
color: #292D33;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
margin-bottom: toRpx(16);
height: calc(2 * 1.2em); // 固定两行高度,1.4为行高倍数,可根据实际调整
line-height: 1.2;
}
.recommend-course-item-text {
font-size: toRpx(24);
color: #999EA8;
}
}
}
}
}
}
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(380);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(678);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(30) 0;
font-size: toRpx(24);
}
/deep/ {
.uni-scroll-view-content {
height: calc(100% - #{toRpx(20)});
}
}
</style>
\ No newline at end of file
<!-- 学习中心首页 - 正在学习 -->
<template>
<view class="task-box">
<scroll-view scroll-y ref="scrollViewRef" :scroll-top="scrollTop" @scrolltolower="pageonReachBottom"
class="task-list-box">
<template v-if="taskList.length">
<view class="task-list">
<view class="task-item" v-for="(item, index) in taskList" :key="index" @click="handleTaskItemClick(item)">
<!-- 左上角:必修/选修标签 -->
<template v-if="item.planCourseType">
<image class="course-tag-left"
:src="item.planCourseType == 1 ? require('@/assets/images/studyCenter/Required.png') : require('@/assets/images/studyCenter/Elective.png')"
mode="aspectFit" />
</template>
<!-- 右上角:文档/视频标签 -->
<view class="course-tag-right" v-if="item.courseFileType">
<text class="tag-text">{{ COURSE_TYPE[item.courseFileType].name}}</text>
</view>
<image class="task-item-img" :src="require(`@/assets/images/common/${COURSE_TYPE[item.courseFileType].image}.webp`)" mode="aspectFill" />
<view class="task-item-content">
<view class="task-item-title">{{ item.title }}</view>
<view class="task-item-text">
<view class="task-item-label">课程时长</view>
<view class="task-item-value">
{{ (item.totalDuration || item.totalDuration === 0) ? `${item.totalDuration}min` : '-' }}
</view>
</view>
<view class="task-item-text">
<view class="task-item-label">任务进度</view>
<view class="task-item-progress">
<view class="task-item-progress-bar" :style="{ width: Math.floor(item.process) + '%' }"></view>
<view class="task-item-progress-text">{{ Math.floor(item.process) }}%</view>
</view>
</view>
</view>
</view>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
暂无数据
</view>
</template>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template>
</scroll-view>
</view>
</template>
<script>
const COURSE_TYPE = {
10: {
name: '视频',
image: 'short-course-default'
},
80: {
name: '音频',
image: 'course-default-bg'
},
20: {
name: '混合',
image: 'short-course-default'
},
30: {
name: '文档',
image: 'course-default-bg'
},
40: {
name: 'H5',
image: 'course-default-bg'
},
70: {
name: 'URL',
image: 'course-default-bg'
},
120: {
name: '图文',
image: 'course-default-bg'
}
}
import dayjs from 'dayjs'
export default {
name: 'MyTask',
data() {
return {
finishIndex: 2,
nothing: false,
total: 0,
pageNum: 1,
pageSize: 12,
scrollTop: 0,
taskList: [],
COURSE_TYPE
}
},
mounted() {
this.getCourseTaskPage(this.tabIndex)
},
beforeDestroy() {
// 移除事件监听,防止内存泄漏
uni.$off && uni.$off('backStudyCenter');
},
methods: {
// 格式化时间
formatTime(time, formatStr) {
if (!time) return '-';
return dayjs(time).format(formatStr);
},
// 获取正在学习接口, learnStatus: 1, // 学习状态 0:待学习 1: 正在学习 2:已学完
async getCourseTaskPage() {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const params = {
learnStatus: 1, // 学习状态 0:待学习 1: 正在学习 2:已学完
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getMyCourseList(params)
let newList = res.list || [];
if (pageNum == 1) {
this.taskList = newList
} else {
this.taskList = this.taskList.concat(newList)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
pageonReachBottom() {
console.log('到底了');
// 解构赋值,设置 nothing 的默认值
let { pageNum, total, pageSize, tabIndex, finishIndex } = this;
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1;
if (tabIndex == 0) {
this.getCourseTaskPage()
} else {
this.getCourseTaskPage()
}
} else {
this.nothing = true;
}
},
handleTaskItemClick(item) {
console.log(item)
},
findBeiSenSSOToken() {
return new Promise(resolve => {
const url = 'https%3A%2F%2Fcloud.italent.cn%2FPageHome%2FIndex%3Fproduct%3DLearning%26keyName%3DNusion%26pageCode%3DLearningNewHomepage%26appCode%3DLearning%26_qsrcapp%3DLearning%26_qrt%3Dhtml%26quark_s%3D5102bff371c00da5b19968ee53a8c3f1499ecd2447a19f72f3e3ba2390cc9617%23%2FviewDynamic%3Fshadow_context%3D%257BappModel%253A%2522italent%2522%252Cuppid%253A%25221%2522%257D%26quark_s%3D028930f1066f8ef8d28790940d53ae64337f44bde3a44cf89a290e4a3611e3e2'
uni.$api.commonApi.findBeiSenSSOToken({}).then(res => {
uni.$storage.set('beisenToken', res.data)
const studyUrl = res.data ? `${res.data}&return_url=${url}` : ''
resolve(studyUrl)
})
})
},
}
}
</script>
<style lang="scss" scoped>
.task-box {
height: 100%;
}
.tab-list {
display: flex;
width: toRpx(436);
height: toRpx(80);
background-color: #F5F6F7;
border-radius: toRpx(16);
color: #666666;
font-size: toRpx(28);
.tab-item {
box-sizing: border-box;
display: flex;
flex: 1;
align-items: center;
justify-content: center;
margin: toRpx(6);
&.active {
background-color: #fff;
color: #1A1A1A;
border-radius: toRpx(10);
font-weight: 600;
}
}
}
.tips {
display: flex;
align-items: center;
padding: toRpx(8) toRpx(22);
background-color: rgba(255, 243, 224, 0.8);
border-radius: toRpx(8);
font-size: toRpx(24);
color: #FF9D0A;
height: toRpx(48);
margin: toRpx(24) toRpx(40) 0;
&-text {
margin-top: toRpx(4);
}
.icon-study-tips {
margin-right: toRpx(8);
}
}
.tab-box {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 toRpx(40);
}
.finish-tab {
display: flex;
&-item {
width: toRpx(148);
height: toRpx(64);
border-radius: toRpx(48);
background: #f2f2f2;
color: #666666;
font-size: toRpx(28);
line-height: toRpx(68);
text-align: center;
margin-right: toRpx(16);
&:last-child {
margin-right: 0;
}
&.finish-active {
background: #2d66f71a;
font-weight: 500;
color: #2D66F7;
}
}
}
.task-list-box {
// margin-top: toRpx(24);
height: 100%;
}
.task-finish-box {
margin-top: toRpx(24);
height: calc(100% - #{toRpx(138)});
}
.task-list {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: toRpx(32);
padding: 0 toRpx(64);
.task-item {
position: relative;
width: 100%;
// height: toRpx(432);
background-color: #fff;
border-radius: toRpx(24);
font-size: 0;
box-shadow: 0 toRpx(8) toRpx(24) 0 #2a61eb1a;
// 左上角标签
.course-tag-left {
position: absolute;
left: 0;
top: 0;
width: toRpx(94);
height: toRpx(48);
border-radius: toRpx(24) 0 toRpx(20) 0;
z-index: 2;
}
// 右上角标签
.course-tag-right {
position: absolute;
right: toRpx(16);
top: toRpx(16);
width: toRpx(72);
height: toRpx(40);
border-radius: toRpx(4);
background: rgba(0, 0, 0, 0.35);
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
.tag-text {
width: toRpx(48);
height: toRpx(36);
color: #ffffff;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(36);
}
}
.task-item-img {
width: 100%;
height: toRpx(180);
border-radius: toRpx(24) toRpx(24) 0 0;
}
.task-item-content {
padding: toRpx(32);
}
.task-item-title {
font-size: toRpx(30);
color: #292D33;
font-weight: 500;
margin-bottom: toRpx(24);
width: toRpx(340);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.task-item-text {
position: relative;
display: flex;
align-items: center;
font-size: toRpx(24);
margin-bottom: toRpx(24);
&:last-child {
margin-bottom: 0;
}
.task-item-label {
width: toRpx(96);
color: #999EA8;
margin-right: toRpx(24);
}
.task-item-value {
color: #666666;
display: inline-flex;
align-items: center;
justify-content: center;
.dot-value {
width: toRpx(12);
height: toRpx(12);
border-radius: 50%;
background: #2CCA74;
margin-right: toRpx(8);
}
.green {
color: #2CCA74;
}
}
}
.task-item-progress {
width: toRpx(288);
height: toRpx(16);
background: linear-gradient(128.8deg, rgba(117, 188, 255, .35) 0%, rgba(44, 102, 247, .35) 100%);
border-radius: toRpx(8);
.task-item-progress-text {
color: #3B73FF;
font-size: toRpx(24);
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
}
.task-item-progress-bar {
height: 100%;
background: linear-gradient(128.8deg, #75bcff 0%, #2c66f7 100%);
border-radius: toRpx(8);
}
}
}
}
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(270);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(678);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(30) 0 toRpx(50);
font-size: toRpx(24);
}
/deep/ {
.uni-scroll-view-content {
height: calc(100% - #{toRpx(20)});
}
}
</style>
\ No newline at end of file
<!-- 我的课程 - 待学习 -->
<!-- 学习中心首页 - 全部课程 -->
<template>
<view class="recommend-course">
<scroll-view scroll-y ref="scrollViewRef" :scroll-top="scrollTop" @scrolltolower="pageonReachBottom"
:class="getScrollHeight">
<template v-if="recommendCourseList.length">
<view class="recommend-course-list" :class="{ 'fixed-width': cardWidth > 0 }">
<view class="recommend-course-item" v-for="(item, index) in recommendCourseList" :key="index"
@click="startStudy(item, index)" :style="cardWidth > 0 ? `width: ${cardWidth}rpx` : ''">
<!-- 左上角:必修/选修标签 -->
<template v-if="item.planCourseType">
<image class="course-tag-left"
:src="item.planCourseType == 1 ? require('@/assets/images/studyCenter/Required.png') : require('@/assets/images/studyCenter/Elective.png')"
mode="aspectFit" />
</template>
<!-- 右上角:文档/视频标签 -->
<view class="course-tag-right" v-if="item.courseFileType">
<text class="tag-text">{{ COURSE_TYPE[item.courseFileType].name}}</text>
</view>
<image class="recommend-course-item-img"
src="../../../../assets/images/common/course-default-bg.webp" mode="scaleToFill" />
<view class="recommend-course-content">
<view class="recommend-course-item-title">
{{ item.title }}
</view>
<view class="recommend-course-item-text">
<text class="duration-value">课程时长</text>
<text>{{ (item.totalDuration || item.totalDuration === 0) ?
`${item.totalDuration}min` : '-' }}</text>
</view>
<!-- 评分星星 -->
<view v-if="!simplified && item.rating !== undefined" class="course-rating">
<view class="star-list">
<image v-for="star in 5" :key="star" class="star-icon" :src="getStarIcon(item.rating, star)"
mode="aspectFit" />
</view>
<text class="rating-text">{{ item.rating }}</text>
</view>
<!-- 学习人数 -->
<view class="student-count">
<image class="student-icon" :src="require('@/assets/images/studyCenter/rs.png')" mode="aspectFit" />
<text class="student-text">{{ item.learnTotal }}人已学习</text>
</view>
</view>
</view>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
暂无数据
</view>
</template>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template>
</scroll-view>
</view>
</template>
<script>
import { COURSE_TYPE } from '../contant.js'
export default {
name: 'ToLearnCourse',
props: {
// 卡片宽度,不传则使用默认的响应式布局
cardWidth: {
type: Number,
default: 0
},
// 是否显示简化版(只显示背景图、标题和时间)
simplified: {
type: Boolean,
default: false
}
},
data() {
return {
recommendCourseList: [],
nothing: false,
total: 0,
pageNum: 1,
pageSize: 12,
scrollTop: 0,
COURSE_TYPE
}
},
computed: {
getScrollHeight() {
const list = this.recommendCourseList;
if (!list || list.length === 0) {
return '';
}
return 'scroll-view'
}
},
mounted() {
this.getALlCourse()
this.asyncfindBeiSenSSOToken()
},
methods: {
// 获取星星图标
getStarIcon(rating, position) {
const roundedRating = Math.round(rating * 2) / 2 // 四舍五入到0.5
const diff = roundedRating - (position - 1)
if (diff >= 1) {
// 亮星
return require('@/assets/images/studyCenter/liang.png')
} else if (diff === 0.5) {
// 半星
return require('@/assets/images/studyCenter/zuo.png')
} else {
// 灰星
return require('@/assets/images/studyCenter/hui.png')
}
},
// 获取我的任务接口, completeStatus: 完成状态 0=待完成 1=已完成, courseType: 课程类型 1=短课程 2=长课程
async getALlCourse() {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const params = {
staffPhone: uni.$storage.get('userInfo').phone, // 推荐状态 0=无推荐 1=推荐课程
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getALlCourse(params)
console.log(res, '全部课程')
// 临时添加测试数据字段
const listWithTestData = res.list.map((item, index) => ({
...item,
required: index % 3 === 0, // 每3个课程第1个是必修
courseType: index % 2 === 0 ? 'video' : 'document', // 交替显示视频/文档
rating: (Math.random() * 2 + 3).toFixed(1), // 随机评分 3.0-5.0
studentCount: Math.floor(Math.random() * 1000) + 100 // 随机学习人数 100-1100
}))
if (pageNum == 1) {
this.recommendCourseList = listWithTestData
} else {
this.recommendCourseList = this.recommendCourseList.concat(listWithTestData)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
pageonReachBottom() {
console.log('到底了');
// 解构赋值,设置 nothing 的默认值
let { pageNum, total, nothing = 'nothing', pageSize } = this;
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1;
this.getALlCourse()
} else {
this.nothing = true;
}
},
startStudy(item, index) {
let { pageNum, total, nothing = 'nothing', pageSize } = this;
uni.$track.add({ eventCode: 'app_recommend_course', businessId: item.id, pagePath: '/pages/equity/index' })
uni.navigateTo({
url: `/pages/common/studyDetail/detail?type=recommendation&index=${index}&recommendCourseList=${encodeURIComponent(JSON.stringify(this.recommendCourseList))}&pageNum=${pageNum}&pageSize=${pageSize}&total=${total}`
})
},
async asyncfindBeiSenSSOToken() {
const res = await uni.$api.commonApi.findBeiSenSSOToken({})
uni.$storage.set('beisenToken', res.data)
},
}
}
</script>
<style lang="scss" scoped>
.recommend-course {
// height: calc(100% - #{toRpx(300)});
height: 100%;
// padding-bottom: toRpx(100);
.scroll-view {
margin-top: toRpx(40);
height: 100%;
.recommend-course-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(32);
padding: 0 0 toRpx(32);
&.fixed-width {
grid-template-columns: repeat(4, toRpx(530));
justify-content: center;
.recommend-course-item {
width: toRpx(530) !important;
max-width: toRpx(530);
min-width: toRpx(530);
font-size: 0;
}
}
.recommend-course-item {
width: 100%;
min-height: toRpx(376);
box-shadow: 0 toRpx(8) toRpx(24) 0 #2a61eb1a;
border-radius: toRpx(24);
position: relative;
// 左上角标签
.course-tag-left {
position: absolute;
left: 0;
top: 0;
width: toRpx(94);
height: toRpx(48);
border-radius: toRpx(24) 0 toRpx(20) 0;
z-index: 2;
}
// 右上角标签
.course-tag-right {
position: absolute;
right: toRpx(16);
top: toRpx(16);
width: toRpx(72);
height: toRpx(40);
border-radius: toRpx(4);
background: rgba(0, 0, 0, 0.35);
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
.tag-text {
width: toRpx(48);
height: toRpx(36);
color: #ffffff;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(36);
}
}
.recommend-course-item-img {
width: 100%;
height: toRpx(180);
border-radius: toRpx(16) toRpx(16) 0 0;
}
.recommend-course-content {
padding: toRpx(32);
background-color: #fff;
border-radius: 0 0 toRpx(16) toRpx(16);
.recommend-course-item-title {
font-size: toRpx(30);
color: #292D33;
display: -webkit-box;
-webkit-line-clamp: 1;
line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
margin-bottom: toRpx(16);
height: calc(1 * 1.2em);
line-height: 1.2;
}
.recommend-course-item-text {
display: flex;
align-items: center;
font-size: toRpx(24);
color: #666666;
.duration-value {
color: #999ea8;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
margin-right: toRpx(24);
}
}
// 评分星星
.course-rating {
display: flex;
align-items: center;
margin-top: toRpx(12);
.star-list {
display: flex;
align-items: center;
.star-icon {
width: toRpx(40);
height: toRpx(40);
margin-right: toRpx(6);
&:last-child {
margin-right: 0;
}
}
}
.rating-text {
width: toRpx(40);
height: toRpx(36);
color: #666666;
font-size: toRpx(28);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: left;
line-height: toRpx(36);
margin-left: toRpx(6);
}
}
// 学习人数
.student-count {
display: flex;
align-items: center;
margin-top: toRpx(12);
.student-icon {
width: toRpx(32);
height: toRpx(32);
margin-right: toRpx(8);
}
.student-text {
height: toRpx(36);
color: #999ea8;
font-size: toRpx(24);
font-weight: 400;
font-family: "HarmonyOSSansSC";
text-align: left;
line-height: toRpx(36);
}
}
}
}
}
}
}
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(280);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(678);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(30) 0 toRpx(50);
font-size: toRpx(24);
}
/deep/ {
.uni-scroll-view-content {
height: calc(100% - #{toRpx(20)});
}
}
</style>
\ No newline at end of file
const COURSE_TYPE = {
10: {
name: '视频',
image: 'short-course-default'
},
80: {
name: '音频',
image: 'course-default-bg'
},
20: {
name: '混合',
image: 'short-course-default'
},
30: {
name: '文档',
image: 'course-default-bg'
},
40: {
name: 'H5',
image: 'course-default-bg'
},
70: {
name: 'URL',
image: 'course-default-bg'
},
120: {
name: '图文',
image: 'course-default-bg'
}
}
export {
COURSE_TYPE
}
\ No newline at end of file
......@@ -6,7 +6,7 @@
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000000"></uni-icons>
</view>
<view class="title">我的课程</view>
<view class="title">我的课程1</view>
</view>
</view>
......@@ -23,17 +23,18 @@
</view>
<!-- 提示信息 -->
<view class="tips">
<view class="tips" v-if="residueInfo.remindType != 0">
<view class="sprite-icon icon-study-tips"></view>
<view class="tips-text">剩余X天完成必修课学习及通过课后考试,过期将锁定开单权限</view>
<view class="tips-text" v-if="residueInfo.remindType == '1'">剩余{{ residueInfo.residueDays }}天完成必修课学习及通过课后考试,过期将锁定开单权限</view>
<view class="tips-text" v-if="residueInfo.remindType == '2'">完成必修课学习及通过课后考试后,即可解锁开单权限</view>
</view>
<!-- 课程列表 -->
<view class="course-content">
<!-- 待学习 tab:使用 RecommendCourse 组件 -->
<RecommendCourse v-if="currentTab === 0" ref="recommendCourse" :cardWidth="530" />
<!-- 正在学习 tab:使用 MyTask 组件 -->
<MyTask v-else-if="currentTab === 1" ref="myTask" :cardWidth="530" />
<view class="course-content" :class="residueInfo.remindType != 0 ? 'with-tips' : 'no-tips'">
<!-- 待学习 tab:使用 ToLearnCourse 组件 -->
<ToLearnCourse v-if="currentTab === 0" ref="toLearnCourse" :cardWidth="530" />
<!-- 正在学习 tab:使用 Studying 组件 -->
<Studying v-else-if="currentTab === 1" ref="studying" :cardWidth="530" />
<!-- 已学完 tab:使用 CompletedCourse 组件 -->
<CompletedCourse v-else-if="currentTab === 2" ref="completedCourse" :cardWidth="530" />
</view>
......@@ -41,33 +42,51 @@
</template>
<script>
import RecommendCourse from '@/components/HomeFrame/components/Study/RecommendCourse.vue'
import MyTask from '@/components/HomeFrame/components/Study/MyTask.vue'
import CompletedCourse from '@/components/HomeFrame/components/Study/CompletedCourse.vue'
import ToLearnCourse from './components/ToLearnCourse.vue'
import Studying from './components/Studying.vue'
import CompletedCourse from './components/CompletedCourse.vue'
export default {
name: 'MyCoursePage',
components: {
RecommendCourse,
MyTask,
ToLearnCourse,
Studying,
CompletedCourse
},
data() {
return {
currentTab: 0,
tabList: [
{ label: '待学习', count: '8' },
{ label: '正在学习', count: '5' },
{ label: '已学完', count: '6' }
]
{ label: '待学习', count: '0', key: 'unLearnCount' },
{ label: '正在学习', count: '0', key: 'learningCount' },
{ label: '已学完', count: '0', key: 'completedCount' }
],
residueInfo: {}
}
},
mounted() {
console.log('MyCoursePage mounted')
this.getMyCourseTabCount()
this.getStudyCenterResidueTime()
},
methods: {
back() {
uni.navigateBack()
},
switchTab(index) {
this.currentTab = index
},
// tab 页面数量
async getMyCourseTabCount() {
const res = await uni.$api.commonApi.getMyCourseTabCount()
this.tabList.forEach((tab, index) => {
tab.count = res[tab.key] || '0'
})
},
// 学习中心 - 我的课程剩余开单时间
async getStudyCenterResidueTime() {
const res = await uni.$api.commonApi.getStudyCenterResidueTime()
this.residueInfo = res
}
}
}
......@@ -191,9 +210,15 @@ export default {
.course-content {
width: 100%;
max-height: toRpx(1200);
overflow-y: auto;
padding: 0 toRpx(64);
// height: toRpx(1200);
// overflow-y: auto;
// padding: 0 toRpx(64);
&.no-tips {
height: calc(100vh - #{toRpx(300)});
}
&.with-tips {
height: calc(100vh - #{toRpx(380)});
}
}
}
</style>
......
<template>
<view class="my-exam-container">
<!-- 顶部导航 -->
<view class="header">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000000"></uni-icons>
</view>
<view class="title">我的考试</view>
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000000"></uni-icons>
</view>
<view class="title">我的考试</view>
</view>
<!-- Tab 切换 -->
......@@ -51,12 +49,23 @@ export default {
]
}
},
mounted() {
this.getExamStatistics()
},
methods: {
back() {
uni.navigateBack()
},
switchTab(index) {
this.currentTab = index
},
async getExamStatistics() {
const res = await uni.$api.commonApi.getExamStatistics({
staffPhone: uni.$storage.get('userInfo').phone
})
console.log(res)
this.tabList[0].count = res.passCount || '0'
this.tabList[1].count = res.failCount || '0'
}
}
}
......@@ -64,60 +73,50 @@ export default {
<style lang="scss" scoped>
.my-exam-container {
width: 100%;
height: 100vh;
position: relative;
overflow: hidden;
&::after {
content: '';
background-image: url('@/assets/images/common/home-bg-1.webp');
background-size: 100% 100%;
background-repeat: no-repeat;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding-top: toRpx(112);
}
.header {
position: relative;
z-index: 10;
background: transparent;
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 999;
pointer-events: none;
.nav-bar {
display: flex;
align-items: center;
justify-content: center;
height: toRpx(88);
position: relative;
.back {
position: absolute;
left: toRpx(32);
display: flex;
align-items: center;
justify-content: center;
width: toRpx(60);
height: toRpx(60);
}
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
font-size: toRpx(36);
font-weight: 500;
color: #000000;
}
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
}
}
.tab-container {
display: flex;
align-items: center;
margin-top: toRpx(44);
margin-bottom: toRpx(28);
padding: 0 toRpx(64);
margin-top: toRpx(52);
margin-bottom: toRpx(32);
.tab-item {
width: toRpx(208);
height: toRpx(72);
......@@ -160,11 +159,8 @@ export default {
.exam-content {
width: 100%;
max-height: toRpx(1200);
overflow-y: auto;
padding: 0 toRpx(64);
// overflow-y: auto;
}
}
</style>
......@@ -60,8 +60,8 @@
<script>
import LearnStatistics from '@/components/HomeFrame/components/Study/LearnStatistics.vue'
import WeeklyConversionRate from '@/components/HomeFrame/components/Study/WeeklyConversionRate.vue'
import MyTask from '@/components/HomeFrame/components/Study/MyTask.vue'
import RecommendCourse from '@/components/HomeFrame/components/Study/RecommendCourse.vue'
import MyTask from './components/MyTask.vue'
import RecommendCourse from './components/RecommendCourse.vue'
import RadarChart from '@/pages/common/studyDetail/components/RadarChart.vue'
export default {
......@@ -307,7 +307,7 @@
.data-container {
background: #ffffff;
border-radius: toRpx(48);
height: toRpx(1312);
height: toRpx(1326);
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border: toRpx(2) solid #fff;
box-sizing: border-box;
......
......@@ -257,6 +257,14 @@ const refreshPageData = notRefreshOrder => {
getApp().globalDataorderListDateListScreenRefresh = true
}
// val:判断的值,unit单位
const filterValue = (val, unit = '') => {
if (val === null || val === undefined) {
return '-'
}
return `${val}${unit}`
}
export default {
compareVersions,
convertDateTimeFormat,
......@@ -276,5 +284,6 @@ export default {
decimal,
showNoAccess,
setCopyData,
refreshPageData
refreshPageData,
filterValue
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!