Commit 4aea790b by Lin

feat(HomeFrame, PreBackPopup):重构预研究弹窗中的跳过次数处理逻辑

- 更新 PreStudyPopup,在确认操作时调用 deductSkipCount 方法。
-- 移除冗余的确认处理函数,并将跳过次数扣除逻辑直接集成到 PreBackPopup 中。
- 优化确认提示文本,动态显示剩余跳过次数。
1 parent 34a39ff0
......@@ -193,7 +193,7 @@
<StudyPopup :show.sync="showPreStudyPopup" title="提示" :width="848" :height="968"
:topImage="require('@/assets/images/common/warning-notice.webp')" :topImageWidth="848" :topImageHeight="248">
<PreStudyPopup :prelearnData="prelearnData" :confirmText="preStudyPopInfo.confirmText" @cancel="handlePreStudyCancel"
@confirm="handlePreStudyConfirm" @start-study="handlePreStudyStart" />
@confirm="deductSkipCount" @start-study="handlePreStudyStart" />
</StudyPopup>
<!-- 学习中心权限弹窗 -->
......@@ -363,7 +363,7 @@ export default {
confirmText: '确认已提交'
},
preStudyPopInfo: {
confirmText: '跳过(剩余2次)',
confirmText: '',
},
showStudyPermissionPopup: false,
showPreStudyPopup: false,
......@@ -497,16 +497,6 @@ export default {
this.getCustomerProfileGroupInfo()
},
methods: {
async deductSkipCountAPI() {
let requestParams = {
serialVersionUID:'',
activityId:'',
activityProductId:'',
eventType:'',
}
const res = await uni.$api.commonApi.deductSkipCountAPI(requestParams)
console.log('deductSkipCountAPI***', res);
},
handleHomeContentTabClick(index) {
this.homeContentTabIndex = index
console.log('当前选中标签:', this.currentHomeContentTab)
......@@ -587,9 +577,6 @@ export default {
handlePreStudyCancel() {
this.showPreStudyPopup = false
},
handlePreStudyConfirm() {
this.showPreStudyPopup = false
},
handlePreStudyStart() {
this.showPreStudyPopup = false
},
......@@ -871,6 +858,17 @@ export default {
if (res) {
this.prelearnData = res
this.showPreStudyPopup = res.shouldPopup
this.preStudyPopInfo.confirmText = `跳过(剩余${res.remainingSkipCount}次)`
}
},
async deductSkipCount() {
let requestParams = {
activityId:this.prelearnData.getActivityMessagePopUpWindow
}
const res = await uni.$api.commonApi.deductSkipCountAPI(requestParams)
console.log('deductSkipCountAPI***', res);
if (res) {
this.showPreStudyPopup = false
}
},
handleFooter(val) {
......
......@@ -12,7 +12,7 @@
<view class="cancel-button" @click="handleCancel">
取消
</view>
<view class="confirm-button" @click="handleConfirm">
<view class="confirm-button" @click="deductSkipCount">
{{ confirmText }}
</view>
</view>
......@@ -36,8 +36,15 @@ export default {
handleCancel() {
this.$emit('cancel')
},
handleConfirm() {
this.$emit('confirm')
async deductSkipCount() {
let requestParams = {
activityId:this.prelearnContext.getActivityMessagePopUpWindow
}
const res = await uni.$api.commonApi.deductSkipCountAPI(requestParams)
console.log('deductSkipCountAPI***', res);
if (res) {
this.$emit('confirm')
}
},
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!