|
|
@ -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}`]); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|