Commit 96d020d6 authored by Facius's avatar Facius

fix: 【ID1001402】 【小程序-首页-体验弹窗】:来回切换题库,每次都弹出体验弹窗

parent 7d28687d
...@@ -124,6 +124,7 @@ export default { ...@@ -124,6 +124,7 @@ export default {
canExperience: false, // 体验资格 canExperience: false, // 体验资格
finishCount: 0, finishCount: 0,
pass: this.$u.random(95, 99), pass: this.$u.random(95, 99),
isAdd: false, // 题库切换
} }
}, },
computed: { computed: {
...@@ -261,7 +262,7 @@ export default { ...@@ -261,7 +262,7 @@ export default {
if (info) { if (info) {
this.selected = info this.selected = info
page.info = null page.info = null
this.visible = info.state this.isAdd = this.selected.isAdd
this.pass = this.$u.random(95, 99) this.pass = this.$u.random(95, 99)
this.queryMyQuestionWarehouseDetail(this.selected.id) this.queryMyQuestionWarehouseDetail(this.selected.id)
} else { } else {
...@@ -281,6 +282,8 @@ export default { ...@@ -281,6 +282,8 @@ export default {
.checkGetQuestion(id) .checkGetQuestion(id)
.then((res) => { .then((res) => {
this.canExperience = res <= 0 this.canExperience = res <= 0
this.visible = this.isAdd && this.canExperience
this.isAdd = false
}) })
.catch((err) => { .catch((err) => {
console.log(err) console.log(err)
......
...@@ -267,6 +267,7 @@ export default { ...@@ -267,6 +267,7 @@ export default {
}) })
if (result) { if (result) {
data.isAdd = true
this.setPageInfo(data) this.setPageInfo(data)
// 成功 // 成功
this.$refs.uToast.show({ this.$refs.uToast.show({
...@@ -333,7 +334,6 @@ export default { ...@@ -333,7 +334,6 @@ export default {
var pages = getCurrentPages() var pages = getCurrentPages()
if (pages.length >= 1) { if (pages.length >= 1) {
var page = pages[0] var page = pages[0]
console.log('--------setPageInfo--------', info)
page.info = info page.info = info
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment