Commit 4e02d0bd by 胡悦

提交学习中心样式和修复bug

1 parent 16d10142

2.49 MB | W: | H:

2.49 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -20,6 +20,7 @@ export default { ...@@ -20,6 +20,7 @@ export default {
created() { created() {
uni.$on('messageBackHome', (topList) => { uni.$on('messageBackHome', (topList) => {
this.topList = topList this.topList = topList
this.getMessageSummary()
}) })
}, },
mounted() { mounted() {
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
<view :class="['progress-bar-value', isBeisen ? '' : 'big-top']" <view :class="['progress-bar-value', isBeisen ? '' : 'big-top']"
:style="{ width: dataInfo[item.key] ? `${dataInfo[item.key]}%` : '0' }"></view> :style="{ width: dataInfo[item.key] ? `${dataInfo[item.key]}%` : '0' }"></view>
</view> </view>
<view v-else :class="['progress-bar-box2', isBeisen ? '' : 'big-height']"></view>
<view :class="['progress-item-finish', isBeisen ? '' : 'big-margin']"> <view :class="['progress-item-finish', isBeisen ? '' : 'big-margin']">
<template v-if="dataInfo[item.key] || dataInfo[item.key] == 0"> <template v-if="dataInfo[item.key] || dataInfo[item.key] == 0">
<view>本周已有</view> <view>本周已有</view>
...@@ -131,7 +132,7 @@ export default { ...@@ -131,7 +132,7 @@ export default {
width: calc(100% - #{toRpx(64)}); width: calc(100% - #{toRpx(64)});
border-radius: toRpx(24); border-radius: toRpx(24);
background: #ffffff; background: #ffffff;
padding: toRpx(24); padding: toRpx(28) toRpx(24) toRpx(24);
margin: 0 toRpx(32) toRpx(20); margin: 0 toRpx(32) toRpx(20);
&.small-height { &.small-height {
...@@ -152,7 +153,7 @@ export default { ...@@ -152,7 +153,7 @@ export default {
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
align-items: center; align-items: center;
margin-top: toRpx(12); margin-top: toRpx(12);
margin-bottom: toRpx(36); margin-bottom: toRpx(42);
.statistics-item { .statistics-item {
display: flex; display: flex;
...@@ -199,7 +200,7 @@ export default { ...@@ -199,7 +200,7 @@ export default {
.progress-item { .progress-item {
display: flex; display: flex;
justify-content: space-between; // justify-content: space-between;
flex-direction: column; flex-direction: column;
border-radius: toRpx(12); border-radius: toRpx(12);
...@@ -252,13 +253,20 @@ export default { ...@@ -252,13 +253,20 @@ export default {
position: relative; position: relative;
width: calc(100% - #{toRpx(68)}); width: calc(100% - #{toRpx(68)});
} }
.progress-bar-box2 {
width: calc(100% - #{toRpx(68)});
height: toRpx(48);
&.big-height {
height: toRpx(80);
}
}
.progress-bar { .progress-bar {
width: 100%; width: 100%;
height: toRpx(12); height: toRpx(12);
border-radius: toRpx(8); border-radius: toRpx(8);
opacity: 0.35; opacity: 0.35;
background: linear-gradient(128.8deg, #75bcff 0%, #2c66f7 100%); background: linear-gradient(128.8deg, #75bcff 0%, #2c66f7 100%);
margin-top: toRpx(32); margin-top: toRpx(36);
&.big-margin { &.big-margin {
margin-top: toRpx(72); margin-top: toRpx(72);
...@@ -281,13 +289,13 @@ export default { ...@@ -281,13 +289,13 @@ export default {
.progress-item-finish { .progress-item-finish {
height: toRpx(72); height: toRpx(72);
margin-top: toRpx(36); margin-top: toRpx(46);
font-size: toRpx(22); font-size: toRpx(22);
color: #808080; color: #808080;
line-height: toRpx(36); line-height: toRpx(36);
&.big-margin { &.big-margin {
margin-top: toRpx(72); margin-top: toRpx(84);
} }
.progress-text { .progress-text {
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<template v-else-if="item._showDays"> <template v-else-if="item._showDays">
<view class="countdown-label">剩</view> <view class="countdown-label">剩</view>
<view class="countdown-num">{{ item._leftDays }}</view> <view class="countdown-num">{{ item._leftDays }}</view>
<view class="countdown-days-label">天</view> <view class="countdown-label">天</view>
</template> </template>
<template v-else> <template v-else>
<view class="countdown-label">剩</view> <view class="countdown-label">剩</view>
...@@ -63,14 +63,18 @@ ...@@ -63,14 +63,18 @@
<view class="task-item-title">{{ item.taskTitle }}</view> <view class="task-item-title">{{ item.taskTitle }}</view>
<view class="task-item-text"> <view class="task-item-text">
<view class="task-item-label">任务进度</view> <view class="task-item-label">任务进度</view>
<view class="task-item-progress"> <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-bar" :style="{ width: Math.floor(item.taskProgress) + '%' }"></view>
<view class="task-item-progress-text">{{ Math.floor(item.taskProgress) }}%</view> <view class="task-item-progress-text">{{ Math.floor(item.taskProgress) }}%</view>
</view> </view>
<view class="task-item-value" v-else><view class="dot-value"></view><view class="green">已完成</view></view>
</view> </view>
<view class="task-item-text" v-if="item.courseType === 2"> <view class="task-item-text" v-if="item.courseType === 2">
<view class="task-item-label">课程数</view> <view class="task-item-label">课程数</view>
<view class="task-item-value">{{ item.courseTotalCount }} 节 | {{ item.totalDuration ? `${item.totalDuration}min` : '-' }}</view> <view class="task-item-value">
{{ item.courseTotalCount }}节 |
{{ (item.totalDuration || item.totalDuration === 0) ? `${item.totalDuration}min` : '-' }}
</view>
</view> </view>
<view class="task-item-text"> <view class="task-item-text">
<view class="task-item-label">完成时间</view> <view class="task-item-label">完成时间</view>
...@@ -129,18 +133,13 @@ export default { ...@@ -129,18 +133,13 @@ export default {
} }
} }
}, },
// created () {
// // 监听自定义事件
// uni.$on('backStudyCenter', () => {
// console.log('backStudyCenter')
// this.getCourseTaskPage(this.tabIndex)
// })
// },
mounted() { mounted() {
this.getCourseTaskPage(this.tabIndex) this.getCourseTaskPage(this.tabIndex)
}, },
beforeDestroy() { beforeDestroy() {
this.clearCountdownTimer(); this.clearCountdownTimer();
// 移除事件监听,防止内存泄漏
uni.$off && uni.$off('backStudyCenter');
}, },
methods: { methods: {
// 清除倒计时定时器 // 清除倒计时定时器
...@@ -359,7 +358,7 @@ export default { ...@@ -359,7 +358,7 @@ export default {
this.getCourseTaskPage(this.tabIndex, index) this.getCourseTaskPage(this.tabIndex, index)
}, },
handleTaskItemClick(item) { handleTaskItemClick(item) {
console.log(item) // console.log(item)
const {courseType, id} = item const {courseType, id} = item
if (courseType == 1) { if (courseType == 1) {
uni.$track.add({eventCode: 'app_short_course', businessId: id, pagePath: '/pages/equity/index'}) uni.$track.add({eventCode: 'app_short_course', businessId: id, pagePath: '/pages/equity/index'})
...@@ -368,6 +367,11 @@ export default { ...@@ -368,6 +367,11 @@ export default {
url: `/pages/common/studyDetail/${courseType == 1 ? 'shortCourse' : 'longCourse'}?row=${encodeURIComponent(JSON.stringify(item))}&completeStatus=${this.tabIndex}`, url: `/pages/common/studyDetail/${courseType == 1 ? 'shortCourse' : 'longCourse'}?row=${encodeURIComponent(JSON.stringify(item))}&completeStatus=${this.tabIndex}`,
fail: (err) => { fail: (err) => {
console.error('页面跳转失败:', err); console.error('页面跳转失败:', err);
},
// 页面跳转后,监听返回事件
success: () => {
// 兼容H5/小程序/APP,返回时触发自定义事件
// 这里不需要处理,onShow和backStudyCenter事件已处理倒计时恢复
} }
}); });
}, },
...@@ -411,6 +415,7 @@ export default { ...@@ -411,6 +415,7 @@ export default {
background-color: #fff; background-color: #fff;
color: #1A1A1A; color: #1A1A1A;
border-radius: toRpx(10); border-radius: toRpx(10);
font-weight: 600;
} }
} }
} }
...@@ -452,7 +457,7 @@ export default { ...@@ -452,7 +457,7 @@ export default {
background: #f2f2f2; background: #f2f2f2;
color: #666666; color: #666666;
font-size: toRpx(28); font-size: toRpx(28);
line-height: toRpx(64); line-height: toRpx(68);
text-align: center; text-align: center;
margin-right: toRpx(16); margin-right: toRpx(16);
...@@ -538,7 +543,7 @@ export default { ...@@ -538,7 +543,7 @@ export default {
} }
.timeout-label { .timeout-label {
height: toRpx(40); height: toRpx(40);
line-height: toRpx(40); line-height: toRpx(44);
border-radius: toRpx(4); border-radius: toRpx(4);
background: #00000059; background: #00000059;
color: #fff; color: #fff;
...@@ -562,7 +567,7 @@ export default { ...@@ -562,7 +567,7 @@ export default {
font-size: toRpx(30); font-size: toRpx(30);
color: #292D33; color: #292D33;
font-weight: 500; font-weight: 500;
margin-bottom: toRpx(20); margin-bottom: toRpx(24);
width: toRpx(340); width: toRpx(340);
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -574,7 +579,7 @@ export default { ...@@ -574,7 +579,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: toRpx(24); font-size: toRpx(24);
margin-bottom: toRpx(12); margin-bottom: toRpx(24);
.task-item-label { .task-item-label {
width: toRpx(96); width: toRpx(96);
...@@ -584,6 +589,19 @@ export default { ...@@ -584,6 +589,19 @@ export default {
.task-item-value { .task-item-value {
color: #666666; 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;
}
} }
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<view class="recommend-course-item-title"> <view class="recommend-course-item-title">
{{ item.courseName }} {{ item.courseName }}
</view> </view>
<view class="recommend-course-item-text">{{ item.courseTotalCount ? `${item.courseTotalCount}节` : '-' }} | {{ item.totalDuration ? `${item.totalDuration}min` : '-' }}</view> <view class="recommend-course-item-text">{{ (item.totalDuration || item.totalDuration === 0) ? `${item.totalDuration}min` : '-' }}</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -74,43 +74,26 @@ export default { ...@@ -74,43 +74,26 @@ export default {
computed: { computed: {
tabList() { tabList() {
const weekConversionRatio = this.dataInfo && this.dataInfo.weekConversionRatio const weekConversionRatio = this.dataInfo && this.dataInfo.weekConversionRatio
// const weekConversionRatio = {
// 0: {
// top: 1,
// myConversionRatio: '0',
// topOneConversionRatio: '94.5'
// },
// 1: {
// top: 2,
// myConversionRatio: '74.3',
// topOneConversionRatio: '94.5'
// },
// 2: {
// top: 3,
// myConversionRatio: '55.7',
// topOneConversionRatio: '84.5'
// },
// }
if (!weekConversionRatio) return [] if (!weekConversionRatio) return []
// 按顺序延保、权益、轻改生成tabList // 按顺序轻改、权益、延保生成tabList
const order = [0, 2, 1] const order = [0, 1, 2]
const tabArr = order const tabArr = order
.filter(key => weekConversionRatio.hasOwnProperty(key)) .filter(key => weekConversionRatio.hasOwnProperty(key))
.map(key => { .map(key => {
let title = ''; let title = '';
if (key == 0) title = '延保'; if (key == 0) title = '轻改';
else if (key == 2) title = '权益'; else if (key == 1) title = '权益';
else if (key == 1) title = '轻改'; else if (key == 2) title = '延保';
else title = `类型${key}`; else title = `类型${key}`;
return { return {
title, title,
value: key value: key
} }
}); });
// 默认展示延保,如果没有延保,tabIndex默认为第一个 // 有延保默认展示延保,没有延保默认展示第一个
this.$nextTick(() => { this.$nextTick(() => {
if (tabArr.length > 0) { if (tabArr.length > 0) {
const yanbaoIndex = tabArr.findIndex(item => item.value == 0); const yanbaoIndex = tabArr.findIndex(item => item.value == 2);
if (yanbaoIndex !== -1) { if (yanbaoIndex !== -1) {
if (this.tabIndex !== yanbaoIndex) this.tabIndex = yanbaoIndex; if (this.tabIndex !== yanbaoIndex) this.tabIndex = yanbaoIndex;
} else { } else {
...@@ -213,7 +196,7 @@ export default { ...@@ -213,7 +196,7 @@ export default {
/* 进度条整体项样式 */ /* 进度条整体项样式 */
.bar-box { .bar-box {
margin-top: toRpx(28); margin-top: toRpx(44);
} }
.bar-item { .bar-item {
...@@ -223,7 +206,7 @@ export default { ...@@ -223,7 +206,7 @@ export default {
padding-right: toRpx(120); padding-right: toRpx(120);
&:last-child { &:last-child {
margin-bottom: toRpx(10); margin-bottom: toRpx(22);
} }
.bar-label { .bar-label {
......
...@@ -77,8 +77,13 @@ export default { ...@@ -77,8 +77,13 @@ export default {
created () { created () {
// 监听自定义事件 // 监听自定义事件
uni.$on('backStudyCenter', () => { uni.$on('backStudyCenter', () => {
console.log('backStudyCenter') console.log('backStudyCenter', this.$refs.myTask)
this.$refs.myTask.getCourseTaskPage(this.tabIndex) const { tabIndex, finishIndex } = this.$refs.myTask
if (tabIndex === 0) {
this.$refs.myTask.getCourseTaskPage(tabIndex)
} else {
this.$refs.myTask.getCourseTaskPage(tabIndex, finishIndex)
}
this.getStudyBoard() this.getStudyBoard()
}) })
}, },
...@@ -191,7 +196,7 @@ export default { ...@@ -191,7 +196,7 @@ export default {
width: calc(100% - #{toRpx(64)}); width: calc(100% - #{toRpx(64)});
border-radius: toRpx(24); border-radius: toRpx(24);
background: #ffffff; background: #ffffff;
padding: toRpx(24); padding: toRpx(28) toRpx(24) toRpx(24);
margin: 0 toRpx(32) toRpx(16); margin: 0 toRpx(32) toRpx(16);
&.big-height { &.big-height {
......
...@@ -21,12 +21,24 @@ ...@@ -21,12 +21,24 @@
<scroll-view scroll-y class="service-list" @scrolltolower="pageonReachBottom" :scroll-top="scrollTop"> <scroll-view scroll-y class="service-list" @scrolltolower="pageonReachBottom" :scroll-top="scrollTop">
<view class="service-item" v-for="(item, index) in list" :key="index" @click="handleDetail(item)"> <view class="service-item" v-for="(item, index) in list" :key="index" @click="handleDetail(item)">
<view class="service-item-title"> <view class="service-item-title">
<template v-if="moduleType == 3 || moduleType == 4"> <view class="service-item-title-left">
<view class="service-item-title-left">{{ item.title }}</view> <view
</template> class="dot-value"
<template v-else> v-if="(
<view class="service-item-title-left">{{ moduleTypeEnum[moduleType] }}</view> (moduleType == 0 && !item.readFlag) ||
</template> (moduleType == 1 && item.status == 0) ||
(moduleType == 2 && item.status == 0) ||
(moduleType == 3 && item.status == 0) ||
(moduleType == 4 && item.status == 0)
)"
></view>
<template v-if="moduleType == 3 || moduleType == 4">
{{ item.title }}
</template>
<template v-else>
{{ moduleTypeEnum[moduleType] }}
</template>
</view>
<view class="service-item-title-right"> <view class="service-item-title-right">
<view>查看详情</view> <view>查看详情</view>
<view class="sprite-icon icon-coupon-arrow"></view> <view class="sprite-icon icon-coupon-arrow"></view>
...@@ -121,24 +133,7 @@ export default { ...@@ -121,24 +133,7 @@ export default {
watch: { watch: {
moduleType: { moduleType: {
handler(newVal) { handler(newVal) {
switch (newVal) { this.getRightList(newVal)
case 0:
this.getSystemPage()
break
case 1:
this.getScriptList()
break
case 2:
this.getWarningPage()
break
case 3:
this.getCourseList(3)
break
case 4:
this.getCourseList(4)
default:
break
}
}, },
} }
}, },
...@@ -149,6 +144,8 @@ export default { ...@@ -149,6 +144,8 @@ export default {
}, },
onShow() { onShow() {
this.getMessageSummary(this.userInfo.sceneType) this.getMessageSummary(this.userInfo.sceneType)
console.log(this.moduleType, 'moduleType')
this.getRightList(this.moduleType)
}, },
methods: { methods: {
formatTime(time, formatStr) { formatTime(time, formatStr) {
...@@ -160,6 +157,27 @@ export default { ...@@ -160,6 +157,27 @@ export default {
const res = await getMessageSummary({businessType: sceneType}) const res = await getMessageSummary({businessType: sceneType})
this.messageList = res this.messageList = res
}, },
getRightList(val) {
switch (val) {
case 0:
this.getSystemPage()
break
case 1:
this.getScriptList()
break
case 2:
this.getWarningPage()
break
case 3:
console.log(111)
this.getCourseList(3)
break
case 4:
this.getCourseList(4)
default:
break
}
},
// 获取缓存中置顶的列表 // 获取缓存中置顶的列表
getTopInfo() { getTopInfo() {
const {phone, shopMerchantId, sceneType} = this.userInfo const {phone, shopMerchantId, sceneType} = this.userInfo
...@@ -325,6 +343,20 @@ export default { ...@@ -325,6 +343,20 @@ export default {
console.error('调用 getWarningPage 方法时出错:', error); console.error('调用 getWarningPage 方法时出错:', error);
} }
break; break;
case 3:
try {
this.getCourseList(3);
} catch (error) {
console.error('调用 getWarningPage 方法时出错:', error);
}
break;
case 4:
try {
this.getCourseList(4);
} catch (error) {
console.error('调用 getWarningPage 方法时出错:', error);
}
break;
default: default:
break; break;
} }
...@@ -383,9 +415,13 @@ export default { ...@@ -383,9 +415,13 @@ export default {
break break
case 3: case 3:
console.log('短课程学习跳转') console.log('短课程学习跳转')
uni.$track.add({eventCode: 'app_short_course', businessId: item.id, pagePath: '/pages/common/serviceDetail/index'}) uni.$track.add({eventCode: 'app_short_course', businessId: item.detailId, pagePath: '/pages/common/serviceDetail/index'})
// const row = {
// ...item,
// }
// row.id = item.detailId
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/studyDetail/shortCourse?row=${encodeURIComponent(JSON.stringify(item))}&completeStatus=${item.completeStatus}`, url: `/pages/common/studyDetail/shortCourse?row=${encodeURIComponent(JSON.stringify(item))}&completeStatus=${item.completeStatus}&from=service`,
fail: (err) => { fail: (err) => {
console.error('页面跳转失败:', err); console.error('页面跳转失败:', err);
} }
...@@ -555,7 +591,17 @@ export default { ...@@ -555,7 +591,17 @@ export default {
&:not(:last-child) { &:not(:last-child) {
margin-bottom: toRpx(32); margin-bottom: toRpx(32);
} }
&-title-left {
display: flex;
align-items: center;
.dot-value {
width: toRpx(12);
height: toRpx(12);
border-radius: 50%;
background: #F24724;
margin-right: toRpx(24);
}
}
&-title { &-title {
display: flex; display: flex;
align-items: center; align-items: center;
......
<template> <template>
<view > <view >
<template v-if="labelColors && labelColors.length > 0"> <template v-if="labelColors && labelColors.length > 0">
<qiun-data-charts type="radar" :opts="opts" :chartData="chartData" :class="['charts-box', heightClass]" /> <qiun-data-charts type="radar" :opts="opts" :tooltipShow="false" :chartData="chartData" :class="['charts-box', heightClass]" />
</template> </template>
<template v-else> <template v-else>
<view class="nothing flex" :class="['big-height']"> <view class="nothing flex" :class="['big-height']">
...@@ -55,6 +55,7 @@ export default { ...@@ -55,6 +55,7 @@ export default {
opacity: 0.2, opacity: 0.2,
max: 3, max: 3,
labelShow: true, labelShow: true,
dataPointShape: false,
axisLabelTofix: 1, // 保留一位小数 axisLabelTofix: 1, // 保留一位小数
labelFormatter: function (val) { labelFormatter: function (val) {
// 精确到小数点后一位 // 精确到小数点后一位
...@@ -82,7 +83,7 @@ export default { ...@@ -82,7 +83,7 @@ export default {
width: 100%; width: 100%;
height: toRpx(228); height: toRpx(228);
flex-direction: column; flex-direction: column;
margin-top: toRpx(44); margin-top: toRpx(76);
font-size: toRpx(24); font-size: toRpx(24);
color: #999999; color: #999999;
box-sizing: border-box; box-sizing: border-box;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</view> </view>
<view class="item-info"> <view class="item-info">
<view class="item-info-label">课程时长</view> <view class="item-info-label">课程时长</view>
<view class="item-info-value">{{ item.learnDuration ? `${item.learnDuration}min` : '-' }}</view> <view class="item-info-value">{{ (item.learnDuration || item.learnDuration === 0) ? `${item.learnDuration}min` : '-' }}</view>
</view> </view>
</view> </view>
<image class="completed-bg" src="../../../assets/images/common/completed-bg.png" mode="scaleToFill" <image class="completed-bg" src="../../../assets/images/common/completed-bg.png" mode="scaleToFill"
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<view class="item-content"> <view class="item-content">
<view class="recommendation-title">{{ item.courseName }}</view> <view class="recommendation-title">{{ item.courseName }}</view>
<view class="item-info"> <view class="item-info">
<view class="item-info-label">{{item.courseTotalCount ? `${item.courseTotalCount}节` : '-' }}|{{ item.totalDuration ? `${item.totalDuration}min` : '-' }}</view> <view class="item-info-label">{{ (item.totalDuration || item.totalDuration === 0) ? `${item.totalDuration}min` : '-' }}</view>
</view> </view>
</view> </view>
<view class="item-btn" @click="openCourse(index, item)"> <view class="item-btn" @click="openCourse(index, item)">
...@@ -333,10 +333,15 @@ export default { ...@@ -333,10 +333,15 @@ export default {
&:first-child { &:first-child {
border-radius: toRpx(24) toRpx(24) 0 0; border-radius: toRpx(24) toRpx(24) 0 0;
} }
&:last-child { &:last-child {
border-radius: 0 0 toRpx(24) toRpx(24); border-radius: 0 0 toRpx(24) toRpx(24);
} }
&:first-child:last-child {
/* 只有一个元素时,四个角都圆角 */
border-radius: toRpx(24);
}
&.active { &.active {
background: #EBF0FF; background: #EBF0FF;
...@@ -369,6 +374,7 @@ export default { ...@@ -369,6 +374,7 @@ export default {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
word-break: break-all; word-break: break-all;
margin-bottom: toRpx(16);
} }
.recommendation-title { .recommendation-title {
...@@ -389,7 +395,7 @@ export default { ...@@ -389,7 +395,7 @@ export default {
font-size: toRpx(24); font-size: toRpx(24);
&:not(:last-child) { &:not(:last-child) {
margin-bottom: toRpx(2); margin-bottom: toRpx(10);
} }
.item-info-label { .item-info-label {
......
...@@ -23,11 +23,15 @@ ...@@ -23,11 +23,15 @@
</view> </view>
<view class="course-info"> <view class="course-info">
<view class="info-label">课程数</view> <view class="info-label">课程数</view>
<view class="info-value">{{rowData.courseTotalCount ? `${rowData.courseTotalCount}节` : '-' }}|{{ rowData.totalDuration ? `${rowData.totalDuration}min` : '-' }}</view> <view class="info-value">
{{ (rowData.courseTotalCount || rowData.courseTotalCount === 0) ? `${rowData.courseTotalCount}节` : '-' }}|
{{ (rowData.totalDuration || rowData.totalDuration === 0) ? `${rowData.totalDuration}min` : '-' }}
</view>
</view> </view>
<view class="course-info"> <view class="course-info">
<view class="info-label">完成时间</view> <view class="info-label">完成时间</view>
<view class="info-value">{{completeStatus == 0 ? formatTime(rowData.taskDeadline, 'YYYY-MM-DD HH:mm') : formatTime(rowData.finishDate, 'YYYY-MM-DD HH:mm') }}</view> <view class="info-value">{{ completeStatus == 0 ? formatTime(rowData.taskDeadline, 'YYYY-MM-DD HH:mm') :
formatTime(rowData.finishDate, 'YYYY-MM-DD HH:mm') }}</view>
</view> </view>
</view> </view>
<view class="time-limit-countdown" v-if="completeStatus == 0 && rowData.punishType == 1"> <view class="time-limit-countdown" v-if="completeStatus == 0 && rowData.punishType == 1">
...@@ -35,15 +39,13 @@ ...@@ -35,15 +39,13 @@
<view class="countdown-label">仅剩</view> <view class="countdown-label">仅剩</view>
<view class="countdown-num">{{ countdown.days < 10 ? '0' + countdown.days : countdown.days }}</view> <view class="countdown-num">{{ countdown.days < 10 ? '0' + countdown.days : countdown.days }}</view>
<view class="countdown-separator">天</view> <view class="countdown-separator">天</view>
<view class="countdown-num">{{ countdown.hours < 10 ? '0' + countdown.hours : countdown.hours <view class="countdown-num">{{ countdown.hours < 10 ? '0' + countdown.hours : countdown.hours }}</view>
}}</view>
<view class="countdown-separator">:</view> <view class="countdown-separator">:</view>
<view class="countdown-num">{{ countdown.minutes < 10 ? '0' + countdown.minutes : <view class="countdown-num">{{ countdown.minutes < 10 ? '0' + countdown.minutes : countdown.minutes
countdown.minutes }}</view> }}</view>
<view class="countdown-separator">:</view> <view class="countdown-separator">:</view>
<view class="countdown-num">{{ countdown.seconds < 10 ? '0' + countdown.seconds : <view class="countdown-num">{{ countdown.seconds < 10 ? '0' + countdown.seconds :
countdown.seconds }}</view> countdown.seconds }}</view>
<view class="countdown-unit">天</view>
</template> </template>
<template v-else> <template v-else>
<view class="countdown-label" style="color:#B87A11;">已超时</view> <view class="countdown-label" style="color:#B87A11;">已超时</view>
...@@ -52,9 +54,10 @@ ...@@ -52,9 +54,10 @@
</view> </view>
<view class="course-list-box-wrapper"> <view class="course-list-box-wrapper">
<view class="course-list-box-title">课程列表</view> <view class="course-list-box-title">课程列表</view>
<scroll-view class="course-list-box" scroll-y > <scroll-view class="course-list-box" scroll-y>
<view class="course-list-item-wrapper"> <view class="course-list-item-wrapper">
<view class="course-list-item" @click="startStudy(index, item)" v-for="(item, index) in courseList" :key="index"> <view class="course-list-item" @click="startStudy(index, item)" v-for="(item, index) in courseList"
:key="index">
<image class="course-img" src="../../../assets/images/common/long-course-default.webp" mode="scaleToFill" /> <image class="course-img" src="../../../assets/images/common/long-course-default.webp" mode="scaleToFill" />
<view class="item-content"> <view class="item-content">
<view class="item-title">{{ item.courseName }}</view> <view class="item-title">{{ item.courseName }}</view>
...@@ -67,11 +70,11 @@ ...@@ -67,11 +70,11 @@
</view> </view>
<view class="item-info"> <view class="item-info">
<view class="item-info-label">考试成绩</view> <view class="item-info-label">考试成绩</view>
<view class="item-info-value">{{ item.totalScore ? '已完成' : '待考核'}}</view> <view class="item-info-value">{{ item.totalScore ? '已完成' : '待考核' }}</view>
</view> </view>
<view class="item-info"> <view class="item-info">
<view class="item-info-label">课程时长</view> <view class="item-info-label">课程时长</view>
<view class="item-info-value">{{ item.learnDuration ? `${item.learnDuration}min` : '-' }}</view> <view class="item-info-value">{{ (item.learnDuration || item.learnDuration === 0) ? `${item.learnDuration}min` : '-' }}</view>
</view> </view>
<template v-if="item.status === 5"> <template v-if="item.status === 5">
<image class="completed-bg" src="../../../assets/images/common/completed-bg.png" mode="scaleToFill" /> <image class="completed-bg" src="../../../assets/images/common/completed-bg.png" mode="scaleToFill" />
...@@ -81,7 +84,7 @@ ...@@ -81,7 +84,7 @@
开始学习 开始学习
</view> </view>
</template> </template>
</view> </view>
</view> </view>
</view> </view>
...@@ -121,7 +124,7 @@ export default { ...@@ -121,7 +124,7 @@ export default {
} }
}, },
onLoad(options) { onLoad(options) {
const {row} = options const { row } = options
const rowData = JSON.parse(decodeURIComponent(row)) const rowData = JSON.parse(decodeURIComponent(row))
console.log(rowData, 'rowData') console.log(rowData, 'rowData')
this.rowData = rowData this.rowData = rowData
...@@ -204,27 +207,22 @@ export default { ...@@ -204,27 +207,22 @@ export default {
this.timer = setInterval(updateCountdown, 1000) this.timer = setInterval(updateCountdown, 1000)
}, },
startStudy(index, item) { startStudy(index, item) {
const beisenToken = this.findBeiSenSSOToken() uni.$api.commonApi.findBeiSenSSOToken({}).then(res => {
if (beisenToken) { console.log(res, 'res')
uni.$track.add({eventCode: 'app_long_course', businessId: item.id, pagePath: '/pages/common/studyDetail/longCourse'}) const beisenToken = res.data
uni.navigateTo({ if (beisenToken) {
url: `/pages/common/studyDetail/detail?type=long&index=${index}&courseList=${encodeURIComponent(JSON.stringify(this.courseList))}` uni.$track.add({ eventCode: 'app_long_course', businessId: item.id, pagePath: '/pages/common/studyDetail/longCourse' })
}) uni.navigateTo({
} else { url: `/pages/common/studyDetail/detail?type=long&index=${index}&courseList=${encodeURIComponent(JSON.stringify(this.courseList))}`
uni.showToast({ })
title: '培训账号未创建', } else {
icon: 'none' uni.showToast({
}) title: '培训账号未创建',
} icon: 'none'
}, })
findBeiSenSSOToken () { }
return new Promise(resolve => {
uni.$api.commonApi.findBeiSenSSOToken({}).then(res => {
uni.$storage.set('beisenToken', res.data)
resolve(res.data)
})
}) })
}, }
} }
} }
</script> </script>
...@@ -306,7 +304,7 @@ export default { ...@@ -306,7 +304,7 @@ export default {
.course-title { .course-title {
font-size: toRpx(34); font-size: toRpx(34);
color: #292D33; color: #292D33;
margin-bottom: toRpx(24); margin-bottom: toRpx(28);
font-weight: 500; font-weight: 500;
} }
...@@ -317,7 +315,7 @@ export default { ...@@ -317,7 +315,7 @@ export default {
font-size: toRpx(28); font-size: toRpx(28);
&:not(:last-child) { &:not(:last-child) {
margin-bottom: toRpx(16); margin-bottom: toRpx(28);
} }
.info-label { .info-label {
...@@ -358,6 +356,7 @@ export default { ...@@ -358,6 +356,7 @@ export default {
position: absolute; position: absolute;
right: toRpx(48); right: toRpx(48);
top: toRpx(40); top: toRpx(40);
line-height: toRpx(48);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
...@@ -369,16 +368,20 @@ export default { ...@@ -369,16 +368,20 @@ export default {
height: toRpx(48); height: toRpx(48);
margin-right: toRpx(16); margin-right: toRpx(16);
} }
.countdown-num { .countdown-num {
display: flex; display: flex;
align-items: center; flex-basis: 0;
justify-content: center; // justify-content: center;
color: #B87A11; color: #B87A11;
width: toRpx(48); width: toRpx(48);
height: toRpx(48); height: toRpx(48);
line-height: toRpx(48);
border-radius: toRpx(6); border-radius: toRpx(6);
background: #b87a1126; background: #b87a1126;
margin: 0 toRpx(8); margin: 0 toRpx(8);
line-height:normal;
padding: toRpx(10) toRpx(8) toRpx(6);
} }
.countdown-separator { .countdown-separator {
...@@ -387,6 +390,7 @@ export default { ...@@ -387,6 +390,7 @@ export default {
.countdown-label, .countdown-label,
.countdown-unit { .countdown-unit {
line-height: toRpx(48);
color: #B87A11; color: #B87A11;
margin: 0 toRpx(4); margin: 0 toRpx(4);
} }
...@@ -443,18 +447,16 @@ export default { ...@@ -443,18 +447,16 @@ export default {
font-size: toRpx(30); font-size: toRpx(30);
color: #292D33; color: #292D33;
font-weight: 500; font-weight: 500;
margin-bottom: toRpx(20); margin-top: toRpx(8);
overflow: hidden; margin-bottom: toRpx(28);
text-overflow: ellipsis; overflow: hidden; /* 超出部分隐藏 */
display: -webkit-box; white-space: nowrap; /* 文本不换行 */
-webkit-line-clamp: 1; text-overflow: ellipsis; /* 超出部分显示省略号 */
-webkit-box-orient: vertical;
word-break: break-all;
} }
.item-info { .item-info {
display: flex; display: flex;
margin-bottom: toRpx(12); margin-bottom: toRpx(16);
font-size: toRpx(24); font-size: toRpx(24);
.item-info-label { .item-info-label {
...@@ -483,7 +485,7 @@ export default { ...@@ -483,7 +485,7 @@ export default {
} }
.item-btn { .item-btn {
margin-top: toRpx(24); margin-top: toRpx(32);
width: toRpx(430.5); width: toRpx(430.5);
height: toRpx(56); height: toRpx(56);
border-radius: toRpx(24); border-radius: toRpx(24);
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</view> </view>
</view> </view>
<view class="bottom-box"> <view class="bottom-box">
<view class="bottom-box-title"> <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(rowData.checkDate, 'YYYY年MM月DD日') }}</view>
</view> </view>
...@@ -78,11 +78,11 @@ ...@@ -78,11 +78,11 @@
</view> </view>
<view class="role-tag-score"> <view class="role-tag-score">
<view class="role-tag-score-text">战败</view> <view class="role-tag-score-text">战败</view>
<view class="score-line"></view> {{ item.inspectionScore }} <view class="score-text-unit">分</view> <view class="score-line"></view> {{ Math.floor(item.inspectionScore) }} <view class="score-text-unit">分</view>
</view> </view>
</view> </view>
</view> </view>
<view class="sprite-icon icon-coupon-arrow"></view> <view class="sprite-icon icon-detail-arrow"></view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
...@@ -115,7 +115,6 @@ ...@@ -115,7 +115,6 @@
<view class="countdown-separator">:</view> <view class="countdown-separator">:</view>
<view class="countdown-num">{{ countdown.seconds < 10 ? '0' + countdown.seconds : <view class="countdown-num">{{ countdown.seconds < 10 ? '0' + countdown.seconds :
countdown.seconds }}</view> countdown.seconds }}</view>
<view class="countdown-unit">天</view>
</template> </template>
<template v-else> <template v-else>
<view <view
...@@ -194,7 +193,7 @@ ...@@ -194,7 +193,7 @@
<view class="role-tag-score"> <view class="role-tag-score">
<view class="role-tag-score-text">战败</view> <view class="role-tag-score-text">战败</view>
<view class="score-line"></view> <view class="score-line"></view>
<view class="score-value">{{ popupDetail.inspectionScore }}</view> <view class="score-value">{{ Math.floor(popupDetail.inspectionScore) }}</view>
<view class="score-text-unit">分</view> <view class="score-text-unit">分</view>
</view> </view>
</view> </view>
...@@ -273,13 +272,19 @@ export default { ...@@ -273,13 +272,19 @@ export default {
} }
}, },
onLoad (options) { onLoad (options) {
console.log(options, 'options')
const { row } = options const { row } = options
const rowData = JSON.parse(decodeURIComponent(row)) const rowData = JSON.parse(decodeURIComponent(row))
console.log(rowData, 'rowData') console.log(rowData, 'rowData')
this.rowData = rowData this.rowData = rowData
this.completeStatus = options.completeStatus this.completeStatus = options.completeStatus
if (!this.rowData.taskDeadline) this.rowData.taskDeadline = rowData.finishTime if (!this.rowData.taskDeadline) this.rowData.taskDeadline = rowData.finishTime
this.getShortCourseDetail(rowData.id) if (options.from === 'service') {
this.getShortCourseDetail(rowData.detailId, rowData.id)
} else {
this.getShortCourseDetail(rowData.id)
}
if (this.completeStatus == 0) { if (this.completeStatus == 0) {
this.initCountdown() this.initCountdown()
} }
...@@ -336,10 +341,14 @@ export default { ...@@ -336,10 +341,14 @@ export default {
uni.navigateBack(); uni.navigateBack();
} }
}, },
async getShortCourseDetail (id) { async getShortCourseDetail (id, boxId) {
uni.showLoading() uni.showLoading()
this.studyId = id this.studyId = id
const res = await uni.$api.commonApi.getShortCourseDetail({ id }) const params = { id }
if (boxId) {
params.boxId = boxId
}
const res = await uni.$api.commonApi.getShortCourseDetail(params)
uni.hideLoading() uni.hideLoading()
// const res = { // const res = {
// staffName: '许小奇', // staffName: '许小奇',
...@@ -549,7 +558,7 @@ export default { ...@@ -549,7 +558,7 @@ export default {
height: toRpx(36); height: toRpx(36);
border-radius: toRpx(4); border-radius: toRpx(4);
border: toRpx(2) solid #e8ecf0; border: toRpx(2) solid #e8ecf0;
padding: 0 toRpx(16); padding: toRpx(4) toRpx(16);
font-size: toRpx(24); font-size: toRpx(24);
color: #79859e; color: #79859e;
margin-left: toRpx(12); margin-left: toRpx(12);
...@@ -564,7 +573,7 @@ export default { ...@@ -564,7 +573,7 @@ export default {
&-info { &-info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: toRpx(16); margin-top: toRpx(24);
&-item { &-item {
color: #79859e; color: #79859e;
...@@ -589,6 +598,9 @@ export default { ...@@ -589,6 +598,9 @@ export default {
color: #1a1a1a; color: #1a1a1a;
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 400; font-weight: 400;
&.margin-bottom {
margin-bottom: toRpx(12);
}
.date { .date {
font-size: toRpx(24); font-size: toRpx(24);
...@@ -679,7 +691,7 @@ export default { ...@@ -679,7 +691,7 @@ export default {
color: #79859e; color: #79859e;
border-radius: toRpx(4); border-radius: toRpx(4);
border: toRpx(2) solid #e8ecf0; border: toRpx(2) solid #e8ecf0;
padding: 0 toRpx(8); padding: toRpx(4) toRpx(8);
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
...@@ -688,7 +700,7 @@ export default { ...@@ -688,7 +700,7 @@ export default {
.role-tag-score { .role-tag-score {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: toRpx(32); font-size: toRpx(28);
color: #292d33; color: #292d33;
margin-right: toRpx(26); margin-right: toRpx(26);
...@@ -868,9 +880,11 @@ export default { ...@@ -868,9 +880,11 @@ export default {
.table-content-text { .table-content-text {
color: #71747a; color: #71747a;
line-height: toRpx(40);
} }
.table-content-suggest { .table-content-suggest {
line-height: toRpx(40);
.suggest-title { .suggest-title {
display: inline-block; display: inline-block;
color: #3b73ff; color: #3b73ff;
...@@ -922,7 +936,7 @@ export default { ...@@ -922,7 +936,7 @@ export default {
margin-right: toRpx(12); margin-right: toRpx(12);
} }
.score-value { .score-value {
font-size: toRpx(40); font-size: toRpx(32);
color: #292d33; color: #292d33;
} }
.score-text-unit { .score-text-unit {
...@@ -938,6 +952,8 @@ export default { ...@@ -938,6 +952,8 @@ export default {
margin-top: toRpx(16); margin-top: toRpx(16);
.role-tag { .role-tag {
height: toRpx(44);
line-height: toRpx(44);
margin-right: toRpx(12); margin-right: toRpx(12);
font-size: toRpx(22); font-size: toRpx(22);
color: #79859e; color: #79859e;
...@@ -971,10 +987,14 @@ export default { ...@@ -971,10 +987,14 @@ export default {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: toRpx(208); width: 100%;
height: toRpx(170); height: toRpx(170);
border-radius: toRpx(16); border-radius: toRpx(16);
background-color: #f5f7fa; background-color: #f5f7fa;
// margin-right: toRpx(32);
&:nth-child(5n) {
margin-right: 0;
}
.identity-title { .identity-title {
font-size: toRpx(32); font-size: toRpx(32);
color: #383838; color: #383838;
...@@ -982,7 +1002,7 @@ export default { ...@@ -982,7 +1002,7 @@ export default {
.identity-desc { .identity-desc {
font-size: toRpx(40); font-size: toRpx(40);
color: #181a1f; color: #181a1f;
margin-top: toRpx(12); margin-top: toRpx(16);
&.bad { &.bad {
color: #eb4e4e; color: #eb4e4e;
} }
...@@ -990,4 +1010,7 @@ export default { ...@@ -990,4 +1010,7 @@ export default {
} }
} }
} }
.summary-content {
line-height: toRpx(40);
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
// 返回 // 返回
back() { back() {
// this.showPage('MessageList') // this.showPage('MessageList')
uni.$emit('pageBack'); // uni.$emit('pageBack');
uni.navigateBack({ uni.navigateBack({
delta: 1, delta: 1,
animationType: 'pop-out', animationType: 'pop-out',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!