dev-hxf #10
@@ -5,7 +5,7 @@ VITE_APP_TITLE = 金武联驾校
|
||||
VITE_APP_ENV = 'development'
|
||||
|
||||
# 金武联驾校/开发环境
|
||||
VITE_APP_BASE_API = 'http://118.31.23.45:8888/'
|
||||
VITE_APP_BASE_API = 'http://192.168.1.2:8888/'
|
||||
|
||||
#
|
||||
VITE_WEB_BASE_URL = 'http://118.31.23.45:8888/'
|
||||
VITE_WEB_BASE_URL = 'http://192.168.1.2:8888/'
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<script>
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
export default {
|
||||
onLaunch: function () {
|
||||
useUserStore().queryVipList()
|
||||
if(useUserStore().isLogin) {
|
||||
useQuestionStore().getOrderQuestion('1')
|
||||
useUserStore().getUserInfo()
|
||||
useUserStore().searchUserVip()
|
||||
}
|
||||
|
||||
@@ -21,14 +21,14 @@ export function getCode(data) {
|
||||
export function logout() {
|
||||
return request({
|
||||
url: 'driver-api/tdSysUser/loginOut',
|
||||
method: 'get',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function getInfo() {
|
||||
return request({
|
||||
url: 'driver-api/tdSysUser/queryUserMessage',
|
||||
method: 'get',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
10
src/jtools/api/question.js
Normal file
10
src/jtools/api/question.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import request from '../request/index.js';
|
||||
|
||||
|
||||
export function queryQuestion(data) {
|
||||
return request({
|
||||
url: 'driver-api/tdQuestion/queryQuestion',
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
@@ -1,18 +1,30 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
defineStore
|
||||
} from 'pinia';
|
||||
import http from '@/jtools/request/index';
|
||||
import constants from '@/jtools/constants';
|
||||
import {
|
||||
queryQuestion
|
||||
} from '@/jtools/api/question';
|
||||
import storage from '@/jtools/storage';
|
||||
|
||||
const question = defineStore({
|
||||
id: 'question',
|
||||
state: () => ({
|
||||
orderQuestionList: [], //顺序做题
|
||||
currentCartype: storage.get('carType') || '1001',
|
||||
orderQuestion: [], //顺序做题
|
||||
}),
|
||||
|
||||
actions: {
|
||||
// 获取顺序做题
|
||||
getQuestionList(arr) {
|
||||
this.orderQuestionList=[...arr]
|
||||
getOrderQuestion(val) {
|
||||
queryQuestion({
|
||||
carTypeId: this.currentCartype,
|
||||
subject: val
|
||||
}).then(res => {
|
||||
if (res.code == '0000') {
|
||||
this.orderQuestion = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
@@ -124,6 +124,13 @@
|
||||
"navigationBarTitleText": "章节练习",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/testRoom",
|
||||
"style": {
|
||||
"navigationBarTitleText": "考场实况",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
@@ -4,14 +4,17 @@
|
||||
<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="btn-item flex ai-c jc-c">
|
||||
<view class="text-center cor-fff" style="line-height: 40rpx;" @tap="toAnswer('顺序答题')">
|
||||
<view class="fs16">顺序练习</view>
|
||||
<text class="fs14">0/2344</text>
|
||||
<text class="fs14">{{rightList.length+wrongList.length}}/{{orderQuestion.length}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</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="btn2-item flex ai-c jc-c">
|
||||
<view class="text-center cor-fff" style="line-height: 40rpx;" @tap="toExams">
|
||||
<view class="fs16">模拟考试</view>
|
||||
@@ -21,6 +24,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding: 0 28rpx;margin-top: 60rpx;">
|
||||
<view class="tabs-box">
|
||||
<view class="wp33 flex ai-c jc-c" @tap="toVip">
|
||||
@@ -47,7 +51,7 @@
|
||||
<view class="mt5">专项练习</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wp33 flex ai-c jc-c">
|
||||
<view class="wp33 flex ai-c jc-c" @tap="toTestRoom">
|
||||
<view class="text-center wp100">
|
||||
<image style="width: 72rpx;height: 72rpx;margin: 0 auto;"
|
||||
src="../../static/image/index/realicon.png"></image>
|
||||
@@ -73,7 +77,7 @@
|
||||
<view style="padding: 0 28rpx;margin-top: 30rpx;" @tap="toClass">
|
||||
<view class="video-box">
|
||||
<view class="flex jc-sb ai-c wp100">
|
||||
<text style="color: #05C341;font-size: 36rpx;">科一精品视频课</text>
|
||||
<text style="color: #05C341;font-size: 36rpx;">科{{type==1?'一':'四'}}精品视频课</text>
|
||||
<text class="cor-666 fs12">全部10节课 ></text>
|
||||
</view>
|
||||
<view class="flex ai-c mt20">
|
||||
@@ -82,7 +86,7 @@
|
||||
<u-button :customStyle="{width:'200rpx',height:'66rpx',borderRadius: '33rpx'}" iconColor="#fff"
|
||||
text="去看视频" color="linear-gradient(90deg, #11DF20 0%, #00B74F 100%)" icon="play-circle">
|
||||
</u-button>
|
||||
<view class="cor-333 fs15 fw600 mt10">科一易错试题</view>
|
||||
<view class="cor-333 fs15 fw600 mt10">科{{type==1?'一':'四'}}易错试题</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -92,11 +96,34 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState,mapActions } from 'pinia' //引入映射函数
|
||||
import storage from '@/jtools/storage';
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
export default {
|
||||
props:{
|
||||
type:{
|
||||
type:[String,Number],
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
return {
|
||||
rightList:storage.get('rightList'),
|
||||
wrongList:storage.get('wrongList'),
|
||||
allQuestionNum:0,
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
// this.allQuestionNum=useQuestionStore().orderQuestion.length
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["orderQuestion"]) //映射函数,取出tagslist
|
||||
},
|
||||
methods: {
|
||||
toTestRoom(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/index/testRoom"
|
||||
})
|
||||
},
|
||||
toVip(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/index/videoVip"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</u-sticky>
|
||||
<view style="height: 100vh;background-color: rgb(245, 245, 245);">
|
||||
<template v-if="tIndex===0 || tIndex===3">
|
||||
<Subject1 />
|
||||
<Subject1 :type="tIndex+1" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<subject2 />
|
||||
@@ -38,313 +38,13 @@
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getAllQuestion()
|
||||
},
|
||||
methods:{
|
||||
...mapActions(useQuestionStore, ['getQuestionList']), //映射action
|
||||
//切换科目
|
||||
changeCategory(val){
|
||||
this.tIndex=val.index
|
||||
console.log(this.tIndex);
|
||||
},
|
||||
//获取全部题库
|
||||
getAllQuestion(){
|
||||
const arr = [{
|
||||
questionId: 0,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第一题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'C',
|
||||
}, {
|
||||
questionId: 1,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第二题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'B',
|
||||
}, {
|
||||
questionId: 2,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第三题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
},
|
||||
{
|
||||
questionId: 3,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第四题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}, {
|
||||
questionId: 4,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第5题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
},
|
||||
{
|
||||
questionId: 5,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第6题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}, {
|
||||
questionId: 6,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第7题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}, {
|
||||
questionId: 7,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第8题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}, {
|
||||
questionId: 8,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第9题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'C',
|
||||
}, {
|
||||
questionId: 9,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第10题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'B',
|
||||
}, {
|
||||
questionId: 10,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第11题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
},
|
||||
{
|
||||
questionId: 11,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第12题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}, {
|
||||
questionId: 12,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第13题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
},
|
||||
{
|
||||
questionId: 13,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第14题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}, {
|
||||
questionId: 14,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第15题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}, {
|
||||
questionId: 15,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第16题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}
|
||||
]
|
||||
this.getQuestionList(arr)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
100
src/pages/index/testRoom.vue
Normal file
100
src/pages/index/testRoom.vue
Normal file
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-sticky bgColor="#fff">
|
||||
<u-tabs :list="categoryList" :scrollable="false" @click="changeCategory"></u-tabs>
|
||||
</u-sticky>
|
||||
<view class="p14">
|
||||
<view class="flex ai-c" v-if="carTypeList&&carTypeList.length">
|
||||
<view class="car_item mr10" v-for="(item,index) of carTypeList" :key="index" @tap="chooseCar(item.value)" :class="item.value===tCar?'checked_car':'unchecked_car'">{{item.label}}</view>
|
||||
</view>
|
||||
<view class="flex p14 bc-fff" style="border-radius: 16rpx;" v-for="(item,index) of videoList" :key="index" @tap="toDetail">
|
||||
<image class="pic" src="../../static/image/index/index_bg.png"></image>
|
||||
<view class="ml10" style="width: calc(100% - 320rpx);">
|
||||
<text class="fs16 cor-000 fw600">八一考场</text>
|
||||
<view class="fs14 mt40 cor-666 flex jc-sb ai-c wp100" >
|
||||
<text>共9条路线视频</text>
|
||||
<text>蜀山区</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
tCar:0,
|
||||
categoryList:[{
|
||||
name:'全部'
|
||||
},{
|
||||
name:'蜀山区'
|
||||
},{
|
||||
name:'长丰县'
|
||||
},{
|
||||
name:'瑶海区'
|
||||
},{
|
||||
name:'肥东县'
|
||||
},{
|
||||
name:'庐江县'
|
||||
}],
|
||||
carTypeList:[],
|
||||
videoList:[{
|
||||
label:"111"
|
||||
},{
|
||||
label:'222'
|
||||
},{
|
||||
label:'333'
|
||||
},{
|
||||
label:'444'
|
||||
}]
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
chooseCar(val){
|
||||
this.tCar=val
|
||||
},
|
||||
changeCategory(val){
|
||||
|
||||
},
|
||||
toDetail(){
|
||||
uni.navigateTo({
|
||||
url:'/pages/questionBank/videoDetail?type=test'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
::v-deep .u-tabs__wrapper__nav__line {
|
||||
background: linear-gradient(90deg, #11DF20 0%, #00B74F 100%) !important;
|
||||
bottom: 14rpx !important;
|
||||
}
|
||||
.car_item{
|
||||
font-size: 28rpx;
|
||||
padding:0 34rpx;
|
||||
height: 58rpx;
|
||||
line-height: 58rpx;
|
||||
border-radius: 29rpx;
|
||||
}
|
||||
.checked_car{
|
||||
background-color: #05C341;
|
||||
color: #fff;
|
||||
}
|
||||
.unchecked_car{
|
||||
border: 1px solid #DDD;
|
||||
color: #666;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.pic{
|
||||
width: 300rpx;
|
||||
height: 169rpx;
|
||||
background: #00B74F;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
::v-deep .u-tabs__wrapper__nav__item{
|
||||
padding: 0 !important;
|
||||
}
|
||||
</style>
|
||||
@@ -10,18 +10,18 @@
|
||||
<scroll-view scroll-y="true" class="swiper-scroll">
|
||||
<view>
|
||||
<view class="m14lr">
|
||||
<text class="tag_box">{{quesItem.questionTypeDesc}}</text>
|
||||
<text class="fs18">{{quesItem.questionDesc}}</text>
|
||||
<text class="tag_box">{{getQuestType(quesItem.type)}}</text>
|
||||
<text class="fs18">{{quesItem.question}}</text>
|
||||
</view>
|
||||
<view class="flex m14lr ai-c mt20" v-for="(item,index) in quesItem.optionList"
|
||||
:key="item.op" @tap="answerQues(item.op,index)">
|
||||
:key="item.op" @tap="answerQues(item.opValue,index)">
|
||||
<template
|
||||
v-if="quesItem.clickAnswer&&item.op===quesItem.rightOp">
|
||||
<u-icon class="mr15" name="checkmark-circle-fill" color="#05C341" size="30"></u-icon>
|
||||
v-if="quesItem.clickAnswer&&quesItem.trueAnswer.includes(item.opValue)">
|
||||
<u-icon class="mr15" name="checkmark-circle-fill" color="#05C341" size="32"></u-icon>
|
||||
</template>
|
||||
<template
|
||||
v-else-if="quesItem.clickAnswer===item.op&&item.op!==quesItem.rightAnswer">
|
||||
<u-icon class="mr15" name="close-circle-fill" color="red" size="30"></u-icon>
|
||||
v-else-if="quesItem.clickAnswer&&quesItem.clickAnswer.includes(item.opValue)&&!quesItem.trueAnswer.includes(item.opValue)">
|
||||
<u-icon class="mr15" name="close-circle-fill" color="red" size="32"></u-icon>
|
||||
</template>
|
||||
<template v-else-if="!item.chooseOption">
|
||||
<view class="option_item">{{item.op}}</view>
|
||||
@@ -29,10 +29,10 @@
|
||||
<text class="fs18">{{item.opDesc}}</text>
|
||||
</view>
|
||||
<view class="m14lr mt30"
|
||||
v-if="quesItem.clickAnswer&&quesItem.clickAnswer!==quesItem.rightOp || tCurrent===1">
|
||||
v-if="quesItem.clickAnswer&&!quesItem.trueAnswer.includes(quesItem.clickAnswer) || tCurrent===1">
|
||||
<view class="answer_box">
|
||||
<text class="fs18 fw600 cor-000">答案:{{quesItem.rightOp}}</text>
|
||||
<view class="fs18 cor-000" style="text-indent:2em;"> 这里是相关解释文字,这里是相关解释文字相关解释文字</view>
|
||||
<text class="fs18 fw600 cor-000">答案:{{getRightOp(quesItem.trueAnswer)}}</text>
|
||||
<view class="fs18 cor-000" style="text-indent:2em;"> {{quesItem.bestAnswer}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -219,7 +219,7 @@ export default {
|
||||
rightList:[],
|
||||
wrongList:[],
|
||||
collectList:storage.get('collectList') || [],
|
||||
questionList: [],//数据源
|
||||
questionList: [{isCollect:true}],//数据源
|
||||
swiperList: [], // 轮播图数据列表
|
||||
swiperIndex: 0, // 轮播图当前位置
|
||||
isChange: false, // 是否切换
|
||||
@@ -228,10 +228,33 @@ export default {
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getQuestionList()
|
||||
this.renderSwiper(0)
|
||||
},
|
||||
methods: {
|
||||
//获取正确选项
|
||||
getRightOp(val){
|
||||
let rightOp=''
|
||||
this.questionList[this.topicIndex].optionList.forEach(item=>{
|
||||
if(this.questionList[this.topicIndex].trueAnswer.includes(item.opValue)){
|
||||
if(rightOp){
|
||||
rightOp=rightOp+'、'+item.op
|
||||
}else{
|
||||
rightOp=item.op
|
||||
}
|
||||
}
|
||||
})
|
||||
return rightOp
|
||||
},
|
||||
//获取题类型
|
||||
getQuestType(val){
|
||||
if(val=='1'){
|
||||
return '判断'
|
||||
}else if(val=='2'){
|
||||
return '单选'
|
||||
}else if(val=='3'){
|
||||
return '多选'
|
||||
}
|
||||
},
|
||||
//开通VIP
|
||||
toVip(){
|
||||
this.showVip=true
|
||||
@@ -364,22 +387,37 @@ export default {
|
||||
this.topicIndex = index;
|
||||
this.renderSwiper(index);
|
||||
},
|
||||
isArrEqual(arr1, arr2){
|
||||
return arr1.length === arr2.length && arr1.every((ele) => arr2.includes(ele));
|
||||
},
|
||||
//答题
|
||||
answerQues(op, index) {
|
||||
const falseList =storage.get('wrongList') || []
|
||||
const trueList =storage.get('rightList') || []
|
||||
if (!this.questionList[this.topicIndex].clickAnswer) {
|
||||
this.questionList[this.topicIndex].optionList[index].chooseOption = op
|
||||
this.questionList[this.topicIndex].clickAnswer = op
|
||||
this.questionList[this.topicIndex].optionList[index].chooseOption =`${this.questionList[this.topicIndex].optionList[index].chooseOption?this.questionList[this.topicIndex].optionList[index].chooseOption:''}${op}`
|
||||
this.questionList[this.topicIndex].clickAnswer = `${this.questionList[this.topicIndex].optionList[index].clickAnswer?this.questionList[this.topicIndex].optionList[index].clickAnswer:''}${op}`
|
||||
}
|
||||
if(this.tCurrent!==1){
|
||||
if(this.questionList[this.topicIndex].clickAnswer===this.questionList[this.topicIndex].rightOp){
|
||||
const arr1=this.questionList[this.topicIndex].clickAnswer.split('')
|
||||
const arr2=this.questionList[this.topicIndex].trueAnswer.split('')
|
||||
if(this.isArrEqual(arr1,arr2)){
|
||||
if(!this.rightList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
this.rightList.push(this.questionList[this.topicIndex].questionId)
|
||||
}
|
||||
console.log(this.rightList);
|
||||
if(!trueList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
trueList.push(this.questionList[this.topicIndex].questionId)
|
||||
storage.set('rightList',trueList)
|
||||
}
|
||||
if(this.wrongList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
const wIndex=this.wrongList.indexOf(this.questionList[this.topicIndex].questionId)
|
||||
this.wrongList.splice(wIndex,1)
|
||||
}
|
||||
if(falseList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
const wIndex=falseList.indexOf(this.questionList[this.topicIndex].questionId)
|
||||
falseList.splice(wIndex,1)
|
||||
storage.set('wrongList',falseList)
|
||||
}
|
||||
if(this.topicIndex<this.questionList.length-1){
|
||||
this.topicIndex ++;
|
||||
this.qIndex=this.topicIndex
|
||||
@@ -403,6 +441,15 @@ export default {
|
||||
if(!this.wrongList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
this.wrongList.push(this.questionList[this.topicIndex].questionId)
|
||||
}
|
||||
if(!falseList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
falseList.push(this.questionList[this.topicIndex].questionId)
|
||||
storage.set('wrongList',falseList)
|
||||
}
|
||||
if(trueList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
const rIndex=trueList.indexOf(this.questionList[this.topicIndex].questionId)
|
||||
trueList.splice(rIndex,1)
|
||||
storage.set('wrongList',trueList)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -411,312 +458,21 @@ export default {
|
||||
this.getQuestionList()
|
||||
this.renderSwiper(0)
|
||||
},
|
||||
getQuestionList() {
|
||||
this.questionList = [{
|
||||
questionId: 0,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第一题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'C',
|
||||
}, {
|
||||
questionId: 1,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第二题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'B',
|
||||
}, {
|
||||
questionId: 2,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第三题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
},
|
||||
{
|
||||
questionId: 3,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第四题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}, {
|
||||
questionId: 4,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第5题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
},
|
||||
{
|
||||
questionId: 5,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第6题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}, {
|
||||
questionId: 6,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第7题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}, {
|
||||
questionId: 7,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第8题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}, {
|
||||
questionId: 8,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第9题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'C',
|
||||
}, {
|
||||
questionId: 9,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第10题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'B',
|
||||
}, {
|
||||
questionId: 10,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第11题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
},
|
||||
{
|
||||
questionId: 11,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第12题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}, {
|
||||
questionId: 12,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第13题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
},
|
||||
{
|
||||
questionId: 13,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第14题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}, {
|
||||
questionId: 14,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第15题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
}, {
|
||||
questionId: 15,
|
||||
questionTypeDesc: '单选',
|
||||
questionDesc: '第16题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
|
||||
optionList: [{
|
||||
op: 'A',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'B',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'C',
|
||||
opDesc: '注意新手标志'
|
||||
}, {
|
||||
op: 'D',
|
||||
opDesc: '注意新手标志'
|
||||
}],
|
||||
rightOp: 'A',
|
||||
getQuestionList(val) {
|
||||
console.log(val);
|
||||
this.questionList=val.map(item=>{
|
||||
let isCollect=false
|
||||
if(this.collectList.includes(item.questionId)){
|
||||
isCollect=true
|
||||
}
|
||||
]
|
||||
if(this.tCurrent===1){
|
||||
this.questionList=this.questionList.map(item=>{
|
||||
return {
|
||||
...item,
|
||||
clickAnswer:item.rightOp
|
||||
isCollect:isCollect,
|
||||
...item
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- <u-navbar :title="navTitle" @rightClick="rightClick" :autoBack="true">
|
||||
</u-navbar> -->
|
||||
<j-navbar>{{navTitle}}</j-navbar>
|
||||
<Question :tabsList="tabsList" :isShowAll="true" />
|
||||
<Question ref="question" :tabsList="tabsList" :isShowAll="true"></Question>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -27,16 +27,21 @@
|
||||
},{
|
||||
label:"背题",
|
||||
value:1
|
||||
}]
|
||||
}],
|
||||
questionArr:[]
|
||||
}
|
||||
},
|
||||
onLoad(op) {
|
||||
if(op&&op.navTitle){
|
||||
this.navTitle=op.navTitle
|
||||
if(this.navTitle==='顺序答题'){
|
||||
this.questionArr=[...this.orderQuestion]
|
||||
this.$refs.question.getQuestionList(this.questionArr)
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["orderQuestionList"]) //映射函数,取出tagslist
|
||||
...mapState(useQuestionStore, ["orderQuestion"]) //映射函数,取出tagslist
|
||||
},
|
||||
methods: {
|
||||
rightClick() {
|
||||
|
||||
@@ -2,12 +2,18 @@
|
||||
<view>
|
||||
<sunny-video style="width: 100%" videoHeight="422rpx" ref="sunny-video" title="测试视频" src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4" @timeupdate="timeupdate" />
|
||||
<view class="p14 bc-fff">
|
||||
<u-scroll-list :indicator="false" v-if="videoType=='test'">
|
||||
<view class="flex ai-c jc-sb mt15">
|
||||
<view class="tab_iem mr15" :class="videoIndex===item.value?'checked_tab':''" v-for="(item,index) of testList" :key="index" @tap="checkTest(item.value)">{{item.label}}</view>
|
||||
</view>
|
||||
</u-scroll-list>
|
||||
<view class="flex ai-c jc-sb mt10 wp100">
|
||||
<text class="fs18 fw600 cor-000">C1捷达-基础操作视频讲解</text>
|
||||
<view class="flex" @tap="popupShow=true">
|
||||
<view class="flex" @tap="popupShow=true" v-if="videoType!='test'">
|
||||
<text class="fs14 cor-666">更多</text>
|
||||
<u-icon color="#666" name="arrow-right" size="18"></u-icon>
|
||||
</view>
|
||||
<view v-else class="fs14 cor-666">共9条路线</view>
|
||||
</view>
|
||||
<view>
|
||||
</view>
|
||||
@@ -53,6 +59,30 @@
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
videoIndex:0,
|
||||
testList:[{
|
||||
label:"八一考场",
|
||||
value:0,
|
||||
},{
|
||||
label:"富凯考场",
|
||||
value:1
|
||||
},{
|
||||
label:"新亚考场",
|
||||
value:2
|
||||
},{
|
||||
label:"庐江考场",
|
||||
value:3
|
||||
},{
|
||||
label:"富凯考场",
|
||||
value:4
|
||||
},{
|
||||
label:"新亚考场",
|
||||
value:5
|
||||
},{
|
||||
label:"庐江考场",
|
||||
value:6
|
||||
}],
|
||||
videoType:'',
|
||||
popupShow:false,
|
||||
nowVideo:0,
|
||||
videoList:[{
|
||||
@@ -82,7 +112,15 @@
|
||||
}]
|
||||
}
|
||||
},
|
||||
onLoad(op){
|
||||
if(op.type){
|
||||
this.videoType=op.type
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
checkTest(val){
|
||||
this.videoIndex=val
|
||||
},
|
||||
checkVideo(val){
|
||||
this.nowVideo=val
|
||||
}
|
||||
@@ -130,4 +168,17 @@
|
||||
background: #00B74F;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.tab_iem{
|
||||
width: 145rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
background: #F5F5F5;
|
||||
border-radius: 10rpx;
|
||||
color:#333
|
||||
}
|
||||
.checked_tab{
|
||||
background: linear-gradient(90deg, #11DF20 0%, #01B74F 100%);
|
||||
color:#fff
|
||||
}
|
||||
</style>
|
||||
BIN
src/static/image/index/green_bg.png
Normal file
BIN
src/static/image/index/green_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
src/static/image/index/orange_bg.png
Normal file
BIN
src/static/image/index/orange_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Reference in New Issue
Block a user