pull/24/head
脆皮鸭 1 year ago
parent 287f123ac7
commit bf05f771f7
  1. 87
      src/jtools/store/question.js
  2. 3
      src/pages.json
  3. 25
      src/pages/index/components/Subject1.vue
  4. 13
      src/pages/index/index.vue
  5. 7
      src/pages/questionBank/chapterExercise.vue
  6. 31
      src/pages/questionBank/components/Question.vue
  7. 7
      src/pages/questionBank/exclusiveExercise.vue
  8. 56
      src/pages/questionBank/practiceExams.vue
  9. 51
      src/pages/questionBank/questionBank.vue

@ -56,18 +56,14 @@ const question = defineStore({
getOrderQuestion_sub1(isUpdate) { getOrderQuestion_sub1(isUpdate) {
if (isUpdate) { if (isUpdate) {
this.loading_subject1 = true this.loading_subject1 = true
queryQuestion({ const that=this
carTypeId: this.currentCartype, uni.request({
subject: '1', url: 'https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E9%A2%98%E5%BA%93/%E5%B0%8F%E8%BD%A6%E7%A7%91%E7%9B%AE%E4%B8%80%E9%A2%98%E5%BA%93.json',
// questionIdList:[10982,10983,10985,10986] success(resp) {
}).then(res => { if (resp.data) {
if (res.code == '0000') { that.orderQuestion_subject1 = resp.data.data
this.loading_subject1=false const diveList = that.divideArray(that.orderQuestion_subject1, 5)
uni.showToast({ that.loading_subject1 = false
title:'题库加载完成!'
})
this.orderQuestion_subject1 = res.data
const diveList=this.divideArray(this.orderQuestion_subject1,5)
uni.setStorageSync('questionOneSub1', diveList[0]) uni.setStorageSync('questionOneSub1', diveList[0])
uni.setStorageSync('questionOneSub2', diveList[1]) uni.setStorageSync('questionOneSub2', diveList[1])
uni.setStorageSync('questionOneSub3', diveList[2]) uni.setStorageSync('questionOneSub3', diveList[2])
@ -77,7 +73,7 @@ const question = defineStore({
const trueList = storage.get('rightList_subject1') || [] const trueList = storage.get('rightList_subject1') || []
const falseArr = [] const falseArr = []
const rightArr = [] const rightArr = []
this.orderQuestion_subject1.forEach(item=>{ that.orderQuestion_subject1.forEach(item => {
if (falseList.includes(item.questionId)) { if (falseList.includes(item.questionId)) {
falseArr.push(item.questionId) falseArr.push(item.questionId)
} }
@ -88,6 +84,7 @@ const question = defineStore({
storage.set('wrongList_subject1', falseArr) storage.set('wrongList_subject1', falseArr)
storage.set('rightList_subject1', rightArr) storage.set('rightList_subject1', rightArr)
} }
}
}) })
} else { } else {
const list1 = uni.getStorageSync('questionOneSub1') || [] const list1 = uni.getStorageSync('questionOneSub1') || []
@ -100,18 +97,14 @@ const question = defineStore({
} else { } else {
this.loading_subject1 = true this.loading_subject1 = true
queryQuestion({ const that = this
carTypeId: this.currentCartype, uni.request({
subject: '1', url: 'https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E9%A2%98%E5%BA%93/%E5%B0%8F%E8%BD%A6%E7%A7%91%E7%9B%AE%E4%B8%80%E9%A2%98%E5%BA%93.json',
// questionIdList:[10982,10983,10985,10986] success(resp) {
}).then(res => { if (resp.data) {
if (res.code == '0000') { that.orderQuestion_subject1 = resp.data.data
this.loading_subject1=false const diveList = that.divideArray(that.orderQuestion_subject1, 5)
uni.showToast({ that.loading_subject1 = false
title:'题库加载完成!'
})
this.orderQuestion_subject1 = res.data
const diveList=this.divideArray(this.orderQuestion_subject1,5)
uni.setStorageSync('questionOneSub1', diveList[0]) uni.setStorageSync('questionOneSub1', diveList[0])
uni.setStorageSync('questionOneSub2', diveList[1]) uni.setStorageSync('questionOneSub2', diveList[1])
uni.setStorageSync('questionOneSub3', diveList[2]) uni.setStorageSync('questionOneSub3', diveList[2])
@ -121,7 +114,7 @@ const question = defineStore({
const trueList = storage.get('rightList_subject1') || [] const trueList = storage.get('rightList_subject1') || []
const falseArr = [] const falseArr = []
const rightArr = [] const rightArr = []
this.orderQuestion_subject1.forEach(item=>{ that.orderQuestion_subject1.forEach(item => {
if (falseList.includes(item.questionId)) { if (falseList.includes(item.questionId)) {
falseArr.push(item.questionId) falseArr.push(item.questionId)
} }
@ -132,6 +125,7 @@ const question = defineStore({
storage.set('wrongList_subject1', falseArr) storage.set('wrongList_subject1', falseArr)
storage.set('rightList_subject1', rightArr) storage.set('rightList_subject1', rightArr)
} }
}
}) })
} }
} }
@ -140,15 +134,14 @@ const question = defineStore({
getOrderQuestion_sub4(isUpdate) { getOrderQuestion_sub4(isUpdate) {
if (isUpdate) { if (isUpdate) {
this.loading_subject4 = true this.loading_subject4 = true
queryQuestion({ const that = this
carTypeId: this.currentCartype, uni.request({
subject: '4', url: 'https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E9%A2%98%E5%BA%93/%E5%B0%8F%E8%BD%A6%E7%A7%91%E7%9B%AE%E5%9B%9B%E9%A2%98%E5%BA%93.json',
// questionIdList:[10982,10983,10985,10986] success(resp) {
}).then(res => { if (resp.data) {
if (res.code == '0000') { that.orderQuestion_subject4 = resp.data.data
this.loading_subject4=false const diveList = that.divideArray(that.orderQuestion_subject4, 5)
this.orderQuestion_subject4 = res.data that.loading_subject4 = false
const diveList=this.divideArray(this.orderQuestion_subject4,5)
uni.setStorageSync('questionFourSub1', diveList[0]) uni.setStorageSync('questionFourSub1', diveList[0])
uni.setStorageSync('questionFourSub2', diveList[1]) uni.setStorageSync('questionFourSub2', diveList[1])
uni.setStorageSync('questionFourSub3', diveList[2]) uni.setStorageSync('questionFourSub3', diveList[2])
@ -158,7 +151,7 @@ const question = defineStore({
const trueList = storage.get('rightList_subject4') || [] const trueList = storage.get('rightList_subject4') || []
const falseArr = [] const falseArr = []
const rightArr = [] const rightArr = []
this.orderQuestion_subject4.forEach(item=>{ that.orderQuestion_subject4.forEach(item => {
if (falseList.includes(item.questionId)) { if (falseList.includes(item.questionId)) {
falseArr.push(item.questionId) falseArr.push(item.questionId)
} }
@ -169,6 +162,7 @@ const question = defineStore({
storage.set('wrongList_subject4', falseArr) storage.set('wrongList_subject4', falseArr)
storage.set('rightList_subject4', rightArr) storage.set('rightList_subject4', rightArr)
} }
}
}) })
} else { } else {
const list1 = uni.getStorageSync('questionFourSub1') || [] const list1 = uni.getStorageSync('questionFourSub1') || []
@ -181,15 +175,14 @@ const question = defineStore({
} else { } else {
this.loading_subject4 = true this.loading_subject4 = true
queryQuestion({ const that = this
carTypeId: this.currentCartype, uni.request({
subject: '4', url: 'https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E9%A2%98%E5%BA%93/%E5%B0%8F%E8%BD%A6%E7%A7%91%E7%9B%AE%E5%9B%9B%E9%A2%98%E5%BA%93.json',
// questionIdList:[10982,10983,10985,10986] success(resp) {
}).then(res => { if (resp.data) {
if (res.code == '0000') { that.orderQuestion_subject4 = resp.data.data
this.loading_subject4=false const diveList = that.divideArray(that.orderQuestion_subject4, 5)
this.orderQuestion_subject4 = res.data that.loading_subject4 = false
const diveList=this.divideArray(this.orderQuestion_subject4,5)
uni.setStorageSync('questionFourSub1', diveList[0]) uni.setStorageSync('questionFourSub1', diveList[0])
uni.setStorageSync('questionFourSub2', diveList[1]) uni.setStorageSync('questionFourSub2', diveList[1])
uni.setStorageSync('questionFourSub3', diveList[2]) uni.setStorageSync('questionFourSub3', diveList[2])
@ -199,7 +192,7 @@ const question = defineStore({
const trueList = storage.get('rightList_subject4') || [] const trueList = storage.get('rightList_subject4') || []
const falseArr = [] const falseArr = []
const rightArr = [] const rightArr = []
this.orderQuestion_subject4.forEach(item=>{ that.orderQuestion_subject4.forEach(item => {
if (falseList.includes(item.questionId)) { if (falseList.includes(item.questionId)) {
falseArr.push(item.questionId) falseArr.push(item.questionId)
} }
@ -210,6 +203,7 @@ const question = defineStore({
storage.set('wrongList_subject4', falseArr) storage.set('wrongList_subject4', falseArr)
storage.set('rightList_subject4', rightArr) storage.set('rightList_subject4', rightArr)
} }
}
}) })
} }
} }
@ -217,7 +211,6 @@ const question = defineStore({
//获取索引 //获取索引
getCurrentIndex(index, val) { getCurrentIndex(index, val) {
this[`currentIndex_subject${val}`] = index this[`currentIndex_subject${val}`] = index
console.log(`currentIndex_subject${val}`,this[`currentIndex_subject${val}`]);
} }
} }
}); });

@ -8,7 +8,8 @@
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "金武联驾考" "navigationStyle": "custom",
"enablePullDownRefresh": false
} }
}, },
{ {

@ -161,11 +161,18 @@
subject: this.subject, subject: this.subject,
}).then(async (resp) => { }).then(async (resp) => {
if (resp.code === '0000') { if (resp.code === '0000') {
if(resp.data&&resp.data.length){
const arr = resp.data const arr = resp.data
const listJson = JSON.stringify(arr) const listJson = JSON.stringify(arr)
uni.navigateTo({ uni.navigateTo({
url: "/pages/index/trueTest?subject="+ this.subject + "&questionIdList=" + listJson url: "/pages/index/trueTest?subject="+ this.subject + "&questionIdList=" + listJson
}) })
}else{
uni.showToast({
title: '暂无题目',
icon: 'none'
})
}
} else if (resp.code === '4001') { } else if (resp.code === '4001') {
uni.showToast({ uni.showToast({
title: '当前题库非最新版,请更新~', title: '当前题库非最新版,请更新~',
@ -219,22 +226,36 @@
await this.searchUserVip() await this.searchUserVip()
const result = this.vipOnList.some(item => item.subjects.includes(this.subject)) const result = this.vipOnList.some(item => item.subjects.includes(this.subject))
if (result) { if (result) {
if(resp.data&&resp.data.length){
const listJson = JSON.stringify(resp.data) const listJson = JSON.stringify(resp.data)
uni.navigateTo({ uni.navigateTo({
url: "/pages/questionBank/questionBank?navTitle=" + title + "&subject=" + this.subject + url: "/pages/questionBank/questionBank?navTitle=" + title + "&subject=" + this.subject +
"&needVip=" + result + "&questionIdList=" + listJson "&needVip=" + !result + "&questionIdList=" + listJson
}) })
}else{
uni.showToast({
title: '暂无题目',
icon: 'none'
})
}
} else { } else {
if (resp.data && resp.data.length > 3) { if (resp.data && resp.data.length > 3) {
const arr = resp.data.slice(0, 3) const arr = resp.data.slice(0, 3)
} else { } else {
const arr = resp.data const arr = resp.data
} }
if(arr&&arr.length){
const listJson = JSON.stringify(arr) const listJson = JSON.stringify(arr)
uni.navigateTo({ uni.navigateTo({
url: "/pages/questionBank/questionBank?navTitle=" + title + "&subject=" + this.subject + url: "/pages/questionBank/questionBank?navTitle=" + title + "&subject=" + this.subject +
"&needVip=" + result + "&questionIdList=" + listJson "&needVip=" + !result + "&questionIdList=" + listJson
}) })
}else{
uni.showToast({
title: '暂无题目',
icon: 'none'
})
}
} }
} else { } else {
uni.redirectTo({ uni.redirectTo({

@ -1,7 +1,13 @@
<template> <template>
<view> <view>
<u-loading-page :loading="getLoading" loading-text="题库更新中..."></u-loading-page> <view v-if="getLoading" class="wp100 relative" style="height: 100vh;">
<image class="wp100" mode="widthFix" src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E8%80%83%E8%AF%95%E6%8F%90%E9%86%92_20230906135037.png"></image>
<view class="wp100 flex ai-c jc-c" style="position: absolute;bottom: 0;left: 0;padding-bottom: 124rpx;">
<image style="width: 452rpx;" src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E9%87%91%E6%AD%A6%E8%81%94_20230831123333.png" mode="widthFix"></image>
</view>
</view>
<view v-if="!getLoading"> <view v-if="!getLoading">
<j-navbar :isBack="false">金武联驾考</j-navbar>
<u-sticky bgColor="#fff"> <u-sticky bgColor="#fff">
<u-tabs :list="categoryList" :current="curTab" :scrollable="false" @change="changeCategory"></u-tabs> <u-tabs :list="categoryList" :current="curTab" :scrollable="false" @change="changeCategory"></u-tabs>
</u-sticky> </u-sticky>
@ -57,6 +63,11 @@
computed: { computed: {
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1","curSubject"]), //tagslist ...mapState(useQuestionStore, ["loading_subject4", "loading_subject1","curSubject"]), //tagslist
getLoading() { getLoading() {
if(this.loading_subject4 && this.loading_subject1){
uni.hideTabBar();
}else{
uni.showTabBar()
}
return this.loading_subject4 && this.loading_subject1 return this.loading_subject4 && this.loading_subject1
} }
}, },

@ -49,11 +49,18 @@
...param, ...param,
}).then(async (resp) => { }).then(async (resp) => {
if (resp.code === '0000') { if (resp.code === '0000') {
if(resp.data&&resp.data.length){
const arr = resp.data const arr = resp.data
const listJson = JSON.stringify(arr) const listJson = JSON.stringify(arr)
uni.navigateTo({ uni.navigateTo({
url: "/pages/questionBank/questionBank?navTitle=" + title + "&subject=" + this.subject + "&questionIdList=" + listJson url: "/pages/questionBank/questionBank?navTitle=" + title + "&subject=" + this.subject + "&questionIdList=" + listJson
}) })
}else{
uni.showToast({
title: '暂无题目',
icon: 'none'
})
}
}else if (resp.code === '4001') { }else if (resp.code === '4001') {
uni.showToast({ uni.showToast({
title: '当前题库非最新版,请更新~', title: '当前题库非最新版,请更新~',

@ -8,9 +8,9 @@
</view> </view>
</view> </view>
<swiper class="swiper mt20" :current="swiperIndex" :duration="duration" :autoplay="false" <swiper class="swiper mt20" :current="swiperIndex" :duration="duration" :autoplay="false"
:disable-programmatic-animation="true" @change="onChange" @animationfinish="onAnimationfinish" @change="onChange" @animationfinish="onAnimationfinish"
@touchend="touchEnd"> @touchend="touchEnd">
<swiper-item v-for="(quesItem,quesIndex) in swiperList" :key="quesIndex"> <swiper-item v-for="(quesItem,quesIndex) in swiperList" :key="quesIndex.questionId">
<scroll-view scroll-y="true" class="swiper-scroll"> <scroll-view scroll-y="true" class="swiper-scroll">
<view> <view>
<view class="m14lr"> <view class="m14lr">
@ -18,7 +18,7 @@
<text class="fs18" style="line-height: 42rpx;vertical-align: middle;">{{quesItem.question}}</text> <text class="fs18" style="line-height: 42rpx;vertical-align: middle;">{{quesItem.question}}</text>
</view> </view>
<view class="p14" v-if="quesItem.imageUrl"> <view class="p14" v-if="quesItem.imageUrl">
<image style="width: 100%;" mode="widthFix" :src="quesItem.imageUrl"></image> <image v-show="quesItem.imageUrl" style="width: 100%;height: auto;" mode="widthFix" :lazy-load="true" @load="onoff='1'" :src="quesItem.imageUrl"></image>
</view> </view>
<template v-if="quesItem.type!='3'"> <template v-if="quesItem.type!='3'">
<view class="flex m14lr ai-c mt20" v-for="(item,index) in quesItem.optionList" :key="item.op" <view class="flex m14lr ai-c mt20" v-for="(item,index) in quesItem.optionList" :key="item.op"
@ -99,10 +99,10 @@
</view> </view>
</view> </view>
<view class="text-center flex jc-c ai-c" style="flex-direction: column;" @tap="toCollect"> <view class="text-center flex jc-c ai-c" style="flex-direction: column;" @tap="toCollect">
<u-icon name="star-fill" v-if="questionList[topicIndex].isCollect" color="rgb(249,236,141)" <u-icon name="star-fill" v-if="collectList.includes(questionList[topicIndex].questionId)"
size="24"></u-icon> color="rgb(249,236,141)" size="24"></u-icon>
<u-icon name="star" v-else size="24"></u-icon> <u-icon name="star" v-else size="24"></u-icon>
<text class="cor-666">{{questionList[topicIndex].isCollect?'已收藏':'收藏'}}</text> <text class="cor-666">{{collectList.includes(questionList[topicIndex].questionId)?'已收藏':'收藏'}}</text>
</view> </view>
<view class="text-center"> <view class="text-center">
<view style="color: #00B74F;">{{rightList.length}}</view> <view style="color: #00B74F;">{{rightList.length}}</view>
@ -191,10 +191,10 @@
</view> </view>
</view> </view>
<view class="text-center flex jc-c ai-c" style="flex-direction: column;" @tap="toCollect"> <view class="text-center flex jc-c ai-c" style="flex-direction: column;" @tap="toCollect">
<u-icon name="star-fill" v-if="questionList[topicIndex].isCollect" color="rgb(249,236,141)" <u-icon name="star-fill" v-if="collectList.includes(questionList[topicIndex].questionId)"
size="24"></u-icon> color="rgb(249,236,141)" size="24"></u-icon>
<u-icon name="star" v-else size="24"></u-icon> <u-icon name="star" v-else size="24"></u-icon>
<text class="cor-666">{{questionList[topicIndex].isCollect?'已收藏':'收藏'}}</text> <text class="cor-666">{{collectList.includes(questionList[topicIndex].questionId)?'已收藏':'收藏'}}</text>
</view> </view>
<view class="text-center"> <view class="text-center">
<view style="color: #00B74F;">{{rightList.length}}</view> <view style="color: #00B74F;">{{rightList.length}}</view>
@ -212,7 +212,7 @@
</view> </view>
</view> </view>
<view class="flex ai-c jc-fs p14" style="flex-wrap: wrap;max-height: 400px;overflow-y: scroll;"> <view class="flex ai-c jc-fs p14" style="flex-wrap: wrap;max-height: 400px;overflow-y: scroll;">
<view v-for="(item,index) of questionList" :key="index" style="width:20%;" class="flex ai-c jc-c" <view v-for="(item,index) of questionList" :key="item.questionId" style="width:20%;" class="flex ai-c jc-c"
@tap="chooseQueston(index)"> @tap="chooseQueston(index)">
<view class="tCircle mb10" :class="{ <view class="tCircle mb10" :class="{
'active':index == topicIndex, 'active':index == topicIndex,
@ -298,6 +298,7 @@
}, },
data() { data() {
return { return {
onoff:'0',
navTitle: '', navTitle: '',
originArray: '', originArray: '',
showBestAnswer: false, showBestAnswer: false,
@ -355,13 +356,8 @@
const arr = JSON.parse(val) const arr = JSON.parse(val)
let arr1 = [] let arr1 = []
arr.forEach(item => { arr.forEach(item => {
let isCollect = false
if (this.collectList.includes(item.questionId)) {
isCollect = true
}
arr1.push({ arr1.push({
isChoose: false, isChoose: false,
isCollect: isCollect,
...item ...item
}) })
}) })
@ -534,12 +530,9 @@
}) })
}, },
toCollect() { toCollect() {
if (this.questionList[this.topicIndex].isCollect) {
if (this.collectList.includes(this.questionList[this.topicIndex].questionId)) { if (this.collectList.includes(this.questionList[this.topicIndex].questionId)) {
const idx = this.collectList.indexOf(this.questionList[this.topicIndex].questionId) const idx = this.collectList.indexOf(this.questionList[this.topicIndex].questionId)
this.collectList.splice(idx, 1) this.collectList.splice(idx, 1)
}
this.questionList[this.topicIndex].isCollect = false
uni.showToast({ uni.showToast({
title: "取消收藏", title: "取消收藏",
icon: 'none' icon: 'none'
@ -593,6 +586,7 @@
// //
onChange(e) { onChange(e) {
// this.onoff='0'
// //
if (e.detail.source != "touch") return; if (e.detail.source != "touch") return;
@ -742,6 +736,7 @@
} else { } else {
this.questionList = JSON.parse(this.originArray) this.questionList = JSON.parse(this.originArray)
} }
console.log(this.questionList);
if (this.navTitle === '顺序答题') { if (this.navTitle === '顺序答题') {
this.pickerTopic(this[`currentIndex_subject${this.subject}`]) this.pickerTopic(this[`currentIndex_subject${this.subject}`])
} else { } else {

@ -218,11 +218,18 @@
...param, ...param,
}).then(async (resp) => { }).then(async (resp) => {
if (resp.code === '0000') { if (resp.code === '0000') {
if(resp.data&&resp.data.length){
const arr = resp.data const arr = resp.data
const listJson = JSON.stringify(arr) const listJson = JSON.stringify(arr)
uni.navigateTo({ uni.navigateTo({
url: "/pages/questionBank/questionBank?navTitle=" + title + "&subject=" + this.subject + "&questionIdList=" + listJson url: "/pages/questionBank/questionBank?navTitle=" + title + "&subject=" + this.subject + "&questionIdList=" + listJson
}) })
}else{
uni.showToast({
title: '暂无题目',
icon: 'none'
})
}
}else if (resp.code === '4001') { }else if (resp.code === '4001') {
uni.showToast({ uni.showToast({
title: '当前题库非最新版,请更新~', title: '当前题库非最新版,请更新~',

@ -57,21 +57,20 @@
this.isShowAll = op.needVip this.isShowAll = op.needVip
} }
let arr = [] let arr = []
arr = [...this[`orderQuestion_subject${this.subject}`]]
let questionObj = {}
arr.forEach(item => {
item.isChoose = false
questionObj[item.questionId] = item
})
if (op.questionIdList) { if (op.questionIdList) {
const idList = JSON.parse(op.questionIdList) const idList = JSON.parse(op.questionIdList)
arr = this[`orderQuestion_subject${this.subject}`].filter(qItem=>idList.includes(qItem.questionId)) if (idList && idList.length > 0) {
idList.forEach(item => {
this.questionArr.push(questionObj[item])
})
} }
arr.forEach(item => {
let isCollect = false
if (this.collectList.includes(item.questionId)) {
isCollect = true
} }
this.questionArr.push({
isChoose: false,
isCollect: isCollect,
...item
})
})
this.type = 'exam' this.type = 'exam'
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr), this.title) this.$refs.question.getQuestionList(JSON.stringify(this.questionArr), this.title)
} }
@ -85,48 +84,19 @@
toBack() { toBack() {
this.$refs.question.submitPaper() this.$refs.question.submitPaper()
}, },
changeTab(val) { async changeTab(val) {
if (val == 1) { if (val == 1) {
const param=this.subject=='1'?{isExam1: '1'}:{isExam2: '1'}
queryQuestionId({
versionId: this.version,
carTypeId: storage.get('carType') || '1001',
subject: this.subject,
...param
}).then(async (resp) => {
if (resp.code === '0000') {
if (this.token) {
await this.searchUserVip() await this.searchUserVip()
const result = this.vipOnList.some(item => item.subjects.includes(this.subject)) const result = this.vipOnList.some(item => item.subjects.includes(this.subject))
if (result) { if (result) {
const listJson = JSON.stringify(resp.data)
uni.navigateTo({ uni.navigateTo({
url: "/pages/questionBank/practiceExams?title=考前密卷" + "&subject=" + this.subject + "&questionIdList=" + listJson url: "/pages/index/secretPapers?subject=" + this.subject
}) })
} else { } else {
if (resp.data && resp.data.length > 3) {
const arr = resp.data.slice(0, 3)
} else {
const arr = resp.data
}
const listJson = JSON.stringify(arr)
uni.navigateTo({ uni.navigateTo({
url: "/pages/questionBank/practiceExams?title=" + title + "&subject=" + this.subject + "&questionIdList=" + listJson+"&needVip="+result url: "/pages/index/videoVip?subject=" + this.subject
})
}
} else {
uni.redirectTo({
url: '/pages/login/login'
});
}
} else if (resp.code === '4001') {
uni.showToast({
title: '当前题库非最新版,请更新~',
icon: 'none'
}) })
this.getAllQuestion()
} }
})
} }
} }
} }

@ -60,51 +60,22 @@
if (op.needVip) { if (op.needVip) {
this.isShowAll = !Boolean(op.needVip == 'true') this.isShowAll = !Boolean(op.needVip == 'true')
} }
if (this.navTitle === '顺序答题') { arr = [...this[`orderQuestion_subject${this.subject}`]]
if (this.subject == '1') { let questionObj={}
arr = [...this.orderQuestion_subject1] arr.forEach(item => {
} else if (this.subject == '4') { item.isChoose=false
arr = [...this.orderQuestion_subject4] questionObj[item.questionId]=item
} })
if(op.navTitle==='顺序答题'){
this.questionArr=arr
}else if (op.questionIdList) { }else if (op.questionIdList) {
const idList = JSON.parse(op.questionIdList) const idList = JSON.parse(op.questionIdList)
arr = this[`orderQuestion_subject${this.subject}`].filter(qItem=>idList.includes(qItem.questionId)) if(idList&&idList.length>0){
}else{ idList.forEach(item=>{
if(op.isVip){ this.questionArr.push(questionObj[item])
param.isVip=op.isVip
}
const resp=await queryQuestionId({
subject:this.subject,
carTypeId:storage.get('carType') || '1001',
versionId:this.version,
...params
}) })
let list=[]
if(resp.code==='0000'){
await this.searchUserVip()
const res = this.vipOnList.some(item => item.subjects.includes(this.subject))
if (!res) {
list=resp.data.slice(0,3)
}else{
list=resp.data
} }
} }
if(op.needVip){
this.isShowAll = op.needVip
}
arr=this[`orderQuestion_subject${this.subject}`].filter(qItem=>list.includes(qItem.questionId))
}
arr.forEach(item => {
let isCollect = false
if (this.collectList.includes(item.questionId)) {
isCollect = true
}
this.questionArr.push({
isChoose: false,
isCollect: isCollect,
...item
})
})
this.loading = false this.loading = false
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr), this.navTitle) this.$refs.question.getQuestionList(JSON.stringify(this.questionArr), this.navTitle)
this.$refs.question.getOriginArr(JSON.stringify(this.questionArr)) this.$refs.question.getOriginArr(JSON.stringify(this.questionArr))

Loading…
Cancel
Save