pull/19/head
脆皮鸭 1 year ago
parent 77de5d5d6e
commit c3e6002ca3
  1. 1
      src/App.vue
  2. 4
      src/components/j-navbar/j-navbar.vue
  3. 9
      src/jtools/api/question.js
  4. 12
      src/pages/index/components/Subject1.vue
  5. 9
      src/pages/index/components/Subject2.vue
  6. 63
      src/pages/index/index.vue
  7. 9
      src/pages/questionBank/components/Question.vue
  8. 31
      src/pages/questionBank/exclusiveExercise.vue
  9. 2
      src/pages/questionBank/questionBank.vue

@ -27,4 +27,5 @@ export default {
/*每个页面公共css */
@import "uni_modules/uview-plus/index.scss";
@import "static/style/index.scss";
button::after{ border: none;}
</style>

@ -140,8 +140,8 @@ export default {
.cu-bar {
width: 100%;
.content {
// width: 350rpx;
display: flex;
width: 350rpx;
// display: flex;
flex-direction: row;
flex: 1;
align-items: center;

@ -13,7 +13,8 @@ export function questionCategory(data) {
return request({
url: 'driver-api/tdQuestion/questionCategory',
method: 'POST',
data
data,
noToken: true
});
}
@ -45,7 +46,8 @@ export function testTotal(data) {
export function querySysConfigList(carTypeId, configKey) {
return request({
url: 'driver-api/tdSysConfigList/querySysConfigList?configKey=' + configKey + '&carTypeId=' + carTypeId,
method: 'GET'
method: 'GET',
noToken: true
});
}
@ -54,6 +56,7 @@ export function queryProjectList(data) {
return request({
url: 'driver-api/tdTestProject/queryProjectList',
method: 'POST',
data
data,
noToken:true
});
}

@ -4,9 +4,10 @@
<image style="width: 100%;" src="../../static/image/index/index_bg.jpg"></image>
<view class="center-box flex jc-sb ai-c">
<view class="box-item flex ai-c jc-c">
<view class="flex jc-c ai-c" style="width: 230rpx;height: 230rpx;background-image: url(../../../static/image/index/green_bg.png);background-size: 100% 100%;">
<view class="flex jc-c ai-c relative" style="width: 230rpx;height: 230rpx;" @tap="toAnswer('顺序答题',false)">
<image style="width: 230rpx;height: 230rpx;position: absolute;left: 0;top: 0;" src="../../../static/image/index/green_bg.png"></image>
<view class="btn-item flex ai-c jc-c">
<view class="text-center cor-fff" style="line-height: 40rpx;" @tap="toAnswer('顺序答题',false)">
<view class="text-center cor-fff" style="line-height: 40rpx;">
<view class="fs16">顺序练习</view>
<text class="fs14">{{getDoNum}}/{{subject=='1'?orderQuestion_subject1.length:orderQuestion_subject4.length}}</text>
</view>
@ -14,9 +15,10 @@
</view>
</view>
<view class="box-item flex ai-c jc-c">
<view class="flex jc-c ai-c" style="width: 230rpx;height: 230rpx;background-image: url(../../../static/image/index/orange_bg.png);background-size: 100% 100%;">
<view class="flex jc-c ai-c relative" style="width: 230rpx;height: 230rpx;" @tap="toExams">
<image style="width: 230rpx;height: 230rpx;position: absolute;left: 0;top: 0;" src="../../../static/image/index/orange_bg.png"></image>
<view class="btn2-item flex ai-c jc-c">
<view class="text-center cor-fff" style="line-height: 40rpx;" @tap="toExams">
<view class="text-center cor-fff" style="line-height: 40rpx;">
<view class="fs16">模拟考试</view>
<text class="fs14">去考试</text>
</view>
@ -174,7 +176,7 @@
},
toExclusive(){
uni.navigateTo({
url:"/pages/questionBank/exclusiveExercise"
url:"/pages/questionBank/exclusiveExercise?subject="+this.subject
})
},
toWrongList(){

@ -74,6 +74,15 @@ export default {
await this.getDiverType()
},
methods:{
getOperateList(){
queryProjectList({
"carTypeId": storage.get('carType') || '1001',
"subject": String(this.subject),
"type": "2"
}).then(resp=>{
console.log(resp);
})
},
toVideo(){
uni.navigateTo({
url:"/pages/questionBank/videoDetail?driveType="+this.diverTypeList[this.diverTypeIndex].configItemCode+"&subject="+this.subject+"&projectId="+this.projectId+"&type=1"

@ -4,11 +4,11 @@
<u-tabs :list="categoryList" :current="curTab" :scrollable="false" @change="changeCategory"></u-tabs>
</u-sticky>
<view style="height: 100vh;background-color: rgb(245, 245, 245);">
<template v-if="tIndex===0 || tIndex===3">
<Subject1 :subject="tIndex+1" :rightList="rightList" :wrongList="wrongList" />
<template v-if="subject=='1' || subject=='4'">
<Subject1 :subject="subject" :rightList="rightList" :wrongList="wrongList" />
</template>
<template v-else>
<subject2 :subject="tIndex+1" ref="subjectRef" />
<subject2 :subject="subject" ref="subjectRef" />
</template>
</view>
</view>
@ -17,53 +17,66 @@
import { mapState,mapActions } from 'pinia' //
import useQuestionStore from '@/jtools/store/question' //store
import storage from '@/jtools/storage';
import {
querySysConfigList,
} from '@/jtools/api/question';
import Subject1 from "./components/Subject1";
import Subject2 from "./components/Subject2";
export default {
components: {Subject1,Subject2},
data() {
return {
subject:storage.get('curSubject') || '1',
curTab:Number(storage.get('curSubject'))-1,
tIndex:Number(storage.get('curSubject'))-1,
searchValue:'',
cityName:'',
categoryList:[{
name:'科目1'
},{
name:'科目2'
},{
name:'科目3'
},{
name:'科目4'
}],
rightList:storage.get(`rightList_subject${this.tIndex+1}`) || [],
wrongList:storage.get(`wrongList_subject${this.tIndex+1}`) || [],
categoryList:[],
rightList:storage.get(`rightList_subject${this.subject}`) || [],
wrongList:storage.get(`wrongList_subject${this.subject}`) || [],
};
},
onLoad(){
this.getSubjectConfig()
},
onShow() {
if(this.tIndex==0||this.tIndex==3){
this.rightList=storage.get(`rightList_subject${this.tIndex+1}`) || []
this.wrongList=storage.get(`wrongList_subject${this.tIndex+1}`) || []
if(this.subject=='1'||this.subject=='4'){
this.rightList=storage.get(`rightList_subject${this.subject}`) || []
this.wrongList=storage.get(`wrongList_subject${this.subject}`) || []
}
},
methods:{
...mapActions(useQuestionStore,['getOrderQuestion_sub4','getOrderQuestion_sub1','changeSubject']),
//
getSubjectConfig(){
const carTypeId=storage.get('carType') || '1001'
querySysConfigList(carTypeId,'Subject').then(resp=>{
if(resp.code==='0000'){
this.categoryList=resp.data.map(item=>{
return{
...item,
name:item.configItemName
}
})
}
})
},
//
async changeCategory(val){
this.tIndex=val.index
if(this.tIndex==0){
this.subject=val.configItemCode
console.log();
if(this.subject=='1'){
await this.getOrderQuestion_sub1()
}else if(this.tIndex==3){
}else if(this.subject=='4'){
await this.getOrderQuestion_sub4()
}else{
this.changeSubject(val.index+1)
this.changeSubject(this.subject)
setTimeout(()=>{
this.$refs.subjectRef.getDiverType()
},100)
}
if(this.tIndex==0||this.tIndex==3){
this.rightList=storage.get(`rightList_subject${this.tIndex+1}`) || []
this.wrongList=storage.get(`wrongList_subject${this.tIndex+1}`) || []
if(this.subject=='1'||this.subject=='4'){
this.rightList=storage.get(`rightList_subject${this.subject}`) || []
this.wrongList=storage.get(`wrongList_subject${this.subject}`) || []
}
},
}

@ -11,7 +11,7 @@
<view>
<view class="m14lr">
<text class="tag_box">{{getQuestType(quesItem.type)}}</text>
<text class="fs18">{{quesItem.question}}</text>
<text class="fs18" style="line-height: 42rpx;vertical-align: middle;">{{quesItem.question}}</text>
</view>
<view class="p14" v-if="quesItem.imageUrl">
<image style="width: 100%;" mode="widthFix" :src="quesItem.imageUrl"></image>
@ -35,7 +35,7 @@
</template>
</view>
<view class="m14lr mt30"
v-if="quesItem.clickAnswer&&!quesItem.trueAnswer.includes(quesItem.clickAnswer)">
v-if="quesItem.clickAnswer&&!quesItem.trueAnswer.includes(quesItem.clickAnswer) || showBestAnswer">
<view class="answer_box">
<text class="fs18 fw600 cor-000">答案:{{getRightOp(quesItem.trueAnswer)}}</text>
<view class="fs18 cor-000" style="text-indent:2em;"> {{quesItem.bestAnswer}}</view>
@ -263,6 +263,7 @@ export default {
},
data() {
return {
showBestAnswer:false,
nowPrice:68,
showVip:false,
popupShow:false,
@ -304,6 +305,9 @@ export default {
},
methods: {
...mapActions(useQuestionStore,['getCurrentIndex']),
isShowBest(val){
this.showBestAnswer=val
},
duoxuan(val){
if(val&&val.length>1){
this.questionList[this.topicIndex].isChoose=true
@ -694,6 +698,7 @@ export default {
}
.tag_box {
vertical-align: middle;
display: inline-block;
width: 78rpx;
height: 42rpx;

@ -21,7 +21,7 @@
<u-grid :border="false" col="4">
<u-grid-item v-for="(listItem,listIndex) in list" :key="listIndex" @click="toAnswer(listItem.title,listItem.isError,listItem.isNew)">
<view style="width: 84rpx;height: 84rpx;">
<image style="width: 84rpx;" mode="widthFix" :src="listItem.image"></image>
<image style="width: 84rpx;height: 100rpx;" mode="widthFix" :src="listItem.image"></image>
</view>
<text class="grid-text fs14 cor-000">{{listItem.title}}</text>
<text class="grid-text mb10 fs12 cor-999">{{listItem.subTitle}}</text>
@ -30,10 +30,10 @@
</view>
<view class="mt14 p14 bc-fff" style="border-radius: 20rpx;">
<text class="fs18 cor-000 fw600">常见考点</text>
<view class="flex ai-c wp100 mt15" style="flex-wrap: wrap;">
<view class="wp50 flex ai-c mb25" v-for="(item,index) of testCenterList" :key="index" @tap="toQuestionBank(item)">
<view class="flex ai-c wp100 mt10" style="flex-wrap: wrap;">
<view class="wp50 flex ai-c p15tb" style="border-bottom: 1rpx solid #DDDCDC;" v-for="(item,index) of testCenterList" :key="index" @tap="toQuestionBank(item)">
<view class="dot_item">{{index+1}}</view>
<text class="ml5">{{item.configItemName}}</text>
<text class="ml5 topic_cont_text" style="width: calc(100% - 65rpx);">{{item.configItemName}}</text>
</view>
</view>
</view>
@ -85,16 +85,21 @@
isError:0,
image:neverWriteIcon
}],
testCenterList:[]
testCenterList:[],
subject:'1'
}
},
onLoad(){
onLoad(op){
if(op.subject){
this.subject=op.subject
}
this.getExamPoint()
},
methods: {
getExamPoint(){
const carTypeId=storage.get('carType') || '1001'
querySysConfigList(carTypeId,'ExamKeys').then(resp=>{
const examKey = this.subject=='1'?'ExamKeysOfSubjectOne':'ExamKeysOfSubjectFour'
querySysConfigList(carTypeId,examKey).then(resp=>{
if(resp.code==='0000'){
this.testCenterList=resp.data
}
@ -128,10 +133,20 @@
.dot_item{
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
line-height: 41rpx;
color: #fff;
text-align: center;
background: #0BD032;
border-radius: 50%;
}
.topic_cont_text{
height:45rpx;
overflow: hidden;
word-break: break-all; /* break-all(允许在单词内换行。) */
text-overflow: ellipsis; /* 超出部分省略号 */
display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
-webkit-line-clamp:1; /** 显示的行数 **/
}
</style>

@ -116,8 +116,10 @@
clickAnswer: item.trueAnswer
}
})
this.$refs.question.isShowBest(true)
this.$refs.question.getQuestionList(JSON.stringify(list))
} else {
this.$refs.question.isShowBest(false)
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr))
}
},

Loading…
Cancel
Save