Commit e2ae475c by Lin

feat(HomeFrame): 添加预学习弹框及相关功能

- 在 HomeFrame 组件中新增预学习弹框,包含确认和取消操作。
- 更新环境配置,将默认环境索引从3改为1。
- 修改活动类型标签,更新为“新享特惠”和“售后钜惠”。
1 parent 0a6ac5a9
......@@ -111,8 +111,8 @@ export default {
data() {
return {
activityTypeTabs: [
{ label: '售前活动', key: 'preSale' },
{ label: '售后活动', key: 'afterSale' }
{ label: '新享特惠', key: 'preSale' },
{ label: '售后钜惠', key: 'afterSale' }
],
activityTypeIndex: 0,
carModelTabs: [
......
......@@ -192,6 +192,13 @@
:confirmText="examPopInfo.confirmText" @cancel="handleExamCancel" @confirm="handleExamConfirm" />
</StudyPopup>
<!-- 预学习弹框 -->
<StudyPopup :show.sync="showPreStudyPopup" title="提示" :width="848" :height="1028"
:topImage="require('@/assets/images/common/warning-notice.webp')" :topImageWidth="848" :topImageHeight="248">
<PreStudyPopup :confirmText="examPopInfo.confirmText" @cancel="handlePreStudyCancel"
@confirm="handlePreStudyConfirm" />
</StudyPopup>
<!-- 学习中心权限弹窗 -->
<StudyPopup :show.sync="showStudyPermissionPopup" title="" :width="848" :height="870"
:topImage="require('@/assets/images/common/warning-notice.webp')" :topImageWidth="848" :topImageHeight="248"
......@@ -259,6 +266,7 @@ import { interceptionMixin } from '@/mixin/index'
import StudyPopup from '@/components/StudyPopup.vue'
import StudyPopupContent from '@/components/StudyPopupContent.vue'
import ExamSubmitPopup from '@/components/ExamSubmitPopup.vue'
import PreStudyPopup from '@/components/PreStudyPopup.vue'
import StudyCenterPermissionPopup from '@/components/StudyCenterPermissionPopup.vue'
import ActivityPopup from './components/ActivityPopup.vue'
import ErrorOrderPopup from '@/components/ErrorOrderPopup.vue'
......@@ -294,6 +302,7 @@ export default {
StudyPopup,
StudyPopupContent,
ExamSubmitPopup,
PreStudyPopup,
StudyCenterPermissionPopup,
ActivityCenter,
ActivityPopup,
......@@ -355,6 +364,7 @@ export default {
confirmText: '确认已提交'
},
showStudyPermissionPopup: false,
showPreStudyPopup: false,
courseInfo: {
title: ''
},
......@@ -380,6 +390,7 @@ export default {
uni.$off('pageBack')
},
async mounted() {
console.log('sessionId', this.sessionId)
this._syncShowFloatLog()
this._unsubFloatLog = FloatLogConfig.subscribe(() => {
this._syncShowFloatLog()
......@@ -539,6 +550,12 @@ export default {
}
this.getLevelExamInfo()
},
handlePreStudyCancel() {
this.showPreStudyPopup = false
},
handlePreStudyConfirm() {
this.showPreStudyPopup = false
},
handleStudyPermissionConfirm() {
this.showStudyPermissionPopup = false
if (this.lockReason == '2') {
......
<template>
<view class="exam-submit-popup-wrapper">
<view class="content-box">
<scroll-view class="course-list" scroll-y>
<view
class="course-item"
v-for="(item, index) in displayCourseList"
:key="item.id || index"
@click="handleStartStudy(item, index)"
>
<view class="course-item-title">
<view class="course-item-title-text">{{ item.title }}</view>
<view class="course-item-desc">{{ item.description }}</view>
</view>
<view class="course-item-btn" v-if="item.state === 0">开启学习</view>
<view class="course-item-btn course-item-btn--learned" v-else>已学习</view>
</view>
</scroll-view>
</view>
<!-- 按钮组(始终显示) -->
<view class="button-group">
<view class="confirm-button" @click="handleConfirm">
{{ confirmText }}
</view>
</view>
</view>
</template>
<script>
const DEFAULT_COURSE_LIST = [
{
id: 1,
title: 'AITO 春醒悦享车衣套餐',
description: '包含:原厂定制隐形车衣 + 专属天窗....',
state:1
},
{
id: 2,
title: 'AITO 春醒悦享车衣套餐',
description: '包含:原厂定制隐形车衣 + 专属天窗....',
state:0
},
{
id: 3,
title: 'AITO 春醒悦享车衣套餐',
description: '包含:原厂定制隐形车衣 + 专属天窗....',
state:0
}
]
export default {
name: 'PreStudyPopup',
props: {
confirmText: {
type: String,
default: '跳过'
},
courseList: {
type: Array,
default: () => []
}
},
computed: {
displayCourseList() {
return this.courseList.length ? this.courseList : DEFAULT_COURSE_LIST
}
},
methods: {
handleStartStudy(item, index) {
this.$emit('start-study', item, index)
},
handleCancel() {
this.$emit('cancel')
},
handleConfirm() {
this.$emit('confirm')
}
}
}
</script>
<style lang="scss" scoped>
.exam-submit-popup-wrapper {
position: relative;
width: 100%;
min-height: toRpx(400);
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: toRpx(48);
}
.content-box {
width: toRpx(720);
box-sizing: border-box;
}
.course-list {
width: 100%;
height: toRpx(480);
box-sizing: border-box;
}
.course-item {
display: flex;
align-items: center;
justify-content: space-between;
gap: toRpx(16);
width: 100%;
padding: toRpx(16);
border-radius: toRpx(16);
border: toRpx(2) solid #e4e9f7;
background: #f5f7fa;
box-sizing: border-box;
margin-bottom: toRpx(48);
}
.course-item-title {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: toRpx(16);
}
.course-item-title-text {
width: 100%;
color: #333333;
font-size: toRpx(40);
font-weight: 500;
font-family: "HarmonyOSSansSC";
line-height: toRpx(60);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.course-item-desc {
width: 100%;
color: #999999;
font-size: toRpx(28);
font-weight: 400;
font-family: "HarmonyOSSansSC";
line-height: toRpx(48);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.course-item-btn {
flex-shrink: 0;
height: toRpx(56);
padding: 0 toRpx(16);
border-radius: toRpx(8);
border: toRpx(2) solid rgba(44, 102, 247, 0.1);
background: #2c66f7;
color: #ffffff;
font-size: toRpx(26);
font-weight: 400;
font-family: "HarmonyOSSansSC";
line-height: toRpx(56);
text-align: center;
white-space: nowrap;
&--learned {
border: 1px solid rgba(44, 102, 247, 0.10);
background: rgba(44, 102, 247, 0.05);
color: #2c66f7;
}
}
.button-group {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
gap: toRpx(16);
margin-top: auto;
margin-top: toRpx(48);
}
.confirm-button {
width: toRpx(338);
height: toRpx(80);
margin: 0 auto;
border-radius: toRpx(48);
border: toRpx(2) solid #979797;
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>
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 3
const index = 1
/**
*
0本地
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!