Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="btns" @click="jumps('')">
|
||||
<view class="btns" @click="jumps('/packageB/train/wrongAnswer/mistakeNotebook')">
|
||||
<image src="/packageB/static/images/train/ctb-k.png" mode=""></image>
|
||||
<view>
|
||||
<text>错题本 </text>
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
|
||||
<script setup>
|
||||
import { inject, ref, reactive } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
const { $api, navTo, navBack,urls } = inject('globalFunction');
|
||||
import config from "@/config.js"
|
||||
const userInfo = ref({});
|
||||
@@ -147,9 +147,12 @@ const examInfo = ref({})
|
||||
const baseUrl = config.imgBaseUrl
|
||||
const dialogVisible = ref(false);
|
||||
const handleScrollToLower = () => {
|
||||
|
||||
getDataList('add');
|
||||
};
|
||||
onLoad(() => {
|
||||
|
||||
});
|
||||
onShow(()=>{
|
||||
getDictionary()
|
||||
const date = new Date();
|
||||
let year = date.getFullYear();
|
||||
@@ -160,7 +163,7 @@ onLoad(() => {
|
||||
dates.value=year+'-'+month+'-'+day
|
||||
Authorization.value=uni.getStorageSync('Padmin-Token')||''
|
||||
getHeart();
|
||||
});
|
||||
})
|
||||
function getHeart() {
|
||||
const raw =Authorization.value;
|
||||
const token = typeof raw === "string" ? raw.trim() : "";
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<div class="parse1">正确答案:</div>
|
||||
<div class="parse2" v-if="item.type=='single'" style="color: #30A0FF;font-weight: bold;">{{String.fromCharCode(65 + Number(item.answer))}}.</div>
|
||||
<div class="parse2" v-if="item.type=='multiple'" style="color: #30A0FF;font-weight: bold;">
|
||||
<span v-for="(val,i) in parseOptions(item.answer)">{{indexToLetter(val-1)}}.</span>
|
||||
<span v-for="(val,i) in parseOptions(item.answer)">{{indexToLetter(Number(val))}}.</span>
|
||||
</div>
|
||||
<div class="parse2" v-if="item.type=='judge'" style="color: #30A0FF;font-weight: bold;">{{item.answer}}</div>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,585 @@
|
||||
<template>
|
||||
<div>错题本</div>
|
||||
<div class="app-box">
|
||||
<div class="con-box">
|
||||
<template #headContent>
|
||||
<view class="collection-search">
|
||||
<view class="search-content">
|
||||
<view class="header-input button-click">
|
||||
<uni-icons class="iconsearch" color="#6A6A6A" type="search" size="22"></uni-icons>
|
||||
<input
|
||||
class="input"
|
||||
v-model="searchKeyword"
|
||||
@confirm="searchVideo"
|
||||
placeholder="输入题目关键词"
|
||||
placeholder-class="inputplace"
|
||||
/>
|
||||
<uni-icons
|
||||
v-if="searchKeyword"
|
||||
class="clear-icon"
|
||||
type="clear"
|
||||
size="24"
|
||||
color="#999"
|
||||
@click="clearSearch"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<checkbox-group>
|
||||
<label>
|
||||
<checkbox :value="checkeds" :checked="checkeds" @click="selects()" />全选
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
<div class="serchBtns">
|
||||
<div class="btn" @click="startPractice" style="background-color: #4B9FF5;">开始练习</div>
|
||||
<div class="btn" @click="batchMark" style="background-color: #FF9F51;">批量标记</div>
|
||||
<div class="btn" @click="clearNotebook" style="background-color: #F1705F;">清空错题本</div>
|
||||
</div>
|
||||
</template>
|
||||
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLower">
|
||||
<div class="cards" v-for="(item,index) in dataList">
|
||||
<div class="choices">
|
||||
<checkbox-group>
|
||||
<label>
|
||||
<checkbox value="cb" :checked="item.checked" @click="choice(index)" color="#FFCC33" style="transform:scale(0.7)" />
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</div>
|
||||
<div class="cardHead">
|
||||
<div class="cardHeadLeft">
|
||||
<div class="cardTitle">{{item.content}}</div>
|
||||
</div>
|
||||
<div class="titleType primary2" v-if="item.status==0">未复习</div>
|
||||
<div class="titleType primary" v-if="item.status==1">已复习</div>
|
||||
<div class="titleType success" v-if="item.status==2">已掌握</div>
|
||||
</div>
|
||||
<div class="heng"></div>
|
||||
<div class="cardCon">
|
||||
<div class="conten" style="width: 40%;">类型:
|
||||
<div class="titleType primary" v-if="item.type=='single'">单选</div>
|
||||
<div class="titleType success" v-if="item.type=='multiple'">多选</div>
|
||||
<div class="titleType tertiary" v-if="item.type=='judge'">判断</div>
|
||||
</div>
|
||||
<div class="conten" style="width: 60%;">错误时间:{{item.errorTime}}</div>
|
||||
<div class="conten" style="width: 40%;">等级:
|
||||
<div class="titleType success" v-if="item.diffculty=='easy'">初级</div>
|
||||
<div class="titleType tertiary" v-if="item.diffculty=='medium'">中级</div>
|
||||
<div class="titleType primary2" v-if="item.diffculty=='hard'">高级</div>
|
||||
</div>
|
||||
<div class="conten" style="width: 60%;">最后复习:{{item.reviewTime || '未复习'}}</div>
|
||||
</div>
|
||||
<div class="flooter">
|
||||
<div @click="handleDetail(item)">查看详情</div>
|
||||
<div @click="removeFromNotebook(item.questionId,3)">移出错题</div>
|
||||
</div>
|
||||
</div>
|
||||
</scroll-view>
|
||||
</div>
|
||||
<div class="cards2" v-if="dialogVisible">
|
||||
<div class="cardCon" style="height: 50%;">
|
||||
<div class="cardHead" style="margin-bottom: 30rpx;">
|
||||
<div>批量标记</div>
|
||||
<div style="font-size: 40rpx;" @click="clones()">×</div>
|
||||
</div>
|
||||
<div class="detailTitle">已选择{{selectedItems.length}}道错题</div>
|
||||
<div class="status-tags">
|
||||
<radio-group @change="radioChange">
|
||||
<label class="uni-list-cell uni-list-cell-pd">
|
||||
<view style="margin: 20rpx 20%;">
|
||||
<radio :value="1" :checked="1 === current" />标记为已复习
|
||||
</view>
|
||||
<view style="margin: 20rpx 20%;">
|
||||
<radio :value="2" :checked="2 === current" />标记为已掌握
|
||||
</view>
|
||||
<view style="margin: 20rpx 20%;">
|
||||
<radio :value="3" :checked="3 === current" />移出错题本
|
||||
</view>
|
||||
|
||||
<!-- <view>{{item.name}}</view> -->
|
||||
</label>
|
||||
</radio-group>
|
||||
</div>
|
||||
|
||||
<div style="display: flex;justify-content: center;margin-top: 30rpx;">
|
||||
<div class="rightBtn" @click="mark()">标记</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup>
|
||||
import { inject, ref, reactive,watch } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
const { $api, navTo, navBack,urls } = inject('globalFunction');
|
||||
import config from "@/config.js"
|
||||
const userInfo = ref({});
|
||||
const Authorization = ref('');
|
||||
const searchKeyword = ref('');
|
||||
const dataList=ref([])
|
||||
const pageSize=ref(10)
|
||||
const pageNum=ref(1)
|
||||
const totalNum=ref(0)
|
||||
const dates=ref('')
|
||||
// const classification=ref([])
|
||||
// const levalLabels=ref([])
|
||||
const examInfo = ref({})
|
||||
const baseUrl = config.imgBaseUrl
|
||||
const dialogVisible = ref(false);
|
||||
const checkeds = ref(false);
|
||||
const selectedItems = ref([]);
|
||||
const current = ref("");
|
||||
const handleScrollToLower = () => {
|
||||
getDataList('add');
|
||||
};
|
||||
function selects(){
|
||||
checkeds.value=!checkeds.value;
|
||||
dataList.value.forEach(item=>{
|
||||
item.checked=checkeds.value
|
||||
})
|
||||
};
|
||||
function choice(i){
|
||||
dataList.value[i].checked=!dataList.value[i].checked;
|
||||
}
|
||||
onLoad(() => {
|
||||
// getDictionary()
|
||||
// const date = new Date();
|
||||
// let year = date.getFullYear();
|
||||
// let month = date.getMonth() + 1; // 月份从0开始,需要加1
|
||||
// let day = date.getDate();
|
||||
// month=month>9?month:'0'+month
|
||||
// day=day>9?day:'0'+day
|
||||
// dates.value=year+'-'+month+'-'+day
|
||||
// Authorization.value=uni.getStorageSync('Padmin-Token')||''
|
||||
// getHeart();
|
||||
});
|
||||
onShow(()=>{
|
||||
Authorization.value=uni.getStorageSync('Padmin-Token')||''
|
||||
getHeart();
|
||||
})
|
||||
function getHeart() {
|
||||
const raw =Authorization.value;
|
||||
const token = typeof raw === "string" ? raw.trim() : "";
|
||||
const headers = token ? { 'Authorization': raw.startsWith("Bearer ") ? raw : `Bearer ${token}` }: {}
|
||||
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
|
||||
if (resData.code == 200) {
|
||||
getUserInfo();
|
||||
} else {
|
||||
navTo('/packageB/login')
|
||||
}
|
||||
});
|
||||
};
|
||||
function getUserInfo(){
|
||||
let header={
|
||||
'Authorization':Authorization.value
|
||||
}
|
||||
$api.myRequest('/system/user/login/user/info', {},'get',10100,header).then((resData) => {
|
||||
userInfo.value = resData.info || {};
|
||||
getDataList('refresh');
|
||||
});
|
||||
};
|
||||
// function getDictionary(){
|
||||
// $api.myRequest('/system/public/dict/data/type/question_classification', {},'get',9100).then((resData) => {
|
||||
// classification.value=resData.data
|
||||
// });
|
||||
// $api.myRequest('/system/public/dict/data/type/question_level', {},'get',9100).then((resData) => {
|
||||
// levalLabels.value=resData.data
|
||||
// });
|
||||
// }
|
||||
// 搜索
|
||||
function searchVideo() {
|
||||
getDataList('refresh');
|
||||
}
|
||||
|
||||
// 清除搜索内容
|
||||
function clearSearch() {
|
||||
searchKeyword.value = '';
|
||||
getDataList('refresh');
|
||||
}
|
||||
// 获取错题列表
|
||||
function getDataList(type = 'add') {
|
||||
let maxPage=Math.ceil(totalNum.value/pageSize.value)
|
||||
let params={}
|
||||
if (type === 'refresh') {
|
||||
pageNum.value = 1;
|
||||
params={
|
||||
content:searchKeyword.value,
|
||||
pageSize:pageSize.value,
|
||||
pageNum:pageNum.value,
|
||||
userId:userInfo.value.userId
|
||||
}
|
||||
$api.myRequest('/train/public/mistackUser/mistackTable', params).then((resData) => {
|
||||
if(resData.code==200){
|
||||
dataList.value=resData.rows
|
||||
totalNum.value=resData.total
|
||||
dataList.value.forEach(item=>{
|
||||
item.checked=false
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
if (type === 'add' && pageNum.value < maxPage) {
|
||||
pageNum.value += 1;
|
||||
params={
|
||||
content:searchKeyword.value,
|
||||
pageSize:pageSize.value,
|
||||
pageNum:pageNum.value,
|
||||
userId:userInfo.value.userId
|
||||
}
|
||||
$api.myRequest('/train/public/mistackUser/mistackTable', params).then((resData) => {
|
||||
if(resData.code==200){
|
||||
dataList.value=dataList.value.concat(resData.rows)
|
||||
totalNum.value=resData.total
|
||||
dataList.value.forEach(item=>{
|
||||
item.checked=false
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function handleDetail(row){
|
||||
navTo(`/packageB/train/wrongAnswer/wrongDetail?questionId=${row.questionId}`);
|
||||
}
|
||||
function startPractice(row){
|
||||
navTo('/packageB/train/wrongAnswer/questionPractice');
|
||||
}
|
||||
function clones(){
|
||||
dialogVisible.value=false
|
||||
}
|
||||
function radioChange(evt) {
|
||||
current.value=evt.detail.value;
|
||||
}
|
||||
|
||||
function clearNotebook() {
|
||||
$api.myRequest('/train/public/mistackUser/clear', {
|
||||
userId:userInfo.value.userId,
|
||||
}).then((resData) => {
|
||||
if(resData&&resData.code==200){
|
||||
getDataList('refresh');
|
||||
}
|
||||
});
|
||||
};
|
||||
function batchMark() {
|
||||
// 批量标记逻辑
|
||||
dataList.value.forEach(item=>{
|
||||
if(item.checked){
|
||||
selectedItems.value.push(item)
|
||||
}
|
||||
})
|
||||
if(selectedItems.value.length>0){
|
||||
dialogVisible.value=true
|
||||
}else{
|
||||
$api.msg('请先选择要标记的错题!')
|
||||
}
|
||||
};
|
||||
function mark(){
|
||||
let ids=[]
|
||||
selectedItems.value.forEach(item=>{
|
||||
ids.push(item.questionId)
|
||||
})
|
||||
$api.myRequest('/train/public/mistackUser/batchUpdate', {
|
||||
userId:userInfo.value.userId,
|
||||
questionIds:ids.join(","),
|
||||
status:current.value
|
||||
}).then((resData) => {
|
||||
if(resData&&resData.code==200){
|
||||
if(current.value==3){
|
||||
$api.msg('移出成功!')
|
||||
}else{
|
||||
$api.msg('标记成功!')
|
||||
}
|
||||
dialogVisible.value=false
|
||||
getDataList('refresh');
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
function removeFromNotebook(id,i) {
|
||||
$api.myRequest('/train/public/mistackUser/batchUpdate', {
|
||||
userId:userInfo.value.userId,
|
||||
questionId:id,
|
||||
status:i
|
||||
}).then((resData) => {
|
||||
if(resData&&resData.code==200){
|
||||
if(i==3){
|
||||
$api.msg('移出成功!')
|
||||
}else{
|
||||
$api.msg('标记成功!')
|
||||
}
|
||||
getDataList('refresh');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style lang="stylus" scoped>
|
||||
.app-box{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: relative;
|
||||
.con-box{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top:0;
|
||||
z-index: 10;
|
||||
padding: 20rpx 28rpx;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
.serchBtns{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20rpx;
|
||||
.btn{
|
||||
width: 30%;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
text-align: center
|
||||
color: #fff;
|
||||
border-radius: 10rpx
|
||||
}
|
||||
}
|
||||
.collection-search{
|
||||
padding: 10rpx 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.search-content{
|
||||
width: 80%;
|
||||
position: relative
|
||||
display: flex
|
||||
align-items: center
|
||||
padding: 14rpx 0
|
||||
.header-input{
|
||||
padding: 0
|
||||
width: calc(100%);
|
||||
position: relative
|
||||
.iconsearch{
|
||||
position: absolute
|
||||
left: 30rpx;
|
||||
top: 50%
|
||||
transform: translate(0, -50%)
|
||||
z-index: 1
|
||||
}
|
||||
.input{
|
||||
padding: 0 80rpx 0 80rpx
|
||||
height: 80rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 75rpx 75rpx 75rpx 75rpx;
|
||||
border: 2rpx solid #ECECEC
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.clear-icon{
|
||||
position: absolute
|
||||
right: 30rpx;
|
||||
top: 50%
|
||||
transform: translate(0, -50%)
|
||||
z-index: 1
|
||||
cursor: pointer
|
||||
}
|
||||
.inputplace{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #B5B5B5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.main-scroll {
|
||||
width: 100%;
|
||||
height: 85%;
|
||||
.cards{
|
||||
width: 100%;
|
||||
height: 280rpx;
|
||||
background: linear-gradient(0deg, #E3EFFF 0%, #FBFDFF 100%);
|
||||
// box-shadow: 0px 0px 6px 0px rgba(0,71,200,0.32);
|
||||
border-radius: 12rpx;
|
||||
border: 2px solid #EDF5FF;
|
||||
margin-bottom: 30rpx;
|
||||
padding: 30rpx 40rpx 0;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
.choices{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -10rpx;
|
||||
}
|
||||
.cardHead{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.cardHeadLeft{
|
||||
display: flex;
|
||||
align-items: center
|
||||
width: 75%;
|
||||
.cardTitle{
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #0069CB;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.titleType{
|
||||
border-radius: 4px;
|
||||
font-size: 22rpx;
|
||||
color: #157EFF;
|
||||
width: 100rpx;
|
||||
height: 38rpx;
|
||||
text-align: center;
|
||||
line-height: 38rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
.heng{
|
||||
width: 120rpx;
|
||||
height: 4rpx;
|
||||
background: linear-gradient(88deg, #015EEA 0%, #00C0FA 100%);
|
||||
margin: 10rpx 0 20rpx;
|
||||
}
|
||||
.cardCon{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
.conten{
|
||||
width: 50%;
|
||||
font-size: 22rpx;
|
||||
color: #666666;
|
||||
display: flex;
|
||||
align-items: center
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.status-tags{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.flooter{
|
||||
border-top: 1px solid #ccc;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
view{
|
||||
font-size: 28rpx;
|
||||
margin-left: 30rpx;
|
||||
color: #2175F3;
|
||||
padding-top: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.cards2{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
z-index: 10000;
|
||||
padding: 100rpx 50rpx;
|
||||
box-sizing: border-box;
|
||||
.cardCon{
|
||||
height: 70%;
|
||||
background-color: #fff;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
.cardHead{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
.titleType{
|
||||
display: inline-block
|
||||
border-radius: 4px;
|
||||
font-size: 22rpx;
|
||||
color: #157EFF;
|
||||
width: 100rpx;
|
||||
height: 38rpx;
|
||||
text-align: center;
|
||||
line-height: 38rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.primary{
|
||||
border: 1px solid #157EFF!important;
|
||||
color: #157EFF!important
|
||||
}
|
||||
.success{
|
||||
border: 1px solid #05A636!important;
|
||||
color: #05A636!important
|
||||
}
|
||||
.info{
|
||||
border: 1px solid #898989!important;
|
||||
color: #898989!important
|
||||
}
|
||||
.tertiary{
|
||||
border: 1px solid #E6A340!important;
|
||||
color: #E6A340!important
|
||||
}
|
||||
.primary2{
|
||||
border: 1px solid #F56C6C!important;
|
||||
color: #F56C6C!important
|
||||
}
|
||||
.rightBtn{
|
||||
width: 140rpx;
|
||||
height: 44rpx;
|
||||
line-height: 44rpx;
|
||||
background: linear-gradient(90deg, #00C0FA 0%, #1271FF 100%);
|
||||
border-radius: 4px;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.detailTitle{
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
margin: 30rpx 0;
|
||||
}
|
||||
.detailCon{
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.exam-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 35rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
font-family: 'D-DIN-Medium';
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.info-divider {
|
||||
width: 2px;
|
||||
background-color: #C3E1FF;
|
||||
}
|
||||
</style>
|
||||
540
packageB/train/wrongAnswer/questionPractice.vue
Normal file
540
packageB/train/wrongAnswer/questionPractice.vue
Normal file
@@ -0,0 +1,540 @@
|
||||
<template>
|
||||
<div class="app-box">
|
||||
<image src="/packageB/static/images/train/bj.jpg" class="bjImg" mode=""></image>
|
||||
<div class="con-box">
|
||||
<div class="header">
|
||||
<div>错题练习</div>
|
||||
<div class="headBtn" @click="complete()">退出</div>
|
||||
</div>
|
||||
<div class="problemCard">
|
||||
<div v-for="(item,index) in problemData" :key="index">
|
||||
<template v-if="questionIndex==(index+1)">
|
||||
<div class="problemTitle">
|
||||
<span class="titleType" v-if="item.type=='single'">单选题</span>
|
||||
<span class="titleType" v-if="item.type=='multiple'">多选题</span>
|
||||
<span class="titleType" v-if="item.type=='judge'">判断题</span>
|
||||
<span>{{item.content}}</span>
|
||||
</div>
|
||||
<div class="options" v-if="item.type=='single'">
|
||||
<div class="opt" @click="selected(i)" :class="radio!==''&&i==radio?'active':''" v-for="(val,i) in parseOptions(item.trainChooses)">
|
||||
<div class="optLab">{{indexToLetter(i)}}</div>
|
||||
<span>{{val}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="options" v-if="item.type=='multiple'">
|
||||
<div class="opt" @click="selected2(i)" :class="judgment(i)?'active':''" v-for="(val,i) in parseOptions(item.trainChooses)">
|
||||
<div class="optLab">{{indexToLetter(i)}}</div>
|
||||
<span>{{val}}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="options" v-if="item.type=='judge'">
|
||||
<div class="opt" @click="selected3('正确')" :class="radio2=='正确'?'active':''">
|
||||
<span>正确</span>
|
||||
</div>
|
||||
<div class="opt" @click="selected3('错误')" :class="radio2=='错误'?'active':''">
|
||||
<span>错误</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="analysis" v-if="analysis">
|
||||
<div class="analysisHead correct" v-if="judgWhether=='正确'">
|
||||
<div>回答正确!</div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="analysisHead errors" v-if="judgWhether=='错误'">
|
||||
<div>回答错误!</div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="analysisCon">
|
||||
<div class="parse1">正确答案:</div>
|
||||
<div class="parse2" v-if="item.type=='single'" style="color: #30A0FF;font-weight: bold;">{{String.fromCharCode(65 + Number(item.answer))}}.</div>
|
||||
<div class="parse2" v-if="item.type=='multiple'" style="color: #30A0FF;font-weight: bold;">
|
||||
<span v-for="(val,i) in parseOptions(item.answer)">{{indexToLetter(Number(val))}}.</span>
|
||||
</div>
|
||||
<div class="parse2" v-if="item.type=='judge'" style="color: #30A0FF;font-weight: bold;">{{item.answer}}</div>
|
||||
</div>
|
||||
<div class="analysisCon">
|
||||
<div class="parse1">答案解析:</div>
|
||||
<div class="parse2">{{item.answerDesc}}</div>
|
||||
</div>
|
||||
<div class="analysisCon">
|
||||
<div class="parse1">知识点:</div>
|
||||
<div>
|
||||
<el-tag style="margin-right: 10px;">{{item.knowledgePoint}}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="problemBtns">
|
||||
<div v-if="analysis&&judgWhether!=''&&questionIndex!=problemData.length" @click="questionIndex+=1">下一题</div>
|
||||
<div v-else :class="((radio===''&&radio2===''&&checkList.length==0&&isRunning)||analysis)?'events':''" @click="submit()">提交答案</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="footerLeft">
|
||||
<div class="zuo" :class="questionIndex==1?'events':''" @click="questionIndex-=1"></div>
|
||||
<div class="you" :class="questionIndex==problemData.length?'events':''" @click="questionIndex+=1"></div>
|
||||
|
||||
</div>
|
||||
<div class="footerLeft">
|
||||
<div>
|
||||
<div class="icons" style="background-color: #1CADF5;">√</div>
|
||||
<div class="texts" style="color: #1CADF5;">{{correctIndex}}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="icons" style="background-color: #FF6668;">×</div>
|
||||
<div class="texts" style="color: #FF6668;">{{errorsIndex}}</div>
|
||||
</div>
|
||||
<div @click="dialogVisible=true">
|
||||
<div><span style="color: #1CADF5;">{{questionIndex}}</span>/{{problemData.length}}</div>
|
||||
<div>题号</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cards" v-if="dialogVisible">
|
||||
<div class="cardCon">
|
||||
<div class="cardHead">
|
||||
<div>题号</div>
|
||||
<div style="font-size: 40rpx;" @click="clones()">×</div>
|
||||
</div>
|
||||
<div class="questionNums">
|
||||
<div class="questions" :class="item.whether=='正确'?'questionCorrect':item.whether=='错误'?'questionError':questionIndex==(index+1)?'questionsActive':''" @click="switchs(index)" v-for="(item,index) in problemList" :key="index">{{index+1}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, inject, watch, ref, onMounted,onBeforeUnmount,computed } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
const { $api,urls , navTo,navBack , vacanciesTo, formatTotal, config } = inject('globalFunction');
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
import useDictStore from '@/stores/useDictStore';
|
||||
const userInfo = ref({});
|
||||
const Authorization = ref('');
|
||||
const radio = ref('');
|
||||
const radio2 = ref('');
|
||||
const checkList = ref([]);
|
||||
const questionIndex = ref(1);
|
||||
const correctIndex = ref(0);
|
||||
const errorsIndex = ref(0);
|
||||
const analysis = ref(false);
|
||||
const judgWhether = ref('');
|
||||
const isRunning = ref(false);
|
||||
const dialogVisible = ref(false);
|
||||
const problemData = ref([]);
|
||||
const problemList = ref([]);
|
||||
watch(questionIndex, (newVal, oldVal) => {
|
||||
radio.value=""
|
||||
radio2.value=""
|
||||
checkList.value=[]
|
||||
analysis.value=false
|
||||
judgWhether.value=""
|
||||
});
|
||||
|
||||
onLoad((options) => {
|
||||
Authorization.value=uni.getStorageSync('Padmin-Token')||''
|
||||
getHeart();
|
||||
});
|
||||
onShow(()=>{
|
||||
|
||||
})
|
||||
|
||||
function getHeart() {
|
||||
const raw =Authorization.value;
|
||||
const token = typeof raw === "string" ? raw.trim() : "";
|
||||
const headers = token ? { 'Authorization': raw.startsWith("Bearer ") ? raw : `Bearer ${token}` }: {}
|
||||
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
|
||||
if (resData.code == 200) {
|
||||
getUserInfo();
|
||||
} else {
|
||||
navTo('/packageB/login')
|
||||
}
|
||||
});
|
||||
};
|
||||
function getUserInfo(){
|
||||
let header={
|
||||
'Authorization':Authorization.value
|
||||
}
|
||||
$api.myRequest('/system/user/login/user/info', {},'get',10100,header).then((resData) => {
|
||||
userInfo.value = resData.info || {};
|
||||
// userId.value=resData.info.userId
|
||||
queryData()
|
||||
});
|
||||
};
|
||||
function queryData(){
|
||||
problemData.value=[]
|
||||
let header={
|
||||
'Authorization':Authorization.value,
|
||||
'Content-Type':"application/x-www-form-urlencoded"
|
||||
}
|
||||
$api.myRequest('/train/public/mistackUser/getMistackPractice', {
|
||||
userId: userInfo.value.userId
|
||||
},'post',9100,header).then((resData) => {
|
||||
if(resData&&resData.code==200){
|
||||
resData.data.forEach((item,i)=>{
|
||||
problemData.value.push(item)
|
||||
problemList.value.push({index:i+1,whether:""})
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//提交答案
|
||||
function submit(){
|
||||
let indexs=questionIndex.value-1
|
||||
let parm={
|
||||
questionId:problemData.value[indexs].questionId,
|
||||
userId:userInfo.value.userId,
|
||||
trueAnswer:problemData.value[indexs].answer
|
||||
}
|
||||
if(problemData.value[indexs].type=='single'){
|
||||
parm.submitAnswer=radio.value
|
||||
}else if(problemData.value[indexs].type=='multiple'){
|
||||
parm.submitAnswer=checkList.value.join(',')
|
||||
}else if(problemData.value[indexs].type=='judge'){
|
||||
parm.submitAnswer=radio2.value
|
||||
}
|
||||
let header={
|
||||
'Authorization':Authorization.value,
|
||||
'Content-Type':"application/x-www-form-urlencoded"
|
||||
}
|
||||
$api.myRequest('/train/public/mistackUser/submitAnswer', parm,'post',9100,header).then((resData) => {
|
||||
if(resData&&resData.code==200){
|
||||
analysis.value=true
|
||||
judgWhether.value=resData.msg
|
||||
problemList.value[indexs].whether=resData.msg
|
||||
if(resData.msg=='正确'){
|
||||
correctIndex.value++
|
||||
}else if(resData.msg=='错误'){
|
||||
errorsIndex.value++
|
||||
}
|
||||
if(questionIndex.value==problemData.value.length){
|
||||
$api.msg('已经是最后一题了')
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
function selected(i){
|
||||
radio.value=i
|
||||
};
|
||||
//多选
|
||||
function selected2(i){
|
||||
let arr=checkList.value.join(",")
|
||||
if(arr.indexOf(i) !== -1){
|
||||
const index = checkList.value.indexOf(i);
|
||||
if (index !== -1) {
|
||||
checkList.value.splice(index, 1);
|
||||
}
|
||||
}else{
|
||||
checkList.value.push(i)
|
||||
}
|
||||
};
|
||||
function judgment(i){
|
||||
let arr=checkList.value.join(",")
|
||||
if(arr.indexOf(i) !== -1){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
};
|
||||
function selected3(i){
|
||||
radio2.value=i
|
||||
};
|
||||
// 解析选项
|
||||
function parseOptions(options) {
|
||||
if (!options) return [];
|
||||
// 假设options是字符串格式,以分号分隔
|
||||
if (typeof options === 'string') {
|
||||
return options.split(',').filter(opt => opt.trim());
|
||||
}
|
||||
// 如果是数组,直接返回
|
||||
if (Array.isArray(options)) {
|
||||
return options;
|
||||
}
|
||||
return [];
|
||||
};
|
||||
function indexToLetter(index) {
|
||||
// 将索引转换为对应的字母
|
||||
return String.fromCharCode(65 + index);
|
||||
};
|
||||
|
||||
function clones(){
|
||||
dialogVisible.value=false
|
||||
};
|
||||
function switchs(i){
|
||||
questionIndex.value=(i+1)
|
||||
dialogVisible.value=false
|
||||
};
|
||||
function complete(){
|
||||
navBack()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.app-box{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: relative;
|
||||
.bjImg{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.con-box{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top:0;
|
||||
z-index: 10;
|
||||
padding: 20rpx 28rpx;
|
||||
box-sizing: border-box;
|
||||
.header{
|
||||
height: 100rpx;
|
||||
padding: 0 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: linear-gradient(0deg, #4285EC 0%, #0BBAFB 100%);
|
||||
color: #fff;
|
||||
font-size: 26rpx;
|
||||
border-radius: 10rpx
|
||||
.headBtn{
|
||||
background: #499FFF;
|
||||
border-radius: 4px;
|
||||
width: 100rpx;
|
||||
text-align: center;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
}
|
||||
.problemCard{
|
||||
margin-top: 30rpx;
|
||||
.problemTitle{
|
||||
font-size: 30rpx;
|
||||
.titleType{
|
||||
display: inline-block;
|
||||
background-color: #499FFF;
|
||||
border-radius: 10rpx 10rpx 10rpx 0;
|
||||
padding: 8rpx 12rpx;
|
||||
color: #fff;
|
||||
font-size: 26rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
.options{
|
||||
margin-top: 30rpx;
|
||||
.opt{
|
||||
height: 60rpx;
|
||||
/* background-color: #F8F9FA; */
|
||||
border-radius: 5px;
|
||||
margin-bottom: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 30rpx;
|
||||
box-sizing: border-box;
|
||||
color: #808080;
|
||||
font-size: 30rpx;
|
||||
.optLab{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
text-align: center;
|
||||
line-height: 40rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #8C8C8C;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
font-size: 32rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
.active{
|
||||
background: linear-gradient(90deg, #25A9F5 0%, #B1DBFF 100%);
|
||||
color: #fff!important;
|
||||
font-weight: bold;
|
||||
}
|
||||
.active>view{
|
||||
background-color: #fff!important;
|
||||
color: #25A9F5!important;
|
||||
}
|
||||
}
|
||||
.analysis{
|
||||
margin-top: 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 15rpx;
|
||||
border: 1px solid #10A8FF;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
.analysisHead{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 32rpx;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
.correct{
|
||||
color: #67C23A;
|
||||
}
|
||||
.errors{
|
||||
color: #F06A6A;
|
||||
}
|
||||
.analysisCon{
|
||||
margin-top: 30rpx;
|
||||
.parse1{
|
||||
font-size: 30rpx;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
}
|
||||
.parse2{
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.problemBtns{
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: center
|
||||
view{
|
||||
width: 140rpx
|
||||
height: 50rpx
|
||||
text-align: center
|
||||
line-height: 50rpx
|
||||
background-color: #10A8FF
|
||||
color: #fff
|
||||
font-size: 28rpx
|
||||
border-radius: 5rpx
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.footer{
|
||||
width: 100%;
|
||||
height: 120rpx;
|
||||
border-top: 1px solid #ddd
|
||||
position: fixed
|
||||
bottom: 0
|
||||
left: 0
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: space-between
|
||||
.footerLeft{
|
||||
display: flex
|
||||
align-items: center
|
||||
font-size: 30rpx;
|
||||
text-align: center
|
||||
.zuo{
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
border-top: 2px solid #666
|
||||
border-left: 2px solid #666
|
||||
transform: rotate(-45deg); /* 鼠标悬停时旋转360度 */
|
||||
margin-left: 60rpx;
|
||||
}
|
||||
.you{
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
border-right: 2px solid #666
|
||||
border-bottom: 2px solid #666
|
||||
transform: rotate(-45deg); /* 鼠标悬停时旋转360度 */
|
||||
// margin-left: 30rpx;
|
||||
margin-right: 50rpx;
|
||||
}
|
||||
.icons{
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 30rpx;
|
||||
border-radius: 50%
|
||||
}
|
||||
.texts{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
.footerLeft>view{
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
.footerBtn{
|
||||
width: 140rpx
|
||||
height: 50rpx
|
||||
text-align: center
|
||||
line-height: 50rpx
|
||||
background-color: #67C23A
|
||||
color: #fff
|
||||
font-size: 28rpx
|
||||
border-radius: 5rpx
|
||||
}
|
||||
}
|
||||
}
|
||||
.cards{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
z-index: 1000;
|
||||
padding: 100rpx 50rpx;
|
||||
box-sizing: border-box;
|
||||
.cardCon{
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
.cardHead{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.questionNums{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.questions{
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 2px solid #E0E0E0;
|
||||
font-size: 28rpx;
|
||||
margin-right: 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.questionsActive{
|
||||
background-color: #F0F9FF;
|
||||
border: 2px solid #409EFF;
|
||||
}
|
||||
.questionCorrect{
|
||||
background-color: #F0F9FF;
|
||||
border: 2px solid #64BC38;
|
||||
color: #6BC441;
|
||||
}
|
||||
.questionError{
|
||||
background-color: #FFF1F0;
|
||||
border: 2px solid #F56C6C;
|
||||
color: #F36B6B;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.events{
|
||||
pointer-events: none; /* 这会禁用所有指针事件 */
|
||||
opacity: 0.5; /* 可选:改变透明度以视觉上表示不可点击 */
|
||||
cursor: not-allowed; /* 可选:改变鼠标光标样式 */
|
||||
}
|
||||
</style>
|
||||
442
packageB/train/wrongAnswer/wrongDetail.vue
Normal file
442
packageB/train/wrongAnswer/wrongDetail.vue
Normal file
@@ -0,0 +1,442 @@
|
||||
<template>
|
||||
<div class="app-box">
|
||||
<image src="/packageB/static/images/train/bj.jpg" class="bjImg" mode=""></image>
|
||||
<div class="con-box">
|
||||
<div class="problemCard">
|
||||
<div>
|
||||
<div class="problemTitle">
|
||||
<span class="titleType" v-if="problemData.type=='single'">单选题</span>
|
||||
<span class="titleType" v-if="problemData.type=='multiple'">多选题</span>
|
||||
<span class="titleType" v-if="problemData.type=='judge'">判断题</span>
|
||||
<span>{{problemData.content}}</span>
|
||||
</div>
|
||||
<div class="options" v-if="problemData.type=='single'">
|
||||
<div class="opt" :class="problemData.submitAnswer!==''&&i==problemData.submitAnswer?'active':''" v-for="(val,i) in parseOptions(problemData.trainChooses)">
|
||||
<div class="optLab">{{indexToLetter(i)}}</div>
|
||||
<span>{{val}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="options" v-if="problemData.type=='multiple'">
|
||||
<div class="opt" :class="judgment(i)?'active':''" v-for="(val,i) in parseOptions(problemData.trainChooses)">
|
||||
<div class="optLab">{{indexToLetter(i)}}</div>
|
||||
<span>{{val}}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="options" v-if="problemData.type=='judge'">
|
||||
<div class="opt" :class="problemData.submitAnswer=='正确'?'active':''">
|
||||
<span>正确</span>
|
||||
</div>
|
||||
<div class="opt" :class="problemData.submitAnswer=='错误'?'active':''">
|
||||
<span>错误</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="analysis">
|
||||
<div class="analysisHead correct" v-if="problemData.submitAnswer==problemData.trueAnswer">
|
||||
<div>回答正确!</div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="analysisHead errors" v-else>
|
||||
<div>回答错误!</div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="analysisCon">
|
||||
<div class="parse1">正确答案:</div>
|
||||
<div class="parse2" v-if="problemData.type=='single'" style="color: #30A0FF;font-weight: bold;">{{String.fromCharCode(65 + Number(problemData.trueAnswer))}}.</div>
|
||||
<div class="parse2" v-if="problemData.type=='multiple'" style="color: #30A0FF;font-weight: bold;">
|
||||
<span v-for="(val,i) in parseOptions(problemData.trueAnswer)">{{indexToLetter(Number(val))}}.</span>
|
||||
</div>
|
||||
<div class="parse2" v-if="problemData.type=='judge'" style="color: #30A0FF;font-weight: bold;">{{problemData.trueAnswer}}</div>
|
||||
</div>
|
||||
<div class="analysisCon">
|
||||
<div class="parse1">答案解析:</div>
|
||||
<div class="parse2">{{problemData.answerDesc}}</div>
|
||||
</div>
|
||||
<div class="analysisCon">
|
||||
<div class="parse1">知识点:</div>
|
||||
<div>
|
||||
<el-tag style="margin-right: 10px;">{{problemData.knowledgePoint}}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="problemBtns">
|
||||
<div @click="removeFromNotebook(2)">标记掌握</div>
|
||||
<div @click="removeFromNotebook(3)">移出错题</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, inject, watch, ref, onMounted,onBeforeUnmount,computed } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
const { $api,urls , navTo,navBack , vacanciesTo, formatTotal, config } = inject('globalFunction');
|
||||
import useUserStore from '@/stores/useUserStore';
|
||||
import useDictStore from '@/stores/useDictStore';
|
||||
const userInfo = ref({});
|
||||
const rows = ref({});
|
||||
const Authorization = ref('');
|
||||
const radio = ref('');
|
||||
const radio2 = ref('');
|
||||
const checkList = ref([]);
|
||||
const questionIndex = ref(1);
|
||||
const judgWhether = ref('');
|
||||
const problemData = ref({});
|
||||
|
||||
onLoad((options) => {
|
||||
rows.value=options
|
||||
Authorization.value=uni.getStorageSync('Padmin-Token')||''
|
||||
getHeart();
|
||||
});
|
||||
onShow(()=>{
|
||||
|
||||
})
|
||||
|
||||
function getHeart() {
|
||||
const raw =Authorization.value;
|
||||
const token = typeof raw === "string" ? raw.trim() : "";
|
||||
const headers = token ? { 'Authorization': raw.startsWith("Bearer ") ? raw : `Bearer ${token}` }: {}
|
||||
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
|
||||
if (resData.code == 200) {
|
||||
getUserInfo();
|
||||
} else {
|
||||
navTo('/packageB/login')
|
||||
}
|
||||
});
|
||||
};
|
||||
function getUserInfo(){
|
||||
let header={
|
||||
'Authorization':Authorization.value
|
||||
}
|
||||
$api.myRequest('/system/user/login/user/info', {},'get',10100,header).then((resData) => {
|
||||
userInfo.value = resData.info || {};
|
||||
// userId.value=resData.info.userId
|
||||
queryData()
|
||||
});
|
||||
};
|
||||
function queryData(){
|
||||
let header={
|
||||
'Authorization':Authorization.value,
|
||||
'Content-Type':"application/x-www-form-urlencoded"
|
||||
}
|
||||
$api.myRequest('/train/public/mistackUser/detail', {
|
||||
userId: userInfo.value.userId,
|
||||
questionId:rows.value.questionId,
|
||||
},'post',9100,header).then((resData) => {
|
||||
if(resData&&resData.code==200){
|
||||
problemData.value=resData.data;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
function removeFromNotebook(i) {
|
||||
$api.myRequest('/train/public/mistackUser/batchUpdate', {
|
||||
userId:userInfo.value.userId,
|
||||
questionId:rows.value.questionId,
|
||||
status:i
|
||||
}).then((resData) => {
|
||||
if(resData&&resData.code==200){
|
||||
if(i==3){
|
||||
$api.msg('移出成功!')
|
||||
}else{
|
||||
$api.msg('标记成功!')
|
||||
}
|
||||
navBack()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function judgment(i){
|
||||
let arr=checkList.value.join(",")
|
||||
if(arr.indexOf(i) !== -1){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
};
|
||||
|
||||
// 解析选项
|
||||
function parseOptions(options) {
|
||||
if (!options) return [];
|
||||
// 假设options是字符串格式,以分号分隔
|
||||
if (typeof options === 'string') {
|
||||
return options.split(',').filter(opt => opt.trim());
|
||||
}
|
||||
// 如果是数组,直接返回
|
||||
if (Array.isArray(options)) {
|
||||
return options;
|
||||
}
|
||||
return [];
|
||||
};
|
||||
function indexToLetter(index) {
|
||||
// 将索引转换为对应的字母
|
||||
return String.fromCharCode(65 + index);
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.app-box{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: relative;
|
||||
.bjImg{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.con-box{
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top:0;
|
||||
z-index: 10;
|
||||
padding: 20rpx 28rpx;
|
||||
box-sizing: border-box;
|
||||
.header{
|
||||
height: 100rpx;
|
||||
padding: 0 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: linear-gradient(0deg, #4285EC 0%, #0BBAFB 100%);
|
||||
color: #fff;
|
||||
font-size: 26rpx;
|
||||
border-radius: 10rpx
|
||||
.headBtn{
|
||||
background: #499FFF;
|
||||
border-radius: 4px;
|
||||
width: 100rpx;
|
||||
text-align: center;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
}
|
||||
.problemCard{
|
||||
margin-top: 30rpx;
|
||||
.problemTitle{
|
||||
font-size: 30rpx;
|
||||
.titleType{
|
||||
display: inline-block;
|
||||
background-color: #499FFF;
|
||||
border-radius: 10rpx 10rpx 10rpx 0;
|
||||
padding: 8rpx 12rpx;
|
||||
color: #fff;
|
||||
font-size: 26rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
.options{
|
||||
margin-top: 30rpx;
|
||||
.opt{
|
||||
height: 60rpx;
|
||||
/* background-color: #F8F9FA; */
|
||||
border-radius: 5px;
|
||||
margin-bottom: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 30rpx;
|
||||
box-sizing: border-box;
|
||||
color: #808080;
|
||||
font-size: 30rpx;
|
||||
.optLab{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
text-align: center;
|
||||
line-height: 40rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #8C8C8C;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
font-size: 32rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
.active{
|
||||
background: linear-gradient(90deg, #25A9F5 0%, #B1DBFF 100%);
|
||||
color: #fff!important;
|
||||
font-weight: bold;
|
||||
}
|
||||
.active>view{
|
||||
background-color: #fff!important;
|
||||
color: #25A9F5!important;
|
||||
}
|
||||
}
|
||||
.analysis{
|
||||
margin-top: 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 40rpx;
|
||||
border: 1px solid #10A8FF;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
.analysisHead{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 32rpx;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
.correct{
|
||||
color: #67C23A;
|
||||
}
|
||||
.errors{
|
||||
color: #F06A6A;
|
||||
}
|
||||
.analysisCon{
|
||||
margin-top: 30rpx;
|
||||
.parse1{
|
||||
font-size: 30rpx;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
}
|
||||
.parse2{
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.problemBtns{
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: center
|
||||
view{
|
||||
width: 140rpx
|
||||
height: 50rpx
|
||||
text-align: center
|
||||
line-height: 50rpx
|
||||
background-color: #10A8FF
|
||||
color: #fff
|
||||
font-size: 28rpx
|
||||
border-radius: 5rpx
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.footer{
|
||||
width: 100%;
|
||||
height: 120rpx;
|
||||
border-top: 1px solid #ddd
|
||||
position: fixed
|
||||
bottom: 0
|
||||
left: 0
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: space-between
|
||||
.footerLeft{
|
||||
display: flex
|
||||
align-items: center
|
||||
font-size: 30rpx;
|
||||
text-align: center
|
||||
.zuo{
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
border-top: 2px solid #666
|
||||
border-left: 2px solid #666
|
||||
transform: rotate(-45deg); /* 鼠标悬停时旋转360度 */
|
||||
margin-left: 60rpx;
|
||||
}
|
||||
.you{
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
border-right: 2px solid #666
|
||||
border-bottom: 2px solid #666
|
||||
transform: rotate(-45deg); /* 鼠标悬停时旋转360度 */
|
||||
// margin-left: 30rpx;
|
||||
margin-right: 50rpx;
|
||||
}
|
||||
.icons{
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 30rpx;
|
||||
border-radius: 50%
|
||||
}
|
||||
.texts{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
.footerLeft>view{
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
.footerBtn{
|
||||
width: 140rpx
|
||||
height: 50rpx
|
||||
text-align: center
|
||||
line-height: 50rpx
|
||||
background-color: #67C23A
|
||||
color: #fff
|
||||
font-size: 28rpx
|
||||
border-radius: 5rpx
|
||||
}
|
||||
}
|
||||
}
|
||||
.cards{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
z-index: 1000;
|
||||
padding: 100rpx 50rpx;
|
||||
box-sizing: border-box;
|
||||
.cardCon{
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
.cardHead{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.questionNums{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.questions{
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 2px solid #E0E0E0;
|
||||
font-size: 28rpx;
|
||||
margin-right: 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.questionsActive{
|
||||
background-color: #F0F9FF;
|
||||
border: 2px solid #409EFF;
|
||||
}
|
||||
.questionCorrect{
|
||||
background-color: #F0F9FF;
|
||||
border: 2px solid #64BC38;
|
||||
color: #6BC441;
|
||||
}
|
||||
.questionError{
|
||||
background-color: #FFF1F0;
|
||||
border: 2px solid #F56C6C;
|
||||
color: #F36B6B;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.events{
|
||||
pointer-events: none; /* 这会禁用所有指针事件 */
|
||||
opacity: 0.5; /* 可选:改变透明度以视觉上表示不可点击 */
|
||||
cursor: not-allowed; /* 可选:改变鼠标光标样式 */
|
||||
}
|
||||
</style>
|
||||
12
pages.json
12
pages.json
@@ -341,6 +341,18 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "错题本"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "train/wrongAnswer/questionPractice",
|
||||
"style": {
|
||||
"navigationBarTitleText": "错题练习"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "train/wrongAnswer/wrongDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "错题详情"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user