This commit is contained in:
杨航
2025-11-07 15:54:56 +08:00
parent c59af638a7
commit 1afbf155e9
5 changed files with 246 additions and 87 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
ENV = 'development.yh'
# 'development.yh'
VITE_APP_BASE_API_Url = 'http://25.18.122.91:9786'
VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786'
# VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.32.154:9604'
+45
View File
@@ -0,0 +1,45 @@
import request from '@/api/request'
// 1.本月/本年/累计 学习信息查询接口
export const queryStudyStatistics = (data) => {
return request({
url: '/traapp/traStudyAnalysis/queryStudyStatistics',
method: 'post',
data
});
};
// 课程推荐查询接口
export const queryRecmdCrsInfo = (data) => {
return request({
url: '/traapp/traStudyAnalysis/queryRecmdCrsInfo',
method: 'post',
data
});
};
// 4.维度分析查询接口
export const queryDimesionInfo = (data) => {
return request({
url: '/traapp/traStudyAnalysis/queryDimesionInfo',
method: 'post',
data
});
};
// 5.学习习惯查询接口
export const queryHabitInfo = (data) => {
return request({
url: '/traapp/traStudyAnalysis/queryHabitInfo',
method: 'post',
data
});
};
// 6.学习建议查询接口
export const querySuggestInfo = (data) => {
return request({
url: '/traapp/traStudyAnalysis/querySuggestInfo',
method: 'post',
data
});
};
+195 -81
View File
@@ -8,20 +8,16 @@
</view>
<view class="analytics-box">
<view class="tabs-box">
<uv-tabs :list="tabList" @click="changeTab" :scrollable="true" active-style="font-weight:bold; color:#000;" :current="currentTab"
class="font_pf my_tabs" :inactive-style="{ color: '#333333', fontSize: '28rpx', fontWeight: '500' }"
<uv-tabs :list="tabList" @click="changeTab" :scrollable="true" active-style="font-weight:bold; color:#000;"
:current="currentTab" class="font_pf my_tabs"
:inactive-style="{ color: '#333333', fontSize: '28rpx', fontWeight: '500' }"
:activeStyle="{ color: '#333333', fontSize: '28rpx', fontWeight: '600' }"></uv-tabs>
</view>
<!-- <view class="calendar-box" @click="openCalendar">统计周期</view>
<uv-calendar ref="calendarRef" mode="range" @confirm="calendarConfirm" minDate="2025-01-01" :maxDate="maxDate" monthNum="100" :allowSameDay="true"></uv-calendar> -->
<view class="date-input">
<uni-datetime-picker
type="daterange"
v-model="daterange"
start="2025-01-01"
:end="maxDate"
rangeSeparator="至"
></uni-datetime-picker>
<view class="date-input" v-show="activeTabVal === '04'">
<uni-datetime-picker class="custom-datepicker" ref="dateinputRef" type="daterange" v-model="daterange"
start="2025-01-01" :end="maxDate" rangeSeparator="至" @change="changeDate"></uni-datetime-picker>
</view>
<view class="analytics-items">
<view class="analytics-item">
@@ -29,7 +25,7 @@
课程学习时长
</view>
<view class="analytics-item-value">
<text class="analytics-item-value-v">{{6.5}}</text>
<text class="analytics-item-value-v">{{statisticsObj.crsStdyTmLen }}</text>
<text class="analytics-item-value-unit">h</text>
</view>
</view>
@@ -38,7 +34,7 @@
课程学习次数
</view>
<view class="analytics-item-value">
<text class="analytics-item-value-v">{{14}}</text>
<text class="analytics-item-value-v">{{statisticsObj.crsStdyCnt }}</text>
<text class="analytics-item-value-unit"></text>
</view>
</view>
@@ -47,7 +43,7 @@
课程练习时长
</view>
<view class="analytics-item-value">
<text class="analytics-item-value-v">{{24.4}}</text>
<text class="analytics-item-value-v">{{statisticsObj.crsExrTmLen }}</text>
<text class="analytics-item-value-unit">h</text>
</view>
</view>
@@ -56,7 +52,7 @@
完成任务数
</view>
<view class="analytics-item-value">
<text class="analytics-item-value-v">{{14}}</text>
<text class="analytics-item-value-v">{{statisticsObj.completeTaskCnt }}</text>
<text class="analytics-item-value-unit"></text>
</view>
</view>
@@ -65,7 +61,7 @@
完成考试数
</view>
<view class="analytics-item-value">
<text class="analytics-item-value-v">{{14}}</text>
<text class="analytics-item-value-v">{{statisticsObj.completedExamCnt }}</text>
<text class="analytics-item-value-unit"></text>
</view>
</view>
@@ -74,7 +70,7 @@
考试合格率
</view>
<view class="analytics-item-value">
<text class="analytics-item-value-v">{{82.8}}</text>
<text class="analytics-item-value-v">{{statisticsObj.passExamRate }}</text>
<text class="analytics-item-value-unit">%</text>
</view>
</view>
@@ -83,7 +79,7 @@
陪练次数
</view>
<view class="analytics-item-value">
<text class="analytics-item-value-v">{{14}}</text>
<text class="analytics-item-value-v">{{statisticsObj.partnerCnt }}</text>
<text class="analytics-item-value-unit"></text>
</view>
</view>
@@ -92,28 +88,34 @@
课程学习次数
</view>
<view class="analytics-item-value">
<text class="analytics-item-value-v">{{14}}</text>
<text class="analytics-item-value-v">{{statisticsObj.askCnt }}</text>
<text class="analytics-item-value-unit"></text>
</view>
</view>
<view class="analytics-item">
<!-- <view class="analytics-item">
<view class="analytics-item-title">
软件用时
</view>
<view class="analytics-item-value">
<text class="analytics-item-value-v">{{44.4}}</text>
<text class="analytics-item-value-v">{{statisticsObj.crsStdyCnt }}</text>
<text class="analytics-item-value-unit">h</text>
</view>
</view>
</view> -->
</view>
</view>
<view class="evaluation-box dens">
<view class="dens-item" v-for="item in 5">
<view class="item-title">话术完整性</view>
<view class="item-cont">逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性</view>
<view class="evaluation-box dens" v-if="loading">
<CommonLoading color="#06f" class="loading-box"/>
</view>
<view class="evaluation-box dens" v-if="!loading">
<view class="dens-item" v-for="item in dimesionList">
<view class="item-title">{{item.title}}</view>
<view class="item-cont">{{item.content}}</view>
</view>
</view>
<view class="evaluation-box study">
<view class="evaluation-box study" v-if="loading">
<CommonLoading color="#06f" class="loading-box"/>
</view>
<view class="evaluation-box study" v-if="!loading">
<view class="study-item">
<view class="item-title bg-tm">时间管理 {{'规律性学习者'}}</view>
<view class="item-cont study1-bg">逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性</view>
@@ -123,12 +125,18 @@
<view class="item-cont study2-bg">逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性</view>
</view>
</view>
<view class="evaluation-box study1">
<view class="evaluation-box study1" v-if="loading">
<CommonLoading color="#06f" class="loading-box"/>
</view>
<view class="evaluation-box study1" v-if="!loading">
<view class="study1-item">
<view class="item-cont study3-bg">逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性逻辑贯穿性</view>
<view class="item-cont study3-bg">{{suggestObj.content}}</view>
</view>
</view>
<view class="evaluation-box course">
<view class="evaluation-box course" v-if="loading">
<CommonLoading color="#06f" class="loading-box"/>
</view>
<view class="evaluation-box course" v-if="!loading">
<CourseItem v-for="item in courseList" :itemInfo="item" @clickItem="toCourseDetail(item)" />
<view class="empty-box" v-if="courseList.length === 0">暂无数据</view>
</view>
@@ -139,10 +147,12 @@
<script setup>
import common from '@/common/common'
import {
getTraTagListApi,
queryTraPartnerCatelogList,
queryCrsInfoByCatalogApi
} from '@/api/sparring.js'
queryStudyStatistics,
queryRecmdCrsInfo,
queryDimesionInfo,
queryHabitInfo,
querySuggestInfo,
} from '@/api/analytics.js'
import {
onMounted,
ref,
@@ -168,8 +178,10 @@
])
const courseList = ref([])
const currentTab = ref(0)
const daterange = ref(['',''])
const maxDate = computed(()=> {
const activeTabVal = ref('01')
const daterange = ref(['', ''])
const dateinputRef = ref()
const maxDate = computed(() => {
let _date = new Date()
let _year = _date.getFullYear()
let _month = _date.getMonth() + 1
@@ -177,23 +189,87 @@
return `${_year}-${_month < 10 ? '0' + _month: _month}-${_day < 10 ? '0' + _day: _day}`
})
const calendarRef = ref()
const openCalendar = () => {
calendarRef.value.open()
const statisticsObj = ref({
"crsStdyTmLen": 0,
"crsStdyCnt": 0,
"crsExrTmLen": 0,
"completeTaskCnt": 0,
"completedExamCnt": 0,
"passExamRate": 0,
"partnerCnt": 9,
"askCnt": 0
})
const dimesionList = ref([])
const suggestObj = ref({
content: ''
})
// const openCalendar = () => {
// calendarRef.value.open()
// }
// const calendarConfirm = (data) => {
// console.log('data:', data)
// currentTab.value = -1
// }
const changeDate = (date) => {
console.log('date:', date)
if (date.length > 0) {
if (!!date[0]) {
getInfoNow({
dateType: '04',
startDate: date[0],
endDate: date[1],
})
}
}
}
const calendarConfirm = (data) => {
console.log('data:',data)
currentTab.value = -1
const loading = ref(false)
const getInfoNow = async (params) => {
loading.value = true
try {
let _res1 = await queryStudyStatistics(params)
statisticsObj.value = {..._res1.body}
let _res2 = await queryDimesionInfo(params)
dimesionList.value = [..._res2.body]
let _res3 = await queryHabitInfo(params)
let _res4 = await querySuggestInfo(params)
if(_res4.body && _res4.body.length > 0){
suggestObj.value = {..._res4.body[0]}
}
console.log(_res1,_res2,_res3,_res4)
} catch {
} finally{
loading.value = false
}
}
// 跳转 课程详情
const toCourseDetail = item => {
common.navigateTo('/pages/courseDetail/index?crsNum=' + item.crsNum + '&crsId=' + item.crsId)
}
const changeTab = (info) => {
console.log(info)
activeTabVal.value = info.value
if (info.value === '04') {
dateinputRef.value.clear()
daterange.value = ['', '']
}else{
getInfoNow({
dateType: activeTabVal.value
})
}
}
onMounted(() => {})
const getCrsListNow = () => {
queryRecmdCrsInfo().then(res => {
console.log(res)
courseList.value = res.body || []
})
}
onMounted(() => {
getCrsListNow()
getInfoNow({
dateType: activeTabVal.value
})
})
</script>
<style lang="scss" scoped>
@@ -205,7 +281,7 @@
}
:deep(.uv-tabs__wrapper__nav__item) {
padding: 0 20rpx !important;
padding: 0 30rpx !important;
}
}
@@ -241,7 +317,7 @@
// background-color: red;
text-align: center;
font-size: 33rpx;
padding: 10rpx 100rpx 0;
padding: 10rpx 0rpx 0;
line-height: 46rpx;
box-sizing: border-box;
font-weight: 500;
@@ -251,33 +327,12 @@
overflow: hidden;
text-overflow: ellipsis;
// margin-bottom: 23rpx;
.arrow-icon {
position: absolute;
left: 36rpx;
top: 20rpx;
color: #fff !important;
}
.feedback-icon {
position: absolute;
width: 40rpx;
height: 40rpx;
cursor: pointer;
right: 50rpx;
top: 33rpx;
transform: translateY(-50%);
background: url(@/static/images/sparring/feedback.png) no-repeat;
background-size: 28rpx 28rpx;
background-position: center;
}
.back-icon {
position: absolute;
width: 40rpx;
height: 40rpx;
cursor: pointer;
left: 50rpx;
left: 30rpx;
top: 33rpx;
transform: translateY(-50%);
}
@@ -302,7 +357,9 @@
}
.analytics-box {
height: 490rpx;
min-height: 490rpx;
border-radius: 15rpx;
// overflow: hidden;
background: url(@/static/images/analytics/bg2.png) no-repeat;
background-size: cover;
background-position: center;
@@ -328,6 +385,7 @@
.analytics-items {
padding-top: 20rpx;
padding-bottom: 20rpx;
width: 100%;
overflow: hidden;
@@ -368,15 +426,26 @@
padding: 100rpx 26rpx 24rpx;
border-radius: 15rpx;
margin-bottom: 24rpx;
position: relative;
min-height: 200rpx;
.loading-box{
position: absolute;
top: 120rpx;
left: 50%;
transform: translateX(-50%);
}
&.dens {
background-image: url(@/static/images/analytics/weidu.png);
}
&.study {
background-image: url(@/static/images/analytics/study1.png)
}
&.study1 {
background-image: url(@/static/images/analytics/study.png);
}
&.course {
background-image: url(@/static/images/analytics/course.png);
}
@@ -408,17 +477,21 @@
// line-height: 50rpx;
// }
// }
.study-item,.study1-item, .dens-item{
.study-item,
.study1-item,
.dens-item {
padding: 12rpx 0;
.item-title{
.item-title {
line-height: 40rpx;
position: relative;
padding: 8rpx 46rpx 8rpx 26rpx;
line-height: 42rpx;
font-size: 29rpx;
margin-bottom: 16rpx;
&::before{
&::before {
content: '';
display: block;
background-color: #000;
@@ -429,23 +502,27 @@
left: 0rpx;
top: 22rpx;
}
&.bg-tm{
&.bg-tm {
padding-left: 54rpx;
background-image: url(@/static/images/analytics/time-icon.png);
background-repeat: no-repeat;
background-size: 38rpx 40rpx;
background-position: left center;
&::before{
&::before {
display: none;
}
}
&.bg-know{
&.bg-know {
padding-left: 54rpx;
background-image: url(@/static/images/analytics/knowledge.png);
background-repeat: no-repeat;
background-size: 38rpx 40rpx;
background-position: left center;
&::before{
&::before {
display: none;
}
}
@@ -454,21 +531,24 @@
.item-cont {
font-size: 28rpx;
line-height: 50rpx;
&.study1-bg{
&.study1-bg {
background-color: #e4efff;
border-radius: 15rpx;
padding: 12rpx 24rpx;
width: calc(100% - 54rpx);
margin-left: 54rpx;
}
&.study2-bg{
&.study2-bg {
background-color: #f6f0df;
border-radius: 15rpx;
padding: 12rpx 24rpx;
width: calc(100% - 54rpx);
margin-left: 54rpx;
}
&.study3-bg{
&.study3-bg {
background-color: #e4efff;
border-radius: 15rpx;
padding: 12rpx 24rpx;
@@ -477,7 +557,8 @@
}
}
}
.empty-box{
.empty-box {
text-align: center;
font-size: 25rpx;
color: #ccc;
@@ -485,4 +566,37 @@
}
}
}
.date-input {
.custom-datepicker {
width: 500rpx;
position: relative;
&::after {
content: '';
position: absolute;
top: 50%;
right: 0;
width: 10rpx;
height: 10rpx;
border-top: 3rpx solid #999;
border-left: 3rpx solid #999;
transform: rotate(135deg) translateY(50%);
}
::v-deep .uni-date-x {
background-color: rgba(255, 255, 255, 0);
width: 500rpx;
}
::v-deep .uni-date-x--border {
border: 0;
width: 500rpx;
}
::v-deep .range-separator {
font-size: 13px;
}
}
}
</style>
@@ -83,7 +83,7 @@
</time-picker>
</view>
<view style="line-height: 50px;">
<uni-icons type="arrowthinright" color="#999"></uni-icons>
<!-- <uni-icons type="arrowthinright" color="#999"></uni-icons> -->
</view>
<view class="uni-date-changed--time-end">
<view class="uni-date-changed--time-date">{{tempRange.after ? tempRange.after : endDateText}}</view>
@@ -7,12 +7,12 @@
:class="{'uni-date-editor--x__disabled': disabled,'uni-date-x--border': border}"
>
<view v-if="!isRange" class="uni-date-x uni-date-single">
<uni-icons class="icon-calendar" type="calendar" color="#c0c4cc" size="22"></uni-icons>
<!-- <uni-icons class="icon-calendar" type="calendar" color="#c0c4cc" size="22"></uni-icons> -->
<view class="uni-date__x-input">{{ displayValue || singlePlaceholderText }}</view>
</view>
<view v-else class="uni-date-x uni-date-range">
<uni-icons class="icon-calendar" type="calendar" color="#c0c4cc" size="22"></uni-icons>
<!-- <uni-icons class="icon-calendar" type="calendar" color="#c0c4cc" size="22"></uni-icons> -->
<view class="uni-date__x-input text-center">{{ displayRangeValue.startDate || startPlaceholderText }}</view>
<view class="range-separator">{{rangeSeparator}}</view>
@@ -21,7 +21,7 @@
</view>
<view v-if="showClearIcon" class="uni-date__icon-clear" @click.stop="clear">
<uni-icons type="clear" color="#c0c4cc" size="22"></uni-icons>
<!-- <uni-icons type="clear" color="#c0c4cc" size="22"></uni-icons> -->
</view>
</view>
</slot>
@@ -69,7 +69,7 @@
</time-picker>
</view>
<uni-icons type="arrowthinright" color="#999" style="line-height: 40px;"></uni-icons>
<!-- <uni-icons type="arrowthinright" color="#999" style="line-height: 40px;"></uni-icons> -->
<view class="popup-x-header--datetime">
<input class="uni-date__input uni-date-range__input" type="text" v-model="tempRange.endDate"