Commit 4b21073b authored by Facius's avatar Facius

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

parents 32f278e3 53d4c5f9
......@@ -9,7 +9,7 @@
title-bold
></u-navbar>
<view class="u-flex contents" v-if="total > 0">
<view class="head" v-if="!daily">
<view class="head" v-if="!daily.status">
<view class="u-flex tab" v-if="type !== 2">
<view
:class="['tab-list', { active: model === 1 }]"
......@@ -88,15 +88,30 @@
</view>
</view>
<!-- 提示 -->
<answer-operation-tips :show.sync="show" />
<!-- 考试成绩 -->
<answer-complete-pop
:numberList="result"
:type="completeType"
:visible.sync="visible"
:numberList="complete.result"
:type="complete.type"
:visible.sync="complete.visible"
@cancel="cancel"
@submit="submit"
>
</answer-complete-pop>
<!-- 每日一练 -->
<view class="daily">
<dailyPop
:count="daily.count"
:visible.sync="daily.visible"
@cancel="dailyCancel"
@submit="dailySubmit"
>
</dailyPop>
</view>
</view>
</template>
......@@ -104,6 +119,8 @@
import swiperLimitedLoad from '@/components/swiper-limited-load/index.vue'
import answerOperationTips from '@/components/answer-operation-tips/index.vue'
import answerCompletePop from '@/components/answer-complete-pop/index.vue'
import dailyPop from '@/components/daily-pop/index.vue'
import Utils from './utils.js'
const NO_PREV_PAGE = -1
......@@ -114,18 +131,27 @@ export default {
swiperLimitedLoad,
answerOperationTips,
answerCompletePop,
dailyPop
},
data() {
return {
visible: false,
show: false,
// 1 练习 or 每日一练 2 考试 3 收藏记录 4 错题记录
type: 1,
// 1 答题模式 2 学习模式
model: 1,
// 每日一练
daily: false,
dailyCount: 0,
daily: {
status: false,
count: 0,
visible: false
},
// 考试成绩弹框
complete: {
type: 'pass',
result: [],
visible: false,
},
timestamp: 60 * 60,
list: [],
// key为currentPage,value为此页list数据
......@@ -135,8 +161,6 @@ export default {
// 仅仅记录swiper的位置
currentIndex: 0,
swiperDuration: '0',
result: [],
completeType: 'pass',
// 分页数据
currentPage: 1,
pageSize: 10,
......@@ -346,11 +370,11 @@ export default {
this.$u.vuex('lastIndex', this.currentIndex)
// 每日一练数量统计
if (this.type === 1 && this.daily) {
if (this.dailyCount < 9) this.dailyCount++
if (this.dailyCount === 9) {
this.completeType = 'daily'
this.visible = true
if (this.type === 1 && this.daily.status) {
if (this.daily.count < 9) this.daily.count++
if (this.daily.count === 9) {
this.daily.visible = true
this.daily.status = false
return
}
}
......@@ -370,30 +394,28 @@ export default {
const fail = this.list.filter((v) => v.result === 'fail').length // 错题数
const noStart = this.list.filter((v) => !v.result).length // 未做题数
const fraction = 0 // 分数
this.result = [fail, noStart, fraction]
this.completeType = 'pass'
this.visible = true
this.complete.result = [fail, noStart, fraction]
this.complete.type = 'pass'
this.complete.visible = true
},
// 弹框确认
// 考试成绩弹框确认
submit() {
if (this.completeType === 'daily') {
this.daily = false
this.visible = false
} else {
// 提前交卷
this.$u.route({
url: 'pages/learn/source',
})
}
// 提前交卷
this.$u.route({
url: '/pages/learn/score',
})
},
// 弹框取消
// 考试成绩弹框取消
cancel() {
if (this.completeType === 'daily') {
// 查看记录
// this.$u.route('/pages/index/index')
} else {
this.visible = false
}
this.complete.visible = false
},
// 每日一练弹框确认
dailySubmit() {
this.daily.visible = false
},
// 每日一练弹框取消
dailyCancel() {
this.$u.route('/pages/learn/record')
},
// 收藏
collection() {
......@@ -500,6 +522,14 @@ export default {
},
}
</script>
<style lang="scss">
.daily{
.u-mode-center-box {
background-color: transparent !important;
padding-top: 40rpx;
}
}
</style>
<style lang="scss" scoped>
.answer {
height: 100vh;
......@@ -514,7 +544,6 @@ export default {
flex-direction: column;
.head {
width: 100%;
height: 90rpx;
.tab {
margin: 10rpx auto;
border: 2rpx solid #2953ff;
......
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