Commit 96ab3b90 authored by Facius's avatar Facius

improvement: 专项列表

parent 086b3467
...@@ -152,6 +152,16 @@ ...@@ -152,6 +152,16 @@
"disableScroll": true "disableScroll": true
} }
}, },
{
"path": "selectSpecial",
"name": "learnSelectSpecial",
"style": {
"navigationBarTitleText": "专项练习",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{ {
"path": "beginAnswer", "path": "beginAnswer",
"name": "learnBeginAnswer", "name": "learnBeginAnswer",
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
v-for="(item, index) in subItems" v-for="(item, index) in subItems"
:key="index" :key="index"
class="sub-content-item" class="sub-content-item"
@click="handleClick(item.pathName)" @click="handleClick(item.pathName, item.params)"
> >
<view class="sub-image"> <view class="sub-image">
<image :src="item.icon" :style="item.imageStyle"></image> <image :src="item.icon" :style="item.imageStyle"></image>
...@@ -143,9 +143,7 @@ export default { ...@@ -143,9 +143,7 @@ export default {
}, },
examText() { examText() {
return this.selected.cardId return this.info.cardId ? '/' + this.selected.totalExam : '题库进阶练习'
? '/' + this.selected.totalExam
: '题库进阶练习'
}, },
info() { info() {
return { return {
...@@ -164,11 +162,12 @@ export default { ...@@ -164,11 +162,12 @@ export default {
subItems() { subItems() {
return [ return [
{ {
pathName: 'pages/xxx/xxx', pathName: 'pages/learn/selectSpecial',
title: '专项练习', title: '专项练习',
value: '', value: '',
icon: process.uniEnv.qn_base_url + 'zhuanxiang.png', icon: process.uniEnv.qn_base_url + 'zhuanxiang.png',
imageStyle: 'width:72rpx;height:64rpx', imageStyle: 'width:72rpx;height:64rpx',
params: this.data,
}, },
{ {
pathName: '/pages/learn/answer?source=5', pathName: '/pages/learn/answer?source=5',
...@@ -268,17 +267,17 @@ export default { ...@@ -268,17 +267,17 @@ export default {
}, },
handleSelect() { handleSelect() {
var str = this.selected.id ? 'selectedList' : 'selectCategory' var str = this.info.id ? 'selectedList' : 'selectCategory'
this.$u.route({ this.$u.route({
url: 'pages/learn/' + str, url: 'pages/learn/' + str,
}) })
}, },
// 每日一练 // 每日一练
handleAnswer() { handleAnswer() {
if (this.selected.cardId) { if (this.info.cardId) {
// 练习 // 练习
// ... // ...
} else if (this.selected.id) { } else if (this.info.id) {
if (this.info.experience) { if (this.info.experience) {
this.selected.state = false this.selected.state = false
this.$u.vuex('experience', false) this.$u.vuex('experience', false)
...@@ -315,7 +314,7 @@ export default { ...@@ -315,7 +314,7 @@ export default {
}) })
}, },
handleClickItem(key) { handleClickItem(key) {
if (this.selected.id) { if (this.info.id) {
// 跳转到学练记录 // 跳转到学练记录
this.$u.route({ this.$u.route({
url: 'pages/learn/record?part=', url: 'pages/learn/record?part=',
...@@ -342,7 +341,7 @@ export default { ...@@ -342,7 +341,7 @@ export default {
}) })
}, },
handleClickExam(index) { handleClickExam(index) {
if (this.selected.cardId) { if (this.info.cardId) {
// 已绑卡 // 已绑卡
if (index == 0) { if (index == 0) {
// 做题 // 做题
...@@ -358,7 +357,7 @@ export default { ...@@ -358,7 +357,7 @@ export default {
url: 'pages/learn/beginAnswer', url: 'pages/learn/beginAnswer',
}) })
} }
} else if (this.selected.id) { } else if (this.info.id) {
// 已选题库 // 已选题库
// 绑卡 // 绑卡
...@@ -371,14 +370,24 @@ export default { ...@@ -371,14 +370,24 @@ export default {
}) })
} }
}, },
handleClick(path) { handleClick(path, params) {
if (!this.selected.id) { debugger
if (this.info.cardId) {
if (params) {
this.setPageInfo(params)
}
// 已经绑卡
this.$u.route({ this.$u.route({
url: 'pages/learn/selectCategory', url: path,
}) })
} else if (this.info.id) {
// 已选题库未绑卡
// 绑卡
this.type = 'bound'
this.show = true
} else { } else {
this.$u.route({ this.$u.route({
url: path, url: 'pages/learn/selectCategory',
}) })
} }
}, },
...@@ -387,6 +396,13 @@ export default { ...@@ -387,6 +396,13 @@ export default {
console.log(res) console.log(res)
this.provinceList = res this.provinceList = res
}, },
setPageInfo(info) {
var pages = getCurrentPages()
if (pages.length >= 1) {
var page = pages[pages.length - 1]
page.info = info
}
},
}, },
} }
</script> </script>
......
...@@ -10,7 +10,22 @@ ...@@ -10,7 +10,22 @@
></u-navbar> ></u-navbar>
<view class="selected-list-content"> <view class="selected-list-content">
<view class="label-content"> <view class="label-content">
<view v-for="(value, key) in lables" :key="key" class="label-item"> <view
v-for="(item, index) in lables"
:key="index"
class="special-item"
hover-class="hover-class"
@click="handleClick(item.source)"
>
<view class="left-view">
<image :src="item.image" class="item-image"></image>
<view class="item-title">{{ item.title }}</view>
<view
>共<text class="item-count">{{ info[item.key] }}</text
>道</view
>
</view>
<u-icon name="arrow-right" class="item-icon"></u-icon>
</view> </view>
</view> </view>
<!-- 无数据 --> <!-- 无数据 -->
...@@ -20,42 +35,65 @@ ...@@ -20,42 +35,65 @@
</template> </template>
<script> <script>
import QuestionBankCell from '@/components/question-bank-cell'
export default { export default {
components: {
QuestionBankCell,
},
data() { data() {
return { return {
info: {}, // 已选题库列表 info: {}, // 已选题库列表
loading: true,
} }
}, },
computed: { computed: {
lables() { // 1.顺序答题 2.随机练习 3.模拟考试 4.收藏答题 5.错题答题 6.专项练习-单选 7.专项练习-多选 8.专项练习-判断 9.专项练习-答案是
return {
oneAnswerCount: '单选题',
anyAnswerCount: '多选题', lables() {
trueOrFalseCount: '判断题', return [
trueAnswerCount: '判断题(结果为正确)', {
} key: 'oneAnswerCount',
title: '单选题',
source: 6,
image: process.uniEnv.qn_base_url + 'danxuan.png',
},
{
key: 'anyAnswerCount',
title: '多选题',
source: 7,
image: process.uniEnv.qn_base_url + 'duoxuan.png',
},
{
key: 'trueOrFalseCount',
title: '判断题',
source: 8,
image: process.uniEnv.qn_base_url + 'panduan.png',
},
{
key: 'trueAnswerCount',
title: '判断题(结果为正确)',
source: 9,
image: process.uniEnv.qn_base_url + 'zhengquepanduanti.png',
},
]
}, },
}, },
onLoad(e) { onLoad(e) {
this.loadList() // 获取已选题库列表 this.getPageInfo()
}, },
methods: { methods: {
getPageInfo() { getPageInfo() {
var pages = getCurrentPages() var pages = getCurrentPages()
if (pages.length >= 2) { if (pages.length >= 2) {
var page = pages[pages.length - 2] var page = pages[pages.length - 2]
this.selected = page.info this.info = page.info
} }
}, },
// 点击了添加按钮 // 点击了添加按钮
handleClick(index) {}, handleClick(source) {
// 1.顺序答题 2.随机练习 3.模拟考试 4.收藏答题 5.错题答题 6.专项练习-单选 7.专项练习-多选 8.专项练习-判断 9.专项练习-答案是
this.$u.route({
url: 'pages/learn/answer',
params: {
source: source,
},
})
},
}, },
} }
</script> </script>
...@@ -76,7 +114,7 @@ export default { ...@@ -76,7 +114,7 @@ export default {
background-image: linear-gradient(to top, #f8fafd 0%, #e9f3ff 50%); background-image: linear-gradient(to top, #f8fafd 0%, #e9f3ff 50%);
background-size: 100% 520rpx; background-size: 100% 520rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
padding: 0 24rpx 0rpx 24rpx; padding: 0 24rpx;
.selected-list-content { .selected-list-content {
height: 100%; height: 100%;
...@@ -84,28 +122,43 @@ export default { ...@@ -84,28 +122,43 @@ export default {
.label-content { .label-content {
margin-bottom: 44rpx; margin-bottom: 44rpx;
.label-item { .special-item {
margin-bottom: 24rpx; margin-top: 24rpx;
background-color: #ffffff;
border-radius: 12rpx;
padding: 0 24rpx 0 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
height: 142rpx;
.left-view {
display: flex;
align-items: center;
color: #5a6073;
font-size: 32rpx;
.item-image {
width: 48rpx;
height: 48rpx;
}
.item-title {
font-size: 36rpx;
font-weight: bold;
color: #191c27;
padding: 0 16rpx 0 24rpx;
}
.item-count {
color: #2953ff;
padding: 0 4rpx;
}
}
.item-icon {
color: #9ea5bb;
font-size: 34rpx;
}
}
.hover-class {
background-color: #dddddd;
} }
}
}
.tag-loading-view {
display: flex;
align-items: center;
justify-content: center;
margin-top: 400rpx;
color: #999999;
text-align: center;
position: absolute;
width: 100%;
padding-right: 11rpx;
}
.bottom-view {
margin-bottom: 44rpx;
.button-icon {
margin-right: 10rpx;
font-size: 46rpx;
font-weight: bold;
} }
} }
} }
......
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