This commit is contained in:
2023-08-21 09:10:50 +08:00
parent a90c28f6fd
commit 7c54101dd6
12 changed files with 272 additions and 101 deletions

View File

@@ -3,7 +3,7 @@
<!-- <u-navbar :title="navTitle" @rightClick="rightClick" :autoBack="true">
</u-navbar> -->
<j-navbar>{{navTitle}}</j-navbar>
<Question ref="question" :tabsList="tabsList" :isShowAll="true"></Question>
<Question ref="question" :tabsList="tabsList" :isShowAll="true" :subject="subject" :navTitle="navTitle"></Question>
</view>
</template>
@@ -14,12 +14,17 @@
} from 'pinia' //引入映射函数
import useQuestionStore from '@/jtools/store/question' //引入store
import Question from './components/Question.vue';
import {
queryQuestion
} from '@/jtools/api/question';
import storage from '@/jtools/storage';
export default {
components: {
Question
},
data() {
return {
subject:1,
navTitle:'',
tabsList:[{
label:"答题",
@@ -34,10 +39,27 @@
onLoad(op) {
if(op&&op.navTitle){
this.navTitle=op.navTitle
const param={}
if(this.navTitle==='顺序答题'){
this.questionArr=[...this.orderQuestion]
this.$refs.question.getQuestionList(this.questionArr)
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr))
}else if(this.navTitle==='错题本'){
param.questionIdList=storage.get(`wrongList_subject${this.subject}`) || []
}else if(this.navTitle==='收藏夹'){
param.questionIdList=storage.get(`collectList_subject${this.subject}`) || []
}
if(op.questionList){
param.questionList=JSON.parse(op.questionList)
}
queryQuestion(param).then(res => {
if (res.code == '0000') {
this.questionArr = res.data
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr))
}
})
}
if(op.subject){
this.subject=op.subject
}
},
computed: {