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