Commit 85eb46c4 authored by linwenqing's avatar linwenqing

Merge branch 'dev-v1.0.0' of https://git.banshouhui.com/wuzhenzhe/study into dev-v1.0.0

parents c8b8a848 9e748cbe
......@@ -274,6 +274,7 @@ export default {
: false
if (check) {
this.$u.vuex(`lastIndex.${this.questionWarehouseId}`, 0)
this.$u.vuex(`answerCount.${this.questionWarehouseId}`, 0)
this.$u.vuex(`questionList.${this.questionWarehouseId}`, [])
}
} else if (this.source === 4) {
......@@ -473,8 +474,9 @@ export default {
`questionList.${this.questionWarehouseId}`,
this.questionList[this.questionWarehouseId]
)
this.$u.vuex(`lastIndex.${this.questionWarehouseId}`, this.currentIndex)
this.$u.vuex(`lastIndex.${this.questionWarehouseId}`, this.currentIndex)
// 统计是否达满所有试题
this.count = this.questionList[this.questionWarehouseId].reduce(
(accumulator, currentValue) => {
......@@ -484,6 +486,10 @@ export default {
0
)
let count = this.answerCount[this.questionWarehouseId] || 0
count+=1
this.$u.vuex(`answerCount.${this.questionWarehouseId}`, count)
if (this.count === this.total) {
this.$nextTick(() => {
return this.$u.toast('您已经答完全部试题')
......
......@@ -218,7 +218,7 @@ export default {
// if (this.buttonDisabled) return
if (this.range.length <= 0 || this.range.length == null) {
this.$refs.uToast.show({
title: '该类型和区域没有的题库',
title: '该类型和区域没有题库',
type: 'warning',
duration: 1500,
callback: () => {
......@@ -273,7 +273,7 @@ export default {
})
} else {
this.$refs.uToast.show({
title: '该类型和区域没有的题库',
title: '该类型和区域没有题库',
type: 'warning',
duration: 1500,
callback: () => {
......
......@@ -31,7 +31,7 @@
<view class="field-view">
<u-input
class="input-view"
password
type="password"
input-align="center"
v-model="password"
placeholder="请输入密码"
......@@ -145,7 +145,25 @@ export default {
},
}
</script>
<style lang="scss">
.bound-questions {
.u-flex {
display: flex;
justify-content: center;
align-items: center;
// background-color: green;
}
.u-input__right-icon__item {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
// background-color: red;
width: 60rpx;
flex-shrink: 0;
}
}
</style>
<style lang="scss" scoped>
::-webkit-scrollbar {
width: 0;
......
......@@ -15,11 +15,11 @@ let saveStateKeys = [
'vuex_token',
'openId',
'searchHistory',
'questionList',
'lastIndex',
'tipStatus',
'questionWarehouseId',
'relationId', // 绑卡用
'answerCount'
]
// 保存变量到本地存储中
......@@ -45,7 +45,7 @@ const store = new Vuex.Store({
openId: lifeData.openId ? lifeData.openId : '',
relationId: lifeData.relationId ? lifeData.relationId : '', // 绑卡用
searchHistory: lifeData.searchHistory ? lifeData.searchHistory : [], // 搜索历史记录
questionList: lifeData.questionList ? lifeData.questionList : {}, // 练习列表
answerCount: lifeData.answerCount ? lifeData.answerCount : {},// 已回答题数
lastIndex: lifeData.lastIndex ? lifeData.lastIndex : {}, // 上次做到第几题
tipStatus: lifeData.tipStatus ? lifeData.tipStatus : false, // 滑动提示
questionWarehouseId: lifeData.questionWarehouseId
......@@ -53,6 +53,7 @@ const store = new Vuex.Store({
: '1414854649273384960', // 科目ID
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
vuex_version: '1.0.0',
questionList: {}, // 练习列表
beginTime: null // 考试开始时间
},
mutations: {
......
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