Commit 3da6a525 by 李伟康

Merge branch 'SAAS+V4.55.0' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V4.55.0

2 parents 18d21840 eaacc8db
...@@ -377,5 +377,45 @@ module.exports = { ...@@ -377,5 +377,45 @@ module.exports = {
projectName: 'pad', projectName: 'pad',
...data ...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 @@ ...@@ -21,6 +21,7 @@
:class="['tab-item', { tabActive: tabIndex == index }]" :class="['tab-item', { tabActive: tabIndex == index }]"
:key="index" :key="index"
@click="changeIndex(index, i)" @click="changeIndex(index, i)"
v-if="!i.hidden"
> >
<view class="icon-box"> <view class="icon-box">
<view :class="['sprite-icon', `icon-${i.icon}${tabIndex == index ? '-active' : ''}`]"></view> <view :class="['sprite-icon', `icon-${i.icon}${tabIndex == index ? '-active' : ''}`]"></view>
...@@ -116,7 +117,8 @@ export default { ...@@ -116,7 +117,8 @@ export default {
icon: "study", icon: "study",
isTrack: true, isTrack: true,
name: 'StudyCenter', name: 'StudyCenter',
eventCode: 'app_study_center' eventCode: 'app_study_center',
hidden: true
}, },
{ {
label: "场景集市", label: "场景集市",
...@@ -305,22 +307,35 @@ export default { ...@@ -305,22 +307,35 @@ export default {
merchantId: shopMerchantId, merchantId: shopMerchantId,
scene scene
}).then(result => { }).then(result => {
uni.$storage.set('isSaleOpen', result)
if (result) { if (result) {
this.hasPerson = true this.hasPerson = true
}
const channelType = 1
// 非直营且非鸿蒙智行, 隐藏学习中心tab
if (result || channelType == 1) {
this.tabs[2].hidden = false
} }
}) })
}, },
// 获取话术未读列表 // 获取话术未读列表
async getMessage () { async getMessage () {
const { sceneType, uuid } = uni.$storage.get("userInfo") 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({ const res = await uni.$api.commonApi.getUnreadRecord({
businessType: sceneType, // businessType: sceneType,
businessTypeList,
uuid uuid
}) })
if (res.total) { if (res.total) {
this.messageData = res this.messageData = res
this.messageType = 'attendance' this.messageType = 'attendance'
this.$refs.kfRef.open() // this.$refs.kfRef.open()
} }
}, },
// 消息中心未读总数 // 消息中心未读总数
...@@ -381,7 +396,6 @@ export default { ...@@ -381,7 +396,6 @@ export default {
}) })
}, },
getMessageInfo () { getMessageInfo () {
console.log(111111, 'getMessageInfo')
// this.getMessage() // this.getMessage()
// this.getMessageCount() // this.getMessageCount()
this.getMessagePop() this.getMessagePop()
......
...@@ -36,6 +36,7 @@ export default { ...@@ -36,6 +36,7 @@ export default {
}, },
handleClick(item) { handleClick(item) {
const { moduleType } = item const { moduleType } = item
uni.$track.add({eventCode: 'app_service_center'})
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/serviceDetail/index?moduleType=${moduleType}` url: `/pages/common/serviceDetail/index?moduleType=${moduleType}`
}) })
......
<!-- 累计学习 --> <!-- 累计学习 -->
<template> <template>
<view class="learn-statistics"> <view :class="['learn-statistics', isBeisen ? 'big-height' : 'small-height']">
<view class="learn-statistics-title">累计学习</view> <view class="learn-statistics-title" v-if="isBeisen">累计学习</view>
<view class="statistics-content"> <view class="statistics-content" v-if="isBeisen">
<view class="statistics-item "> <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 class="statistics-unit blue-number">小时</view>
</view> </view>
<view class="statistics-item"> <view class="statistics-item">
<view class="text">排名</view> <view class="text">排名</view>
<view class="statistics-rank">13</view> <view class="statistics-rank">{{ dataInfo.learnDurationRank || '-' }}</view>
<view class="statistics-unit">名</view> <view class="statistics-unit">名</view>
</view> </view>
</view> </view>
<view :class="['progress-box', progressList.length === 1 ? 'only-one' : '']"> <view :class="['progress-box', progressList.filter(item => !item.hidden).length === 1 ? 'only-one' : '']">
<view class="progress-item" v-for="(item, index) in progressList" :key="index"> <template v-for="(item, index) in progressList">
<view class="progress-item-title">{{ item.title }}</view> <view :class="['progress-item', isBeisen ? 'bg' : '']" :key="index" v-if="!item.hidden">
<view class="progress-item-value"> <view :class="['progress-item-title', isBeisen ? '' : 'title']">{{ item.title }}</view>
<view class="number">{{ item.value ? item.value : '-' }}</view> <view class="progress-item-value">
<view v-if="item.value" class="unit">{{ item.unit }}</view> <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>
<view style="position: relative;"> </template>
<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>
</view> </view>
</view> </view>
</template> </template>
...@@ -44,13 +56,40 @@ ...@@ -44,13 +56,40 @@
export default { export default {
name: 'LearnStatistics', name: 'LearnStatistics',
props: { props: {
progressList: { isBeisen: {
type: Array, type: Boolean,
default: () => [] default: false
},
dataInfo: {
type: Object,
default: () => {}
} }
}, },
data() { 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> </script>
...@@ -60,9 +99,17 @@ export default { ...@@ -60,9 +99,17 @@ 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) toRpx(32); padding: toRpx(24);
margin: 0 toRpx(32) toRpx(20); margin: 0 toRpx(32) toRpx(20);
&.small-height {
height: toRpx(396);
}
&.big-height {
height: toRpx(480);
}
&-title { &-title {
font-size: toRpx(28); font-size: toRpx(28);
color: #1A1A1A; color: #1A1A1A;
...@@ -72,7 +119,8 @@ export default { ...@@ -72,7 +119,8 @@ export default {
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
align-items: center; align-items: center;
margin-top: toRpx(16); margin-top: toRpx(12);
margin-bottom: toRpx(36);
.statistics-item { .statistics-item {
display: flex; display: flex;
...@@ -111,7 +159,6 @@ export default { ...@@ -111,7 +159,6 @@ export default {
.progress-box { .progress-box {
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
margin-top: toRpx(40);
gap: toRpx(24); gap: toRpx(24);
&.only-one { &.only-one {
...@@ -122,13 +169,22 @@ export default { ...@@ -122,13 +169,22 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-direction: column; flex-direction: column;
background-color: #F5F9FF; border-radius: toRpx(12);
padding: toRpx(24) toRpx(20);
&.bg {
background-color: #F5F9FF;
padding: toRpx(24) toRpx(20);
}
&-title { &-title {
font-size: toRpx(32); font-size: toRpx(32);
color: #808080; color: #808080;
font-size: toRpx(24); font-size: toRpx(24);
&.title {
color: #1A1A1A;
font-size: toRpx(28);
}
} }
&-value { &-value {
...@@ -140,16 +196,28 @@ export default { ...@@ -140,16 +196,28 @@ export default {
color: #000; color: #000;
font-size: toRpx(32); font-size: toRpx(32);
font-weight: 500; font-weight: 500;
&.blue-number {
font-size: toRpx(40);
font-weight: 700;
color: #3B73FF;
}
} }
.unit { .unit {
font-size: toRpx(20); font-size: toRpx(20);
color: #000; color: #000;
margin-left: toRpx(4);
&.blue-unit {
font-size: toRpx(22);
font-weight: 500;
color: #3B73FF;
}
} }
} }
.progress-bar { .progress-bar {
// position: relative;
width: calc(100% - #{toRpx(68)}); width: calc(100% - #{toRpx(68)});
height: toRpx(12); height: toRpx(12);
border-radius: toRpx(8); border-radius: toRpx(8);
...@@ -157,6 +225,10 @@ export default { ...@@ -157,6 +225,10 @@ export default {
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(32);
&.big-margin {
margin-top: toRpx(72);
}
&-value { &-value {
position: absolute; position: absolute;
left: 0; left: 0;
...@@ -165,14 +237,23 @@ export default { ...@@ -165,14 +237,23 @@ export default {
border-radius: toRpx(8); border-radius: toRpx(8);
opacity: 1; opacity: 1;
background: linear-gradient(128.8deg, #75bcff 0%, #2c66f7 100%); background: linear-gradient(128.8deg, #75bcff 0%, #2c66f7 100%);
&.big-top {
top: toRpx(72);
}
} }
} }
.progress-item-finish { .progress-item-finish {
height: toRpx(72); height: toRpx(72);
margin-top: toRpx(40); margin-top: toRpx(36);
font-size: toRpx(22); font-size: toRpx(22);
color: #808080; color: #808080;
line-height: toRpx(36);
&.big-margin {
margin-top: toRpx(72);
}
.progress-text { .progress-text {
display: flex; display: flex;
......
<template> <template>
<view class="study-box2"> <view :class="['study-box2', isFlag ? '' : '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">
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
</view> </view>
<view class="rank-title">周转化率排名</view> <view class="rank-title">周转化率排名</view>
<view class="rank-value"> <view class="rank-value">
<view class="rank-number">{{ barValue }}</view>名 <view class="rank-number">{{ currentConversionData.top }}</view>名
</view> </view>
<view class="bar-box"> <view class="bar-box">
<view class="bar-item" v-for="(item, index) in barList" :key="index"> <view class="bar-item" v-for="(item, index) in barList" :key="index">
<view class="bar-label">{{ item.label }}</view> <view class="bar-label">{{ item.label }}</view>
<view class="bar-container"> <view class="bar-container">
<view class="bar" :class="item.class" :style="{ width: item.value + '%' }"></view> <view class="bar" :class="item.class" :style="{ width: currentConversionData[item.key] + '%' }"></view>
<view class="bar-text" :style="{ left: `calc(${item.value}%)` }">{{ item.value }}%</view> <view class="bar-text" :style="{ left: `calc(${currentConversionData[item.key]}%)` }">{{ currentConversionData[item.key] }}%</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -25,34 +25,98 @@ ...@@ -25,34 +25,98 @@
export default { export default {
name: 'WeeklyConversionRate', name: 'WeeklyConversionRate',
props: { props: {
barList: { isFlag: {
type: Array, type: Boolean,
default: () => [] default: false
}, },
barValue: { dataInfo: {
type: Number, type: Object,
default: 0 default: () => {}
} }
}, },
data() { data() {
return { return {
tabList: [ barValue: 56,
barList: [
{ {
title: '延保', label: '我的',
value: '1' value: '74.3',
key: 'myConversionRatio',
class: 'my'
}, },
{ {
title: '权益', label: 'Top1',
value: '2' value: '94.5',
}, key: 'topOneConversionRatio',
{ class: 'top1'
title: '轻改', }
value: '3'
},
], ],
tabIndex: 0, 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: { methods: {
handleTabClick(index) { handleTabClick(index) {
this.tabIndex = index this.tabIndex = index
...@@ -67,6 +131,9 @@ export default { ...@@ -67,6 +131,9 @@ export default {
background: #ffffff; background: #ffffff;
padding: toRpx(24); padding: toRpx(24);
margin: 0 toRpx(32) toRpx(16); margin: 0 toRpx(32) toRpx(16);
&.big-height {
height: toRpx(764);
}
.tab-list { .tab-list {
display: flex; display: flex;
...@@ -144,7 +211,7 @@ export default { ...@@ -144,7 +211,7 @@ export default {
position: relative; position: relative;
flex: 1; flex: 1;
// width: toRpx(380); // width: toRpx(380);
height: toRpx(20); height: toRpx(12);
// overflow: hidden; // overflow: hidden;
} }
......
...@@ -4,14 +4,16 @@ ...@@ -4,14 +4,16 @@
<view class="title">学习看板</view> <view class="title">学习看板</view>
<view class="study-board-box"> <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"> <template v-if="isFlag">
<view>能力分析</view> <view :class="['study-box3', isBeisen ? '' : 'big-height']">
<RadarChart :chartData="chartData" /> <view :class="['study-box3-title', isBeisen ? '' : 'big-margin']">能力分析</view>
</view> <RadarChart :labelColors="labelColors" :heightClass="isBeisen ? '' : 'big-height'" :chartData="chartData" />
</view>
</template>
</view> </view>
</view> </view>
<view class="study-right"> <view class="study-right">
...@@ -29,7 +31,7 @@ ...@@ -29,7 +31,7 @@
</view> </view>
</view> </view>
<template v-if="firstIndex == 0"> <template v-if="firstIndex == 0">
<MyTask /> <MyTask ref="myTask" />
</template> </template>
<template v-if="firstIndex == 1"> <template v-if="firstIndex == 1">
<RecommendCourse /> <RecommendCourse />
...@@ -56,35 +58,9 @@ export default { ...@@ -56,35 +58,9 @@ export default {
}, },
data() { data() {
return { 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: {}, chartData: {},
dataInfo: {},
labelColors: [],
typeList: [ typeList: [
{ tabName: '我的任务', num: () => '' }, { tabName: '我的任务', num: () => '' },
{ tabName: '推荐课程', num: () => '' } { tabName: '推荐课程', num: () => '' }
...@@ -92,10 +68,22 @@ export default { ...@@ -92,10 +68,22 @@ export default {
firstIndex: 0, firstIndex: 0,
firstLeft: ['first', 'second'], firstLeft: ['first', 'second'],
firstClass: ['short-first-nav', 'short-second-nav'], 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() { mounted() {
this.getServerData(); const beisenToken = uni.$storage.get('beisenToken')
console.log(beisenToken, 'beisenToken')
// this.getServerData();
this.getStudyBoard();
}, },
methods: { methods: {
// tab切换 // tab切换
...@@ -118,6 +106,34 @@ export default { ...@@ -118,6 +106,34 @@ export default {
this.chartData = JSON.parse(JSON.stringify(res)); this.chartData = JSON.parse(JSON.stringify(res));
console.log(this.chartData, ' 首页') console.log(this.chartData, ' 首页')
}, 500); }, 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 { ...@@ -156,13 +172,27 @@ export default {
border-radius: 0 0 toRpx(48) toRpx(48); border-radius: 0 0 toRpx(48) toRpx(48);
} }
} }
.study-box3 { .study-box3 {
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(24);
margin: 0 toRpx(32) toRpx(16); margin: 0 toRpx(32) toRpx(16);
&.big-height {
height: toRpx(448);
}
&-title {
margin-bottom: toRpx(10);
&.big-margin {
margin-bottom: toRpx(40);
}
}
} }
.study-right { .study-right {
flex: 1; flex: 1;
background-color: rgba(255, 255, 255, 0.35); background-color: rgba(255, 255, 255, 0.35);
...@@ -238,6 +268,7 @@ export default { ...@@ -238,6 +268,7 @@ export default {
font-weight: 500; font-weight: 500;
font-size: toRpx(32); font-size: toRpx(32);
color: #3B73FF; color: #3B73FF;
&::after { &::after {
content: ''; content: '';
position: absolute; position: absolute;
...@@ -255,5 +286,4 @@ export default { ...@@ -255,5 +286,4 @@ export default {
} }
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -136,8 +136,15 @@ export default { ...@@ -136,8 +136,15 @@ export default {
}) })
const { sceneType, uuid } = uni.$storage.get("userInfo") const { sceneType, uuid } = uni.$storage.get("userInfo")
const { tagIndex, pageNum, pageSize } = this const { tagIndex, pageNum, pageSize } = this
let businessTypeList = []
if (sceneType == 0) {
businessTypeList = [0, 2]
} else if (sceneType == 1) {
businessTypeList = [1]
}
const params = { const params = {
businessType: sceneType, // businessType: sceneType,
businessTypeList,
uuid, uuid,
classCode: tagIndex, classCode: tagIndex,
pageNum, pageNum,
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
i.title }}</view> i.title }}</view>
</view> </view>
<view class="message-item-time-box"> <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 class="sprite-icon icon-stick-top"></view>
</view> </view>
</view> </view>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<view class="message-item-desc">{{ moduleContentEnum[i.moduleType] ? moduleContentEnum[i.moduleType] : <view class="message-item-desc">{{ moduleContentEnum[i.moduleType] ? moduleContentEnum[i.moduleType] :
i.title }}</view> i.title }}</view>
</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> </view>
</view> </view>
...@@ -131,10 +131,13 @@ export default { ...@@ -131,10 +131,13 @@ export default {
computed: { computed: {
getTopList() { getTopList() {
if (!this.topList) return []; if (!this.topList) return [];
// 按topList中的倒序排列 // 过滤出topList中包含moduleType的对象
return this.topList.slice().reverse().map(type => const result = this.msgList.filter(item => this.topList.includes(item.moduleType));
this.msgList.find(item => item.moduleType === type) return result
).filter(Boolean); // // 按topList中的倒序排列
// return this.topList.slice().reverse().map(type =>
// this.msgList.find(item => item.moduleType === type)
// ).filter(Boolean);
}, },
getList() { getList() {
// 过滤掉topList中包含moduleType的对象 // 过滤掉topList中包含moduleType的对象
...@@ -171,8 +174,8 @@ export default { ...@@ -171,8 +174,8 @@ export default {
const key = `${phone}-${shopMerchantId}-${sceneType}` const key = `${phone}-${shopMerchantId}-${sceneType}`
this.topList = _topInfo[key] || [] this.topList = _topInfo[key] || []
}, },
formatTime(time) { formatTime(time, formatStr) {
return dayjs(time).format('HH:mm'); return dayjs(time).format(formatStr);
}, },
handleClick(item) { handleClick(item) {
this.$emit('handleClick', item) this.$emit('handleClick', item)
......
...@@ -20,13 +20,30 @@ ...@@ -20,13 +20,30 @@
</view> </view>
<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">{{ 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 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>
</view> </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"> <template v-if="moduleType == 1 || moduleType == 2">
<view class="service-item-text">提醒内容:{{ moduleContentEnum[moduleType] }}</view> <view class="service-item-text">提醒内容:{{ moduleContentEnum[moduleType] }}</view>
</template> </template>
...@@ -70,6 +87,8 @@ export default { ...@@ -70,6 +87,8 @@ export default {
scriptList: [], scriptList: [],
earlyWarnList: [], earlyWarnList: [],
systemList: [], systemList: [],
shortCourseList: [],
longCourseList: [],
total: 0, total: 0,
nothing: false, nothing: false,
pageNum: 1, pageNum: 1,
...@@ -90,6 +109,10 @@ export default { ...@@ -90,6 +109,10 @@ export default {
return this.scriptList return this.scriptList
case 2: case 2:
return this.earlyWarnList return this.earlyWarnList
case 3:
return this.shortCourseList
case 4:
return this.longCourseList
default: default:
return [] return []
} }
...@@ -108,6 +131,11 @@ export default { ...@@ -108,6 +131,11 @@ export default {
case 2: case 2:
this.getWarningPage() this.getWarningPage()
break break
case 3:
this.getCourseList(3)
break
case 4:
this.getCourseList(4)
default: default:
break break
} }
...@@ -121,11 +149,13 @@ export default { ...@@ -121,11 +149,13 @@ export default {
// this.handleClick({moduleType: this.moduleType}) // this.handleClick({moduleType: this.moduleType})
}, },
methods: { methods: {
formatTime(time, formatStr) {
return dayjs(time).format(formatStr);
},
// 获取服务中心列表 // 获取服务中心列表
async getMessageSummary(sceneType) { async getMessageSummary(sceneType) {
// const userInfo = uni.$storage.get('userInfo') // const userInfo = uni.$storage.get('userInfo')
const res = await getMessageSummary({businessType: sceneType}) const res = await getMessageSummary({businessType: sceneType})
console.log(res, '===')
this.messageList = res this.messageList = res
}, },
// 获取缓存中置顶的列表 // 获取缓存中置顶的列表
...@@ -195,8 +225,15 @@ export default { ...@@ -195,8 +225,15 @@ export default {
}) })
const { sceneType, uuid } = uni.$storage.get("userInfo") const { sceneType, uuid } = uni.$storage.get("userInfo")
const { pageNum, pageSize } = this const { pageNum, pageSize } = this
let businessTypeList = []
if (sceneType == 0) {
businessTypeList = [0, 2]
} else if (sceneType == 1) {
businessTypeList = [1]
}
const params = { const params = {
businessType: sceneType, // businessType: sceneType,
businessTypeList,
uuid, uuid,
pageNum, pageNum,
pageSize pageSize
...@@ -256,7 +293,7 @@ export default { ...@@ -256,7 +293,7 @@ export default {
* 当页面触底时,判断是否还有更多数据,如果有则加载下一页数据 * 当页面触底时,判断是否还有更多数据,如果有则加载下一页数据
* 如果没有更多数据,则标记为没有更多数据状态 * 如果没有更多数据,则标记为没有更多数据状态
*/ */
pageonReachBottom() { pageonReachBottom() {
console.log('到底了'); console.log('到底了');
// 解构赋值,设置 nothing 的默认值 // 解构赋值,设置 nothing 的默认值
let { pageNum, total, nothing = 'nothing', pageSize } = this; let { pageNum, total, nothing = 'nothing', pageSize } = this;
...@@ -352,9 +389,35 @@ export default { ...@@ -352,9 +389,35 @@ export default {
break 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() { handleStickTop() {
console.log('置顶')
clearTimeout(timer) clearTimeout(timer)
const { phone, shopMerchantId, sceneType } = this.userInfo const { phone, shopMerchantId, sceneType } = this.userInfo
const _topInfo = uni.$storage.get('noticeTopInfo') || {} const _topInfo = uni.$storage.get('noticeTopInfo') || {}
......
<template> <template>
<view> <view >
<qiun-data-charts type="radar" :opts="opts" :chartData="chartData" class="charts-box" /> <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> </view>
</template> </template>
<script> <script>
...@@ -10,6 +18,21 @@ export default { ...@@ -10,6 +18,21 @@ export default {
chartData: { chartData: {
type: Object, type: Object,
default: () => {} 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() { data() {
...@@ -19,7 +42,7 @@ export default { ...@@ -19,7 +42,7 @@ export default {
padding: [0, 5, 0, 5], padding: [0, 5, 0, 5],
dataLabel: false, dataLabel: false,
enableScroll: 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, fontSize: 12,
legend: { legend: {
show: false show: false
...@@ -30,7 +53,7 @@ export default { ...@@ -30,7 +53,7 @@ export default {
gridColor: "#dae8fd", gridColor: "#dae8fd",
gridCount: 3, gridCount: 3,
opacity: 0.2, opacity: 0.2,
max: 10, max: 3,
labelShow: true, labelShow: true,
axisLabelTofix: 1, // 保留一位小数 axisLabelTofix: 1, // 保留一位小数
labelFormatter: function (val) { labelFormatter: function (val) {
...@@ -51,5 +74,27 @@ export default { ...@@ -51,5 +74,27 @@ export default {
.charts-box { .charts-box {
width: 100%; width: 100%;
height: toRpx(272); 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> </style>
\ No newline at end of file \ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<view class="scroll-view-box"> <view class="scroll-view-box">
<scroll-view class="scroll-view" scroll-y> <scroll-view class="scroll-view" scroll-y>
<view :class="['scroll-view-item', selectedIndex == index ? 'active' : '']" <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'"> <template v-if="type === 'long'">
<image class="item-img" src="../../../assets/images/common/long-course-default.webp" <image class="item-img" src="../../../assets/images/common/long-course-default.webp"
mode="scaleToFill" /> mode="scaleToFill" />
...@@ -185,7 +185,6 @@ export default { ...@@ -185,7 +185,6 @@ export default {
times: 10 times: 10
} }
], ],
type: '', type: '',
selectedIndex: 0, selectedIndex: 0,
jumpUrl: '', jumpUrl: '',
...@@ -227,12 +226,15 @@ export default { ...@@ -227,12 +226,15 @@ export default {
} }
uni.navigateBack() uni.navigateBack()
}, },
openCourse(index) { openCourse(inde, item) {
console.log(index, 'index') console.log(index, 'index')
this.selectedIndex = index; this.selectedIndex = index;
const arr = ['80cb90d7-1609-4360-8f23-6c47ddba41c0', '17983a1a-5bcd-4e7d-a180-061ef3f9a49d'] const arr = ['80cb90d7-1609-4360-8f23-6c47ddba41c0', '17983a1a-5bcd-4e7d-a180-061ef3f9a49d']
// 只更换url // 只更换url
this.handleOperation(arr[index]); 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) { handleOperation(courseId) {
// 只处理课程详情,设置jumpUrl // 只处理课程详情,设置jumpUrl
......
...@@ -159,13 +159,25 @@ export default { ...@@ -159,13 +159,25 @@ export default {
score: '未完成(25%)', score: '未完成(25%)',
duration: '未完成(25%)' duration: '未完成(25%)'
} }
] ],
} }
}, },
onLoad(options) {
const {row} = options
const rowData = JSON.parse(decodeURIComponent(row))
console.log(rowData, 'rowData')
this.getLongCourseDetail(rowData.id)
},
methods: { methods: {
backPage() { backPage() {
uni.navigateBack(); uni.navigateBack();
}, },
async getLongCourseDetail(id) {
const res = await uni.$api.commonApi.getLongCourseDetail({
id
})
console.log(res, 'res')
},
startStudy(index) { startStudy(index) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/studyDetail/detail?type=long&index=${index}` url: `/pages/common/studyDetail/detail?type=long&index=${index}`
......
...@@ -10,13 +10,12 @@ ...@@ -10,13 +10,12 @@
<view class="left-box"> <view class="left-box">
<view class="top-box"> <view class="top-box">
<view class="top-box-name"> <view class="top-box-name">
许小奇 {{courseDetail.staffName || '-'}}
<view class="role-tag">驻店销售</view> <view class="role-tag" v-for="(item, index) in courseDetail.positionList" :key="index">{{item}}</view>
<view class="role-tag">带教导师</view>
</view> </view>
<view class="top-box-info"> <view class="top-box-info">
<view class="top-box-info-item">驻店时间:首月</view> <view class="top-box-info-item">驻店时间:{{courseDetail.residentTimeTag || '-'}}</view>
<view class="top-box-info-item">直属上级:张三丰</view> <view class="top-box-info-item">直属上级:{{courseDetail.superior || '-'}}</view>
</view> </view>
</view> </view>
<view class="bottom-box"> <view class="bottom-box">
...@@ -24,7 +23,7 @@ ...@@ -24,7 +23,7 @@
<view>战败复盘</view> <view>战败复盘</view>
<view class="date">2025年6月25日</view> <view class="date">2025年6月25日</view>
</view> </view>
<RadarChart :chartData="chartData" /> <RadarChart :labelColors="labelColors" :chartData="chartData" />
<view class="bottom-box-summary"> <view class="bottom-box-summary">
<view>总结</view> <view>总结</view>
<view class="summary-btn">查看</view> <view class="summary-btn">查看</view>
...@@ -115,6 +114,7 @@ export default { ...@@ -115,6 +114,7 @@ export default {
data() { data() {
return { return {
chartData: {}, chartData: {},
labelColors: [],
detailList: [ detailList: [
{ {
name: '许小奇', name: '许小奇',
...@@ -252,15 +252,60 @@ export default { ...@@ -252,15 +252,60 @@ export default {
}, },
], ],
qualityTitle: Object.freeze(['课程标签', '不足/改善建议', '对练考核']), qualityTitle: Object.freeze(['课程标签', '不足/改善建议', '对练考核']),
courseDetail: {},
rowData: {}
} }
}, },
mounted() { 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: { methods: {
backPage() { backPage() {
uni.$emit("backStudyCenter")
uni.navigateBack(); 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() { getServerData() {
//模拟从服务器获取数据时的延时 //模拟从服务器获取数据时的延时
setTimeout(() => { setTimeout(() => {
......
...@@ -41,5 +41,6 @@ export const STORAGE_OBJECTKEY = { ...@@ -41,5 +41,6 @@ export const STORAGE_OBJECTKEY = {
recordTrackList: 'recordTrackList', recordTrackList: 'recordTrackList',
beisenToken: 'beisenToken', beisenToken: 'beisenToken',
messagePopShownDate: 'messagePopShownDate', 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!