提交
@@ -4,11 +4,7 @@ import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
export default {
|
||||
onLaunch: function () {
|
||||
useUserStore().queryVipList()
|
||||
if(useQuestionStore().curSubject=='1'){
|
||||
useQuestionStore().getOrderQuestion_sub1()
|
||||
}else if(useQuestionStore().curSubject=='4'){
|
||||
useQuestionStore().getOrderQuestion_sub4()
|
||||
}
|
||||
useQuestionStore().getAllQuestion()
|
||||
if(useUserStore().isLogin) {
|
||||
useUserStore().getUserInfo()
|
||||
useUserStore().searchUserVip()
|
||||
|
||||
@@ -71,3 +71,33 @@ export function querySpecialNum(data) {
|
||||
noToken:true
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//获取题库版本
|
||||
export function getVersion(carTypeId) {
|
||||
return request({
|
||||
url: '/driver-api/tdQuestionVersion/currentVersion?carTypeId='+carTypeId,
|
||||
method: 'GET',
|
||||
noToken:true
|
||||
});
|
||||
}
|
||||
|
||||
//获取题目ID
|
||||
export function queryQuestionId(data) {
|
||||
return request({
|
||||
url: '/driver-api/tdQuestion/queryQuestionId',
|
||||
method: 'POST',
|
||||
data,
|
||||
noToken:true
|
||||
});
|
||||
}
|
||||
|
||||
//获取模拟考试ID
|
||||
export function getTestQuestionId(data) {
|
||||
return request({
|
||||
url: '/driver-api/tdQuestion/getTestQuestionId',
|
||||
method: 'POST',
|
||||
data,
|
||||
noToken:true
|
||||
});
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ function service(options = {}) {
|
||||
useUserStore().logout()
|
||||
//请求成功
|
||||
resolved(res.data);
|
||||
} else if(res.data.code != '0000') {
|
||||
} else if(res.data.code != '0000'&&res.data.code !='4001') {
|
||||
uni.showToast({
|
||||
title: res?.data?.message || '访问出错',
|
||||
icon: 'none'
|
||||
|
||||
@@ -3,7 +3,8 @@ import {
|
||||
} from 'pinia';
|
||||
import http from '@/jtools/request/index';
|
||||
import {
|
||||
queryQuestion
|
||||
queryQuestion,
|
||||
getVersion
|
||||
} from '@/jtools/api/question';
|
||||
import storage from '@/jtools/storage';
|
||||
|
||||
@@ -11,82 +12,212 @@ const question = defineStore({
|
||||
id: 'question',
|
||||
state: () => ({
|
||||
currentCartype: storage.get('carType') || '1001',
|
||||
orderQuestion_subject1: [], //科目一顺序做题
|
||||
orderQuestion_subject4:[],//科目二顺序做题
|
||||
orderQuestion_subject1:storage.get('question_subject1') || [], //科目一顺序做题
|
||||
orderQuestion_subject4:storage.get('question_subject4') ||[],//科目四顺序做题
|
||||
currentIndex_subject1:0,//科目一索引 顺序做题
|
||||
currentIndex_subject4:0,//科目四索引 顺序做题
|
||||
curSubject:storage.get('curSubject') || '1'
|
||||
curSubject:storage.get('curSubject') || '1',
|
||||
loading_subject1:false,
|
||||
loading_subject4:false,
|
||||
version:storage.get('version') || ''
|
||||
}),
|
||||
|
||||
actions: {
|
||||
getAllQuestion(){
|
||||
getVersion(this.currentCartype).then(resp=>{
|
||||
if(resp.code==='0000'){
|
||||
if(this.version!=resp.data){
|
||||
this.version=resp.data
|
||||
storage.set('version',resp.data)
|
||||
this.getOrderQuestion_sub1(true)
|
||||
this.getOrderQuestion_sub4(true)
|
||||
}else{
|
||||
this.getOrderQuestion_sub1()
|
||||
this.getOrderQuestion_sub4()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
divideArray(array, numChunks) {
|
||||
var chunkSize = Math.ceil(array.length / numChunks);
|
||||
var dividedArray = [];
|
||||
for (var i = 0; i < array.length; i += chunkSize) {
|
||||
dividedArray.push(array.slice(i, i + chunkSize));
|
||||
}
|
||||
return dividedArray;
|
||||
},
|
||||
|
||||
//改变当前科目
|
||||
changeSubject(val){
|
||||
this.curSubject=val
|
||||
storage.set('curSubject',val)
|
||||
},
|
||||
// 获取顺序做题科目1
|
||||
getOrderQuestion_sub1() {
|
||||
this.curSubject='1'
|
||||
storage.set('curSubject','1')
|
||||
if(!this.orderQuestion_subject1.length){
|
||||
queryQuestion({
|
||||
carTypeId: this.currentCartype,
|
||||
subject: '1',
|
||||
// questionIdList:[10982,10983,10985,10986]
|
||||
}).then(res => {
|
||||
if (res.code == '0000') {
|
||||
this.orderQuestion_subject1 = res.data
|
||||
const falseList =storage.get('wrongList_subject1') || []
|
||||
const trueList =storage.get('rightList_subject1')|| []
|
||||
const falseArr=[]
|
||||
const rightArr=[]
|
||||
this.orderQuestion_subject1.forEach(item=>{
|
||||
if(falseList.includes(item.questionId)){
|
||||
falseArr.push(item.questionId)
|
||||
}
|
||||
if(trueList.includes(item.questionId)){
|
||||
rightArr.push(item.questionId)
|
||||
getOrderQuestion_sub1(isUpdate) {
|
||||
if(isUpdate){
|
||||
this.loading_subject1=true
|
||||
queryQuestion({
|
||||
carTypeId: this.currentCartype,
|
||||
subject: '1',
|
||||
// questionIdList:[10982,10983,10985,10986]
|
||||
}).then(res => {
|
||||
if (res.code == '0000') {
|
||||
this.loading_subject1=false
|
||||
uni.showToast({
|
||||
title:'题库加载完成!'
|
||||
})
|
||||
this.orderQuestion_subject1 = res.data
|
||||
const diveList=this.divideArray(this.orderQuestion_subject1,5)
|
||||
uni.setStorageSync('questionOneSub1', diveList[0])
|
||||
uni.setStorageSync('questionOneSub2', diveList[1])
|
||||
uni.setStorageSync('questionOneSub3', diveList[2])
|
||||
uni.setStorageSync('questionOneSub4', diveList[3])
|
||||
uni.setStorageSync('questionOneSub5', diveList[4])
|
||||
const falseList =storage.get('wrongList_subject1') || []
|
||||
const trueList =storage.get('rightList_subject1')|| []
|
||||
const falseArr=[]
|
||||
const rightArr=[]
|
||||
this.orderQuestion_subject1.forEach(item=>{
|
||||
if(falseList.includes(item.questionId)){
|
||||
falseArr.push(item.questionId)
|
||||
}
|
||||
if(trueList.includes(item.questionId)){
|
||||
rightArr.push(item.questionId)
|
||||
}
|
||||
})
|
||||
storage.set('wrongList_subject1',falseArr)
|
||||
storage.set('rightList_subject1',rightArr)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
const list1 = uni.getStorageSync('questionOneSub1') || []
|
||||
const list2 = uni.getStorageSync('questionOneSub2') || []
|
||||
const list3 = uni.getStorageSync('questionOneSub3') || []
|
||||
const list4 = uni.getStorageSync('questionOneSub4') || []
|
||||
const list5 = uni.getStorageSync('questionOneSub5') || []
|
||||
this.orderQuestion_subject1=[...list1,...list2,...list3,...list4,...list5]
|
||||
if(this.orderQuestion_subject1&&this.orderQuestion_subject1.length){
|
||||
|
||||
}else{
|
||||
this.loading_subject1=true
|
||||
queryQuestion({
|
||||
carTypeId: this.currentCartype,
|
||||
subject: '1',
|
||||
// questionIdList:[10982,10983,10985,10986]
|
||||
}).then(res => {
|
||||
if (res.code == '0000') {
|
||||
this.loading_subject1=false
|
||||
uni.showToast({
|
||||
title:'题库加载完成!'
|
||||
})
|
||||
this.orderQuestion_subject1 = res.data
|
||||
const diveList=this.divideArray(this.orderQuestion_subject1,5)
|
||||
uni.setStorageSync('questionOneSub1', diveList[0])
|
||||
uni.setStorageSync('questionOneSub2', diveList[1])
|
||||
uni.setStorageSync('questionOneSub3', diveList[2])
|
||||
uni.setStorageSync('questionOneSub4', diveList[3])
|
||||
uni.setStorageSync('questionOneSub5', diveList[4])
|
||||
const falseList =storage.get('wrongList_subject1') || []
|
||||
const trueList =storage.get('rightList_subject1')|| []
|
||||
const falseArr=[]
|
||||
const rightArr=[]
|
||||
this.orderQuestion_subject1.forEach(item=>{
|
||||
if(falseList.includes(item.questionId)){
|
||||
falseArr.push(item.questionId)
|
||||
}
|
||||
if(trueList.includes(item.questionId)){
|
||||
rightArr.push(item.questionId)
|
||||
}
|
||||
})
|
||||
storage.set('wrongList_subject1',falseArr)
|
||||
storage.set('rightList_subject1',rightArr)
|
||||
}
|
||||
})
|
||||
storage.set('wrongList_subject1',falseArr)
|
||||
storage.set('rightList_subject1',rightArr)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取顺序做题科目4
|
||||
getOrderQuestion_sub4() {
|
||||
this.curSubject='4'
|
||||
storage.set('curSubject','4')
|
||||
if(!this.orderQuestion_subject4.length){
|
||||
queryQuestion({
|
||||
carTypeId: this.currentCartype,
|
||||
subject: '4',
|
||||
// questionIdList:[10982,10983,10985,10986]
|
||||
}).then(res => {
|
||||
if (res.code == '0000') {
|
||||
this.orderQuestion_subject4 = res.data
|
||||
const falseList =storage.get('wrongList_subject4') || []
|
||||
const trueList =storage.get('rightList_subject4')|| []
|
||||
const falseArr=[]
|
||||
const rightArr=[]
|
||||
this.orderQuestion_subject4.forEach(item=>{
|
||||
if(falseList.includes(item.questionId)){
|
||||
falseArr.push(item.questionId)
|
||||
}
|
||||
if(trueList.includes(item.questionId)){
|
||||
rightArr.push(item.questionId)
|
||||
getOrderQuestion_sub4(isUpdate) {
|
||||
if(isUpdate){
|
||||
this.loading_subject4=true
|
||||
queryQuestion({
|
||||
carTypeId: this.currentCartype,
|
||||
subject: '4',
|
||||
// questionIdList:[10982,10983,10985,10986]
|
||||
}).then(res => {
|
||||
if (res.code == '0000') {
|
||||
this.loading_subject4=false
|
||||
this.orderQuestion_subject4 = res.data
|
||||
const diveList=this.divideArray(this.orderQuestion_subject4,5)
|
||||
uni.setStorageSync('questionFourSub1', diveList[0])
|
||||
uni.setStorageSync('questionFourSub2', diveList[1])
|
||||
uni.setStorageSync('questionFourSub3', diveList[2])
|
||||
uni.setStorageSync('questionFourSub4', diveList[3])
|
||||
uni.setStorageSync('questionFourSub5', diveList[4])
|
||||
const falseList =storage.get('wrongList_subject4') || []
|
||||
const trueList =storage.get('rightList_subject4')|| []
|
||||
const falseArr=[]
|
||||
const rightArr=[]
|
||||
this.orderQuestion_subject4.forEach(item=>{
|
||||
if(falseList.includes(item.questionId)){
|
||||
falseArr.push(item.questionId)
|
||||
}
|
||||
if(trueList.includes(item.questionId)){
|
||||
rightArr.push(item.questionId)
|
||||
}
|
||||
})
|
||||
storage.set('wrongList_subject4',falseArr)
|
||||
storage.set('rightList_subject4',rightArr)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
const list1 = uni.getStorageSync('questionFourSub1') || []
|
||||
const list2 = uni.getStorageSync('questionFourSub2') || []
|
||||
const list3 = uni.getStorageSync('questionFourSub3') || []
|
||||
const list4 = uni.getStorageSync('questionFourSub4') || []
|
||||
const list5 = uni.getStorageSync('questionFourSub5') || []
|
||||
this.orderQuestion_subject4=[...list1,...list2,...list3,...list4,...list5]
|
||||
if(this.orderQuestion_subject4&&this.orderQuestion_subject4.length){
|
||||
|
||||
}else{
|
||||
this.loading_subject4=true
|
||||
queryQuestion({
|
||||
carTypeId: this.currentCartype,
|
||||
subject: '4',
|
||||
// questionIdList:[10982,10983,10985,10986]
|
||||
}).then(res => {
|
||||
if (res.code == '0000') {
|
||||
this.loading_subject4=false
|
||||
this.orderQuestion_subject4 = res.data
|
||||
const diveList=this.divideArray(this.orderQuestion_subject4,5)
|
||||
uni.setStorageSync('questionFourSub1', diveList[0])
|
||||
uni.setStorageSync('questionFourSub2', diveList[1])
|
||||
uni.setStorageSync('questionFourSub3', diveList[2])
|
||||
uni.setStorageSync('questionFourSub4', diveList[3])
|
||||
uni.setStorageSync('questionFourSub5', diveList[4])
|
||||
const falseList =storage.get('wrongList_subject4') || []
|
||||
const trueList =storage.get('rightList_subject4')|| []
|
||||
const falseArr=[]
|
||||
const rightArr=[]
|
||||
this.orderQuestion_subject4.forEach(item=>{
|
||||
if(falseList.includes(item.questionId)){
|
||||
falseArr.push(item.questionId)
|
||||
}
|
||||
if(trueList.includes(item.questionId)){
|
||||
rightArr.push(item.questionId)
|
||||
}
|
||||
})
|
||||
storage.set('wrongList_subject4',falseArr)
|
||||
storage.set('rightList_subject4',rightArr)
|
||||
}
|
||||
})
|
||||
storage.set('wrongList_subject4',falseArr)
|
||||
storage.set('rightList_subject4',rightArr)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
//获取索引
|
||||
getCurrentIndex(index,val){
|
||||
this[`currentIndex_subject${val}`]=index
|
||||
console.log(`currentIndex_subject${val}`,this[`currentIndex_subject${val}`]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
{
|
||||
"path": "pages/me/tijian",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的体检",
|
||||
"navigationBarTitleText": "上传证件照",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
@@ -151,6 +151,13 @@
|
||||
"navigationBarTitleText": "上传证件照",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/secretPapers",
|
||||
"style": {
|
||||
"navigationBarTitleText": "考前密卷",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@@ -162,7 +169,7 @@
|
||||
},
|
||||
"tabBar": {
|
||||
"borderStyle": "white",
|
||||
"selectedColor": "#333333",
|
||||
"selectedColor": "#05C341",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"color": "#999999",
|
||||
"list": [{
|
||||
|
||||
@@ -1,28 +1,33 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="box-nav">
|
||||
<image style="width: 100%;" src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E9%A6%96%E9%A1%B5_20230830213855.png"></image>
|
||||
<image style="width: 100%;"
|
||||
src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E9%A6%96%E9%A1%B5_20230830213855.png">
|
||||
</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 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;">
|
||||
<view class="fs16">顺序练习</view>
|
||||
<text class="fs14">{{getDoNum}}/{{subject=='1'?orderQuestion_subject1.length:orderQuestion_subject4.length}}</text>
|
||||
</view>
|
||||
<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;">
|
||||
<view class="fs16">顺序练习</view>
|
||||
<text
|
||||
class="fs14">{{getDoNum}}/{{subject=='1'?orderQuestion_subject1.length:orderQuestion_subject4.length}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box-item flex ai-c jc-c">
|
||||
<view class="flex jc-c ai-c relative" style="width: 230rpx;height: 230rpx;" @tap="toExams('title=模拟考试')">
|
||||
<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;">
|
||||
<view class="fs16">模拟考试</view>
|
||||
<text class="fs14">去考试</text>
|
||||
</view>
|
||||
<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;">
|
||||
<view class="fs16">模拟考试</view>
|
||||
<text class="fs14">去考试</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -31,46 +36,43 @@
|
||||
<view class="tabs-box">
|
||||
<view class="wp33 flex ai-c jc-c" @tap="toVip">
|
||||
<view class="text-center wp100">
|
||||
<image style="width: 72rpx;height: 72rpx;margin: 0 auto"
|
||||
src="../../static/image/index/vipicon.png">
|
||||
<image style="width: 72rpx;height: 72rpx;margin: 0 auto" src="../../static/image/index/vipicon.png">
|
||||
</image>
|
||||
<view class="mt5">VIP课程</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wp33 flex ai-c jc-c" @tap="toAnswer('精简500题',true)">
|
||||
<view class="wp33 flex ai-c jc-c" @tap="toAnswer('精简500题',true)">
|
||||
<view class="text-center wp100">
|
||||
<image style="width: 72rpx;height: 72rpx;margin: 0 auto"
|
||||
src="../../static/image/index/500icon.png">
|
||||
<image style="width: 72rpx;height: 72rpx;margin: 0 auto" src="../../static/image/index/500icon.png">
|
||||
</image>
|
||||
<view class="mt5">精简500题</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wp33 flex ai-c jc-c" @tap="toExclusive">
|
||||
<view class="text-center wp100">
|
||||
<image style="width: 72rpx;height: 72rpx;margin: 0 auto"
|
||||
src="../../static/image/index/zxicon.png">
|
||||
<image style="width: 72rpx;height: 72rpx;margin: 0 auto" src="../../static/image/index/zxicon.png">
|
||||
</image>
|
||||
<view class="mt5">专项练习</view>
|
||||
</view>
|
||||
</view>
|
||||
<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>
|
||||
<image style="width: 72rpx;height: 72rpx;margin: 0 auto;" src="../../static/image/index/realicon.png">
|
||||
</image>
|
||||
<view class="mt5">真实考场模拟</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wp33 flex ai-c jc-c" @tap="toExams('title=考前密卷&isExam1=1')">
|
||||
<view class="wp33 flex ai-c jc-c" @tap="toExams('考前秘卷')">
|
||||
<view class="text-center wp100">
|
||||
<image style="width: 72rpx;height: 72rpx;margin: 0 auto"
|
||||
src="../../static/image/index/testbeforeicon.png"></image>
|
||||
<view class="mt5">考前密卷</view>
|
||||
<image style="width: 72rpx;height: 72rpx;margin: 0 auto" src="../../static/image/index/testbeforeicon.png">
|
||||
</image>
|
||||
<view class="mt5">考前秘卷</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wp33 flex ai-c jc-c" @tap="toWrongList">
|
||||
<view class="text-center wp100">
|
||||
<image style="width: 72rpx;height: 72rpx;margin: 0 auto"
|
||||
src="../../static/image/index/worryicon.png"></image>
|
||||
<image style="width: 72rpx;height: 72rpx;margin: 0 auto" src="../../static/image/index/worryicon.png">
|
||||
</image>
|
||||
<view class="mt5">错题收藏</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -80,7 +82,7 @@
|
||||
<view class="video-box">
|
||||
<view class="flex jc-sb ai-c wp100">
|
||||
<text style="color: #05C341;font-size: 36rpx;">科{{subject==1?'一':'四'}}精品视频课</text>
|
||||
<text class="cor-666 fs12">全部10节课 ></text>
|
||||
<!-- <text class="cor-666 fs12">全部10节课 ></text> -->
|
||||
</view>
|
||||
<view class="flex ai-c mt20">
|
||||
<view class="contain-box relative">
|
||||
@@ -88,66 +90,108 @@
|
||||
<image class="play_btn_2" src="../../static/image/index/play.png" />
|
||||
</view>
|
||||
<view class="ml15 text-center">
|
||||
<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 :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">科{{subject==1?'一':'四'}}易错试题</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState,mapActions } from 'pinia' //引入映射函数
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
} from 'pinia' //引入映射函数
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
import storage from '@/jtools/storage';
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
import {
|
||||
queryQuestionId,
|
||||
getTestQuestionId
|
||||
} from '@/jtools/api/question';
|
||||
export default {
|
||||
props:{
|
||||
subject:{
|
||||
type:[String,Number],
|
||||
props: {
|
||||
subject: {
|
||||
type: [String, Number],
|
||||
},
|
||||
rightList:{
|
||||
type:Array
|
||||
rightList: {
|
||||
type: Array
|
||||
},
|
||||
wrongList:{
|
||||
type:Array
|
||||
wrongList: {
|
||||
type: Array
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
allQuestionNum:0,
|
||||
allQuestionNum: 0,
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
mounted() {
|
||||
|
||||
},
|
||||
computed: {
|
||||
...mapState(useUserStore, ["vipOnList", "token"]),
|
||||
...mapState(useQuestionStore, ["orderQuestion_subject1","orderQuestion_subject4"]) ,//映射函数,取出tagslist
|
||||
getDoNum(){
|
||||
return this.rightList.length+this.wrongList.length
|
||||
...mapState(useQuestionStore, ["orderQuestion_subject1", "orderQuestion_subject4", "version"]), //映射函数,取出tagslist
|
||||
getDoNum() {
|
||||
return this.rightList.length + this.wrongList.length
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useUserStore, ['searchUserVip']),
|
||||
async toTestRoom(){
|
||||
...mapActions(useQuestionStore, ['getOrderQuestion_sub1', 'getOrderQuestion_sub4', 'getAllQuestion']),
|
||||
async toTestRoom() {
|
||||
// uni.navigateTo({
|
||||
// url:"/pages/index/trueTest"
|
||||
// })
|
||||
if (this.token) {
|
||||
await this.searchUserVip()
|
||||
const res = this.vipOnList.some(item => item.subjects == this.subject)
|
||||
const res = this.vipOnList.some(item => item.subjects.includes(this.subject))
|
||||
if (!res) {
|
||||
uni.navigateTo({
|
||||
url:"/pages/index/videoVip?subject="+this.subject
|
||||
url: "/pages/index/videoVip?subject=" + this.subject
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
getTestQuestionId({
|
||||
versionId: this.version,
|
||||
carTypeId: storage.get('carType') || '1001',
|
||||
subject: this.subject,
|
||||
}).then(async (resp) => {
|
||||
if (resp.code === '0000') {
|
||||
const arr = resp.data
|
||||
const listJson = JSON.stringify(arr)
|
||||
uni.navigateTo({
|
||||
url: "/pages/index/trueTest?subject="+ this.subject + "&questionIdList=" + listJson
|
||||
})
|
||||
} else if (resp.code === '4001') {
|
||||
uni.showToast({
|
||||
title: '当前题库非最新版,请更新~',
|
||||
icon: 'none'
|
||||
})
|
||||
this.getAllQuestion()
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
},
|
||||
async toVip() {
|
||||
if (this.token) {
|
||||
await this.searchUserVip()
|
||||
const res = this.vipOnList.some(item => item.subjects.includes(this.subject))
|
||||
if (!res) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/index/trueTest?subject="+this.subject
|
||||
url: "/pages/index/videoVip?subject=" + this.subject
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/me/vip"
|
||||
})
|
||||
}
|
||||
} else {
|
||||
@@ -156,61 +200,143 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
toVip(){
|
||||
// if(storage.get('token')){
|
||||
// uni.navigateTo({
|
||||
// url:"/pages/index/videoVip?subject="+this.subject
|
||||
// })
|
||||
// }else{
|
||||
// uni.navigateTo({
|
||||
// url:'/pages/login/login'
|
||||
// })
|
||||
// }
|
||||
toClass() {
|
||||
uni.showToast({
|
||||
title:'敬请期待',
|
||||
icon:'none'
|
||||
title: '敬请期待',
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
toClass(){
|
||||
uni.showToast({
|
||||
title:'敬请期待',
|
||||
icon:'none'
|
||||
})
|
||||
},
|
||||
toAnswer(title,val) {
|
||||
if(title=='精简500题'){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle="+title+"&subject="+this.subject+"&needVip="+val+"&isVip=1"
|
||||
toAnswer(title, val) {
|
||||
if (title == '精简500题') {
|
||||
queryQuestionId({
|
||||
versionId: this.version,
|
||||
carTypeId: storage.get('carType') || '1001',
|
||||
subject: this.subject,
|
||||
isVip: '1'
|
||||
}).then(async (resp) => {
|
||||
if (resp.code === '0000') {
|
||||
if (this.token) {
|
||||
await this.searchUserVip()
|
||||
const result = this.vipOnList.some(item => item.subjects.includes(this.subject))
|
||||
if (result) {
|
||||
const listJson = JSON.stringify(resp.data)
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/questionBank?navTitle=" + title + "&subject=" + this.subject +
|
||||
"&needVip=" + result + "&questionIdList=" + listJson
|
||||
})
|
||||
} 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({
|
||||
url: "/pages/questionBank/questionBank?navTitle=" + title + "&subject=" + this.subject +
|
||||
"&needVip=" + result + "&questionIdList=" + listJson
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
} else if (resp.code === '4001') {
|
||||
uni.showToast({
|
||||
title: '当前题库非最新版,请更新~',
|
||||
icon: 'none'
|
||||
})
|
||||
this.getAllQuestion()
|
||||
}
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle="+title+"&subject="+this.subject+"&needVip="+val
|
||||
url: "/pages/questionBank/questionBank?navTitle=" + title + "&subject=" + this.subject + "&needVip=" +
|
||||
val
|
||||
})
|
||||
}
|
||||
},
|
||||
toExams(val){
|
||||
if(storage.get('token')){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/practiceExams?subject="+this.subject+'&'+val
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
toExclusive(){
|
||||
toExams(title) {
|
||||
if (storage.get('token')) {
|
||||
if(title=='模拟考试'){
|
||||
getTestQuestionId({
|
||||
versionId: this.version,
|
||||
carTypeId: storage.get('carType') || '1001',
|
||||
subject: this.subject,
|
||||
}).then(async (resp) => {
|
||||
if (resp.code === '0000') {
|
||||
const arr = resp.data
|
||||
const listJson = JSON.stringify(arr)
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/practiceExams?title=" + title + "&subject=" + this.subject + "&questionIdList=" + listJson
|
||||
})
|
||||
} else if (resp.code === '4001') {
|
||||
uni.showToast({
|
||||
title: '当前题库非最新版,请更新~',
|
||||
icon: 'none'
|
||||
})
|
||||
this.getAllQuestion()
|
||||
}
|
||||
})
|
||||
}else if(title=='考前秘卷'){
|
||||
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()
|
||||
const result = this.vipOnList.some(item => item.subjects.includes(this.subject))
|
||||
if (result) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/index/secretPapers?subject=" + this.subject
|
||||
})
|
||||
} 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({
|
||||
url: "/pages/questionBank/practiceExams?title=" + title + "&subject=" + this.subject + "&questionIdList=" + listJson+"&needVip="+result
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
} else if (resp.code === '4001') {
|
||||
uni.showToast({
|
||||
title: '当前题库非最新版,请更新~',
|
||||
icon: 'none'
|
||||
})
|
||||
this.getAllQuestion()
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/exclusiveExercise?subject="+this.subject
|
||||
})
|
||||
},
|
||||
toWrongList(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/wrongQuestion?subject="+this.subject
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
toExclusive() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/exclusiveExercise?subject=" + this.subject
|
||||
})
|
||||
},
|
||||
toWrongList() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/wrongQuestion?subject=" + this.subject
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -280,6 +406,7 @@
|
||||
background: #00B74F;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.play_btn_2 {
|
||||
width: 65rpx;
|
||||
height: 65rpx;
|
||||
@@ -287,4 +414,4 @@
|
||||
left: 165.5rpx;
|
||||
top: 78rpx
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -12,10 +12,10 @@
|
||||
<view class="video_box">
|
||||
<view class="flex ai-c jc-sb mt5">
|
||||
<text class="fs18 cor-000">科{{subject=='2'?'二':'三'}}考试项目讲解</text>
|
||||
<view class="flex ai-c" style="height: 34rpx;line-height: 34rpx;" @tap="changeDiverType">
|
||||
<!-- <view class="flex ai-c" style="height: 34rpx;line-height: 34rpx;" @tap="changeDiverType">
|
||||
<text style="color:#05C341;font-size: 16px;">{{diverTypeList[diverTypeIndex]?.configItemName}}</text>
|
||||
<u-icon name="list" color="#05C341" size="18"></u-icon>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="skill-sequence-panel-content-wrapper">
|
||||
<scroll-view class="skill-sequence-panel-content" scroll-x :scroll-into-view="intoindex">
|
||||
@@ -49,8 +49,8 @@
|
||||
</view>
|
||||
<view class="flex p14lr p20tb bc-fff" style="border-bottom: 1rpx solid #DDDCDC;"
|
||||
v-for="(item,index) of videoList" :key="index" @click="toOperateDetail(item.videoId)">
|
||||
<view class="pic relative" style="overflow: hidden;">
|
||||
<image class="pic" mode="widthFix" :src="item.videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image>
|
||||
<view class="pic relative hide" style="overflow: hidden;">
|
||||
<image class="pic" style="position: absolute;left: 0;top: 0;" mode="widthFix" :src="item.videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image>
|
||||
<image class="play_btn_3" src="../../static/image/index/play.png" />
|
||||
</view>
|
||||
<view class="ml10">
|
||||
@@ -105,7 +105,7 @@
|
||||
async toVipVideo(){
|
||||
if (this.token) {
|
||||
await this.searchUserVip()
|
||||
const res = this.vipOnList.some(item => item.subjects == this.subject)
|
||||
const res = this.vipOnList.some(item => item.subjects.includes(this.subject))
|
||||
if (!res) {
|
||||
uni.navigateTo({
|
||||
url:"/pages/index/videoVip?subject="+this.subject
|
||||
@@ -132,7 +132,6 @@
|
||||
queryProjectList({
|
||||
"carTypeId": storage.get('carType') || '1001',
|
||||
"subject": String(this.subject),
|
||||
"driveType": this.diverTypeList[this.diverTypeIndex].configItemCode,
|
||||
"type": "2"
|
||||
}).then(resp => {
|
||||
if (resp.code === '0000') {
|
||||
@@ -183,7 +182,7 @@
|
||||
getVideoList() {
|
||||
queryProjectList({
|
||||
"carTypeId": storage.get('carType') || '1001',
|
||||
"driveType": this.diverTypeList[this.diverTypeIndex].configItemCode,
|
||||
"driveType": '2',
|
||||
"subject": String(this.subject),
|
||||
"type": "1"
|
||||
}).then(resp => {
|
||||
@@ -301,4 +300,4 @@
|
||||
-webkit-backface-visibility: hidden;
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -1,21 +1,26 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-sticky bgColor="#fff">
|
||||
<u-tabs :list="categoryList" :current="curTab" :scrollable="false" @change="changeCategory"></u-tabs>
|
||||
</u-sticky>
|
||||
<u-loading-page :loading="getLoading" loading-text="题库更新中..."></u-loading-page>
|
||||
<view v-if="!getLoading">
|
||||
<u-sticky bgColor="#fff">
|
||||
<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="subject=='1' || subject=='4'">
|
||||
<Subject1 :subject="subject" :rightList="rightList" :wrongList="wrongList" />
|
||||
<Subject1 :subject="subject" :rightList="rightList" :wrongList="wrongList" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<Subject2 :subject="subject" ref="subjectRef" />
|
||||
</template>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState,mapActions } from 'pinia' //引入映射函数
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
} from 'pinia' //引入映射函数
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
import storage from '@/jtools/storage';
|
||||
import {
|
||||
@@ -23,70 +28,74 @@
|
||||
} from '@/jtools/api/question';
|
||||
import Subject1 from "./components/Subject1";
|
||||
import Subject2 from "./components/Subject2";
|
||||
export default {
|
||||
components: {Subject1,Subject2},
|
||||
data() {
|
||||
export default {
|
||||
components: {
|
||||
Subject1,
|
||||
Subject2
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
subject:storage.get('curSubject') || '1',
|
||||
curTab:Number(storage.get('curSubject'))-1,
|
||||
searchValue:'',
|
||||
cityName:'',
|
||||
categoryList:[],
|
||||
rightList:storage.get(`rightList_subject${this.subject}`) || [],
|
||||
wrongList:storage.get(`wrongList_subject${this.subject}`) || [],
|
||||
subject: storage.get('curSubject') || '1',
|
||||
curTab: 0,
|
||||
searchValue: '',
|
||||
cityName: '',
|
||||
categoryList: [],
|
||||
rightList: storage.get(`rightList_subject${this.subject}`) || [],
|
||||
wrongList: storage.get(`wrongList_subject${this.subject}`) || [],
|
||||
};
|
||||
},
|
||||
onLoad(){
|
||||
onLoad() {
|
||||
this.curTab=Number(this.curSubject)-1
|
||||
this.getSubjectConfig()
|
||||
},
|
||||
onShow() {
|
||||
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']),
|
||||
onShow() {
|
||||
if (this.subject == '1' || this.subject == '4') {
|
||||
this.rightList = storage.get(`rightList_subject${this.subject}`) || []
|
||||
this.wrongList = storage.get(`wrongList_subject${this.subject}`) || []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1","curSubject"]), //映射函数,取出tagslist
|
||||
getLoading() {
|
||||
return this.loading_subject4 && this.loading_subject1
|
||||
}
|
||||
},
|
||||
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{
|
||||
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
|
||||
name: item.configItemName
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
//切换科目
|
||||
async changeCategory(val){
|
||||
this.subject=val.configItemCode
|
||||
console.log();
|
||||
if(this.subject=='1'){
|
||||
await this.getOrderQuestion_sub1()
|
||||
}else if(this.subject=='4'){
|
||||
await this.getOrderQuestion_sub4()
|
||||
}else{
|
||||
//切换科目
|
||||
async changeCategory(val) {
|
||||
this.subject = val.configItemCode
|
||||
this.changeSubject(this.subject)
|
||||
setTimeout(()=>{
|
||||
this.$refs.subjectRef.getDiverType()
|
||||
},100)
|
||||
}
|
||||
if(this.subject=='1'||this.subject=='4'){
|
||||
this.rightList=storage.get(`rightList_subject${this.subject}`) || []
|
||||
this.wrongList=storage.get(`wrongList_subject${this.subject}`) || []
|
||||
}
|
||||
},
|
||||
if (this.subject == '1' || this.subject == '4') {
|
||||
this.rightList = storage.get(`rightList_subject${this.subject}`) || []
|
||||
this.wrongList = storage.get(`wrongList_subject${this.subject}`) || []
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.$refs.subjectRef.getDiverType()
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .u-tabs__wrapper__nav__line {
|
||||
::v-deep .u-tabs__wrapper__nav__line {
|
||||
background: linear-gradient(90deg, #11DF20 0%, #00B74F 100%) !important;
|
||||
bottom: 14rpx !important;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
139
src/pages/index/secretPapers.vue
Normal file
@@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-loading-page :loading="getLoading" loading-text="题库更新中..."></u-loading-page>
|
||||
<view class="relative" v-if="!getLoading"
|
||||
style="width: 100%;background-image: url(https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E8%80%83%E5%89%8D%E5%AF%86%E5%8D%B7_20230904212623.png);background-size: 100% 100%;height: 100vh;">
|
||||
<view style="position: absolute;top: 320px;" class="wp100 p35lr flex jc-sb ai-c">
|
||||
<view class="paper_item" @tap="toExam({isExam1:'1'})">
|
||||
<view class="topTitle">
|
||||
秘卷一
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<text class="wenzi">新规考点提炼</text>
|
||||
<view class="wp100 p5 mt15">
|
||||
<view class="btn">
|
||||
去考试
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="paper_item" @tap="toExam({isExam2:'1'})">
|
||||
<view class="topTitle">
|
||||
秘卷二
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<text class="wenzi">精选高频考试</text>
|
||||
<view class="wp100 p5 mt15">
|
||||
<view class="btn">
|
||||
去考试
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
} from 'pinia' //引入映射函数
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
import storage from '@/jtools/storage';
|
||||
import {
|
||||
queryQuestionId,
|
||||
getTestQuestionId
|
||||
} from '@/jtools/api/question';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
subject:'1'
|
||||
}
|
||||
},
|
||||
onLoad(op){
|
||||
if(op.subject){
|
||||
this.subject=op.subject
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1", "curSubject","version"]), //映射函数,取出tagslist
|
||||
getLoading() {
|
||||
return this.loading_subject4 && this.loading_subject1
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useQuestionStore, ['getOrderQuestion_sub4', 'getOrderQuestion_sub1', 'changeSubject']),
|
||||
toExam(param) {
|
||||
queryQuestionId({
|
||||
versionId: this.version,
|
||||
carTypeId: storage.get('carType') || '1001',
|
||||
subject: this.subject,
|
||||
...param
|
||||
}).then(async (resp) => {
|
||||
if (resp.code === '0000') {
|
||||
const arr = resp.data
|
||||
const listJson = JSON.stringify(arr)
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/practiceExams?title=考前秘卷&subject=" + this.subject + "&questionIdList=" + listJson
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.paper_item {
|
||||
width: 287rpx;
|
||||
height: 320rpx;
|
||||
/* border: 4px solid #F8A42C; */
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.topTitle {
|
||||
width: 100%;
|
||||
height: 85rpx;
|
||||
line-height: 85rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(90deg, #E66501 0%, #F8A42C 100%);
|
||||
border-radius: 16rpx 16rpx 0rpx 0rpx;
|
||||
font-size: 48rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
padding-top: 15px;
|
||||
width: 100%;
|
||||
height: 235rpx;
|
||||
border-radius: 0rpx 0rpx 16rpx 16rpx;
|
||||
border-bottom: 4px solid #F8A42C;
|
||||
border-left: 4px solid #F8A42C;
|
||||
border-right: 4px solid #F8A42C;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wenzi {
|
||||
font-size: 40rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 600;
|
||||
color: #7D4310;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 246rpx;
|
||||
height: 76rpx;
|
||||
text-align: center;
|
||||
line-height: 76rpx;
|
||||
color: #fff;
|
||||
background: linear-gradient(0deg, #E66501 0%, #F8A42C 100%);
|
||||
box-shadow: 0rpx 2rpx 21rpx 0rpx #F7A12A;
|
||||
border-radius: 38rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -91,6 +91,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
} from 'pinia' //引入映射函数
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
import {
|
||||
getTestQuestion,
|
||||
@@ -100,13 +105,14 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
subject: 1,
|
||||
subject:'1',
|
||||
questionIndex: 1,
|
||||
list: [],
|
||||
mutiAns: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["orderQuestion_subject1", "orderQuestion_subject4", "version"]), //映射函数,取出tagslis
|
||||
user() {
|
||||
return useUserStore().userInfo
|
||||
},
|
||||
@@ -126,7 +132,14 @@
|
||||
},
|
||||
onLoad(option) {
|
||||
this.subject = option.subject || 1
|
||||
this._getList()
|
||||
if(option.questionIdList){
|
||||
const idList=JSON.parse(op.questionIdList)
|
||||
let arr = this[`orderQuestion_subject${this.subject}`].filter(qItem=>idList.includes(qItem.questionId))
|
||||
this.list = arr.map(it => ({
|
||||
...it,
|
||||
yourAnswer: ''
|
||||
}))
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fz() {
|
||||
@@ -134,19 +147,19 @@
|
||||
orientation: 'landscape'
|
||||
});
|
||||
},
|
||||
_getList() {
|
||||
getTestQuestion({
|
||||
carTypeId: storage.get('carType') || '1001',
|
||||
subject: this.subject
|
||||
}).then(resp => {
|
||||
if (resp.code === '0000') {
|
||||
this.list = resp.data.map(it => ({
|
||||
...it,
|
||||
yourAnswer: ''
|
||||
}))
|
||||
}
|
||||
})
|
||||
},
|
||||
// _getList() {
|
||||
// getTestQuestion({
|
||||
// carTypeId: storage.get('carType') || '1001',
|
||||
// subject: this.subject
|
||||
// }).then(resp => {
|
||||
// if (resp.code === '0000') {
|
||||
// this.list = resp.data.map(it => ({
|
||||
// ...it,
|
||||
// yourAnswer: ''
|
||||
// }))
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
handleAnswer(index) {
|
||||
// 如果是多选
|
||||
let q = this.list[this.questionIndex - 1]
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
color:#fff
|
||||
}
|
||||
.tag{
|
||||
width: 122rpx;
|
||||
padding:0 5px;
|
||||
height: 36rpx;
|
||||
background: linear-gradient(90deg, #E66501 0%, #F8A42C 100%);
|
||||
border-radius: 8rpx 20rpx 8rpx 8rpx;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="header">
|
||||
<image src="/static/image/login/logo.jpg" mode="widthFix"></image>
|
||||
<view class="mt21 fs16 cor-333 fwb text-center">欢迎使用金联武驾考!</view>
|
||||
<image 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 class="mt21 fs16 cor-333 fwb text-center">欢迎使用金武联驾考!</view>
|
||||
</view>
|
||||
|
||||
<view class="list">
|
||||
@@ -82,6 +82,8 @@
|
||||
if(isPhone(this.login.phone) && this.login.code) {
|
||||
useUserStore().login(this.login).then(resp => {
|
||||
if(resp.userId) {
|
||||
useUserStore().getUserInfo()
|
||||
useUserStore().searchUserVip()
|
||||
this.toHome()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<view class="bc-f5">
|
||||
<!-- <view class="wp100" style="background-color: #333;height: 205px;"></view> -->
|
||||
<view class="relative" style="height: 205px;">
|
||||
<image src="/static/image/mine/mine_bg.png" mode="widthFix" style="width: 100%;"></image>
|
||||
<image src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/vip%E8%83%8C%E6%99%AF%E7%BB%BF_20230831010645.png" mode="widthFix" style="width: 100%;"></image>
|
||||
<view class="info flex ai-c" v-if="isLogin">
|
||||
<u-avatar class="br-p50 overflow-h" :size="64" mp-avatar shape="circle"></u-avatar>
|
||||
<view class="ml12">
|
||||
<view class="flex ai-c fs18 cor-333 fwb">
|
||||
<text class="mr10">{{ user.userName }}{{ user.userId }}</text>
|
||||
<image v-if="vipOn.length" src="/static/image/mine/vip.png" mode="widthFix" style="width: 18px;"></image>
|
||||
<image v-if="vipOn.length" src="../../static/image/mine/vip.png" mode="widthFix" style="width: 18px;"></image>
|
||||
</view>
|
||||
<view class="mt5 fs14 cor-666">陪您学车 第{{ user.days }}天</view>
|
||||
</view>
|
||||
@@ -25,7 +25,7 @@
|
||||
</view>
|
||||
<view class="p15lr" style="transform: translateY(-90px);">
|
||||
<view class="relative mb10" @tap="handleVip">
|
||||
<image src="/static/image/mine/vip_bg.png" mode="widthFix" style="width: 100%;"></image>
|
||||
<image src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/vip%E8%83%8C%E6%99%AF%E9%BB%841_20230831010645.png" mode="widthFix" style="width: 100%;"></image>
|
||||
<view class="absolute p15lr p10tb flex ai-c jc-sb" style="left: 0;top: 0;right: 0;height: 40px;">
|
||||
<view class="flex ai-c">
|
||||
<view class="p3 br-p50" style="background-color: #873E1D;">
|
||||
|
||||
@@ -11,10 +11,6 @@
|
||||
<view class="m30lr fs14 cor-333 fl1">安徽省合肥市包河区</view>
|
||||
<u-icon name="arrow-right" color="#999" />
|
||||
</view>
|
||||
<view class="flex ai-c wp100" style="height: 110rpx;" @tap="toUpload">
|
||||
<view class="fs14 cor-666 fl1">证件照上传</view>
|
||||
<u-icon name="arrow-right" color="#999" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -27,11 +23,6 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toUpload(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/me/uploadPic"
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,42 +1,222 @@
|
||||
<template>
|
||||
<view class="p15 bc-f5">
|
||||
<view class="br8 bc-fff p15lr">
|
||||
<view class="flex ai-c bb1" style="height: 110rpx;">
|
||||
<view class="title">体检结果</view>
|
||||
<view class="ml30 fs14 cor-333 fl1">通过</view>
|
||||
</view>
|
||||
<view class="flex ai-c" style="height: 110rpx;">
|
||||
<view class="title">体检时间</view>
|
||||
<view class="ml30 fs14 cor-333 fl1">2023-08-10 14:35:23</view>
|
||||
</view>
|
||||
<view class="flex ai-fs" style="height: 110rpx;">
|
||||
<view class="title">体检时间</view>
|
||||
<image class="ml30" src="/static/image/mine/tijian.png" style="width: 333rpx;" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="wp100 bc-fff p14">
|
||||
<view class="title fontColor">第一步 上传学员图像</view>
|
||||
<view class="mt15">
|
||||
<!-- <u-upload width="165" height="165" :file-list=" fileList1" multiple :max-count="1" @afterRead="afterRead" @delete="deletePic" /> -->
|
||||
<!-- <u-upload ref="uUpload" class="mt25" :size-type="['compressed']" :file-list="fileList1" deletable :multiple="false" :max-count="1" width="165rpx" height="165rpx" @afterRead="afterRead" @delete="deletePic" /> -->
|
||||
<view style="width: 320rpx;height:300rpx;background-color: rgb(247, 255, 255);border-radius: 20rpx;">
|
||||
<view style="width: 320rpx;height:240rpx;" class="flex jc-c ai-c">
|
||||
<image v-if="fileList&&fileList.length" style="width: 240rpx;height: 240rpx;" :src="fileList[0].url">
|
||||
</image>
|
||||
<u-avatar v-else class="br-p50 overflow-h" :size="64" mp-avatar shape="circle"></u-avatar>
|
||||
</view>
|
||||
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="1" width="150"
|
||||
height="150">
|
||||
<view
|
||||
style="width: 320rpx;height:60rpx;line-height:60rpx;background-color: #05C341;border-radius: 0 0 20rpx 20rpx;"
|
||||
class="text-center cor-fff">
|
||||
点击
|
||||
</view>
|
||||
</u-upload>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt20">
|
||||
<view class="title fontColor">第二步 核实后再提交</view>
|
||||
<u--form labelPosition="left" labelWidth="80" :model="form" :rules="rules" ref="form1">
|
||||
<u-form-item label="姓名" :required="true" prop="name" borderBottom ref="item1">
|
||||
<u--input v-model="form.name" border="none"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="身份证号" :required="true" prop="idNum" borderBottom ref="item2">
|
||||
<u--input v-model="form.idNum" border="none"></u--input>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
</view>
|
||||
<view style="margin-top: 20px;">
|
||||
<u-button type="primary" :style="{width: '100%',borderRadius:'40rpx',backgroundColor:'#05C341'}" :disabled="saving" text="提交"
|
||||
@click="submit" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
import storage from '@/jtools/storage';
|
||||
export default {
|
||||
data() {
|
||||
const shenfenzhen = (rule, value, callback) => {
|
||||
/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value) ? callback() : callback(
|
||||
new Error('请输入正确的身份证号'))
|
||||
}
|
||||
return {
|
||||
form: {
|
||||
name: '',
|
||||
idNum: ''
|
||||
},
|
||||
fileList:[],
|
||||
fileList1: [],
|
||||
uploadList: [],
|
||||
saving: false,
|
||||
rules: {
|
||||
name: [{
|
||||
required: true,
|
||||
message: '请输入姓名',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
idNum: [{
|
||||
required: true,
|
||||
message: '请输入身份证号',
|
||||
trigger: ['blur', 'change']
|
||||
},{
|
||||
// 自定义验证函数,见上说明
|
||||
validator: shenfenzhen,
|
||||
message: '身份证号码不正确',
|
||||
// 触发器可以同时用blur和change
|
||||
trigger: ['change', 'blur'],
|
||||
}]
|
||||
}
|
||||
};
|
||||
},
|
||||
onReady() {
|
||||
if(storage.get('photoForm')){
|
||||
this.fileList=storage.get('photoForm').file
|
||||
this.form={
|
||||
name: storage.get('photoForm').name,
|
||||
idNum: storage.get('photoForm').idNum
|
||||
}
|
||||
}
|
||||
this.$refs.form1.setRules(this.rules);
|
||||
},
|
||||
methods: {
|
||||
// 删除图片
|
||||
deletePic(event) {
|
||||
this.fileList1.splice(event.index, 1);
|
||||
this.uploadList.splice(event.index, 1);
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(event) {
|
||||
// this.compressImage(event.file);
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
const lists = [].concat(event.file);
|
||||
this.fileList=lists
|
||||
this.fileList1 = [];
|
||||
uni.showToast({
|
||||
title:'上传成功!'
|
||||
})
|
||||
},
|
||||
uploadFilePromise(url) {
|
||||
this.saving = true;
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: process.env.VUE_APP_BASE_API + 'mongodb/uploadFile', // 仅为示例,非真实的接口地址
|
||||
filePath: url,
|
||||
name: 'file',
|
||||
success: (res) => {
|
||||
// setTimeout(() => {
|
||||
resolve(JSON.parse(res.data).data);
|
||||
// }, 100);
|
||||
this.saving = false;
|
||||
},
|
||||
fail: () => {
|
||||
resolve(null);
|
||||
this.saving = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
// 提交
|
||||
submit() {
|
||||
this.$refs.form1.validate().then((valid) => {
|
||||
if (valid) {
|
||||
const param={
|
||||
file:this.fileList,
|
||||
...this.form
|
||||
}
|
||||
storage.set('photoForm',param)
|
||||
uni.showToast({
|
||||
title:"提交成功!",
|
||||
duration:2000,
|
||||
})
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack()
|
||||
},1000)
|
||||
} else {
|
||||
console.log('验证失败');
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
async compressImage(image) {
|
||||
const img = new Image();
|
||||
img.src = image.url;
|
||||
|
||||
img.onload = async () => {
|
||||
const canvas = document.createElement('canvas'); // 创建Canvas对象(画布)
|
||||
const context = canvas.getContext('2d');
|
||||
// 默认按比例压缩
|
||||
const cw = img.width;
|
||||
const ch = img.height;
|
||||
let w = img.width;
|
||||
let h = img.height;
|
||||
canvas.width = w;
|
||||
canvas.height = h;
|
||||
if (cw > 400 && cw > ch) {
|
||||
w = 400;
|
||||
h = (400 * ch) / cw;
|
||||
canvas.width = w;
|
||||
canvas.height = h;
|
||||
}
|
||||
if (ch > 400 && ch > cw) {
|
||||
h = 400;
|
||||
w = (400 * cw) / ch;
|
||||
canvas.width = w;
|
||||
canvas.height = h;
|
||||
}
|
||||
// 生成canvas
|
||||
let base64;
|
||||
// 创建属性节点
|
||||
context.clearRect(0, 0, 0, w, h);
|
||||
context.drawImage(img, 0, 0, w, h);
|
||||
if (image.size > 2000000) {
|
||||
// 如果图片超过2m,则进行压缩
|
||||
base64 = canvas.toDataURL(image['type'], 0.5);
|
||||
}
|
||||
const result = await this.uploadFilePromise(base64 || image.url);
|
||||
this.uploadList.push(result);
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.title {
|
||||
width: 120rpx;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
.bb1 {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
</style>
|
||||
.upload-img {
|
||||
width: 165rpx;
|
||||
height: 165rpx;
|
||||
border: 1px dashed #c4c4c4;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.fontColor {
|
||||
color: #383838;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
::v-deep .u-textarea__count {
|
||||
background-color: #f9faf9 !important;
|
||||
}
|
||||
|
||||
::v-deep .u-upload__button>.u-icon>.u-icon__icon {
|
||||
font-size: 90rpx !important;
|
||||
}
|
||||
|
||||
::v-deep .u-button--square {
|
||||
border-radius: 40rpx !important;
|
||||
}
|
||||
::v-deep .u-button--primary{
|
||||
background-color: #05C341 !important;
|
||||
border-color: #05C341 !important;
|
||||
}
|
||||
</style>
|
||||
@@ -5,21 +5,21 @@
|
||||
<view class="mt15">
|
||||
<!-- <u-upload width="165" height="165" :file-list=" fileList1" multiple :max-count="1" @afterRead="afterRead" @delete="deletePic" /> -->
|
||||
<!-- <u-upload ref="uUpload" class="mt25" :size-type="['compressed']" :file-list="fileList1" deletable :multiple="false" :max-count="1" width="165rpx" height="165rpx" @afterRead="afterRead" @delete="deletePic" /> -->
|
||||
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="1" width="150"
|
||||
height="150">
|
||||
<view style="width: 320rpx;height:300rpx;background-color: rgb(247, 255, 255);border-radius: 20rpx;">
|
||||
<view style="width: 320rpx;height:240rpx;" class="flex jc-c ai-c">
|
||||
<image v-if="fileList1&&fileList1.length" style="width: 240rpx;height: 240rpx;" :src="fileList1[0].url">
|
||||
</image>
|
||||
<u-avatar v-else class="br-p50 overflow-h" :size="64" mp-avatar shape="circle"></u-avatar>
|
||||
</view>
|
||||
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="1" width="150"
|
||||
height="150">
|
||||
<view
|
||||
style="width: 320rpx;height:60rpx;line-height:60rpx;background-color: #3C9CFF;border-radius: 0 0 20rpx 20rpx;"
|
||||
class="text-center cor-fff">
|
||||
点击
|
||||
</view>
|
||||
</u-upload>
|
||||
</view>
|
||||
</u-upload>
|
||||
</view>
|
||||
<view class="mt20">
|
||||
<view class="title fontColor">第二步 核实后再提交</view>
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
<swiper class="swiper" :current="current" style="height: 120px;" :autoplay="false" :display-multiple-items="1.45"
|
||||
:disable-programmatic-animation="true" @change="onChange">
|
||||
<swiper-item v-for="(item, index) in vipAllList" :key="index">
|
||||
<view class="relative">
|
||||
<image src="../../static/image/mine/vip_card.png" mode="widthFix" style="width:95%;"></image>
|
||||
<view class="relative" style="background-image: url(https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/vip%E8%83%8C%E6%99%AF_20230831010348.png);width: 95%;height: 204rpx;background-size: 100% 100%;">
|
||||
<!-- <image src="" mode="widthFix" style="width:95%;"></image> -->
|
||||
<view class="vip-info">
|
||||
<u-avatar class="br-p50 overflow-h" style="border: 3px solid #873E1D;" :size="35" mp-avatar></u-avatar>
|
||||
<view class="ml10">
|
||||
@@ -44,7 +44,7 @@
|
||||
<swiper class="swiper" :current="current" style="height: 300px;" :autoplay="false"
|
||||
:disable-programmatic-animation="true" @change="onChange">
|
||||
<swiper-item v-for="(item, index) in vipAllList" :key="index">
|
||||
<view v-if="index == 0 || index == 3" class="p15 br8 cor-fff">
|
||||
<view v-if="index == 0 || index == 3" class="p15 br8 cor-fff bc-fff">
|
||||
<view class="fs18 cor-000 fwb">
|
||||
3步轻松学{{ getKmTitle(item.subjects) }}
|
||||
</view>
|
||||
@@ -165,8 +165,8 @@ export default {
|
||||
return '开通vip助您快速拿证'
|
||||
}
|
||||
},
|
||||
vipHasOpened(item) {
|
||||
return !!this.vipOnList.find(it => it.memberId == item.memberId)
|
||||
vipHasOpened(item) {;
|
||||
return !!this.vipOnList.some(it => it.subjects.includes(item.subjects) )
|
||||
},
|
||||
// 去精选500题 item=> 当前科目vip信息
|
||||
to500(item) {
|
||||
@@ -261,6 +261,7 @@ export default {
|
||||
left: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.corner {
|
||||
@@ -277,6 +278,7 @@ export default {
|
||||
justify-content: center;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.renew {
|
||||
@@ -292,6 +294,7 @@ export default {
|
||||
border-radius: 26rpx;
|
||||
font-size: 12px;
|
||||
color: #F6E99F;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.buy {
|
||||
@@ -308,6 +311,7 @@ export default {
|
||||
border-radius: 30rpx;
|
||||
font-size: 14px;
|
||||
color: #F6E99F;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.study {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<template>
|
||||
<view>
|
||||
<j-navbar>基本操作</j-navbar>
|
||||
<u-sticky bgColor="#fff">
|
||||
<!-- <u-sticky bgColor="#fff">
|
||||
<u-tabs :list="categoryList" :scrollable="false" @click="changeCategory"></u-tabs>
|
||||
</u-sticky>
|
||||
</u-sticky> -->
|
||||
<view class="p14">
|
||||
<!-- <view class="flex ai-c">
|
||||
<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 p14lr p20tb bc-fff mb10" style="border-radius: 10rpx;"
|
||||
v-for="(item,index) of videoList" :key="index" @tap="toOperateDetail(item.videoId)">
|
||||
<view class="pic relative" style="overflow: hidden;">
|
||||
<image class="pic" mode="widthFix" :src="item.videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image>
|
||||
<view class="pic relative hide" style="overflow: hidden;">
|
||||
<image class="pic" style="position: absolute;left: 0;top:0" mode="widthFix" :src="item.videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image>
|
||||
<image class="play_btn_2" src="../../static/image/index/play.png" />
|
||||
</view>
|
||||
<view class="ml10">
|
||||
@@ -51,7 +51,6 @@
|
||||
if(op.type){
|
||||
this.type=op.type
|
||||
}
|
||||
console.log(this.type);
|
||||
this.getDiverType()
|
||||
},
|
||||
methods:{
|
||||
@@ -83,7 +82,6 @@
|
||||
queryProjectList({
|
||||
"carTypeId": storage.get('carType') || '1001',
|
||||
"subject": String(this.subject),
|
||||
"driveType": this.categoryList[this.tCar].configItemCode,
|
||||
"type": this.type
|
||||
}).then(resp => {
|
||||
if(resp.code==='0000'){
|
||||
@@ -156,4 +154,10 @@
|
||||
left: 117.5rpx;
|
||||
top: 52rpx
|
||||
}
|
||||
.hide {
|
||||
backface-visibility: hidden;
|
||||
transform: translate3d(0, 0, 0);
|
||||
-webkit-backface-visibility: hidden;
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
}
|
||||
</style>
|
||||
@@ -1,28 +1,71 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="chapter_item p14" v-for="(item,index) of chapterList" :key="index" @tap="toQuestion(item.configItemCode)">
|
||||
{{item.configItemName}}
|
||||
<u-loading-page :loading="getLoading" loading-text="题库更新中..."></u-loading-page>
|
||||
<view v-if="!getLoading">
|
||||
<view class="chapter_item p14" v-for="(item,index) of chapterList" :key="index" @tap="toQuestion(item.configItemCode)">
|
||||
{{item.configItemName}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
querySysConfigList
|
||||
querySysConfigList,
|
||||
queryQuestionId
|
||||
} from '@/jtools/api/question';
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
} from 'pinia' //引入映射函数
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
import storage from '@/jtools/storage';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
chapterList:[]
|
||||
chapterList:[],
|
||||
subject:'1'
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
onLoad(op){
|
||||
if(op.subject){
|
||||
this.subject=op.subject
|
||||
}
|
||||
this.getChapterList()
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1", "version"]), //映射函数,取出tagslist
|
||||
getLoading() {
|
||||
return this.loading_subject4 && this.loading_subject1
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
...mapActions(useQuestionStore, ['getAllQuestion']),
|
||||
getQuestion(param,title) {
|
||||
queryQuestionId({
|
||||
versionId: this.version,
|
||||
carTypeId: storage.get('carType') || '1001',
|
||||
subject: this.subject,
|
||||
...param,
|
||||
}).then(async (resp) => {
|
||||
if (resp.code === '0000') {
|
||||
const arr = resp.data
|
||||
const listJson = JSON.stringify(arr)
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/questionBank?navTitle=" + title + "&subject=" + this.subject + "&questionIdList=" + listJson
|
||||
})
|
||||
}else if (resp.code === '4001') {
|
||||
uni.showToast({
|
||||
title: '当前题库非最新版,请更新~',
|
||||
icon: 'none'
|
||||
})
|
||||
this.getAllQuestion()
|
||||
}
|
||||
})
|
||||
},
|
||||
getChapterList(){
|
||||
const carTypeId=storage.get('carType') || '1001'
|
||||
const key=this.subject=='1'?'ChapterOfSubjectOne':'ChapterOfSubjectFour'
|
||||
querySysConfigList(carTypeId,'ChapterOfSubjectOne').then(resp=>{
|
||||
if(resp.code==='0000'){
|
||||
this.chapterList=resp.data
|
||||
@@ -30,9 +73,7 @@
|
||||
})
|
||||
},
|
||||
toQuestion(code){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle=章节技巧&chapter="+code
|
||||
})
|
||||
this.getQuestion({chapter:code},'章节技巧')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<text>未做题</text>
|
||||
</view>
|
||||
<view class="text-center wp33" @tap="toQuestionBank">
|
||||
<view>{{wrongList.length}}</view>
|
||||
<view>{{wrongList?.length}}</view>
|
||||
<text>看错题</text>
|
||||
</view>
|
||||
<view class="text-center wp33 flex jc-c ai-c" style="flex-direction: column;" @tap="toExams">
|
||||
@@ -108,6 +108,7 @@
|
||||
this.doNotNum=op.doNotNum
|
||||
}
|
||||
if(op.wrongList){
|
||||
console.log(op.wrongList);
|
||||
this.wrongList=JSON.parse(op.wrongList) || []
|
||||
}
|
||||
if(op.score){
|
||||
@@ -124,6 +125,13 @@
|
||||
onReady() {
|
||||
this.getServerData();
|
||||
},
|
||||
onUnload() {
|
||||
//#ifdef MP-WEIXIN
|
||||
uni.reLaunch({
|
||||
url:"/pages/index/index"
|
||||
})
|
||||
//#endif
|
||||
},
|
||||
computed: {
|
||||
...mapState(useUserStore, ["vipOnList"])
|
||||
},
|
||||
@@ -131,7 +139,7 @@
|
||||
...mapActions(useUserStore, ['searchUserVip']),
|
||||
async toVip(){
|
||||
await this.searchUserVip()
|
||||
const res = this.vipOnList.some(item => item.subjects == this.subject)
|
||||
const res = this.vipOnList.some(item => item.subjects.includes(this.subject))
|
||||
if(res){
|
||||
uni.navigateTo({
|
||||
url: '/pages/me/vip'
|
||||
@@ -166,10 +174,17 @@
|
||||
})
|
||||
},
|
||||
toQuestionBank(){
|
||||
const list =JSON.stringify(this.wrongList)
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle=错题&subject="+this.subject+"&questionList="+list
|
||||
})
|
||||
if(this.wrongList.length==0){
|
||||
uni.showToast({
|
||||
title:'当前无错题~',
|
||||
icon:'none'
|
||||
})
|
||||
}else{
|
||||
const list =JSON.stringify(this.wrongList)
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle=错题&subject="+this.subject+"&questionList="+list
|
||||
})
|
||||
}
|
||||
},
|
||||
//重新考试
|
||||
toExams(){
|
||||
|
||||
@@ -1,42 +1,48 @@
|
||||
<template>
|
||||
<view class="p14">
|
||||
<view class="flex jc-sb">
|
||||
<view class="relative mr5" @tap="toIconSkill">
|
||||
<image style="width: 336rpx;height: 152rpx;" src="../../static/image/practice/errorprone_bg.png">
|
||||
</image>
|
||||
<view style="position: absolute;left: 0;top: 0;" class="p10">
|
||||
<view style="color: #04B13B;font-size: 18px;">图标技巧</view>
|
||||
<text style="color: #04B13B;font-size: 14px;">快速记忆</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative ml5" @tap="toChapterSkill">
|
||||
<image style="width: 363rpx;height: 170rpx;" src="../../static/image/practice/chapter_bg.png"></image>
|
||||
<view style="position: absolute;left: 0;top: 0;" class="p10">
|
||||
<view style="color: #FF6E02;font-size: 18px;">章节练习</view>
|
||||
<text style="color: #FF6E02;font-size: 14px;">共5章</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bc-fff pt14" style="border-radius: 20rpx;">
|
||||
<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;height: 100rpx;" mode="widthFix" :src="listItem.image"></image>
|
||||
<view>
|
||||
<u-loading-page :loading="getLoading" loading-text="题库更新中..."></u-loading-page>
|
||||
<view class="p14" v-if="!getLoading">
|
||||
<view class="flex jc-sb">
|
||||
<view class="relative mr5" @tap="toIconSkill">
|
||||
<image style="width: 336rpx;height: 152rpx;" src="../../static/image/practice/errorprone_bg.png">
|
||||
</image>
|
||||
<view style="position: absolute;left: 0;top: 0;" class="p10">
|
||||
<view style="color: #04B13B;font-size: 18px;">图标技巧</view>
|
||||
<text style="color: #04B13B;font-size: 14px;">快速记忆</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative ml5" @tap="toChapterSkill">
|
||||
<image style="width: 363rpx;height: 170rpx;" src="../../static/image/practice/chapter_bg.png"></image>
|
||||
<view style="position: absolute;left: 0;top: 0;" class="p10">
|
||||
<view style="color: #FF6E02;font-size: 18px;">章节练习</view>
|
||||
<text style="color: #FF6E02;font-size: 14px;">共5章</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bc-fff pt14" style="border-radius: 20rpx;">
|
||||
<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 class="mb5" style="width: 84rpx;height: 84rpx;">
|
||||
<image style="width: 84rpx;height:84rpx;" mode="heightFix" :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>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
</view>
|
||||
<view class="mt14 p14 bc-fff" style="border-radius: 20rpx;">
|
||||
<text class="fs18 cor-000 fw600">常见考点</text>
|
||||
<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 topic_cont_text" style="width: calc(100% - 65rpx);">{{item.configItemName}}</text>
|
||||
</view>
|
||||
<text class="grid-text fs14 cor-000">{{listItem.title}}</text>
|
||||
<text class="grid-text mb10 fs12 cor-999">{{listItem.subTitle}}</text>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
</view>
|
||||
<view class="mt14 p14 bc-fff" style="border-radius: 20rpx;">
|
||||
<text class="fs18 cor-000 fw600">常见考点</text>
|
||||
<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 topic_cont_text" style="width: calc(100% - 65rpx);">{{item.configItemName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -49,8 +55,14 @@
|
||||
import tupianIcon from "../../static/image/index/tupian.png"
|
||||
import {
|
||||
querySysConfigList,
|
||||
querySpecialNum
|
||||
querySpecialNum,
|
||||
queryQuestionId
|
||||
} from '@/jtools/api/question';
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
} from 'pinia' //引入映射函数
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
import storage from '@/jtools/storage';
|
||||
export default {
|
||||
data() {
|
||||
@@ -58,199 +70,222 @@
|
||||
errorIcon,
|
||||
newRulesIcon,
|
||||
neverWriteIcon,
|
||||
list:[{
|
||||
title:'新规题',
|
||||
subTitle:'392题',
|
||||
isNew:1,
|
||||
isError:0,
|
||||
image:newRulesIcon
|
||||
},{
|
||||
title:'易错题',
|
||||
isNew:0,
|
||||
isError:1,
|
||||
subTitle:'392题',
|
||||
image:errorIcon
|
||||
},{
|
||||
title:'单选题',
|
||||
subTitle:'392题',
|
||||
isNew:0,
|
||||
isError:0,
|
||||
image:danxuanIcon
|
||||
},{
|
||||
title:'判断题',
|
||||
subTitle:'392题',
|
||||
isNew:0,
|
||||
isError:0,
|
||||
image:panduanIcon
|
||||
},{
|
||||
title:'图片题',
|
||||
subTitle:'392题',
|
||||
isNew:0,
|
||||
isError:0,
|
||||
image:tupianIcon
|
||||
list: [{
|
||||
title: '新规题',
|
||||
subTitle: '392题',
|
||||
isNew: 1,
|
||||
isError: 0,
|
||||
image: newRulesIcon
|
||||
}, {
|
||||
title: '易错题',
|
||||
isNew: 0,
|
||||
isError: 1,
|
||||
subTitle: '392题',
|
||||
image: errorIcon
|
||||
}, {
|
||||
title: '单选题',
|
||||
subTitle: '392题',
|
||||
isNew: 0,
|
||||
isError: 0,
|
||||
image: danxuanIcon
|
||||
}, {
|
||||
title: '判断题',
|
||||
subTitle: '392题',
|
||||
isNew: 0,
|
||||
isError: 0,
|
||||
image: panduanIcon
|
||||
}, {
|
||||
title: '图片题',
|
||||
subTitle: '392题',
|
||||
isNew: 0,
|
||||
isError: 0,
|
||||
image: tupianIcon
|
||||
}],
|
||||
testCenterList:[],
|
||||
subject:'1'
|
||||
testCenterList: [],
|
||||
subject: '1'
|
||||
}
|
||||
},
|
||||
onLoad(op){
|
||||
if(op.subject){
|
||||
this.subject=op.subject
|
||||
onLoad(op) {
|
||||
if (op.subject) {
|
||||
this.subject = op.subject
|
||||
}
|
||||
this.getExamPoint()
|
||||
this.getQuestionNum()
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1", "version"]), //映射函数,取出tagslist
|
||||
getLoading() {
|
||||
return this.loading_subject4 && this.loading_subject1
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getQuestionNum(){
|
||||
...mapActions(useQuestionStore, ['getAllQuestion']),
|
||||
getQuestionNum() {
|
||||
querySpecialNum({
|
||||
carTypeId:storage.get('carType') || '1001',
|
||||
subject:this.subject
|
||||
}).then(resp=>{
|
||||
if(resp.code==='0000'){
|
||||
if(this.subject=='1'){
|
||||
this.list=[{
|
||||
title:'新规题',
|
||||
subTitle:resp.data.newQuestionNum+'题',
|
||||
isNew:1,
|
||||
isError:0,
|
||||
image:newRulesIcon
|
||||
},{
|
||||
title:'易错题',
|
||||
isNew:0,
|
||||
isError:1,
|
||||
subTitle:resp.data.errorQuestionNum+'题',
|
||||
image:errorIcon
|
||||
},{
|
||||
title:'单选题',
|
||||
subTitle:resp.data.radioQuestionNum+'题',
|
||||
isNew:0,
|
||||
isError:0,
|
||||
image:danxuanIcon
|
||||
},{
|
||||
title:'判断题',
|
||||
subTitle:resp.data.judgeQuestionNum+'题',
|
||||
isNew:0,
|
||||
isError:0,
|
||||
image:panduanIcon
|
||||
},{
|
||||
title:'图片题',
|
||||
subTitle:resp.data.imageQuestionNum+'题',
|
||||
isNew:0,
|
||||
isError:0,
|
||||
image:tupianIcon
|
||||
carTypeId: storage.get('carType') || '1001',
|
||||
subject: this.subject
|
||||
}).then(resp => {
|
||||
if (resp.code === '0000') {
|
||||
if (this.subject == '1') {
|
||||
this.list = [{
|
||||
title: '新规题',
|
||||
subTitle: resp.data.newQuestionNum + '题',
|
||||
isNew: 1,
|
||||
isError: 0,
|
||||
image: newRulesIcon,
|
||||
}, {
|
||||
title: '易错题',
|
||||
isNew: 0,
|
||||
isError: 1,
|
||||
subTitle: resp.data.errorQuestionNum + '题',
|
||||
image: errorIcon,
|
||||
}, {
|
||||
title: '单选题',
|
||||
subTitle: resp.data.radioQuestionNum + '题',
|
||||
isNew: 0,
|
||||
isError: 0,
|
||||
image: danxuanIcon,
|
||||
}, {
|
||||
title: '判断题',
|
||||
subTitle: resp.data.judgeQuestionNum + '题',
|
||||
isNew: 0,
|
||||
isError: 0,
|
||||
image: panduanIcon,
|
||||
}, {
|
||||
title: '图片题',
|
||||
subTitle: resp.data.imageQuestionNum + '题',
|
||||
isNew: 0,
|
||||
isError: 0,
|
||||
image: tupianIcon,
|
||||
}]
|
||||
}else{
|
||||
this.list=[{
|
||||
title:'新规题',
|
||||
subTitle:resp.data.newQuestionNum+'题',
|
||||
isNew:1,
|
||||
isError:0,
|
||||
image:newRulesIcon
|
||||
},{
|
||||
title:'易错题',
|
||||
isNew:0,
|
||||
isError:1,
|
||||
subTitle:resp.data.errorQuestionNum+'题',
|
||||
image:errorIcon
|
||||
},{
|
||||
title:'单选题',
|
||||
subTitle:resp.data.radioQuestionNum+'题',
|
||||
isNew:0,
|
||||
isError:0,
|
||||
image:danxuanIcon
|
||||
},{
|
||||
title:'多选题',
|
||||
subTitle:resp.data.multipleChoiceQuestionNum+'题',
|
||||
isNew:0,
|
||||
isError:0,
|
||||
image:neverWriteIcon
|
||||
},{
|
||||
title:'判断题',
|
||||
subTitle:resp.data.judgeQuestionNum+'题',
|
||||
isNew:0,
|
||||
isError:0,
|
||||
image:panduanIcon
|
||||
},{
|
||||
title:'图片题',
|
||||
subTitle:resp.data.imageQuestionNum+'题',
|
||||
isNew:0,
|
||||
isError:0,
|
||||
image:tupianIcon
|
||||
} else {
|
||||
this.list = [{
|
||||
title: '新规题',
|
||||
subTitle: resp.data.newQuestionNum + '题',
|
||||
isNew: 1,
|
||||
isError: 0,
|
||||
image: newRulesIcon
|
||||
}, {
|
||||
title: '易错题',
|
||||
isNew: 0,
|
||||
isError: 1,
|
||||
subTitle: resp.data.errorQuestionNum + '题',
|
||||
image: errorIcon,
|
||||
}, {
|
||||
title: '单选题',
|
||||
subTitle: resp.data.radioQuestionNum + '题',
|
||||
isNew: 0,
|
||||
isError: 0,
|
||||
image: danxuanIcon,
|
||||
}, {
|
||||
title: '多选题',
|
||||
subTitle: resp.data.multipleChoiceQuestionNum + '题',
|
||||
isNew: 0,
|
||||
isError: 0,
|
||||
image: neverWriteIcon
|
||||
}, {
|
||||
title: '判断题',
|
||||
subTitle: resp.data.judgeQuestionNum + '题',
|
||||
isNew: 0,
|
||||
isError: 0,
|
||||
image: panduanIcon,
|
||||
}, {
|
||||
title: '图片题',
|
||||
subTitle: resp.data.imageQuestionNum + '题',
|
||||
isNew: 0,
|
||||
isError: 0,
|
||||
image: tupianIcon,
|
||||
}]
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
getExamPoint(){
|
||||
const carTypeId=storage.get('carType') || '1001'
|
||||
const examKey = this.subject=='1'?'ExamKeysOfSubjectOne':'ExamKeysOfSubjectFour'
|
||||
querySysConfigList(carTypeId,examKey).then(resp=>{
|
||||
if(resp.code==='0000'){
|
||||
this.testCenterList=resp.data
|
||||
getExamPoint() {
|
||||
const carTypeId = storage.get('carType') || '1001'
|
||||
const examKey = this.subject == '1' ? 'ExamKeysOfSubjectOne' : 'ExamKeysOfSubjectFour'
|
||||
querySysConfigList(carTypeId, examKey).then(resp => {
|
||||
if (resp.code === '0000') {
|
||||
this.testCenterList = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
toAnswer(title,isError,isNew) {
|
||||
if(title=='单选题'){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle="+title+"&isError="+isError+"&isNew="+isNew+"&type=2"+"&subject="+this.subject
|
||||
})
|
||||
}else if(title=='多选题'){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle="+title+"&isError="+isError+"&isNew="+isNew+"&type=3"+"&subject="+this.subject
|
||||
})
|
||||
}else if(title=='判断题'){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle="+title+"&isError="+isError+"&isNew="+isNew+"&type=1"+"&subject="+this.subject
|
||||
})
|
||||
}else if(title=='图片题'){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle="+title+"&isError="+isError+"&isNew="+isNew+"&isImage=1"+"&subject="+this.subject
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle="+title+"&isError="+isError+"&isNew="+isNew+"&subject="+this.subject
|
||||
getQuestion(param,title) {
|
||||
queryQuestionId({
|
||||
versionId: this.version,
|
||||
carTypeId: storage.get('carType') || '1001',
|
||||
subject: this.subject,
|
||||
...param,
|
||||
}).then(async (resp) => {
|
||||
if (resp.code === '0000') {
|
||||
const arr = resp.data
|
||||
const listJson = JSON.stringify(arr)
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/questionBank?navTitle=" + title + "&subject=" + this.subject + "&questionIdList=" + listJson
|
||||
})
|
||||
}else if (resp.code === '4001') {
|
||||
uni.showToast({
|
||||
title: '当前题库非最新版,请更新~',
|
||||
icon: 'none'
|
||||
})
|
||||
this.getAllQuestion()
|
||||
}
|
||||
},
|
||||
toQuestionBank(val){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle="+val.configItemName+"&examKey="+val.configItemCode+"&subject="+this.subject
|
||||
})
|
||||
},
|
||||
toIconSkill(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/index/iconSkill"
|
||||
})
|
||||
},
|
||||
toChapterSkill(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/chapterExercise"
|
||||
})
|
||||
})
|
||||
},
|
||||
toAnswer(title, isError, isNew) {
|
||||
if (title == '单选题') {
|
||||
this.getQuestion({type:'2'},title)
|
||||
} else if (title == '多选题') {
|
||||
this.getQuestion({type:'3'},title)
|
||||
} else if (title == '判断题') {
|
||||
this.getQuestion({type:'1'},title)
|
||||
} else if (title == '图片题') {
|
||||
this.getQuestion({isImage:'1'},title)
|
||||
} else {
|
||||
this.getQuestion({isNew:isNew,isError:isError},title)
|
||||
}
|
||||
},
|
||||
toQuestionBank(val) {
|
||||
this.getQuestion({examKey:val.configItemCode},val.configItemName)
|
||||
},
|
||||
toIconSkill() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/index/iconSkill"
|
||||
})
|
||||
},
|
||||
toChapterSkill() {
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/chapterExercise?subject="+this.subject
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dot_item{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 41rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background: #0BD032;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.topic_cont_text{
|
||||
height:45rpx;
|
||||
.dot_item {
|
||||
width: 40rpx;
|
||||
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; /** 显示的行数 **/
|
||||
word-break: break-all;
|
||||
/* break-all(允许在单词内换行。) */
|
||||
text-overflow: ellipsis;
|
||||
/* 超出部分省略号 */
|
||||
display: -webkit-box;
|
||||
/** 对象作为伸缩盒子模型显示 **/
|
||||
-webkit-box-orient: vertical;
|
||||
/** 设置或检索伸缩盒对象的子元素的排列方式 **/
|
||||
-webkit-line-clamp: 1;
|
||||
/** 显示的行数 **/
|
||||
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -2,8 +2,9 @@
|
||||
<view>
|
||||
<!-- <u-navbar title="模拟考试" @rightClick="rightClick" :autoBack="true">
|
||||
</u-navbar> -->
|
||||
<j-navbar :isDefineBack="true" @toBack="toBack">{{title}}</j-navbar>
|
||||
<Question ref="question" :tabsList="tabsList" v-model:isSubmit="isSubmit" :type="type" :isShowAll="isShowAll" :subject="subject" :navTitle="title" @changeTab="changeTab" />
|
||||
<j-navbar :isDefineBack="true" @toBack="toBack">{{title}}</j-navbar>
|
||||
<Question ref="question" :tabsList="tabsList" v-model:isSubmit="isSubmit" :type="type" :isShowAll="isShowAll"
|
||||
:subject="subject" @changeTab="changeTab" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -12,9 +13,11 @@
|
||||
mapState,
|
||||
mapActions
|
||||
} from 'pinia' //引入映射函数
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
import {
|
||||
getTestQuestion
|
||||
getTestQuestion,
|
||||
queryQuestionId
|
||||
} from '@/jtools/api/question';
|
||||
import storage from '@/jtools/storage';
|
||||
import Question from './components/Question.vue';
|
||||
@@ -24,63 +27,105 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type:'',
|
||||
isShowAll:true,
|
||||
title:"模拟考试",
|
||||
subject:1,
|
||||
isSubmit:false,
|
||||
tabsList:[{
|
||||
label:"模拟考试",
|
||||
value:0
|
||||
},{
|
||||
label:"考前密卷",
|
||||
value:1
|
||||
type: '',
|
||||
collectList: storage.get(`collectList_subject${this.subject}`) || [],
|
||||
questionArr:[],
|
||||
isShowAll: true,
|
||||
title: "模拟考试",
|
||||
subject: 1,
|
||||
isSubmit: false,
|
||||
tabsList: [{
|
||||
label: "模拟考试",
|
||||
value: 0
|
||||
}, {
|
||||
label: "考前秘卷",
|
||||
value: 1
|
||||
}]
|
||||
}
|
||||
},
|
||||
onLoad(op) {
|
||||
if(op.title){
|
||||
this.title=op.title
|
||||
if (op.title) {
|
||||
this.title = op.title
|
||||
}
|
||||
if(op.subject){
|
||||
this.subject=op.subject
|
||||
const param={}
|
||||
if(op.isExam1){
|
||||
param.isExam1=op.isExam1
|
||||
if (op.subject) {
|
||||
this.subject = op.subject
|
||||
const param = {}
|
||||
if (op.isExam1) {
|
||||
param.isExam1 = op.isExam1
|
||||
}
|
||||
getTestQuestion({
|
||||
carTypeId: storage.get('carType') || '1001',
|
||||
subject: this.subject,
|
||||
...param
|
||||
}).then(async (resp)=>{
|
||||
if(resp.code==='0000'){
|
||||
let arr=resp.data
|
||||
if(this.title==='考前密卷'){
|
||||
await this.searchUserVip()
|
||||
const res = this.vipOnList.some(item => item.subjects == this.subject)
|
||||
if (!res) {
|
||||
arr = arr.slice(0, 3)
|
||||
this.isShowAll = false
|
||||
}
|
||||
}
|
||||
this.type='exam'
|
||||
this.$refs.question.getQuestionList(JSON.stringify(arr))
|
||||
if(op.needVip){
|
||||
this.isShowAll = op.needVip
|
||||
}
|
||||
let arr=[]
|
||||
if(op.questionIdList){
|
||||
const idList=JSON.parse(op.questionIdList)
|
||||
arr = this[`orderQuestion_subject${this.subject}`].filter(qItem=>idList.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.type = 'exam'
|
||||
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr),this.title)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(useUserStore, ["vipOnList"])
|
||||
...mapState(useUserStore, ["vipOnList","token"]),
|
||||
...mapState(useQuestionStore, ["orderQuestion_subject1", "orderQuestion_subject4", "version"]), //映射函数,取出tagslist
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useUserStore, ['searchUserVip']),
|
||||
toBack(){
|
||||
toBack() {
|
||||
this.$refs.question.submitPaper()
|
||||
},
|
||||
changeTab(val){
|
||||
if(val==1){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/practiceExams?subject="+this.subject+'&title=考前密卷&isExam1=1'
|
||||
changeTab(val) {
|
||||
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()
|
||||
const result = this.vipOnList.some(item => item.subjects.includes(this.subject))
|
||||
if (result) {
|
||||
const listJson = JSON.stringify(resp.data)
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/practiceExams?title=考前密卷" + "&subject=" + this.subject + "&questionIdList=" + listJson
|
||||
})
|
||||
} 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({
|
||||
url: "/pages/questionBank/practiceExams?title=" + title + "&subject=" + this.subject + "&questionIdList=" + listJson+"&needVip="+result
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
} else if (resp.code === '4001') {
|
||||
uni.showToast({
|
||||
title: '当前题库非最新版,请更新~',
|
||||
icon: 'none'
|
||||
})
|
||||
this.getAllQuestion()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -89,17 +134,19 @@
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
::v-deep .u-count-down{
|
||||
::v-deep .u-count-down {
|
||||
font-size: 28rpx;
|
||||
color:#fff !important;
|
||||
color: #fff !important;
|
||||
display: inline-block !important;
|
||||
}
|
||||
::v-deep .u-count-down__text{
|
||||
|
||||
::v-deep .u-count-down__text {
|
||||
font-size: 28rpx;
|
||||
color:#fff !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
::v-deep .balckColor .u-count-down__text{
|
||||
|
||||
::v-deep .balckColor .u-count-down__text {
|
||||
font-size: 28rpx;
|
||||
color:#333 !important;
|
||||
color: #333 !important;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -88,11 +88,18 @@
|
||||
this.subject=op.subject
|
||||
this.allRightList=storage.get(`rightList_subject${this.subject}`) || []
|
||||
this.allWrongList=storage.get(`wrongList_subject${this.subject}`) || []
|
||||
this.percent=(((this.allRightList.length+this.wrongList.length) / this.orderQuestion.length)*100).toFixed(0)
|
||||
this.percent=(((this.allRightList.length+this.wrongList.length) / this[`orderQuestion_subject${this.subject}`].length)*100).toFixed(0)
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
//#ifdef MP-WEIXIN
|
||||
uni.reLaunch({
|
||||
url:"/pages/index/index"
|
||||
})
|
||||
//#endif
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["orderQuestion_subject1","orderQuestion_subject1"]), //映射函数,取出tagslist
|
||||
...mapState(useQuestionStore, ["orderQuestion_subject1","orderQuestion_subject4"]), //映射函数,取出tagslist
|
||||
getNotDoNum(){
|
||||
return this[`orderQuestion_subject${this.subject}`].length-(this.allRightList.length+this.allWrongList.length)
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- <u-navbar :title="navTitle" @rightClick="rightClick" :autoBack="true">
|
||||
</u-navbar> -->
|
||||
<j-navbar>{{navTitle}}</j-navbar>
|
||||
<Question ref="question" :tabsList="tabsList" :isShowAll="isShowAll" :subject="subject" :navTitle="navTitle"
|
||||
@changeTab="changeTab"></Question>
|
||||
<u-loading-page :loading="loading" :loading-text="loadTxt"></u-loading-page>
|
||||
<view v-if="!loading">
|
||||
<j-navbar>{{navTitle}}</j-navbar>
|
||||
<Question ref="question" :tabsList="tabsList" :isShowAll="isShowAll" :subject="subject" :navTitle="navTitle"
|
||||
@changeTab="changeTab"></Question>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -17,7 +18,8 @@
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
import Question from './components/Question.vue';
|
||||
import {
|
||||
queryQuestion
|
||||
queryQuestion,
|
||||
queryQuestionId
|
||||
} from '@/jtools/api/question';
|
||||
import storage from '@/jtools/storage';
|
||||
export default {
|
||||
@@ -26,6 +28,9 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loadTxt:'加载中...',
|
||||
collectList: storage.get(`collectList_subject${this.subject}`) || [],
|
||||
loading:false,
|
||||
isShowAll: true,
|
||||
needVip: false,
|
||||
subject: 1,
|
||||
@@ -41,94 +46,89 @@
|
||||
}
|
||||
},
|
||||
async onLoad(op) {
|
||||
this.loading=true
|
||||
if (op.needVip) {
|
||||
this.needVip = op.needVip
|
||||
}
|
||||
if(op.subject){
|
||||
this.subject=op.subject
|
||||
if (op.subject) {
|
||||
this.subject = op.subject
|
||||
}
|
||||
if (op && op.navTitle) {
|
||||
this.navTitle = op.navTitle
|
||||
const param = {}
|
||||
let arr=[]
|
||||
let param={}
|
||||
if(op.needVip){
|
||||
this.isShowAll = !Boolean(op.needVip=='true')
|
||||
}
|
||||
if (this.navTitle === '顺序答题') {
|
||||
if(this.subject=='1'){
|
||||
this.questionArr = [...this.orderQuestion_subject1]
|
||||
}else if(this.subject=='4'){
|
||||
this.questionArr = [...this.orderQuestion_subject4]
|
||||
}
|
||||
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr))
|
||||
} else {
|
||||
if (this.navTitle === '错题本') {
|
||||
param.questionIdList = storage.get(`wrongList_subject${this.subject}`) || []
|
||||
} else if (this.navTitle === '收藏夹') {
|
||||
param.questionIdList = storage.get(`collectList_subject${this.subject}`) || []
|
||||
}
|
||||
if (op.questionList) {
|
||||
param.questionIdList = JSON.parse(op.questionList)
|
||||
}
|
||||
if (op.chapter) {
|
||||
param.chapter = op.chapter
|
||||
}
|
||||
if (op.examKey) {
|
||||
param.examKey = op.examKey
|
||||
}
|
||||
if(op.isError&&op.isError=='1'){
|
||||
param.isError=Number(op.isError)
|
||||
}
|
||||
if(op.isNew&&op.isNew=='1'){
|
||||
param.isNew=Number(op.isNew)
|
||||
}
|
||||
if(op.type){
|
||||
param.type=op.type
|
||||
}
|
||||
if(op.isImage){
|
||||
param.isImage=op.isImage
|
||||
if (this.subject == '1') {
|
||||
arr = [...this.orderQuestion_subject1]
|
||||
} else if (this.subject == '4') {
|
||||
arr = [...this.orderQuestion_subject4]
|
||||
}
|
||||
} else if(op.questionIdList){
|
||||
const idList=JSON.parse(op.questionIdList)
|
||||
arr = this[`orderQuestion_subject${this.subject}`].filter(qItem=>idList.includes(qItem.questionId))
|
||||
}else{
|
||||
if(op.isVip){
|
||||
param.isVip=op.isVip
|
||||
}
|
||||
param.subject=this.subject
|
||||
param.carTypeId=storage.get('carType') || '1001'
|
||||
queryQuestion(param).then(async (res) => {
|
||||
if (res.code == '0000') {
|
||||
this.questionArr = res.data
|
||||
if (this.needVip === 'true') {
|
||||
if (this.token) {
|
||||
await this.searchUserVip()
|
||||
const res = this.vipOnList.some(item => item.subjects == this.subject)
|
||||
if (!res) {
|
||||
this.questionArr = this.questionArr.slice(0, 3)
|
||||
this.isShowAll = false
|
||||
}
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
}
|
||||
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr))
|
||||
}
|
||||
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.$refs.question.getQuestionList(JSON.stringify(this.questionArr),this.navTitle)
|
||||
this.$refs.question.getOriginArr(JSON.stringify(this.questionArr))
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["orderQuestion_subject1","orderQuestion_subject4"]), //映射函数,取出tagslist
|
||||
...mapState(useUserStore, ["vipOnList", "token"])
|
||||
...mapState(useQuestionStore, ["orderQuestion_subject1", "orderQuestion_subject4","version"]), //映射函数,取出tagslist
|
||||
...mapState(useUserStore, ["vipOnList", "token"]),
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useUserStore, ['searchUserVip']),
|
||||
...mapActions(useQuestionStore, ['getAllQuestion']),
|
||||
changeTab(val) {
|
||||
if (val == 1) {
|
||||
let list = JSON.parse(JSON.stringify(this.questionArr))
|
||||
list = list.map(item => {
|
||||
return {
|
||||
...item,
|
||||
clickAnswer: item.trueAnswer
|
||||
clickAnswer: item.trueAnswer,
|
||||
isChoose: true,
|
||||
}
|
||||
})
|
||||
this.$refs.question.isShowBest(true)
|
||||
this.$refs.question.getQuestionList(JSON.stringify(list))
|
||||
this.$refs.question.getQuestionList(JSON.stringify(list),this.navTitle)
|
||||
} else {
|
||||
this.$refs.question.isShowBest(false)
|
||||
this.$refs.question.getQuestionList()
|
||||
|
||||
@@ -25,11 +25,9 @@
|
||||
<view class="skill-sequence-skill-wrapper" v-for="(item, index) in videoList" :key="index"
|
||||
@tap="checkVideo(item.projectId)">
|
||||
<view>
|
||||
<view class="mb10 relative">
|
||||
<view class="contain-box" style="overflow: hidden;">
|
||||
<image class="contain-box" mode="widthFix"
|
||||
<view class="mb10 relative contain-box hide" style="overflow: hidden;">
|
||||
<image class="contain-box" style="position: absolute;left: 0;top: 0;" mode="widthFix"
|
||||
:src="item.videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image>
|
||||
</view>
|
||||
<view v-if="projectId==item.projectId" class="playLogo">播放中</view>
|
||||
<image class="play_btn" src="../../static/image/index/play.png" />
|
||||
<text style="position: absolute;right: 8rpx;bottom: 8rpx;color:#fff">{{item.videoTime}}</text>
|
||||
@@ -48,10 +46,10 @@
|
||||
<text class="fs16 cor-666" @tap="popupShow=false">收起</text>
|
||||
</view>
|
||||
<view style="max-height: 800rpx;overflow-y: scroll;" class="p14lr">
|
||||
<view class="flex bc-fff mt10" style="border-radius: 16rpx;" v-for="(item,index) of videoList" :key="index"
|
||||
<view class="flex bc-fff mb15" style="border-radius: 16rpx;" v-for="(item,index) of videoList" :key="index"
|
||||
@tap="checkVideo(item.projectId)">
|
||||
<view class="pic relative" style="overflow: hidden;">
|
||||
<image class="pic" mode="widthFix" :src="item.videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image>
|
||||
<view class="pic relative hide" style="overflow: hidden;">
|
||||
<image class="pic" style="position: absolute;left: 0;top: 0;" mode="widthFix" :src="item.videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image>
|
||||
<image class="play_btn_2" src="../../static/image/index/play.png" />
|
||||
<text style="position: absolute;right: 8rpx;bottom: 8rpx;color:#fff">{{item.videoTime}}</text>
|
||||
</view>
|
||||
@@ -266,4 +264,10 @@
|
||||
display: inline-block;
|
||||
margin-right: 15px;
|
||||
}
|
||||
.hide {
|
||||
backface-visibility: hidden;
|
||||
transform: translate3d(0, 0, 0);
|
||||
-webkit-backface-visibility: hidden;
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
}
|
||||
</style>
|
||||
@@ -5,23 +5,22 @@
|
||||
</u-sticky>
|
||||
<view class="p14">
|
||||
<view class="top_box">
|
||||
<view class="tip_box flex ai-c jc-sb" v-if="tIndex==0">
|
||||
<view class="tip_box flex ai-c jc-sb" v-if="tIndex==0&&showTip">
|
||||
<view class="flex ai-c">
|
||||
<u-icon name="error-circle-fill" color="#FF6E02" size="18"></u-icon>
|
||||
<text class="ml10 fs12" style="color: #FF6E02;">{{title}}</text>
|
||||
</view>
|
||||
<u-icon name="close" color="#FF6E02" size="18"></u-icon>
|
||||
<u-icon name="close" color="#FF6E02" size="18" @tap="showTip=false"></u-icon>
|
||||
</view>
|
||||
<view class="p14">
|
||||
<text class="fs18 cor-000 fw600">{{tIndex==0?'错题':'收藏'}}情况</text>
|
||||
<view class="total_box mt10">
|
||||
<view class="total_box mt10" @tap="toPractice">
|
||||
<view class="flex ai-c jc-sb">
|
||||
<view class="text-center">
|
||||
<view style="width: 111rpx;" class="fs30 cor-000">{{tIndex==0?wrongList.length:collectList.length}}
|
||||
</view>
|
||||
</view>
|
||||
<view style="text-align: right;flex-direction: column;justify-content: right" class="flex ai-c"
|
||||
@tap="toPractice">
|
||||
<view style="text-align: right;flex-direction: column;justify-content: right" class="flex ai-c">
|
||||
<u-icon name="arrow-right" size="18"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
@@ -47,41 +46,28 @@
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex jc-sb ai-c mt10" v-if="tIndex==0">
|
||||
<!-- <view class="flex jc-sb ai-c mt10" v-if="tIndex==0">
|
||||
<text>答对后自动移除错题</text>
|
||||
<u-switch v-model="isMoveWrong" activeColor="#0BD032"></u-switch>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view style="margin-top: 30rpx;" v-if="tIndex==0">
|
||||
<view class="video-box">
|
||||
<view class="flex jc-sb ai-c wp100">
|
||||
<text style="color: #05C341;font-size: 36rpx;">科{{subject==1?'一':'四'}}精品视频课</text>
|
||||
<text class="cor-666 fs12">全部10节课 ></text>
|
||||
</view>
|
||||
<view class="flex ai-c mt20">
|
||||
<view class="contain-box relative">
|
||||
<image class="contain-box" src="../../../static/image/index/jpsp.png"></image>
|
||||
<image class="play_btn_2" src="../../static/image/index/play.png" />
|
||||
</view>
|
||||
<!-- <view class="ml15 text-center">
|
||||
<!-- <view class="ml15 text-center">
|
||||
<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">科{{subject==1?'一':'四'}}易错试题</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="top_box mt15 p14">
|
||||
<view class="top_box mt15 p14" v-if="typeList&&typeList.length">
|
||||
<view class="flex jc-sb aic">
|
||||
<text class="fs18 cor-000 fw600">{{tIndex==0?'错题':'收藏题'}}分类</text>
|
||||
<!-- <u-icon name="arrow-right" size="18"></u-icon> -->
|
||||
</view>
|
||||
<view class="flex ai-c jc-sb" style="flex-wrap: wrap;">
|
||||
<view v-for="(item,index) of typeList" :key="index" class="category_item p14 flex jc-sb ai-c mb10">
|
||||
<view class="flex ai-c jc-sb mt10" style="flex-wrap: wrap;">
|
||||
<!-- 这个点击效果没加 -->
|
||||
<view v-for="(item,index) of typeList" :key="index" class="category_item p14 flex jc-sb ai-c mb10" @tap="toCategoryQuestion(item)">
|
||||
<text class="cor-000">{{item.categoryName}}</text>
|
||||
<text class="cor-666">{{item.num}}</text>
|
||||
</view>
|
||||
@@ -92,6 +78,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
} from 'pinia' //引入映射函数
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
import storage from '@/jtools/storage';
|
||||
import {
|
||||
questionCategory
|
||||
@@ -99,6 +90,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showTip: true,
|
||||
collectList: [],
|
||||
rightList: storage.get(`rightList_subject${this.subject}`) || [],
|
||||
wrongList: storage.get(`wrongList_subject${this.subject}`) || [],
|
||||
@@ -124,6 +116,7 @@
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["orderQuestion_subject1", "orderQuestion_subject4"]), //映射函数,取出tagslist
|
||||
getPercent() {
|
||||
return ((this.wrongList.length / (this.wrongList.length + this.rightList.length)) * 100).toFixed(0)
|
||||
}
|
||||
@@ -144,37 +137,49 @@
|
||||
this.tIndex = val.index
|
||||
this.getQuestionCategory()
|
||||
},
|
||||
toCategoryQuestion(item){
|
||||
const jsonString = JSON.stringify(item.errorQuestionIdList)
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/questionBank?navTitle=" + item.categoryName + "&questionIdList=" + jsonString
|
||||
})
|
||||
},
|
||||
toPractice() {
|
||||
const navTitle = this.tIndex == 0 ? '错题本' : '收藏夹'
|
||||
let arr=[]
|
||||
if (navTitle == '错题本') {
|
||||
arr = this.wrongList
|
||||
if (!this.wrongList.length) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '当前无错题,继续保持吧~',
|
||||
showCancel:false,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '当前无错题,继续保持吧~',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
return
|
||||
}
|
||||
} else if (navTitle == '收藏夹') {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '当前无收藏题~',
|
||||
showCancel:false,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
arr=this.collectList
|
||||
if (!this.collectList.length) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '当前无收藏题~',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return
|
||||
});
|
||||
return
|
||||
}
|
||||
}
|
||||
const listJson=JSON.stringify(arr)
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/questionBank?navTitle=" + navTitle + "&subject=" + this.subject
|
||||
url: "/pages/questionBank/questionBank?navTitle=" + navTitle + "&subject=" + this.subject+"&questionIdList="+listJson
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -244,7 +249,7 @@
|
||||
}
|
||||
|
||||
.category_item {
|
||||
width: 312rpx;
|
||||
width: 310rpx;
|
||||
height: 90rpx;
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
|
||||
|
Before Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 100 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 4.7 KiB |