Commit 4b20b70b by 胡悦

提交学习中心

1 parent d5d9fd9a
......@@ -377,5 +377,45 @@ module.exports = {
projectName: 'pad',
...data
})
},
// 课程消息提醒列表
getCourseList(data) {
return http.post({
method: 'dj.pad.api.page.script.sop.message.course.list',
projectName: 'pad',
...data
})
},
// 学习中心-学习看板
getStudyBoard(data) {
return http.post({
method: 'dj.pad.api.staff.study.bulletin.board',
projectName: 'pad',
...data
})
},
// 学习中心-课程任务分页
getCourseTaskPage(data) {
return http.post({
method: 'dj.pad.api.staff.study.course.task.page',
projectName: 'pad',
...data
})
},
// 学习中心-短课程详情
getShortCourseDetail(data) {
return http.post({
method: 'dj.pad.api.staff.study.short.course.detail',
projectName: 'pad',
...data
})
},
// 学习中心-长课程详情
getLongCourseDetail(data) {
return http.post({
method: 'dj.pad.api.staff.study.long.course.detail',
projectName: 'pad',
...data
})
}
}
......@@ -21,6 +21,7 @@
:class="['tab-item', { tabActive: tabIndex == index }]"
:key="index"
@click="changeIndex(index, i)"
v-if="!i.hidden"
>
<view class="icon-box">
<view :class="['sprite-icon', `icon-${i.icon}${tabIndex == index ? '-active' : ''}`]"></view>
......@@ -116,7 +117,8 @@ export default {
icon: "study",
isTrack: true,
name: 'StudyCenter',
eventCode: 'app_study_center'
eventCode: 'app_study_center',
hidden: true
},
{
label: "场景集市",
......@@ -305,22 +307,35 @@ export default {
merchantId: shopMerchantId,
scene
}).then(result => {
uni.$storage.set('isSaleOpen', result)
if (result) {
this.hasPerson = true
}
const channelType = 1
// 非直营且非鸿蒙智行, 隐藏学习中心tab
if (result || channelType == 1) {
this.tabs[2].hidden = false
}
})
},
// 获取话术未读列表
async getMessage () {
const { sceneType, uuid } = uni.$storage.get("userInfo")
let businessTypeList = []
if (sceneType == 0) {
businessTypeList = [0, 2]
} else if (sceneType == 1) {
businessTypeList = [1]
}
const res = await uni.$api.commonApi.getUnreadRecord({
businessType: sceneType,
// businessType: sceneType,
businessTypeList,
uuid
})
if (res.total) {
this.messageData = res
this.messageType = 'attendance'
this.$refs.kfRef.open()
// this.$refs.kfRef.open()
}
},
// 消息中心未读总数
......@@ -381,7 +396,6 @@ export default {
})
},
getMessageInfo () {
console.log(111111, 'getMessageInfo')
// this.getMessage()
// this.getMessageCount()
this.getMessagePop()
......
......@@ -36,6 +36,7 @@ export default {
},
handleClick(item) {
const { moduleType } = item
uni.$track.add({eventCode: 'app_service_center'})
uni.navigateTo({
url: `/pages/common/serviceDetail/index?moduleType=${moduleType}`
})
......
<!-- 累计学习 -->
<template>
<view class="learn-statistics">
<view class="learn-statistics-title">累计学习</view>
<view class="statistics-content">
<view :class="['learn-statistics', isBeisen ? 'big-height' : 'small-height']">
<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">21.3</view>
<view class="statistics-number blue-number">{{ dataInfo.learnDurationTotal || 0 }}</view>
<view class="statistics-unit blue-number">小时</view>
</view>
<view class="statistics-item">
<view class="text">排名</view>
<view class="statistics-rank">13</view>
<view class="statistics-rank">{{ dataInfo.learnDurationRank || '-' }}</view>
<view class="statistics-unit">名</view>
</view>
</view>
<view :class="['progress-box', progressList.length === 1 ? 'only-one' : '']">
<view class="progress-item" v-for="(item, index) in progressList" :key="index">
<view class="progress-item-title">{{ item.title }}</view>
<view class="progress-item-value">
<view class="number">{{ item.value ? item.value : '-' }}</view>
<view v-if="item.value" class="unit">{{ item.unit }}</view>
<view :class="['progress-box', progressList.filter(item => !item.hidden).length === 1 ? 'only-one' : '']">
<template v-for="(item, index) in progressList">
<view :class="['progress-item', isBeisen ? 'bg' : '']" :key="index" v-if="!item.hidden">
<view :class="['progress-item-title', isBeisen ? '' : 'title']">{{ item.title }}</view>
<view class="progress-item-value">
<view :class="['number', isBeisen ? '' : 'blue-number']">{{ dataInfo[item.key] || dataInfo[item.key] == 0 ?
dataInfo[item.key] : '-' }}</view>
<view v-if="dataInfo[item.key] || dataInfo[item.key] == 0" :class="['unit', isBeisen ? '' : 'blue-unit']">{{
item.unit }}</view>
</view>
<view style="position: relative;" v-if="dataInfo[item.key] || dataInfo[item.key] == 0">
<view :class="['progress-bar', isBeisen ? '' : 'big-margin']"></view>
<view :class="['progress-bar-value', isBeisen ? '' : 'big-top']"
:style="{ width: item.finish ? `${item.finish}%` : '0' }"></view>
</view>
<view :class="['progress-item-finish', isBeisen ? '' : 'big-margin']">
<template v-if="dataInfo[item.key] || dataInfo[item.key] == 0">
<view>本周已有</view>
<view class="progress-text">
<view class="number">{{ dataInfo[item.ratio] + '%' }}</view>的学员完成学习
</view>
</template>
<template v-else>
<template v-if="item.type == 3">
<view>你的表现很好</view>
<view class="progress-text">暂无需短课程学习</view>
</template>
<template v-else-if="item.type == 4">
<view class="no-finish-text">暂无长课程学习安排</view>
</template>
</template>
</view>
</view>
<view style="position: relative;">
<view class="progress-bar"></view>
<view class="progress-bar-value" :style="{ width: item.finish ? `${item.finish}%` : '0' }"></view>
</view>
<view class="progress-item-finish">
<template v-if="item.finish">
<view>本周已有</view>
<view class="progress-text">
<view class="number">{{ item.finish + '%' }}</view>的学员完成学习
</view>
</template>
<template v-else>
<view class="no-finish-text">暂无长课程学习安排</view>
</template>
</view>
</view>
</template>
</view>
</view>
</template>
......@@ -44,13 +56,40 @@
export default {
name: 'LearnStatistics',
props: {
progressList: {
type: Array,
default: () => []
isBeisen: {
type: Boolean,
default: false
},
dataInfo: {
type: Object,
default: () => {}
}
},
data() {
return {}
return {
progressList: [
{
type: 3,
title: '短课程进度',
unit: '%',
key: 'shortCourseProgress',
ratio: 'shortCourseCompletedLearnRatio',
hidden: false
},
{
type: 4,
title: '长课程进度',
unit: '%',
key: 'longCourseProgress',
ratio: 'longCourseCompletedLearnRatio',
hidden: false
}
],
}
},
mounted() {
},
methods: {
}
}
</script>
......@@ -60,9 +99,17 @@ export default {
width: calc(100% - #{toRpx(64)});
border-radius: toRpx(24);
background: #ffffff;
padding: toRpx(24) toRpx(32);
padding: toRpx(24);
margin: 0 toRpx(32) toRpx(20);
&.small-height {
height: toRpx(396);
}
&.big-height {
height: toRpx(480);
}
&-title {
font-size: toRpx(28);
color: #1A1A1A;
......@@ -72,7 +119,8 @@ export default {
display: grid;
grid-template-columns: repeat(2, 1fr);
align-items: center;
margin-top: toRpx(16);
margin-top: toRpx(12);
margin-bottom: toRpx(36);
.statistics-item {
display: flex;
......@@ -111,7 +159,6 @@ export default {
.progress-box {
display: grid;
grid-template-columns: repeat(2, 1fr);
margin-top: toRpx(40);
gap: toRpx(24);
&.only-one {
......@@ -122,13 +169,22 @@ export default {
display: flex;
justify-content: space-between;
flex-direction: column;
background-color: #F5F9FF;
padding: toRpx(24) toRpx(20);
border-radius: toRpx(12);
&.bg {
background-color: #F5F9FF;
padding: toRpx(24) toRpx(20);
}
&-title {
font-size: toRpx(32);
color: #808080;
font-size: toRpx(24);
&.title {
color: #1A1A1A;
font-size: toRpx(28);
}
}
&-value {
......@@ -140,16 +196,28 @@ export default {
color: #000;
font-size: toRpx(32);
font-weight: 500;
&.blue-number {
font-size: toRpx(40);
font-weight: 700;
color: #3B73FF;
}
}
.unit {
font-size: toRpx(20);
color: #000;
margin-left: toRpx(4);
&.blue-unit {
font-size: toRpx(22);
font-weight: 500;
color: #3B73FF;
}
}
}
.progress-bar {
// position: relative;
width: calc(100% - #{toRpx(68)});
height: toRpx(12);
border-radius: toRpx(8);
......@@ -157,6 +225,10 @@ export default {
background: linear-gradient(128.8deg, #75bcff 0%, #2c66f7 100%);
margin-top: toRpx(32);
&.big-margin {
margin-top: toRpx(72);
}
&-value {
position: absolute;
left: 0;
......@@ -165,14 +237,23 @@ export default {
border-radius: toRpx(8);
opacity: 1;
background: linear-gradient(128.8deg, #75bcff 0%, #2c66f7 100%);
&.big-top {
top: toRpx(72);
}
}
}
.progress-item-finish {
height: toRpx(72);
margin-top: toRpx(40);
margin-top: toRpx(36);
font-size: toRpx(22);
color: #808080;
line-height: toRpx(36);
&.big-margin {
margin-top: toRpx(72);
}
.progress-text {
display: flex;
......
......@@ -4,11 +4,11 @@
<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.title }}</view>
<view class="tab-item-title">{{ item }}</view>
</view>
</view>
<view class="finish-tab" v-if="tabIndex === 1">
<view class="finish-tab-item" @click="handleFinishTabClick(0)" :class="{ 'finish-active': finishIndex === 0 }">
<view class="finish-tab-item" @click="handleFinishTabClick(2)" :class="{ 'finish-active': finishIndex === 2 }">
长课程
</view>
<view class="finish-tab-item" @click="handleFinishTabClick(1)" :class="{ 'finish-active': finishIndex === 1 }">
......@@ -25,39 +25,56 @@
<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" v-if="item.type == 1"></view>
<view v-if="item.type == 1" class="time-limit-countdown ">
<view class="countdown-label">剩</view>
<view class="countdown-num">08</view>
<view class="countdown-separator">:</view>
<view class="countdown-num">08</view>
<view class="countdown-separator">:</view>
<view class="countdown-num">08</view>
<view class="countdown-unit">天</view>
<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">
<view class="countdown-label timeout-label">已超时</view>
</template>
<template v-else-if="item._showCountdown">
<view class="countdown-label">剩</view>
<view class="countdown-num">{{ item._countdownHour }}</view>
<view class="countdown-separator">:</view>
<view class="countdown-num">{{ item._countdownMinute }}</view>
<view class="countdown-separator">:</view>
<view class="countdown-num">{{ item._countdownSecond }}</view>
</template>
<template v-else-if="item._showDays">
<view class="countdown-label">剩</view>
<view class="countdown-num">{{ item._leftDays }}</view>
<view class="countdown-days-label">天</view>
</template>
<template v-else>
<view class="countdown-label">剩</view>
<view class="countdown-num">--</view>
<view class="countdown-separator">:</view>
<view class="countdown-num">--</view>
<view class="countdown-separator">:</view>
<view class="countdown-num">--</view>
</template>
</view>
<image
class="task-item-img"
:src="item.type === 1
:src="item.courseType === 1
? require('../../../../assets/images/common/short-course-default.webp')
: require('../../../../assets/images/common/course-default-bg.webp')"
mode="aspectFill"
/>
<view class="task-item-content">
<view class="task-item-title">{{ item.title }}</view>
<view class="task-item-title">{{ item.taskTitle }}</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: item.progress + '%' }"></view>
<view class="task-item-progress-text">{{ item.progress }}%</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>
</view>
<view class="task-item-text" v-if="item.type === 2">
<view class="task-item-text" v-if="item.courseType === 2">
<view class="task-item-label">课程数</view>
<view class="task-item-value">{{ item.courseNum }} | {{ item.courseMinutes }}min</view>
<view class="task-item-value">{{ item.courseTotalCount }} | {{ item.totalDuration ? `${item.totalDuration}mi` : '-' }}</view>
</view>
<view class="task-item-text">
<view class="task-item-label">任务时间</view>
<view class="task-item-value">{{ item.time }}</view>
<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 class="task-item-status">{{ item.status }}</view>
</view>
......@@ -66,7 +83,7 @@
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../../../assets/images/home/nothing.webp" />
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
暂无数据
</view>
</template>
......@@ -78,100 +95,22 @@
</view>
</template>
<script>
import { compact } from 'lodash';
import dayjs from 'dayjs'
export default {
name: 'MyTask',
data() {
return {
tabList: [
{
title: '待完成',
value: '1'
},
{
title: '已完成',
value: '2'
},
],
tabList: ['待完成', '已完成'],
tabIndex: 0,
finishIndex: 0,
nothing: true,
finishIndex: 2,
nothing: false,
total: 0,
pageNum: 1,
pageSize: 9,
scrollTop: 0,
taskList: [
{
title: '短课程·6月11日',
time: '2025.06.12 18:00',
progress: 23,
status: 0,
punishType: 1,
type: 1, // 1: 短课程 2: 长课程
},
{
title: '短课程·6月11日',
time: '2025.06.12 18:00',
progress: 69,
status: 0,
punishType: 1,
type: 1, // 1: 短课程 2: 长课程
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
time: '2025.06.12 18:00',
progress: 15,
status: 0,
type: 2, // 1: 短课程 2: 长课程
courseNum: 2,
courseMinutes: 15
},
{
title: '短课程·6月11日',
time: '2025.06.12 18:00',
progress: 23,
status: 0,
type: 1, // 1: 短课程 2: 长课程
},
{
title: '短课程·6月11日',
time: '2025.06.12 18:00',
progress: 69,
status: 0,
type: 1, // 1: 短课程 2: 长课程
},
{
title: '鸿蒙智行客户沟通技巧',
time: '2025.06.12 18:00',
progress: 15,
status: 0,
type: 2, // 1: 短课程 2: 长课程
courseNum: 2,
courseMinutes: 15
},
{
title: '短课程·6月11日',
time: '2025.06.12 18:00',
progress: 23,
status: 0,
type: 1, // 1: 短课程 2: 长课程
},
{
title: '短课程·6月11日',
time: '2025.06.12 18:00',
progress: 69,
status: 0,
type: 1, // 1: 短课程 2: 长课程
},
{
title: '鸿蒙智行客户沟通技巧',
time: '2025.06.12 18:00',
progress: 15,
status: 0,
type: 2, // 1: 短课程 2: 长课程
courseNum: 2,
courseMinutes: 15
},
]
taskList: [],
timer: null // 只需要一个定时器
}
},
computed: {
......@@ -190,9 +129,218 @@ export default {
}
}
},
created () {
// 监听自定义事件
uni.$on('backStudyCenter', () => {
console.log('backStudyCenter')
this.getCourseTaskPage(this.tabIndex)
})
},
mounted() {
this.getCourseTaskPage(this.tabIndex)
},
beforeDestroy() {
this.clearCountdownTimer();
},
methods: {
// 清除倒计时定时器
clearCountdownTimer() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
// 启动倒计时定时器
startCountdownForAll() {
this.clearCountdownTimer();
this.updateAllCountdowns(); // 立即更新一次
this.timer = setInterval(() => {
this.updateAllCountdowns();
}, 1000);
},
// 更新所有需要倒计时的任务
updateAllCountdowns() {
const now = new Date();
let hasCountdown = false;
this.taskList.forEach(item => {
if (
this.tabIndex === 0 &&
item.punishType == 1 &&
item.taskDeadline
) {
const deadline = new Date(item.taskDeadline);
const diff = deadline - now;
if (diff > 0 && diff <= 24 * 60 * 60 * 1000) {
hasCountdown = true;
const hours = Math.floor(diff / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
this.$set(item, '_countdownHour', hours.toString().padStart(2, '0'));
this.$set(item, '_countdownMinute', minutes.toString().padStart(2, '0'));
this.$set(item, '_countdownSecond', seconds.toString().padStart(2, '0'));
this.$set(item, '_showCountdown', true);
this.$set(item, '_showDays', false);
this.$set(item, '_leftDays', null);
this.$set(item, '_timeout', false);
} else if (diff > 24 * 60 * 60 * 1000) {
// 超过24小时,显示剩余天数
this.$set(item, '_showCountdown', false);
this.$set(item, '_showDays', true);
const days = Math.ceil(diff / (24 * 60 * 60 * 1000));
this.$set(item, '_leftDays', days);
this.$set(item, '_countdownHour', null);
this.$set(item, '_countdownMinute', null);
this.$set(item, '_countdownSecond', null);
this.$set(item, '_timeout', false);
} else if (diff <= 0) {
// 已超时
this.$set(item, '_timeout', true);
this.$set(item, '_showCountdown', false);
this.$set(item, '_showDays', false);
this.$set(item, '_leftDays', null);
this.$set(item, '_countdownHour', null);
this.$set(item, '_countdownMinute', null);
this.$set(item, '_countdownSecond', null);
}
} else {
this.$set(item, '_showCountdown', false);
this.$set(item, '_showDays', false);
this.$set(item, '_leftDays', null);
this.$set(item, '_timeout', false);
}
});
// 如果没有任何需要倒计时的,清除定时器
if (!hasCountdown) {
this.clearCountdownTimer();
}
},
// 格式化时间
formatTime(time, formatStr) {
if (!time) return '-';
return dayjs(time).format(formatStr);
},
// 初始化倒计时字段(用于新获取的数据)
initCountdownFieldsForList(list) {
const now = new Date();
list.forEach(item => {
if (this.tabIndex === 0 && item.punishType == 1 && item.taskDeadline) {
const deadline = new Date(item.taskDeadline);
const diff = deadline - now;
if (diff > 0 && diff <= 24 * 60 * 60 * 1000) {
// 需要倒计时
const hours = Math.floor(diff / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
this.$set(item, '_countdownHour', hours.toString().padStart(2, '0'));
this.$set(item, '_countdownMinute', minutes.toString().padStart(2, '0'));
this.$set(item, '_countdownSecond', seconds.toString().padStart(2, '0'));
this.$set(item, '_showCountdown', true);
this.$set(item, '_showDays', false);
this.$set(item, '_leftDays', null);
this.$set(item, '_timeout', false);
} else if (diff > 24 * 60 * 60 * 1000) {
// 超过24小时,显示剩余天数
const days = Math.ceil(diff / (24 * 60 * 60 * 1000));
this.$set(item, '_showCountdown', false);
this.$set(item, '_showDays', true);
this.$set(item, '_leftDays', days);
this.$set(item, '_countdownHour', null);
this.$set(item, '_countdownMinute', null);
this.$set(item, '_countdownSecond', null);
this.$set(item, '_timeout', false);
} else if (diff <= 0) {
// 已超时
this.$set(item, '_timeout', true);
this.$set(item, '_showCountdown', false);
this.$set(item, '_showDays', false);
this.$set(item, '_leftDays', null);
this.$set(item, '_countdownHour', null);
this.$set(item, '_countdownMinute', null);
this.$set(item, '_countdownSecond', null);
}
} else {
this.$set(item, '_showCountdown', false);
this.$set(item, '_showDays', false);
this.$set(item, '_leftDays', null);
this.$set(item, '_timeout', false);
}
});
},
// 获取我的任务接口, completeStatus: 完成状态 0=待完成 1=已完成, courseType: 课程类型 1=短课程 2=长课程
async getCourseTaskPage(completeStatus, courseType) {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const params = {
completeStatus, // 完成状态 0=待完成 1=已完成
recommendStatus: 0, // 推荐状态 0=无推荐 1=推荐课程
pageNum,
pageSize
}
if (courseType) {
params.courseType = courseType
}
const res = await uni.$api.commonApi.getCourseTaskPage(params)
// 处理倒计时相关字段
let newList = res.list || [];
// 对新获取的数据初始化倒计时字段
if (completeStatus === 0) {
this.initCountdownFieldsForList(newList);
}
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
// 只在tabIndex为0时处理倒计时
if (completeStatus === 0) {
// 启动定时器(不管是第一页还是翻页都要)
this.startCountdownForAll();
} else {
// 非待完成tab,清除定时器
this.clearCountdownTimer();
}
} 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(tabIndex)
} else {
this.getCourseTaskPage(tabIndex, finishIndex)
}
} else {
this.nothing = true;
}
},
handleTabClick(index) {
this.tabIndex = index
this.pageNum = 1
this.nothing = false
this.taskList = []
this.clearCountdownTimer();
if (index == 1) {
this.finishIndex = 2
this.getCourseTaskPage(index, this.finishIndex) // 已完成,默认查长课程
} else {
this.getCourseTaskPage(index)
}
this.scrollTop = 1
setTimeout(() => {
this.scrollTop = 0
......@@ -200,12 +348,20 @@ export default {
},
handleFinishTabClick(index) {
this.finishIndex = index
this.pageNum = 1
this.nothing = false
this.taskList = []
this.clearCountdownTimer();
this.getCourseTaskPage(this.tabIndex, index)
},
handleTaskItemClick(item) {
console.log(item)
const {type} = item
const {courseType, id} = item
if (courseType == 1) {
uni.$track.add({eventCode: 'app_short_course', businessId: id, pagePath: '/pages/equity/index'})
}
uni.navigateTo({
url: `/pages/common/studyDetail/${type == 1 ? 'shortCourse' : 'longCourse'}?row=${encodeURIComponent(JSON.stringify(item))}`,
url: `/pages/common/studyDetail/${courseType == 1 ? 'shortCourse' : 'longCourse'}?row=${encodeURIComponent(JSON.stringify(item))}`,
fail: (err) => {
console.error('页面跳转失败:', err);
}
......@@ -366,6 +522,16 @@ export default {
color: #00000066;
margin: 0 toRpx(4);
}
.timeout-label {
height: toRpx(40);
line-height: toRpx(40);
border-radius: toRpx(4);
background: #00000059;
color: #fff;
padding: toRpx(4) toRpx(8);
padding: 0 toRpx(12);
font-size: toRpx(24);
}
}
.task-item-img {
......
......@@ -4,7 +4,7 @@
: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(index)">
<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"
......@@ -12,16 +12,16 @@
/>
<view class="recommend-course-content">
<view class="recommend-course-item-title">
{{ item.title }}
{{ item.taskTitle }}
</view>
<view class="recommend-course-item-text">{{ item.courseNum }}节 | {{ item.courseMinutes }}min</view>
<view class="recommend-course-item-text">{{ item.courseTotalCount ? `${item.courseTotalCount}节` : '-' }} | {{ item.totalDuration ? `${item.totalDuration}mi` : '-' }}</view>
</view>
</view>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../../../assets/images/home/nothing.webp" />
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
暂无数据
</view>
</template>
......@@ -36,135 +36,138 @@ export default {
name: 'RecommendCourse',
data() {
return {
// recommendCourseList: [],
recommendCourseList: [],
nothing: false,
recommendCourseList: [
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
{
title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
courseNum: 2,
courseMinutes: 15
},
],
total: 0,
pageNum: 1,
pageSize: 9,
// recommendCourseList: [
// {
// taskTitle: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// taskTitle: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// taskTitle: '鸿蒙智行客户沟通',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// taskTitle: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// taskTitle: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// taskTitle: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// {
// title: '鸿蒙智行客户沟通技巧打法都收费阿道夫鞍山市',
// courseNum: 2,
// courseMinutes: 15
// },
// ],
scrollTop: 0,
}
},
......@@ -177,8 +180,51 @@ export default {
return 'scroll-view'
}
},
mounted() {
this.getCourseTaskPage()
},
methods: {
startStudy(index) {
// 获取我的任务接口, 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) {
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}`
})
......@@ -219,6 +265,8 @@ export default {
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);
......
<template>
<view class="study-box2">
<view :class="['study-box2', isFlag ? '' : 'big-height']">
<view class="tab-list">
<view @click="handleTabClick(index)" :class="['tab-item', tabIndex === index ? 'active' : '']"
v-for="(item, index) in tabList" :key="index">
......@@ -8,14 +8,14 @@
</view>
<view class="rank-title">周转化率排名</view>
<view class="rank-value">
<view class="rank-number">{{ barValue }}</view>名
<view class="rank-number">{{ currentConversionData.top }}</view>名
</view>
<view class="bar-box">
<view class="bar-item" v-for="(item, index) in barList" :key="index">
<view class="bar-label">{{ item.label }}</view>
<view class="bar-container">
<view class="bar" :class="item.class" :style="{ width: item.value + '%' }"></view>
<view class="bar-text" :style="{ left: `calc(${item.value}%)` }">{{ item.value }}%</view>
<view class="bar" :class="item.class" :style="{ width: currentConversionData[item.key] + '%' }"></view>
<view class="bar-text" :style="{ left: `calc(${currentConversionData[item.key]}%)` }">{{ currentConversionData[item.key] }}%</view>
</view>
</view>
</view>
......@@ -25,34 +25,98 @@
export default {
name: 'WeeklyConversionRate',
props: {
barList: {
type: Array,
default: () => []
isFlag: {
type: Boolean,
default: false
},
barValue: {
type: Number,
default: 0
dataInfo: {
type: Object,
default: () => {}
}
},
data() {
return {
tabList: [
barValue: 56,
barList: [
{
title: '延保',
value: '1'
label: '我的',
value: '74.3',
key: 'myConversionRatio',
class: 'my'
},
{
title: '权益',
value: '2'
},
{
title: '轻改',
value: '3'
},
label: 'Top1',
value: '94.5',
key: 'topOneConversionRatio',
class: 'top1'
}
],
tabIndex: 0,
}
},
computed: {
tabList() {
// 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 []
// 生成tabList,key为weekConversionRatio的key
return Object.keys(weekConversionRatio).map(key => {
// 这里可以根据实际业务自定义title
// 例如:0-延保,1-精品,2-权益
// 这里暂时用key做title
let title = ''
if (key == 0) title = '延保'
else if (key == 1) title = '轻改'
else if (key == 2) title = '权益'
else title = `类型${key}`
return {
title,
value: key
}
})
},
currentConversionData() {
// 返回当前tabIndex对应的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 {}
const key = this.tabList[this.tabIndex] && this.tabList[this.tabIndex].value
return weekConversionRatio[key] || {}
}
},
methods: {
handleTabClick(index) {
this.tabIndex = index
......@@ -67,6 +131,9 @@ export default {
background: #ffffff;
padding: toRpx(24);
margin: 0 toRpx(32) toRpx(16);
&.big-height {
height: toRpx(764);
}
.tab-list {
display: flex;
......@@ -144,7 +211,7 @@ export default {
position: relative;
flex: 1;
// width: toRpx(380);
height: toRpx(20);
height: toRpx(12);
// overflow: hidden;
}
......
......@@ -4,14 +4,16 @@
<view class="title">学习看板</view>
<view class="study-board-box">
<!-- 累计学习看板 -->
<LearnStatistics :progressList="progressList" />
<LearnStatistics :dataInfo="dataInfo" :isBeisen="isBeisen" />
<!-- 周转化率看板 -->
<WeeklyConversionRate :barList="barList" :barValue="barValue" />
<WeeklyConversionRate :dataInfo="dataInfo" :isFlag="isFlag" />
<!-- 能力分析看板 -->
<view class="study-box3">
<view>能力分析</view>
<RadarChart :chartData="chartData" />
</view>
<template v-if="isFlag">
<view :class="['study-box3', isBeisen ? '' : 'big-height']">
<view :class="['study-box3-title', isBeisen ? '' : 'big-margin']">能力分析</view>
<RadarChart :labelColors="labelColors" :heightClass="isBeisen ? '' : 'big-height'" :chartData="chartData" />
</view>
</template>
</view>
</view>
<view class="study-right">
......@@ -29,7 +31,7 @@
</view>
</view>
<template v-if="firstIndex == 0">
<MyTask />
<MyTask ref="myTask" />
</template>
<template v-if="firstIndex == 1">
<RecommendCourse />
......@@ -56,35 +58,9 @@ export default {
},
data() {
return {
progressList: [
{
title: '短课程进度',
value: '46.2',
unit: '%',
finish: '15'
},
{
title: '长课程进度',
value: null,
unit: '%',
finish: null
}
],
barValue: 56,
barList: [
{
label: '我的',
value: '74.3',
class: 'my'
},
{
label: 'Top1',
value: '94.5',
class: 'top1'
}
],
chartData: {},
dataInfo: {},
labelColors: [],
typeList: [
{ tabName: '我的任务', num: () => '' },
{ tabName: '推荐课程', num: () => '' }
......@@ -92,10 +68,22 @@ export default {
firstIndex: 0,
firstLeft: ['first', 'second'],
firstClass: ['short-first-nav', 'short-second-nav'],
isBeisen: true, // 是否是有北森权限,true 有,false无
isFlag: true // 当前驻店人员所关联的门店非鸿蒙智行或非延保业务
}
},
created () {
// 监听自定义事件
uni.$on('backStudyCenter', () => {
console.log('backStudyCenter')
this.$refs.myTask.getCourseTaskPage(0)
})
},
mounted() {
this.getServerData();
const beisenToken = uni.$storage.get('beisenToken')
console.log(beisenToken, 'beisenToken')
// this.getServerData();
this.getStudyBoard();
},
methods: {
// tab切换
......@@ -118,6 +106,34 @@ export default {
this.chartData = JSON.parse(JSON.stringify(res));
console.log(this.chartData, ' 首页')
}, 500);
},
async getStudyBoard() {
const res = await uni.$api.commonApi.getStudyBoard({})
console.log(111111, 'res', res)
this.dataInfo = res
this.dataInfo.shortCourseProgress = 0
this.dataInfo.shortCourseCompletedLearnRatio = 15
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;
}
}
}
}
......@@ -156,13 +172,27 @@ export default {
border-radius: 0 0 toRpx(48) toRpx(48);
}
}
.study-box3 {
width: calc(100% - #{toRpx(64)});
border-radius: toRpx(24);
background: #ffffff;
padding: toRpx(24);
margin: 0 toRpx(32) toRpx(16);
&.big-height {
height: toRpx(448);
}
&-title {
margin-bottom: toRpx(10);
&.big-margin {
margin-bottom: toRpx(40);
}
}
}
.study-right {
flex: 1;
background-color: rgba(255, 255, 255, 0.35);
......@@ -238,6 +268,7 @@ export default {
font-weight: 500;
font-size: toRpx(32);
color: #3B73FF;
&::after {
content: '';
position: absolute;
......@@ -255,5 +286,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
......@@ -136,8 +136,15 @@ export default {
})
const { sceneType, uuid } = uni.$storage.get("userInfo")
const { tagIndex, pageNum, pageSize } = this
let businessTypeList = []
if (sceneType == 0) {
businessTypeList = [0, 2]
} else if (sceneType == 1) {
businessTypeList = [1]
}
const params = {
businessType: sceneType,
// businessType: sceneType,
businessTypeList,
uuid,
classCode: tagIndex,
pageNum,
......
......@@ -15,7 +15,7 @@
i.title }}</view>
</view>
<view class="message-item-time-box">
<view class="message-item-time">{{ formatTime(i.createdTime) }}</view>
<view class="message-item-time">{{ formatTime(i.createdTime, 'HH:mm') }}</view>
<view class="sprite-icon icon-stick-top"></view>
</view>
</view>
......@@ -35,7 +35,7 @@
<view class="message-item-desc">{{ moduleContentEnum[i.moduleType] ? moduleContentEnum[i.moduleType] :
i.title }}</view>
</view>
<view class="message-item-time">{{ formatTime(i.createdTime) }}</view>
<view class="message-item-time">{{ formatTime(i.createdTime, 'HH:mm') }}</view>
</view>
</view>
</view>
......@@ -131,10 +131,13 @@ export default {
computed: {
getTopList() {
if (!this.topList) return [];
// 按topList中的倒序排列
return this.topList.slice().reverse().map(type =>
this.msgList.find(item => item.moduleType === type)
).filter(Boolean);
// 过滤出topList中包含moduleType的对象
const result = this.msgList.filter(item => this.topList.includes(item.moduleType));
return result
// // 按topList中的倒序排列
// return this.topList.slice().reverse().map(type =>
// this.msgList.find(item => item.moduleType === type)
// ).filter(Boolean);
},
getList() {
// 过滤掉topList中包含moduleType的对象
......@@ -171,8 +174,8 @@ export default {
const key = `${phone}-${shopMerchantId}-${sceneType}`
this.topList = _topInfo[key] || []
},
formatTime(time) {
return dayjs(time).format('HH:mm');
formatTime(time, formatStr) {
return dayjs(time).format(formatStr);
},
handleClick(item) {
this.$emit('handleClick', item)
......
......@@ -20,13 +20,30 @@
</view>
<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-title">{{ moduleTypeEnum[moduleType] }}
<view class="service-item-title">
<template v-if="moduleType == 3 || moduleType == 4">
<view class="service-item-title-left">{{ item.title }}</view>
</template>
<template v-else>
<view class="service-item-title-left">{{ moduleTypeEnum[moduleType] }}</view>
</template>
<view class="service-item-title-right">
<view>查看详情</view>
<view class="sprite-icon icon-coupon-arrow"></view>
</view>
</view>
<view class="service-item-text">提醒时间:{{ item.time }}</view>
<template v-if="moduleType == 3 || moduleType == 4">
<template v-if="item.taskType == 1">
<view class="service-item-text">学习任务名称:{{ item.taskName }}</view>
<view class="service-item-text">任务完成时间:小伙伴,请于{{formatTime(item.finishTime, 'YYYY-MM-DD HH:mm')}}完成哦~</view>
<!-- <view class="service-item-text">提醒内容:{{ item.title }}</view> -->
</template>
<template v-else-if="item.taskType == 2">
<view class="service-item-text">提醒内容:您有未完成的学习任务即将到期:{{formatTime(item.finishTime, 'YYYY-MM-DD HH:mm')}},抓紧时间完成哦!</view>
<!-- <view class="service-item-text">学习任务名称:{{ item.taskName }}</view> -->
</template>
</template>
<view class="service-item-text">提醒时间:{{ item.time || formatTime(item.createdTime, 'YYYY-MM-DD HH:mm') }}</view>
<template v-if="moduleType == 1 || moduleType == 2">
<view class="service-item-text">提醒内容:{{ moduleContentEnum[moduleType] }}</view>
</template>
......@@ -70,6 +87,8 @@ export default {
scriptList: [],
earlyWarnList: [],
systemList: [],
shortCourseList: [],
longCourseList: [],
total: 0,
nothing: false,
pageNum: 1,
......@@ -90,6 +109,10 @@ export default {
return this.scriptList
case 2:
return this.earlyWarnList
case 3:
return this.shortCourseList
case 4:
return this.longCourseList
default:
return []
}
......@@ -108,6 +131,11 @@ export default {
case 2:
this.getWarningPage()
break
case 3:
this.getCourseList(3)
break
case 4:
this.getCourseList(4)
default:
break
}
......@@ -121,11 +149,13 @@ export default {
// this.handleClick({moduleType: this.moduleType})
},
methods: {
formatTime(time, formatStr) {
return dayjs(time).format(formatStr);
},
// 获取服务中心列表
async getMessageSummary(sceneType) {
// const userInfo = uni.$storage.get('userInfo')
const res = await getMessageSummary({businessType: sceneType})
console.log(res, '===')
this.messageList = res
},
// 获取缓存中置顶的列表
......@@ -195,8 +225,15 @@ export default {
})
const { sceneType, uuid } = uni.$storage.get("userInfo")
const { pageNum, pageSize } = this
let businessTypeList = []
if (sceneType == 0) {
businessTypeList = [0, 2]
} else if (sceneType == 1) {
businessTypeList = [1]
}
const params = {
businessType: sceneType,
// businessType: sceneType,
businessTypeList,
uuid,
pageNum,
pageSize
......@@ -256,7 +293,7 @@ export default {
* 当页面触底时,判断是否还有更多数据,如果有则加载下一页数据
* 如果没有更多数据,则标记为没有更多数据状态
*/
pageonReachBottom() {
pageonReachBottom() {
console.log('到底了');
// 解构赋值,设置 nothing 的默认值
let { pageNum, total, nothing = 'nothing', pageSize } = this;
......@@ -352,9 +389,35 @@ export default {
break
}
},
async getCourseList(moduleType) {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const res = await uni.$api.commonApi.getCourseList({
pageNum, pageSize, moduleType
})
res.list?.length && res.list.map(e => {
e.time = e.actualSendTimeStr
})
if (pageNum == 1) {
moduleType == 3 ? (this.shortCourseList = res.list) : (this.longCourseList = res.list)
} else {
moduleType == 3 ? (this.shortCourseList = this.shortCourseList.concat(res.list)) : (this.longCourseList = this.longCourseList.concat(res.list))
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
// 置顶,取消置顶
handleStickTop() {
console.log('置顶')
clearTimeout(timer)
const { phone, shopMerchantId, sceneType } = this.userInfo
const _topInfo = uni.$storage.get('noticeTopInfo') || {}
......
<template>
<view>
<qiun-data-charts type="radar" :opts="opts" :chartData="chartData" class="charts-box" />
<view >
<template v-if="labelColors && labelColors.length > 0">
<qiun-data-charts type="radar" :opts="opts" :chartData="chartData" :class="['charts-box', heightClass]" />
</template>
<template v-else>
<view class="nothing flex" :class="['big-height']">
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
暂无数据
</view>
</template>
</view>
</template>
<script>
......@@ -10,6 +18,21 @@ export default {
chartData: {
type: Object,
default: () => {}
},
heightClass: {
type: String
},
labelColors: {
type: Array,
default: () => ['#666666', '#666666', '#666666', '#666666', '#666666', '#666666', '#666666', '#666666', '#666666']
}
},
watch: {
labelColors: {
handler(newVal) {
console.log(newVal, 'newVal')
this.opts.labelColors = newVal
},
}
},
data() {
......@@ -19,7 +42,7 @@ export default {
padding: [0, 5, 0, 5],
dataLabel: false,
enableScroll: false,
labelColors: ['#666666', '#EB4E4E', '#666666', '#666666', '#666666', '#EB4E4E', '#666666', '#EB4E4E', '#666666'],
// labelColors: ['#666666', '#666666', '#666666', '#666666', '#666666', '#EB4E4E', '#666666', '#EB4E4E', '#666666'],
fontSize: 12,
legend: {
show: false
......@@ -30,7 +53,7 @@ export default {
gridColor: "#dae8fd",
gridCount: 3,
opacity: 0.2,
max: 10,
max: 3,
labelShow: true,
axisLabelTofix: 1, // 保留一位小数
labelFormatter: function (val) {
......@@ -51,5 +74,27 @@ export default {
.charts-box {
width: 100%;
height: toRpx(272);
&.big-height {
height: toRpx(300);
}
}
.nothing {
width: 100%;
height: toRpx(228);
flex-direction: column;
margin-top: toRpx(44);
font-size: toRpx(24);
color: #999999;
box-sizing: border-box;
&.big-height {
height: toRpx(234);
}
.icon {
width: toRpx(288);
height: toRpx(144);
margin-bottom: toRpx(4);
}
}
</style>
\ No newline at end of file
......@@ -12,7 +12,7 @@
<view class="scroll-view-box">
<scroll-view class="scroll-view" scroll-y>
<view :class="['scroll-view-item', selectedIndex == index ? 'active' : '']"
v-for="(item, index) in getCourseList" :key="index" @click="openCourse(index)">
v-for="(item, index) in getCourseList" :key="index" @click="openCourse(index, item)">
<template v-if="type === 'long'">
<image class="item-img" src="../../../assets/images/common/long-course-default.webp"
mode="scaleToFill" />
......@@ -185,7 +185,6 @@ export default {
times: 10
}
],
type: '',
selectedIndex: 0,
jumpUrl: '',
......@@ -227,12 +226,15 @@ export default {
}
uni.navigateBack()
},
openCourse(index) {
openCourse(inde, item) {
console.log(index, 'index')
this.selectedIndex = index;
const arr = ['80cb90d7-1609-4360-8f23-6c47ddba41c0', '17983a1a-5bcd-4e7d-a180-061ef3f9a49d']
// 只更换url
this.handleOperation(arr[index]);
if (this.type === 'recommendation') {
uni.$track.add({eventCode: 'app_recommend_course', businessId: item.id, pagePath: '/pages/common/studyDetail/detail'})
}
},
handleOperation(courseId) {
// 只处理课程详情,设置jumpUrl
......
......@@ -159,13 +159,25 @@ export default {
score: '未完成(25%)',
duration: '未完成(25%)'
}
]
],
}
},
onLoad(options) {
const {row} = options
const rowData = JSON.parse(decodeURIComponent(row))
console.log(rowData, 'rowData')
this.getLongCourseDetail(rowData.id)
},
methods: {
backPage() {
uni.navigateBack();
},
async getLongCourseDetail(id) {
const res = await uni.$api.commonApi.getLongCourseDetail({
id
})
console.log(res, 'res')
},
startStudy(index) {
uni.navigateTo({
url: `/pages/common/studyDetail/detail?type=long&index=${index}`
......
......@@ -10,13 +10,12 @@
<view class="left-box">
<view class="top-box">
<view class="top-box-name">
许小奇
<view class="role-tag">驻店销售</view>
<view class="role-tag">带教导师</view>
{{courseDetail.staffName || '-'}}
<view class="role-tag" v-for="(item, index) in courseDetail.positionList" :key="index">{{item}}</view>
</view>
<view class="top-box-info">
<view class="top-box-info-item">驻店时间:首月</view>
<view class="top-box-info-item">直属上级:张三丰</view>
<view class="top-box-info-item">驻店时间:{{courseDetail.residentTimeTag || '-'}}</view>
<view class="top-box-info-item">直属上级:{{courseDetail.superior || '-'}}</view>
</view>
</view>
<view class="bottom-box">
......@@ -24,7 +23,7 @@
<view>战败复盘</view>
<view class="date">2025年6月25日</view>
</view>
<RadarChart :chartData="chartData" />
<RadarChart :labelColors="labelColors" :chartData="chartData" />
<view class="bottom-box-summary">
<view>总结</view>
<view class="summary-btn">查看</view>
......@@ -115,6 +114,7 @@ export default {
data() {
return {
chartData: {},
labelColors: [],
detailList: [
{
name: '许小奇',
......@@ -252,15 +252,60 @@ export default {
},
],
qualityTitle: Object.freeze(['课程标签', '不足/改善建议', '对练考核']),
courseDetail: {},
rowData: {}
}
},
mounted() {
this.getServerData();
// this.getServerData();
},
onLoad(options) {
const {row} = options
const rowData = JSON.parse(decodeURIComponent(row))
console.log(rowData, 'rowData')
this.rowData = rowData
this.getShortCourseDetail(rowData.id)
},
methods: {
backPage() {
uni.$emit("backStudyCenter")
uni.navigateBack();
},
async getShortCourseDetail(id) {
const res1 = await uni.$api.commonApi.getStudyBoard({id})
const res = {
staffName: '许小奇',
position: '驻店销售,带教导师',
residentTimeTag: '',
superior: '',
defeatReviewTag: ["身份介绍", "逼单能力", "攻防能力", "案例展示", "场景塑造", "专业知识", "需求分析", "话题介入", "服务意识"],
defeatReviewScore: [1, 2, 3, 1, 2, 2, 3, 3, 3]
}
const _chartData = {
categories: res.defeatReviewTag,
series: [
{
data: res.defeatReviewScore
}
]
}
this.chartData = _chartData
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');
}
console.log(_labelColors, '_labelColors')
this.labelColors = _labelColors;
console.log(this.labelColors, 'this.labelColors')
}
console.log(res, 'res')
res.positionList = res.position.split(',')
this.courseDetail = res
},
getServerData() {
//模拟从服务器获取数据时的延时
setTimeout(() => {
......
......@@ -41,5 +41,6 @@ export const STORAGE_OBJECTKEY = {
recordTrackList: 'recordTrackList',
beisenToken: 'beisenToken',
messagePopShownDate: 'messagePopShownDate',
noticeTopInfo: 'noticeTopInfo'
noticeTopInfo: 'noticeTopInfo',
isSaleOpen: 'isSaleOpen'
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!