Commit 4aea790b by Lin

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

- 更新 PreStudyPopup,在确认操作时调用 deductSkipCount 方法。
-- 移除冗余的确认处理函数,并将跳过次数扣除逻辑直接集成到 PreBackPopup 中。
- 优化确认提示文本,动态显示剩余跳过次数。
1 parent 34a39ff0
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,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 :prelearnData="prelearnData" :confirmText="preStudyPopInfo.confirmText" @cancel="handlePreStudyCancel" <PreStudyPopup :prelearnData="prelearnData" :confirmText="preStudyPopInfo.confirmText" @cancel="handlePreStudyCancel"
@confirm="handlePreStudyConfirm" @start-study="handlePreStudyStart" /> @confirm="deductSkipCount" @start-study="handlePreStudyStart" />
</StudyPopup> </StudyPopup>
<!-- 学习中心权限弹窗 --> <!-- 学习中心权限弹窗 -->
...@@ -363,7 +363,7 @@ export default { ...@@ -363,7 +363,7 @@ export default {
confirmText: '确认已提交' confirmText: '确认已提交'
}, },
preStudyPopInfo: { preStudyPopInfo: {
confirmText: '跳过(剩余2次)', confirmText: '',
}, },
showStudyPermissionPopup: false, showStudyPermissionPopup: false,
showPreStudyPopup: false, showPreStudyPopup: false,
...@@ -497,16 +497,6 @@ export default { ...@@ -497,16 +497,6 @@ export default {
this.getCustomerProfileGroupInfo() this.getCustomerProfileGroupInfo()
}, },
methods: { methods: {
async deductSkipCountAPI() {
let requestParams = {
serialVersionUID:'',
activityId:'',
activityProductId:'',
eventType:'',
}
const res = await uni.$api.commonApi.deductSkipCountAPI(requestParams)
console.log('deductSkipCountAPI***', res);
},
handleHomeContentTabClick(index) { handleHomeContentTabClick(index) {
this.homeContentTabIndex = index this.homeContentTabIndex = index
console.log('当前选中标签:', this.currentHomeContentTab) console.log('当前选中标签:', this.currentHomeContentTab)
...@@ -587,9 +577,6 @@ export default { ...@@ -587,9 +577,6 @@ export default {
handlePreStudyCancel() { handlePreStudyCancel() {
this.showPreStudyPopup = false this.showPreStudyPopup = false
}, },
handlePreStudyConfirm() {
this.showPreStudyPopup = false
},
handlePreStudyStart() { handlePreStudyStart() {
this.showPreStudyPopup = false this.showPreStudyPopup = false
}, },
...@@ -871,6 +858,17 @@ export default { ...@@ -871,6 +858,17 @@ export default {
if (res) { if (res) {
this.prelearnData = res this.prelearnData = res
this.showPreStudyPopup = res.shouldPopup 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) { handleFooter(val) {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<view class="cancel-button" @click="handleCancel"> <view class="cancel-button" @click="handleCancel">
取消 取消
</view> </view>
<view class="confirm-button" @click="handleConfirm"> <view class="confirm-button" @click="deductSkipCount">
{{ confirmText }} {{ confirmText }}
</view> </view>
</view> </view>
...@@ -36,8 +36,15 @@ export default { ...@@ -36,8 +36,15 @@ export default {
handleCancel() { handleCancel() {
this.$emit('cancel') this.$emit('cancel')
}, },
handleConfirm() { async deductSkipCount() {
this.$emit('confirm') 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!