This commit is contained in:
2023-08-20 01:59:40 +08:00
parent e635b5c431
commit a90c28f6fd
11 changed files with 307 additions and 360 deletions

View File

@@ -1,26 +1,32 @@
import { defineStore } from 'pinia';
import {
defineStore
} from 'pinia';
import http from '@/jtools/request/index';
import { queryQuestion } from '@/jtools/api/question';
import {
queryQuestion
} from '@/jtools/api/question';
import storage from '@/jtools/storage';
const question = defineStore({
id: 'question',
state: () => ({
id: 'question',
state: () => ({
currentCartype: storage.get('carType') || '1001',
orderQuestionList: [], //顺序做题
}),
orderQuestion: [], //顺序做题
}),
actions: {
// 获取顺序做题
getQuestionList() {
console.log(11111);
queryQuestion({carTypeId:this.currentCartype,subject:'1'}).then(res=>{
if(res.code=='0000'){
this.orderQuestionList=res.data
}
})
},
}
actions: {
// 获取顺序做题
getOrderQuestion(val) {
queryQuestion({
carTypeId: this.currentCartype,
subject: val
}).then(res => {
if (res.code == '0000') {
this.orderQuestion = res.data
}
})
},
}
});
export default question;
export default question;