Commit 8bcf0ad4 by Lin

修复(HomeFrame, PreStudyPopup):更新预学习弹窗逻辑和样式

- 将 HomeFrame 中的 confirmText 绑定改为使用 preStudyPopInfo。
- 更新 HomeFrame 默认隐藏预学习弹窗。
- 优化 PreStudyPopup,增强按钮功能并调整布局,包括为已学课程集成图标。
1 parent eed08aee
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
<!-- 预学习弹框 --> <!-- 预学习弹框 -->
<StudyPopup :show.sync="showPreStudyPopup" title="提示" :width="848" :height="968" <StudyPopup :show.sync="showPreStudyPopup" title="提示" :width="848" :height="968"
:topImage="require('@/assets/images/common/warning-notice.webp')" :topImageWidth="848" :topImageHeight="248"> :topImage="require('@/assets/images/common/warning-notice.webp')" :topImageWidth="848" :topImageHeight="248">
<PreStudyPopup :confirmText="examPopInfo.confirmText" @cancel="handlePreStudyCancel" <PreStudyPopup :confirmText="preStudyPopInfo.confirmText" @cancel="handlePreStudyCancel"
@confirm="handlePreStudyConfirm" @start-study="handlePreStudyStart" /> @confirm="handlePreStudyConfirm" @start-study="handlePreStudyStart" />
</StudyPopup> </StudyPopup>
...@@ -366,8 +366,11 @@ export default { ...@@ -366,8 +366,11 @@ export default {
showError: false, showError: false,
confirmText: '确认已提交' confirmText: '确认已提交'
}, },
preStudyPopInfo: {
confirmText: '跳过(剩余2次)',
},
showStudyPermissionPopup: false, showStudyPermissionPopup: false,
showPreStudyPopup: true, showPreStudyPopup: false,
courseInfo: { courseInfo: {
title: '' title: ''
}, },
......
<template> <template>
<view class="exam-submit-popup-wrapper"> <view class="exam-submit-popup-wrapper">
<view class="content-box"> <view class="content-box">
<scroll-view class="course-list" scroll-y> <scroll-view class="course-list" scroll-y>
<view <view
class="course-item" class="course-item"
v-for="(item, index) in displayCourseList" v-for="(item, index) in displayCourseList"
:key="item.id || index" :key="item.id || index"
> >
<view class="course-item-title"> <view class="course-item-title">
<view class="course-item-title-text">{{ item.title }}</view> <view class="course-item-title-text">{{ item.title }}</view>
<view class="course-item-desc">{{ item.description }}</view> <view class="course-item-desc">{{ item.description }}</view>
</view> </view>
<view <view
class="course-item-btn" class="course-item-btn"
v-if="item.state === 0" v-if="item.state === 0"
@click.stop="handleStartStudy(item, index)" @click.stop="handleStartStudy(item, index)"
>开启学习</view> >开启学习</view>
<view class="course-item-btn course-item-btn--learned" v-else>已学习</view> <view class="course-item-btn course-item-btn--learned" v-else>
</view> <image class="course-item-btn-icon" :src="require('@/assets/images/common/icon-study-right.png')" mode="aspectFit"></image>
</scroll-view> <text>已学习</text>
</view> </view>
<!-- 按钮组(始终显示) --> </view>
<view class="button-group"> </scroll-view>
<view class="confirm-button" @click="handleConfirm"> </view>
{{ confirmText }} <!-- 按钮组(始终显示) -->
</view> <view class="button-group">
</view> <view class="confirm-button" @click="handleConfirm">
</view> {{ confirmText }}
</template> </view>
</view>
<script> </view>
const DEFAULT_COURSE_LIST = [ </template>
{
id: 1, <script>
title: 'AITO 春醒悦享车衣套餐', const DEFAULT_COURSE_LIST = [
description: '包含:原厂定制隐形车衣 + 专属天窗....', {
state:1 id: 1,
}, title: 'AITO 春醒悦享车衣套餐',
{ description: '包含:原厂定制隐形车衣 + 专属天窗....',
id: 2, state: 1
title: 'AITO 春醒悦享车衣套餐', },
description: '包含:原厂定制隐形车衣 + 专属天窗....', {
state:0 id: 2,
} title: 'AITO 春醒悦享车衣套餐',
] description: '包含:原厂定制隐形车衣 + 专属天窗....',
state: 0
export default { }
name: 'PreStudyPopup', ]
props: {
confirmText: { export default {
type: String, name: 'PreStudyPopup',
default: '跳过' props: {
}, confirmText: {
courseList: { type: String,
type: Array, default: '跳过'
default: () => [] },
} courseList: {
}, type: Array,
computed: { default: () => []
displayCourseList() { }
return this.courseList.length ? this.courseList : DEFAULT_COURSE_LIST },
} computed: {
}, displayCourseList() {
methods: { return this.courseList.length ? this.courseList : DEFAULT_COURSE_LIST
handleStartStudy(item, index) { }
if (item.state !== 0) return },
this.$emit('start-study', item, index) methods: {
uni.navigateTo({ handleStartStudy(item, index) {
url: '/pages/common/prelearnBridge' if (item.state !== 0) return
}) this.$emit('start-study', item, index)
}, uni.navigateTo({
handleCancel() { url: '/pages/common/prelearnBridge'
this.$emit('cancel') })
}, },
handleConfirm() { handleCancel() {
this.$emit('confirm') this.$emit('cancel')
} },
} handleConfirm() {
} this.$emit('confirm')
</script> }
}
<style lang="scss" scoped> }
.exam-submit-popup-wrapper { </script>
position: relative;
width: 100%; <style lang="scss" scoped>
min-height: toRpx(400); .exam-submit-popup-wrapper {
display: flex; position: relative;
flex-direction: column; width: 100%;
align-items: center; min-height: toRpx(400);
padding-bottom: toRpx(48); display: flex;
} flex-direction: column;
align-items: center;
.content-box { padding-bottom: toRpx(48);
width: toRpx(720); }
box-sizing: border-box;
} .content-box {
width: toRpx(720);
.course-list { box-sizing: border-box;
width: 100%; }
height: toRpx(440);
box-sizing: border-box; .course-list {
} width: 100%;
height: toRpx(440);
.course-item { box-sizing: border-box;
display: flex; }
align-items: center;
justify-content: space-between; .course-item {
gap: toRpx(16); display: flex;
width: 100%; align-items: center;
padding: toRpx(16); justify-content: space-between;
border-radius: toRpx(16); gap: toRpx(16);
border: toRpx(2) solid #e4e9f7; width: 100%;
background: #f5f7fa; padding: toRpx(16);
box-sizing: border-box; border-radius: toRpx(16);
margin-bottom: toRpx(48); border: toRpx(2) solid #e4e9f7;
} background: #f5f7fa;
box-sizing: border-box;
.course-item-title { margin-bottom: toRpx(48);
flex: 1; }
min-width: 0;
display: flex; .course-item-title {
flex-direction: column; flex: 1;
gap: toRpx(16); min-width: 0;
} display: flex;
flex-direction: column;
.course-item-title-text { gap: toRpx(16);
width: 100%; }
color: #333333;
font-size: toRpx(40); .course-item-title-text {
font-weight: 500; width: 100%;
font-family: "HarmonyOSSansSC"; color: #333333;
line-height: toRpx(60); font-size: toRpx(40);
overflow: hidden; font-weight: 500;
text-overflow: ellipsis; font-family: "HarmonyOSSansSC";
white-space: nowrap; line-height: toRpx(60);
} overflow: hidden;
text-overflow: ellipsis;
.course-item-desc { white-space: nowrap;
width: 100%; }
color: #999999;
font-size: toRpx(28); .course-item-desc {
font-weight: 400; width: 100%;
font-family: "HarmonyOSSansSC"; color: #999999;
line-height: toRpx(48); font-size: toRpx(28);
overflow: hidden; font-weight: 400;
text-overflow: ellipsis; font-family: "HarmonyOSSansSC";
white-space: nowrap; line-height: toRpx(48);
} overflow: hidden;
text-overflow: ellipsis;
.course-item-btn { white-space: nowrap;
flex-shrink: 0; }
height: toRpx(56);
padding: 0 toRpx(16); .course-item-btn {
border-radius: toRpx(8); flex-shrink: 0;
border: toRpx(2) solid rgba(44, 102, 247, 0.1); height: toRpx(56);
background: #2c66f7; padding: 0 toRpx(16);
color: #ffffff; border-radius: toRpx(8);
font-size: toRpx(26); border: toRpx(2) solid rgba(44, 102, 247, 0.1);
font-weight: 400; background: #2c66f7;
font-family: "HarmonyOSSansSC"; color: #ffffff;
line-height: toRpx(56); font-size: toRpx(26);
text-align: center; font-weight: 400;
white-space: nowrap; font-family: "HarmonyOSSansSC";
line-height: toRpx(56);
&--learned { text-align: center;
border: 1px solid rgba(44, 102, 247, 0.10); white-space: nowrap;
background: rgba(44, 102, 247, 0.05);
color: #2c66f7; &--learned {
} display: flex;
} align-items: center;
gap: toRpx(8);
.button-group { border: 1px solid rgba(44, 102, 247, 0.10);
display: flex; background: rgba(44, 102, 247, 0.05);
align-items: center; color: #2c66f7;
justify-content: center; }
width: 100%; }
gap: toRpx(16);
margin-top: toRpx(8); .course-item-btn-icon {
} width: 16px;
height: 16px;
.confirm-button { flex-shrink: 0;
width: toRpx(338); }
height: toRpx(80);
margin: 0 auto; .button-group {
border-radius: toRpx(48); display: flex;
border: toRpx(2) solid #979797; align-items: center;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%); justify-content: center;
color: #ffffff; width: 100%;
font-size: toRpx(28); gap: toRpx(16);
font-weight: 500; margin-top: toRpx(8);
font-family: "HarmonyOSSansSC"; }
text-align: center;
line-height: toRpx(80); .confirm-button {
width: toRpx(338);
&:active { height: toRpx(80);
opacity: 0.8; margin: 0 auto;
} border-radius: toRpx(48);
} border: toRpx(2) solid #979797;
</style> background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #ffffff;
font-size: toRpx(28);
font-weight: 500;
font-family: "HarmonyOSSansSC";
text-align: center;
line-height: toRpx(80);
&:active {
opacity: 0.8;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!