Commit 066ee1dc by 胡悦

feat(studyCenter): 添加返回按钮触发学习弹窗事件并优化样式

- 在多个页面添加返回按钮触发学习弹窗事件
- 更新课程图片显示逻辑,使用动态路径
- 调整任务进度条宽度和字体粗细
- 优化无数据展示图片路径
- 更新sprite图标样式和位置
1 parent 30c9091f

2.92 MB | W: | H:

2.92 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin

56.1 KB | W: | H:

30.4 KB | W: | H:

assets/images/studyCenter/Leaderboard-bg.png
assets/images/studyCenter/Leaderboard-bg.png
assets/images/studyCenter/Leaderboard-bg.png
assets/images/studyCenter/Leaderboard-bg.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -18,9 +18,10 @@
<view class="cancel-button" @click="handleCancel">
未提交
</view>
<view class="confirm-button" @click="handleConfirm">
<view class="confirm-button" v-if="!isLoading" @click="handleConfirm">
{{ confirmText }}
</view>
<view class="confirm-button confirm-button-loading" v-else> {{ confirmText }}</view>
</view>
......@@ -145,6 +146,10 @@ export default {
text-align: center;
line-height: toRpx(80);
&-loading {
opacity: 0.5;
}
&:active {
opacity: 0.8;
}
......
......@@ -185,11 +185,12 @@ export default {
// index = tabs.findIndex(e => e.name == 'ActivityCenter')
// this.changeIndex(index, this.tabs[index])
// })
// uni.$on('studyCenter', () => {
// let { tabs } = this,
// index = tabs.findIndex(e => e.name == 'StudyCenter')
// this.changeIndex(index, this.tabs[index])
// });
// 监听学习任务弹窗提醒,长课程
uni.$on('studyCenter', () => {
let { tabs } = this,
index = tabs.findIndex(e => e.name == 'StudyCenter')
this.changeIndex(index, this.tabs[index])
});
console.log('this.tabIndex', this.tabIndex)
this.getUnreadCount()
this.getStudyCenterPermission()
......
......@@ -20,7 +20,7 @@
</view>
<image class="recommend-course-item-img"
src="../../../../assets/images/common/recommend-course-default.webp" mode="scaleToFill" />
:src="require(`@/assets/images/common/${COURSE_TYPE[item.courseFileType].image}.webp`)" mode="scaleToFill" />
<view class="recommend-course-content">
<view class="recommend-course-item-title">
{{ item.title }}
......@@ -51,7 +51,7 @@
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
<image class="icon" src="../../../../assets/images/common/noData.png" />
暂无数据
</view>
</template>
......@@ -360,16 +360,17 @@ export default {
}
.nothing {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin-top: toRpx(280);
font-size: toRpx(28);
height: toRpx(1000);
color: #999999;
font-size: toRpx(24);
.icon {
width: toRpx(678);
height: toRpx(284);
margin-bottom: toRpx(24);
width: toRpx(344);
height: toRpx(208);
}
}
......
......@@ -41,7 +41,7 @@
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
<image class="icon" src="../../../../assets/images/common/noData.png" />
暂无数据
</view>
</template>
......
......@@ -229,6 +229,7 @@ export default {
created() {
// 监听课程数量更新事件
uni.$on('update:totalCourseCount', (count) => {
console.log(count, 'totalCourseCount')
this.totalCourseCount = count
})
},
......@@ -237,15 +238,15 @@ export default {
uni.$off('update:totalCourseCount')
},
async mounted() {
const beisenToken = uni.$storage.get('beisenToken')
console.log(beisenToken, 'beisenToken')
this.isBeisen = !!beisenToken
if (!beisenToken) {
// 没有北森权限则typeList没有推荐课程
this.typeList = [
{ tabName: '我的任务', num: () => '' }
]
}
// const beisenToken = uni.$storage.get('beisenToken')
// console.log(beisenToken, 'beisenToken')
// this.isBeisen = !!beisenToken
// if (!beisenToken) {
// // 没有北森权限则typeList没有推荐课程
// this.typeList = [
// { tabName: '我的任务', num: () => '' }
// ]
// }
// 检查是否显示我的任务
this.showMyTask = await this.checkStudyCenterPermission()
......@@ -270,7 +271,7 @@ export default {
if (res) {
const list = Array.isArray(res) ? res : []
const filtered = list
.filter(item => item && item.categoryName !== '未分组')
.filter(item => item && item.id !== 1)
.map(item => ({
...item,
children: [
......
......@@ -312,10 +312,16 @@ export default {
console.log('接收到考试提交弹窗事件')
this.showExamPopup = true
})
uni.$on('showStudyPopup', (obj) => {
console.log('接收到学习弹窗事件', obj)
// 查询是否有等级考试
this.getLevelExamInfo()
})
},
beforeDestroy() {
// 组件销毁前移除监听
uni.$off('showExamSubmitPopup')
uni.$off('showStudyPopup')
},
mounted () {
const userInfo = uni.$storage.get('userInfo') || {}
......@@ -375,15 +381,20 @@ export default {
url: `/pages/common/studyWebview?url=${encodeURIComponent(this.jumpUrl)}&pageTitle=学习测评`
})
} else {
throw new Error('获取 token 失败')
uni.showToast({
title: '培训账号未创建',
icon: 'none'
})
this.getLevelExamInfo()
throw new Error('获取 token 失败1')
}
} catch (error) {
uni.hideLoading()
console.error('❌ 获取 token 失败:', error)
// uni.showToast({
// title: '获取授权失败,请重试',
// icon: 'none'
// })
uni.showToast({
title: '培训账号未创建',
icon: 'none'
})
}
},
// 获取北森 SSO Token(参考 detail.vue 的方法)
......
......@@ -19,7 +19,7 @@
</view>
<image class="completed-course-item-img"
src="../../../../assets/images/common/course-default-bg.webp" mode="scaleToFill" />
:src="require(`@/assets/images/common/${COURSE_TYPE[item.courseFileType].image}.webp`)" mode="scaleToFill" />
<view class="completed-course-content">
<view class="completed-course-item-title">
{{ item.title }}
......
......@@ -578,7 +578,7 @@ export default {
}
}
.task-item-progress {
width: toRpx(151);
width: toRpx(214);
height: toRpx(16);
background: linear-gradient(128.8deg, rgba(117, 188, 255, .35) 0%, rgba(44, 102, 247, .35) 100%);
border-radius: toRpx(8);
......
......@@ -21,7 +21,7 @@
</view>
<image class="recommend-course-item-img"
src="../../../../assets/images/common/course-default-bg.webp" mode="scaleToFill" />
:src="require(`@/assets/images/common/${COURSE_TYPE[item.courseFileType].image}.webp`)" mode="scaleToFill" />
<view class="recommend-course-content">
<view class="recommend-course-item-title">
{{ item.title }}
......
......@@ -105,6 +105,8 @@ export default {
// if(currentWebview){
// currentWebview.close()
// }
// 点击返回按钮,触发学习弹窗事件
uni.$emit('showStudyPopup', {name: 'courseDetail'})
uni.navigateBack()
},
async openCourse(index, item) {
......
......@@ -95,6 +95,8 @@ export default {
},
methods: {
back() {
// 点击返回按钮,触发学习弹窗事件
uni.$emit('showStudyPopup', {name: 'leaderboard'})
uni.navigateBack()
},
switchTab(index) {
......@@ -163,7 +165,7 @@ export default {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-weight: 500;
font-size: toRpx(32);
color: #1a1a1a;
}
......@@ -179,7 +181,7 @@ export default {
width: toRpx(1084);
height: toRpx(1312);
border-radius: toRpx(32);
background: #ffffffb3;
background: #ffffff;
backdrop-filter: blur(toRpx(16));
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
position: relative;
......@@ -194,7 +196,7 @@ export default {
width: 100%;
height: toRpx(128);
display: block;
// background-color: #ecf2ff;
background-color: #ecf2ff;
}
}
......@@ -347,7 +349,7 @@ export default {
}
.rank-scroll {
max-height: toRpx(960);
max-height: toRpx(944);
}
}
......
......@@ -72,6 +72,8 @@ export default {
},
methods: {
back() {
// 点击返回按钮,触发学习弹窗事件
uni.$emit('showStudyPopup', {name: 'myCourse'})
uni.navigateBack()
},
switchTab(index) {
......@@ -140,7 +142,7 @@ export default {
}
.title {
font-size: toRpx(36);
font-size: toRpx(32);
font-weight: 500;
color: #000000;
text-align: center;
......
......@@ -69,6 +69,8 @@ export default {
},
methods: {
back() {
// 点击返回按钮,触发学习弹窗事件
uni.$emit('showStudyPopup', {name: 'myExam'})
uni.navigateBack()
},
switchTab(index) {
......@@ -120,7 +122,7 @@ export default {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-weight: 500;
font-size: toRpx(32);
color: #1a1a1a;
}
......
......@@ -118,10 +118,13 @@
}
this.isHmzx = studyCenterPermission.hmzxAuth
this.isYb = studyCenterPermission.authorizedBusinessList && studyCenterPermission.authorizedBusinessList.includes(1)
console.log(this.isBeisen,this.isHmzx, this.isYb, 'this.isYb')
this.getStudyBoard();
},
methods: {
back() {
// 点击返回按钮,触发学习弹窗事件
uni.$emit('showStudyPopup', {name: 'myTask'})
uni.navigateBack()
},
goToMyTask() {
......@@ -221,7 +224,7 @@
}
.title {
font-size: toRpx(36);
font-size: toRpx(32);
font-weight: 500;
color: #000000;
text-align: center;
......@@ -251,7 +254,6 @@
flex: 1;
padding: toRpx(56) toRpx(48) toRpx(80);
overflow: hidden;
padding-top: toRpx(44);
.study-left {
width: toRpx(656);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!