Commit 086b3467 authored by Facius's avatar Facius

improvement: 首页体验资格

parent d7e6c966
......@@ -153,8 +153,7 @@ export default {
cardId:
this.detail.questionWarehouse && this.detail.questionWarehouse.cardId,
provinceName: this.provinceName,
experience:
this.selected.state && !this.detail.questionWarehouse.cardId,
experience: this.experience,
pass: this.$u.random(95, 99) + '%',
days: this.detail.totalDayCount || 0,
today: this.detail.todayCount || 0,
......@@ -250,6 +249,12 @@ export default {
})
this.data = res || { questionWarehouse: {} }
this.selected = this.data.questionWarehouse
this.$u.vuex(
'experience',
this.selected.state && !this.detail.questionWarehouse.cardId
? true
: false
)
},
// 学生查询题库首页
async queryMyQuestionWarehouseDetail(id) {
......@@ -276,8 +281,16 @@ export default {
} else if (this.selected.id) {
if (this.info.experience) {
this.selected.state = false
this.$u.vuex('experience', false)
// 体验
// ...
// 1.顺序答题 2.随机练习 3.模拟考试 4.收藏答题 5.错题答题 6.专项练习-单选 7.专项练习-多选 8.专项练习-判断 9.专项练习-答案是
this.$u.route({
url: 'pages/learn/answer',
params: {
source: 2,
daily: true,
},
})
} else {
// 绑卡提示
this.type = 'bound'
......@@ -317,8 +330,16 @@ export default {
},
handleClickExperience() {
this.selected.state = false
this.$u.vuex('experience', false)
// 体验
// ...
// 1.顺序答题 2.随机练习 3.模拟考试 4.收藏答题 5.错题答题 6.专项练习-单选 7.专项练习-多选 8.专项练习-判断 9.专项练习-答案是
this.$u.route({
url: 'pages/learn/answer',
params: {
source: 2,
daily: true,
},
})
},
handleClickExam(index) {
if (this.selected.cardId) {
......@@ -328,8 +349,8 @@ export default {
this.$u.route({
url: 'pages/learn/answer',
params: {
source: 1
}
source: 1,
},
})
} else {
// 模拟考试
......
......@@ -42,7 +42,7 @@ const store = new Vuex.Store({
// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
userInfo: lifeData.userInfo ? lifeData.userInfo : {},
vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
experience: lifeData.experience ? lifeData.experience : '',
experience: lifeData.experience ? lifeData.experience : false,
openId: lifeData.openId ? lifeData.openId : '',
searchHistory: lifeData.searchHistory ? lifeData.searchHistory : [], // 搜索历史记录
questionList: lifeData.questionList ? lifeData.questionList : [], // 练习列表
......
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