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