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
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
<template v-if="dataInfo[item.key] || dataInfo[item.key] == 0"> <template v-if="dataInfo[item.key] || dataInfo[item.key] == 0">
<view>本周已有</view> <view>本周已有</view>
<view class="progress-text"> <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> </view>
</template> </template>
<template v-else> <template v-else>
...@@ -64,7 +65,7 @@ export default { ...@@ -64,7 +65,7 @@ export default {
}, },
dataInfo: { dataInfo: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
isHmzx: { isHmzx: {
type: Boolean, type: Boolean,
...@@ -249,17 +250,21 @@ export default { ...@@ -249,17 +250,21 @@ export default {
} }
} }
} }
.progress-bar-box { .progress-bar-box {
position: relative; position: relative;
width: calc(100% - #{toRpx(68)}); width: calc(100% - #{toRpx(68)});
} }
.progress-bar-box2 { .progress-bar-box2 {
width: calc(100% - #{toRpx(68)}); width: calc(100% - #{toRpx(68)});
height: toRpx(48); height: toRpx(48);
&.big-height { &.big-height {
height: toRpx(80); height: toRpx(80);
} }
} }
.progress-bar { .progress-bar {
width: 100%; width: 100%;
height: toRpx(12); height: toRpx(12);
......
<template> <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 class="tab-list">
<view @click="handleTabClick(index)" :class="['tab-item', tabIndex === index ? 'active' : '']" <view @click="handleTabClick(index)" :class="['tab-item', tabIndex === index ? 'active' : '']"
v-for="(item, index) in tabList" :key="index"> v-for="(item, index) in tabList" :key="index">
...@@ -49,6 +53,10 @@ export default { ...@@ -49,6 +53,10 @@ export default {
isYb: { isYb: {
type: Boolean, type: Boolean,
default: false default: false
},
isBeisen: {
type: Boolean,
default: false
} }
}, },
data() { data() {
...@@ -146,6 +154,9 @@ export default { ...@@ -146,6 +154,9 @@ export default {
&.big-height { &.big-height {
height: toRpx(764); height: toRpx(764);
} }
&.all-height {
height: calc(100% - #{toRpx(32)});
}
.tab-list { .tab-list {
display: flex; display: flex;
......
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
<view class="title">学习看板</view> <view class="title">学习看板</view>
<view class="study-board-box"> <view class="study-board-box">
<!-- 累计学习看板 --> <!-- 累计学习看板 -->
<template v-if="isBeisen || (isHmzx && isYb)">
<LearnStatistics :dataInfo="dataInfo" :isBeisen="isBeisen" :isHmzx="isHmzx" :isYb="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"> <template v-if="isHmzx && isYb">
<view :class="['study-box3', isBeisen ? '' : 'big-height']"> <view :class="['study-box3', isBeisen ? '' : 'big-height']">
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<view class="bottom-box"> <view class="bottom-box">
<view class="bottom-box-title margin-bottom"> <view class="bottom-box-title margin-bottom">
<view>战败复盘</view> <view>战败复盘</view>
<view class="date">{{ formatTime(rowData.checkDate, 'YYYY年MM月DD日') }}</view> <view class="date">{{ formatTime(courseDetail.checkDate, 'YYYY年MM月DD日') }}</view>
</view> </view>
<RadarChart <RadarChart
:labelColors="labelColors" :labelColors="labelColors"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!