Commit 2daeea05 by 胡悦

refactor(StudyCenter): Update conditional rendering and styles for learning stat…

…istics and conversion rate components

- Added conditional rendering for LearnStatistics based on isBeisen, isHmzx, and isYb flags.
- Updated WeeklyConversionRate component to include isBeisen in class binding logic.
- Improved layout styles for better responsiveness in various scenarios.
- Fixed minor formatting issues in LearnStatistics.vue and shortCourse.vue.
1 parent 9cd457b4
......@@ -2,7 +2,7 @@
<template>
<view :class="['learn-statistics', isBeisen ? 'big-height' : 'small-height']">
<!-- 北森帐号显示累计时长 -->
<view class="learn-statistics-title" v-if="isBeisen">累计学习</view>
<view class="learn-statistics-title" v-if="isBeisen">累计学习</view>
<view class="statistics-content" v-if="isBeisen">
<view class="statistics-item ">
<view class="statistics-number blue-number">{{ dataInfo.learnDurationTotal || 0 }}</view>
......@@ -34,7 +34,8 @@
<template v-if="dataInfo[item.key] || dataInfo[item.key] == 0">
<view>本周已有</view>
<view class="progress-text">
<view class="number">{{ dataInfo[item.ratio] || dataInfo[item.ratio] == 0 ? dataInfo[item.ratio] : '-' }}%</view>学员完成学习
<view class="number">{{ dataInfo[item.ratio] || dataInfo[item.ratio] == 0 ? dataInfo[item.ratio] : '-'
}}%</view>学员完成学习
</view>
</template>
<template v-else>
......@@ -64,7 +65,7 @@ export default {
},
dataInfo: {
type: Object,
default: () => {}
default: () => { }
},
isHmzx: {
type: Boolean,
......@@ -249,17 +250,21 @@ export default {
}
}
}
.progress-bar-box {
position: relative;
width: calc(100% - #{toRpx(68)});
}
.progress-bar-box2 {
width: calc(100% - #{toRpx(68)});
height: toRpx(48);
&.big-height {
height: toRpx(80);
}
}
.progress-bar {
width: 100%;
height: toRpx(12);
......
<template>
<view :class="['study-box2', !isHmzx || !isYb ? 'big-height' : '']">
<view :class="[
'study-box2',
!isBeisen && (!isHmzx || !isYb) ? 'all-height' : '',
isBeisen && (!isHmzx || !isYb) ? 'big-height' : ''
]">
<view class="tab-list">
<view @click="handleTabClick(index)" :class="['tab-item', tabIndex === index ? 'active' : '']"
v-for="(item, index) in tabList" :key="index">
......@@ -49,6 +53,10 @@ export default {
isYb: {
type: Boolean,
default: false
},
isBeisen: {
type: Boolean,
default: false
}
},
data() {
......@@ -146,6 +154,9 @@ export default {
&.big-height {
height: toRpx(764);
}
&.all-height {
height: calc(100% - #{toRpx(32)});
}
.tab-list {
display: flex;
......
......@@ -4,9 +4,11 @@
<view class="title">学习看板</view>
<view class="study-board-box">
<!-- 累计学习看板 -->
<LearnStatistics :dataInfo="dataInfo" :isBeisen="isBeisen" :isHmzx="isHmzx" :isYb="isYb" />
<template v-if="isBeisen || (isHmzx && isYb)">
<LearnStatistics :dataInfo="dataInfo" :isBeisen="isBeisen" :isHmzx="isHmzx" :isYb="isYb" />
</template>
<!-- 周转化率看板 -->
<WeeklyConversionRate :dataInfo="dataInfo" :isHmzx="isHmzx" :isYb="isYb" />
<WeeklyConversionRate :dataInfo="dataInfo" :isBeisen="isBeisen" :isHmzx="isHmzx" :isYb="isYb" />
<!-- 能力分析看板 -->
<template v-if="isHmzx && isYb">
<view :class="['study-box3', isBeisen ? '' : 'big-height']">
......
......@@ -32,7 +32,7 @@
<view class="bottom-box">
<view class="bottom-box-title margin-bottom">
<view>战败复盘</view>
<view class="date">{{ formatTime(rowData.checkDate, 'YYYY年MM月DD日') }}</view>
<view class="date">{{ formatTime(courseDetail.checkDate, 'YYYY年MM月DD日') }}</view>
</view>
<RadarChart
:labelColors="labelColors"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!