Commit 6b4c5283 by cen

Merge branch 'SAAS+V5.5.0' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V5.5.0

2 parents c87972c1 37286d30
No preview for this file type

2.91 MB | W: | H:

2.91 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -122,7 +122,7 @@ export default { ...@@ -122,7 +122,7 @@ export default {
}, },
startStudy(item, index) { startStudy(item, index) {
let { pageNum, total, nothing = 'nothing', pageSize } = this; let { pageNum, total, nothing = 'nothing', pageSize } = this;
uni.$track.add({ eventCode: 'app_completed_course', businessId: item.id, pagePath: '/pages/studyCenter/myCourse' }) uni.$track.add({ eventCode: 'app_completed_course', businessId: item.id, pagePath: '/pages/boutique/myCourse' })
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/studyDetail/detail?type=completed&index=${index}&completedCourseList=${encodeURIComponent(JSON.stringify(this.completedCourseList))}&pageNum=${pageNum}&pageSize=${pageSize}&total=${total}` url: `/pages/common/studyDetail/detail?type=completed&index=${index}&completedCourseList=${encodeURIComponent(JSON.stringify(this.completedCourseList))}&pageNum=${pageNum}&pageSize=${pageSize}&total=${total}`
}) })
......
...@@ -404,7 +404,7 @@ export default { ...@@ -404,7 +404,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.task-box { .task-box {
padding-top: toRpx(32); padding-top: toRpx(32);
height: calc(100% - #{toRpx(100)}); height: calc(100% + #{toRpx(72)});
} }
.tab-list { .tab-list {
......
...@@ -179,7 +179,7 @@ export default { ...@@ -179,7 +179,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.recommend-course { .recommend-course {
height: calc(100% - #{toRpx(100)}); height: calc(100% - #{toRpx(100)});
padding-bottom: toRpx(100);
.scroll-view { .scroll-view {
margin-top: toRpx(40); margin-top: toRpx(40);
height: calc(100% - #{toRpx(70)}); height: calc(100% - #{toRpx(70)});
......
...@@ -103,6 +103,9 @@ ...@@ -103,6 +103,9 @@
confirm-type="search" confirm-type="search"
@confirm="handleSearch" @confirm="handleSearch"
/> />
<view class="clear-btn" @click.stop="clearSearch" v-if="searchKeyword">
<uni-icons type="closeempty" size="16" color="#999ea8"></uni-icons>
</view>
</view> </view>
</view> </view>
...@@ -276,6 +279,11 @@ export default { ...@@ -276,6 +279,11 @@ export default {
console.log('搜索关键词:', this.searchKeyword) console.log('搜索关键词:', this.searchKeyword)
// TODO: 调用课程列表接口,传入搜索关键词 // TODO: 调用课程列表接口,传入搜索关键词
}, },
// 清空搜索
clearSearch() {
this.searchKeyword = ''
this.handleSearch()
},
// 打开筛选弹窗 // 打开筛选弹窗
openFilter() { openFilter() {
this.$refs.orderScreen.open() this.$refs.orderScreen.open()
...@@ -295,19 +303,19 @@ export default { ...@@ -295,19 +303,19 @@ export default {
console.log('筛选条件:', filterData) console.log('筛选条件:', filterData)
// TODO: 调用课程列表接口,传入筛选条件 // TODO: 调用课程列表接口,传入筛选条件
}, },
// 跳转到我的课程页面 // 跳转到我的课程
goToMyCourse() { goToMyCourse() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/studyCenter/myCourse' url: '/pages/boutique/myCourse'
}) })
}, },
// 跳转到我的任务页面 // 跳转到我的任务
async goToMyTask() { async goToMyTask() {
// 先检查权限 // 先检查权限
const hasPermission = await this.checkStudyCenterPermission() const hasPermission = await this.checkStudyCenterPermission()
if (hasPermission) { if (hasPermission) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/studyCenter/myTask' url: '/pages/boutique/myTask'
}) })
} else { } else {
uni.showToast({ uni.showToast({
...@@ -316,14 +324,16 @@ export default { ...@@ -316,14 +324,16 @@ export default {
}) })
} }
}, },
// 跳转到我的考试
goToMyExam() { goToMyExam() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/studyCenter/myExam' url: '/pages/boutique/myExam'
}) })
}, },
// 跳转到排行榜
goToLeaderboard() { goToLeaderboard() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/studyCenter/leaderboard' url: '/pages/boutique/leaderboard'
}) })
}, },
// 检查学习中心权限 // 检查学习中心权限
...@@ -783,6 +793,17 @@ export default { ...@@ -783,6 +793,17 @@ export default {
color: #333333; color: #333333;
text-align: center; text-align: center;
} }
.clear-btn {
position: absolute;
right: toRpx(32);
display: flex;
align-items: center;
justify-content: center;
width: toRpx(48);
height: toRpx(48);
cursor: pointer;
}
} }
} }
...@@ -844,8 +865,9 @@ export default { ...@@ -844,8 +865,9 @@ export default {
font-size: toRpx(24); font-size: toRpx(24);
color: #FF9D0A; color: #FF9D0A;
height: toRpx(48); height: toRpx(48);
margin: toRpx(0) toRpx(40);
margin-top: toRpx(32); margin-top: toRpx(32);
margin-left: toRpx(18);
&-text { &-text {
margin-top: toRpx(4); margin-top: toRpx(4);
......
...@@ -116,25 +116,25 @@ ...@@ -116,25 +116,25 @@
} }
}, },
{ {
"path": "pages/studyCenter/myTask", "path": "pages/boutique/myTask",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/studyCenter/myCourse", "path": "pages/boutique/myCourse",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/studyCenter/myExam", "path": "pages/boutique/myExam",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "pages/studyCenter/leaderboard", "path": "pages/boutique/leaderboard",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
......
...@@ -14,12 +14,10 @@ ...@@ -14,12 +14,10 @@
<view class="content-layout"> <view class="content-layout">
<!-- 左侧排行榜 --> <!-- 左侧排行榜 -->
<view class="left-panel"> <view class="left-panel">
<!-- 顶部占位图片 -->
<view class="top-image-wrapper"> <view class="top-image-wrapper">
<image class="panel-image" :src="require('@/assets/images/studyCenter/Leaderboard-bg.png')" mode="scaleToFill" /> <image class="panel-image" :src="require('@/assets/images/studyCenter/Leaderboard-bg.png')" mode="scaleToFill" />
</view> </view>
<!-- Tab 切换和中位数 -->
<view class="tab-header"> <view class="tab-header">
<view class="tab-list"> <view class="tab-list">
<view <view
...@@ -34,7 +32,6 @@ ...@@ -34,7 +32,6 @@
<view class="median-text">学习时长中位数:{{ medianTime }}小时</view> <view class="median-text">学习时长中位数:{{ medianTime }}小时</view>
</view> </view>
<!-- 排行榜列表 -->
<view class="rank-list"> <view class="rank-list">
<view <view
v-for="(item, index) in leaderboardList" v-for="(item, index) in leaderboardList"
...@@ -42,7 +39,6 @@ ...@@ -42,7 +39,6 @@
:class="['rank-item', { 'current-user': item.isCurrentUser }]" :class="['rank-item', { 'current-user': item.isCurrentUser }]"
> >
<view class="rank-left"> <view class="rank-left">
<!-- 排名显示 -->
<view v-if="item.rank <= 3 && !item.isCurrentUser" class="rank-badge medal"> <view v-if="item.rank <= 3 && !item.isCurrentUser" class="rank-badge medal">
<image class="medal-icon" :src="getMedalIcon(item.rank - 1)" mode="aspectFit" /> <image class="medal-icon" :src="getMedalIcon(item.rank - 1)" mode="aspectFit" />
</view> </view>
...@@ -50,11 +46,9 @@ ...@@ -50,11 +46,9 @@
<text class="rank-number">{{ item.rank >= 100 ? '99+' : item.rank }}</text> <text class="rank-number">{{ item.rank >= 100 ? '99+' : item.rank }}</text>
</view> </view>
<!-- 姓名 -->
<text class="user-name">{{ item.name }}</text> <text class="user-name">{{ item.name }}</text>
</view> </view>
<!-- 学习时长 -->
<text class="study-time">{{ item.hours }}小时</text> <text class="study-time">{{ item.hours }}小时</text>
</view> </view>
</view> </view>
...@@ -104,7 +98,6 @@ export default { ...@@ -104,7 +98,6 @@ export default {
}, },
switchTab(index) { switchTab(index) {
this.currentTab = index this.currentTab = index
// TODO: 根据不同tab加载不同数据
this.generateMockData() this.generateMockData()
}, },
getMedalIcon(index) { getMedalIcon(index) {
...@@ -116,11 +109,9 @@ export default { ...@@ -116,11 +109,9 @@ export default {
return medals[index] return medals[index]
}, },
generateMockData() { generateMockData() {
// 生成100条模拟数据
const names = ['孟伟', '任小宣', '谭亦云', '李晓夏', '李文歆', '袁佳', '刘轩华', '高强', '张明', '王芳', '李娜', '赵伟', '陈静', '周杰', '吴磊', '郑丽', '黄涛', '徐敏', '孙鹏', '马超'] const names = ['孟伟', '任小宣', '谭亦云', '李晓夏', '李文歆', '袁佳', '刘轩华', '高强', '张明', '王芳', '李娜', '赵伟', '陈静', '周杰', '吴磊', '郑丽', '黄涛', '徐敏', '孙鹏', '马超']
this.leaderboardList = [] this.leaderboardList = []
// 第一条:当前用户
this.leaderboardList.push({ this.leaderboardList.push({
rank: this.currentUserRank, rank: this.currentUserRank,
name: this.currentUser.name, name: this.currentUser.name,
...@@ -128,10 +119,8 @@ export default { ...@@ -128,10 +119,8 @@ export default {
isCurrentUser: true isCurrentUser: true
}) })
// 其他99条数据
let baseHours = 250 let baseHours = 250
for (let i = 0; i < 100; i++) { for (let i = 0; i < 100; i++) {
// 跳过当前用户的排名位置
if ((i + 1) === this.currentUserRank) { if ((i + 1) === this.currentUserRank) {
continue continue
} }
...@@ -408,3 +397,4 @@ export default { ...@@ -408,3 +397,4 @@ export default {
} }
</style> </style>
...@@ -30,11 +30,11 @@ ...@@ -30,11 +30,11 @@
<!-- 课程列表 --> <!-- 课程列表 -->
<view class="course-content"> <view class="course-content">
<!-- 待学习 --> <!-- 待学习 tab:使用 RecommendCourse 组件 -->
<RecommendCourse v-if="currentTab === 0" ref="recommendCourse" :cardWidth="530" /> <RecommendCourse v-if="currentTab === 0" ref="recommendCourse" :cardWidth="530" />
<!-- 正在学习 --> <!-- 正在学习 tab:使用 MyTask 组件 -->
<MyTask v-else-if="currentTab === 1" ref="myTask" :cardWidth="530" /> <MyTask v-else-if="currentTab === 1" ref="myTask" :cardWidth="530" />
<!-- 已学完 --> <!-- 已学完 tab:使用 CompletedCourse 组件 -->
<CompletedCourse v-else-if="currentTab === 2" ref="completedCourse" :cardWidth="530" /> <CompletedCourse v-else-if="currentTab === 2" ref="completedCourse" :cardWidth="530" />
</view> </view>
</view> </view>
...@@ -94,13 +94,15 @@ export default { ...@@ -94,13 +94,15 @@ export default {
.header { .header {
position: relative; position: relative;
margin-bottom: toRpx(16); z-index: 10;
background: transparent;
.nav-bar { .nav-bar {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: toRpx(88); height: toRpx(88);
margin-top: var(--status-bar-height);
position: relative; position: relative;
.back { .back {
...@@ -127,7 +129,7 @@ export default { ...@@ -127,7 +129,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 toRpx(64); padding: 0 toRpx(64);
margin-top: toRpx(32); margin-top: toRpx(52);
.tab-item { .tab-item {
width: toRpx(208); width: toRpx(208);
height: toRpx(72); height: toRpx(72);
...@@ -189,11 +191,13 @@ export default { ...@@ -189,11 +191,13 @@ export default {
} }
.course-content { .course-content {
flex: 1; width: 100%;
height: calc(100vh - toRpx(300)); max-height: toRpx(1200);
overflow: hidden; overflow-y: auto;
padding: 0 toRpx(64);
} }
} }
</style> </style>
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
<!-- 考试列表 --> <!-- 考试列表 -->
<view class="exam-content"> <view class="exam-content">
<!-- 已通过 --> <!-- 已通过 tab:使用 PassedExam 组件 -->
<PassedExam v-if="currentTab === 0" ref="passedExam" :cardWidth="530" /> <PassedExam v-if="currentTab === 0" ref="passedExam" :cardWidth="530" />
<!-- 未通过 --> <!-- 未通过 tab:使用 FailedExam 组件 -->
<FailedExam v-else-if="currentTab === 1" ref="failedExam" :cardWidth="530" /> <FailedExam v-else-if="currentTab === 1" ref="failedExam" :cardWidth="530" />
</view> </view>
</view> </view>
...@@ -117,8 +117,8 @@ export default { ...@@ -117,8 +117,8 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 toRpx(64); padding: 0 toRpx(64);
margin-top: toRpx(32); margin-top: toRpx(52);
margin-bottom: toRpx(72); margin-bottom: toRpx(32);
.tab-item { .tab-item {
width: toRpx(208); width: toRpx(208);
height: toRpx(72); height: toRpx(72);
...@@ -161,9 +161,11 @@ export default { ...@@ -161,9 +161,11 @@ export default {
.exam-content { .exam-content {
width: 100%; width: 100%;
height: calc(100vh - var(--status-bar-height) - toRpx(88) - toRpx(100)); max-height: toRpx(1200);
overflow-y: auto; overflow-y: auto;
padding: 0 toRpx(64);
} }
} }
</style> </style>
...@@ -12,16 +12,14 @@ ...@@ -12,16 +12,14 @@
<!-- 内容区域 --> <!-- 内容区域 -->
<view class="study-center"> <view class="study-center">
<!-- 左侧:学习看板 -->
<view class="study-left"> <view class="study-left">
<view class="title">学习看板</view> <view class="title">学习看板</view>
<view class="study-board-box"> <view class="study-board-box">
<!-- 累计学习看板 -->
<template v-if="isBeisen || (isHmzx && isYb)"> <template v-if="isBeisen || (isHmzx && isYb)">
<LearnStatistics :dataInfo="dataInfo" :isBeisen="isBeisen" :isHmzx="isHmzx" :isYb="isYb" /> <LearnStatistics :dataInfo="dataInfo" :isBeisen="isBeisen" :isHmzx="isHmzx" :isYb="isYb" />
</template> </template>
<!-- 周转化率看板 -->
<WeeklyConversionRate :dataInfo="dataInfo" :isBeisen="isBeisen" :isHmzx="isHmzx" :isYb="isYb" /> <WeeklyConversionRate :dataInfo="dataInfo" :isBeisen="isBeisen" :isHmzx="isHmzx" :isYb="isYb" />
<!-- 能力分析看板 -->
<template v-if="isHmzx && isYb"> <template v-if="isHmzx && isYb">
<view :class="['study-box3', isBeisen ? '' : 'big-height']"> <view :class="['study-box3', isBeisen ? '' : 'big-height']">
<view :class="['study-box3-title', isBeisen ? '' : 'big-margin']">能力分析</view> <view :class="['study-box3-title', isBeisen ? '' : 'big-margin']">能力分析</view>
...@@ -30,6 +28,7 @@ ...@@ -30,6 +28,7 @@
</template> </template>
</view> </view>
</view> </view>
<!-- 右侧:任务和课程列表 -->
<view class="study-right"> <view class="study-right">
<view class="data-container"> <view class="data-container">
<view :class="['type-box']"> <view :class="['type-box']">
...@@ -44,9 +43,11 @@ ...@@ -44,9 +43,11 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 我的任务 tab:使用 MyTask 组件 -->
<template v-if="firstIndex == 0"> <template v-if="firstIndex == 0">
<MyTask ref="myTask" /> <MyTask ref="myTask" />
</template> </template>
<!-- 更多课程 tab:使用 RecommendCourse 组件(简化模式) -->
<template v-if="firstIndex == 1"> <template v-if="firstIndex == 1">
<RecommendCourse :simplified="true" /> <RecommendCourse :simplified="true" />
</template> </template>
...@@ -84,14 +85,13 @@ ...@@ -84,14 +85,13 @@
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: false, // 是否是有北森权限,true 有,false无 isBeisen: false,
isFlag: true, // 当前驻店人员所关联的门店非鸿蒙智行或非延保业务 isFlag: true,
isHmzx: false, // 当前驻店人员所关联的门店是否是鸿蒙智行 isHmzx: false,
isYb: false, // 当前驻店人员所关联的门店是否是延保业务 isYb: false,
} }
}, },
created () { created () {
// 监听自定义事件
uni.$on('backStudyCenter', () => { uni.$on('backStudyCenter', () => {
console.log('backStudyCenter', this.$refs.myTask) console.log('backStudyCenter', this.$refs.myTask)
const { tabIndex, finishIndex } = this.$refs.myTask const { tabIndex, finishIndex } = this.$refs.myTask
...@@ -109,28 +109,23 @@ ...@@ -109,28 +109,23 @@
console.log(beisenToken, 'beisenToken') console.log(beisenToken, 'beisenToken')
this.isBeisen = !!beisenToken this.isBeisen = !!beisenToken
if (!beisenToken) { if (!beisenToken) {
// 没有北森权限则typeList没有推荐课程
this.typeList = [ this.typeList = [
{ tabName: '我的任务', num: () => '' } { tabName: '我的任务', num: () => '' }
] ]
} }
this.isHmzx = studyCenterPermission.hmzxAuth this.isHmzx = studyCenterPermission.hmzxAuth
this.isYb = studyCenterPermission.authorizedBusinessList && studyCenterPermission.authorizedBusinessList.includes(1) this.isYb = studyCenterPermission.authorizedBusinessList && studyCenterPermission.authorizedBusinessList.includes(1)
// this.getServerData();
this.getStudyBoard(); this.getStudyBoard();
}, },
methods: { methods: {
// 返回上一页
back() { back() {
uni.navigateBack() uni.navigateBack()
}, },
// 跳转到我的任务页面
goToMyTask() { goToMyTask() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/studyCenter/myTask' url: '/pages/boutique/myTask'
}) })
}, },
// tab切换
changeType(index, tagIndex) { changeType(index, tagIndex) {
this.firstIndex = index this.firstIndex = index
}, },
...@@ -138,7 +133,6 @@ ...@@ -138,7 +133,6 @@
const res = await uni.$api.commonApi.getStudyBoard({}) const res = await uni.$api.commonApi.getStudyBoard({})
console.log(111111, 'res', res) console.log(111111, 'res', res)
this.dataInfo = res this.dataInfo = res
// 虚增已完成学习学员比例
const boostRatio = (val) => { const boostRatio = (val) => {
const numVal = Number(val) const numVal = Number(val)
if (isNaN(numVal)) return val if (isNaN(numVal)) return val
...@@ -163,12 +157,10 @@ ...@@ -163,12 +157,10 @@
series: [ series: [
{ {
data: res.abilityAnalysisScore data: res.abilityAnalysisScore
// data: [1, 2, 3, 1, 2, 2, 3, 3, 3]
} }
] ]
} }
this.chartData = _chartData this.chartData = _chartData
// 设置雷达图标签颜色,1为红色,否则为灰色
if (_chartData.series && _chartData.series[0] && Array.isArray(_chartData.series[0].data)) { if (_chartData.series && _chartData.series[0] && Array.isArray(_chartData.series[0].data)) {
const dataArr = _chartData.series[0].data; const dataArr = _chartData.series[0].data;
let _labelColors = []; let _labelColors = [];
...@@ -189,6 +181,7 @@ ...@@ -189,6 +181,7 @@
width: 100%; width: 100%;
height: 100vh; height: 100vh;
position: relative; position: relative;
overflow: hidden;
&::after { &::after {
content: ''; content: '';
...@@ -203,9 +196,7 @@ ...@@ -203,9 +196,7 @@
z-index: -1; z-index: -1;
} }
// 导航栏样式
.header{ .header{
position: relative; position: relative;
.nav-bar { .nav-bar {
...@@ -236,8 +227,6 @@ ...@@ -236,8 +227,6 @@
} }
} }
.simple-popup-content { .simple-popup-content {
width: 720rpx; width: 720rpx;
padding: 40rpx; padding: 40rpx;
...@@ -261,8 +250,6 @@ ...@@ -261,8 +250,6 @@
overflow: hidden; overflow: hidden;
padding-top: toRpx(44); padding-top: toRpx(44);
// 我的学习时长卡片
.study-left { .study-left {
width: toRpx(656); width: toRpx(656);
margin-right: toRpx(48); margin-right: toRpx(48);
......
...@@ -19,7 +19,12 @@ ...@@ -19,7 +19,12 @@
class="webview-window" class="webview-window"
v-if="webviewUrl" v-if="webviewUrl"
> >
<web-view :src="webviewUrl"></web-view> <web-view :src="webviewUrl" @onPostMessage="handlePostMessage"></web-view>
</view>
<!-- 全屏 Loading -->
<view class="loading-overlay" v-if="showLoading">
<image class="loading-icon" src="../../assets/images/common/loadding.gif" mode="aspectFit" />
</view> </view>
</view> </view>
...@@ -33,7 +38,8 @@ export default { ...@@ -33,7 +38,8 @@ export default {
webviewUrl: '', webviewUrl: '',
pageTitle: '学习测评', pageTitle: '学习测评',
wv: null, wv: null,
hotArea: null // 存储热区对象 hotArea: null, // 存储热区对象
showLoading: true // 控制 loading 显示
} }
}, },
onLoad (options) { onLoad (options) {
...@@ -69,6 +75,14 @@ export default { ...@@ -69,6 +75,14 @@ export default {
this.createHotArea() this.createHotArea()
// this.hideThirdPartyBackButton() // 不隐藏第三方按钮,只用热区拦截点击 // this.hideThirdPartyBackButton() // 不隐藏第三方按钮,只用热区拦截点击
}, 1000) }, 1000)
// 设置超时自动隐藏 loading(防止页面加载失败一直显示 loading)
setTimeout(() => {
if (this.showLoading) {
console.log('⏰ 超时自动关闭 loading')
this.showLoading = false
}
}, 10000) // 10秒后自动关闭
}, },
beforeDestroy() { beforeDestroy() {
// 销毁热区 // 销毁热区
...@@ -112,6 +126,15 @@ export default { ...@@ -112,6 +126,15 @@ export default {
height: 'calc(100% - 136rpx)' // 减去顶部导航栏高度 height: 'calc(100% - 136rpx)' // 减去顶部导航栏高度
}) })
console.log('✅ webview 样式设置成功') console.log('✅ webview 样式设置成功')
// 监听 webview 加载完成事件
wv.addEventListener('loaded', () => {
console.log('✅ webview 加载完成,关闭 loading')
setTimeout(() => {
this.showLoading = false
}, 300)
}, false)
return true return true
} else { } else {
console.log('⚠️ 未找到 webview 对象') console.log('⚠️ 未找到 webview 对象')
...@@ -148,6 +171,17 @@ export default { ...@@ -148,6 +171,17 @@ export default {
} }
}) })
}, },
// 处理 webview 发送的消息
handlePostMessage(e) {
console.log('📨 收到 webview 消息:', e)
// webview 加载完成后隐藏 loading
if (this.showLoading) {
setTimeout(() => {
console.log('✅ webview 消息触发,关闭 loading')
this.showLoading = false
}, 500)
}
},
// 创建透明热区覆盖在返回按钮位置,拦截点击事件 // 创建透明热区覆盖在返回按钮位置,拦截点击事件
createHotArea() { createHotArea() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
...@@ -230,5 +264,23 @@ export default { ...@@ -230,5 +264,23 @@ export default {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
} }
.loading-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #ffffff;
display: flex;
align-items: center;
justify-content: center;
z-index: 99999;
.loading-icon {
width: toRpx(100);
height: toRpx(100);
}
}
</style> </style>
...@@ -5,19 +5,19 @@ class LocalLog { ...@@ -5,19 +5,19 @@ class LocalLog {
logger = null logger = null
constructor() { constructor() {
this.logger={} this.logger={}
// this.logger = new LogCat() this.logger = new LogCat()
} }
debug(msg) { debug(msg) {
// this.logger.writeLog(LogLevel.DEBUG, msg) this.logger.writeLog(LogLevel.DEBUG, msg)
} }
info(msg) { info(msg) {
// this.logger.writeLog(LogLevel.INFO, msg) this.logger.writeLog(LogLevel.INFO, msg)
} }
warn(msg) { warn(msg) {
// this.logger.writeLog(LogLevel.WARN, msg) this.logger.writeLog(LogLevel.WARN, msg)
} }
error(msg) { error(msg) {
// this.logger.writeLog(LogLevel.ERROR, msg) this.logger.writeLog(LogLevel.ERROR, msg)
} }
getFiles(beginDate, endDate) { getFiles(beginDate, endDate) {
const logFiles = this.logger.getLogFileList() const logFiles = this.logger.getLogFileList()
......
# 学习中心功能开发文档
## 一、页面路径
### 1. 我的课程页面
**路径**: `pages/boutique/myCourse.vue`
**使用的组件**:
- `components/HomeFrame/components/Study/RecommendCourse.vue` - 待学习 Tab
- `components/HomeFrame/components/Study/MyTask.vue` - 正在学习 Tab
- `components/HomeFrame/components/Study/CompletedCourse.vue` - 已学完 Tab
---
### 2. 我的考试页面
**路径**: `pages/boutique/myExam.vue`
**使用的组件**:
- `components/HomeFrame/components/Study/PassedExam.vue` - 已通过 Tab
- `components/HomeFrame/components/Study/FailedExam.vue` - 未通过 Tab
---
### 3. 我的任务页面
**路径**: `pages/boutique/myTask.vue`
**使用的组件**:
- `components/HomeFrame/components/Study/LearnStatistics.vue` - 累计学习统计
- `components/HomeFrame/components/Study/WeeklyConversionRate.vue` - 周转化率看板
- `pages/common/studyDetail/components/RadarChart.vue` - 能力分析雷达图
- `components/HomeFrame/components/Study/MyTask.vue` - 我的任务卡片
- `components/HomeFrame/components/Study/RecommendCourse.vue` - 更多课程卡片(简化模式)
---
### 4. 排行榜页面
**路径**: `pages/boutique/leaderboard.vue`
**使用的图片资源**:
- `assets/images/studyCenter/Leaderboard-bg.png` - 顶部占位图
- `assets/images/studyCenter/guan.png` - 冠军勋章
- `assets/images/studyCenter/ya.png` - 亚军勋章
- `assets/images/studyCenter/ji.png` - 季军勋章
- `assets/images/common/developing.webp` - 功能开发中图标
---
## 二、组件路径
### 1. 学习中心主页面
**路径**: `components/HomeFrame/components/StudyCenter.vue`
**使用的组件**:
- `components/TwoLevelSelectComponent.vue` - 二级筛选组件
- `components/SelectComponent.vue` - 单级筛选组件
- `components/OrderScreen/index.vue` - 筛选弹窗组件
- `components/HomeFrame/components/Study/RecommendCourse.vue` - 推荐课程卡片
- `components/HomeFrame/components/Study/MyTask.vue` - 正在学习卡片
---
### 2. 课程卡片组件
#### RecommendCourse.vue(推荐课程卡片)
**路径**: `components/HomeFrame/components/Study/RecommendCourse.vue`
**新增 Props**:
- `cardWidth`: Number, default 0 (0=响应式3列,530=固定宽度4列)
- `simplified`: Boolean, default false (true时仅显示背景图、标题和时间)
---
#### MyTask.vue(正在学习的课程任务卡片)
**路径**: `components/HomeFrame/components/Study/MyTask.vue`
**新增 Props**:
- `cardWidth`: Number, default 0 (0=响应式3列,530=固定宽度4列)
---
#### CompletedCourse.vue(已完成课程卡片)
**路径**: `components/HomeFrame/components/Study/CompletedCourse.vue`
**新增 Props**:
- `cardWidth`: Number, default 0 (0=响应式3列,530=固定宽度4列)
**使用的图片资源**:
- `assets/images/studyCenter/success.png` - 成功图标(144x144)
---
### 3. 考试卡片组件
#### PassedExam.vue(已通过考试卡片)
**路径**: `components/HomeFrame/components/Study/PassedExam.vue`
**说明**: 基于 RecommendCourse.vue 封装,显示绿色分数
---
#### FailedExam.vue(未通过考试卡片)
**路径**: `components/HomeFrame/components/Study/FailedExam.vue`
**说明**: 基于 RecommendCourse.vue 封装,显示红色分数
---
### 4. 筛选弹窗组件
#### OrderScreen/index.vue(筛选弹窗)
**路径**: `components/OrderScreen/index.vue`
**新增 Props**:
- `configData`: Array, default [] (支持外部传入筛选配置)
- `title`: String, default '工单筛选' (支持自定义弹窗标题)
---
#### OrderScreen/courseConfig.js(课程筛选配置)
**路径**: `components/OrderScreen/courseConfig.js`
**说明**: 定义课程筛选的配置项(必修/选修、课程类型、评分)
---
#### OrderScreen/components/CourseOptionList.vue(课程选项列表)
**路径**: `components/OrderScreen/components/CourseOptionList.vue`
**说明**: 处理课程筛选的选项列表组件
---
### 5. 权限弹窗组件
#### StudyCenterPermissionPopup.vue(学习中心权限弹窗)
**路径**: `components/StudyCenterPermissionPopup.vue`
**说明**: 点击"新建工单"时,如果没有学习中心权限,弹出提示
**使用的图片资源**:
- `assets/images/studyCenter/noquan.webp` - 无权限提示图
---
### 6. 其他组件
#### TwoLevelSelectComponent.vue(二级选择器)
**路径**: `components/TwoLevelSelectComponent.vue`
**修改说明**: 移除右箭头图标,调整二级弹窗位置,文字居中对齐
---
#### HomeFrame/index.vue(主框架)
**路径**: `components/HomeFrame/index.vue`
**新增功能**: 集成学习中心权限弹窗,点击"新建工单"时检查权限
---
## 三、路由配置
### pages.json
```json
{
"path": "pages/boutique/myTask",
"style": { "navigationStyle": "custom" }
},
{
"path": "pages/boutique/myCourse",
"style": { "navigationStyle": "custom" }
},
{
"path": "pages/boutique/myExam",
"style": { "navigationStyle": "custom" }
},
{
"path": "pages/boutique/leaderboard",
"style": { "navigationStyle": "custom" }
}
```
---
## 四、跳转路径总结
| 功能 | 跳转方法 | 页面路径 | 所在文件 |
|-----|---------|---------|---------|
| 我的课程 | `goToMyCourse()` | `/pages/boutique/myCourse` | StudyCenter.vue |
| 我的任务 | `goToMyTask()` | `/pages/boutique/myTask` | StudyCenter.vue |
| 我的考试 | `goToMyExam()` | `/pages/boutique/myExam` | StudyCenter.vue |
| 排行榜 | `goToLeaderboard()` | `/pages/boutique/leaderboard` | StudyCenter.vue |
---
## 五、图片资源路径
### 学习中心相关图片
- `assets/images/studyCenter/Required.png` - 必修标签(94x48)
- `assets/images/studyCenter/Elective.png` - 选修标签(94x48)
- `assets/images/studyCenter/liang.png` - 亮星星(40x40)
- `assets/images/studyCenter/zuo.png` - 半星星(40x40)
- `assets/images/studyCenter/hui.png` - 灰星星(40x40)
- `assets/images/studyCenter/rs.png` - 学习人数图标(32x32)
- `assets/images/studyCenter/success.png` - 完成图标(144x144)
- `assets/images/studyCenter/noquan.webp` - 无权限提示图
- `assets/images/studyCenter/Leaderboard-bg.png` - 排行榜顶部图(1084x128)
- `assets/images/studyCenter/guan.png` - 冠军勋章(80x80)
- `assets/images/studyCenter/ya.png` - 亚军勋章(80x80)
- `assets/images/studyCenter/ji.png` - 季军勋章(80x80)
### 通用图片
- `assets/images/common/home-bg-1.webp` - 学习中心背景图
- `assets/images/common/study-title.png` - 学习看板标题背景(656x104)
- `assets/images/common/developing.webp` - 功能开发中图标(344x208)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!