练习-联调

This commit is contained in:
binbin_pan 2024-08-24 18:27:34 +08:00
parent cca07aa193
commit f7b913a5cf
7 changed files with 392 additions and 338 deletions

View File

@ -152,3 +152,21 @@ export function updateRemoveRecordData(params) {
data: params data: params
}) })
} }
// 学习项目-列表 /personalCenter/getStudentStudyWorkList
export function getStudentStudyWorkList(params) {
return request({
url: '/personalCenter/getStudentStudyWorkList',
method: 'post',
data: params
})
}
// 学习项目-目录 /studyWork/StudyWorkAll
export function studyWorkAll(params) {
return request({
url: '/studyWork/StudyWorkAll',
method: 'post',
data: params
})
}

View File

@ -3,6 +3,9 @@ module.exports = {
// baseUrl:'/prod-api', // baseUrl:'/prod-api',
// baseUrl:'http://112.29.103.165:1616/ynuw', // baseUrl:'http://112.29.103.165:1616/ynuw',
baseUrl:'http://192.168.0.137:2900/exam-student', baseUrl:'http://192.168.0.137:2900/exam-student',
// baseUrl:'http://192.168.0.137:2911/exam-bmw',
// 图片展示基础地址
imgUrl:'http://192.168.0.137:2900/exam-file',
// 上传文件地址 // 上传文件地址
uploadUrl: 'http://192.168.0.137:2909/exam-file/file/uploadBase64', uploadUrl: 'http://192.168.0.137:2909/exam-file/file/uploadBase64',
bmwUrl: 'http://192.168.0.137:2911/exam-bmw', bmwUrl: 'http://192.168.0.137:2911/exam-bmw',

View File

@ -1,66 +1,64 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar title="学习项目" @leftClick="leftClick" placeholder /> <u-navbar title="学习项目" @leftClick="leftClick" placeholder />
<view class="status-secs"> <view class="status-secs">
<view <view
v-for="(item, index) in statusList" v-for="(item, index) in statusList"
:key="item.id" :key="item.id"
:class="[ { active: totalStatus.statusCount === item.id } ]" :class="[{ active: totalStatus.statusCount === item.id }]"
@click="chooseStatus(item.id)" @click="chooseStatus(item.id)"
> >
{{ item.text }} {{ item.text }}
</view> </view>
</view> </view>
<uni-easyinput <uni-easyinput
prefixIcon="search" prefixIcon="search"
v-model="totalStatus.keyword" v-model="totalStatus.keyword"
placeholder="请输入项目名称" placeholder="请输入项目名称"
@iconClick="toggleSearch" @iconClick="toggleSearch"
></uni-easyinput> ></uni-easyinput>
<zb-dropdown-menu style="width: 100%"> <zb-dropdown-menu style="width: 100%">
<zb-dropdown-item <zb-dropdown-item
name="first" name="first"
:options="learnTypeRange" :options="learnTypeRange"
v-model="totalStatus.learnType" v-model="totalStatus.learnType"
@change="statusChange" @change="statusChange"
></zb-dropdown-item> ></zb-dropdown-item>
<zb-dropdown-item <zb-dropdown-item
name="two" name="two"
:options="outDateStatusRange" :options="outDateStatusRange"
v-model="totalStatus.outDateStatus" v-model="totalStatus.outDateStatus"
@change="statusChange" @change="statusChange"
></zb-dropdown-item> ></zb-dropdown-item>
<zb-dropdown-item <zb-dropdown-item
name="three" name="three"
:options="qualStatusRange" :options="qualStatusRange"
v-model="totalStatus.qualStatus" v-model="totalStatus.qualStatus"
@change="statusChange" @change="statusChange"
></zb-dropdown-item> ></zb-dropdown-item>
<zb-dropdown-item <zb-dropdown-item
name="four" name="four"
:options="signupStatusRange" :options="signupStatusRange"
v-model="totalStatus.signupStatus" v-model="totalStatus.signupStatus"
@change="statusChange" @change="statusChange"
></zb-dropdown-item> ></zb-dropdown-item>
</zb-dropdown-menu> </zb-dropdown-menu>
<view class="project-cont"> <view class="project-cont">
<view <view v-for="(item, index) in projList" :key="item.id" class="single-proj" @click="toggleDetail(item.id)">
v-for="(item, index) in projList"
:key="item.id"
class="single-proj"
@click="toggleDetail(item.id)"
>
<h4 class="img"> <h4 class="img">
<image :src="item.img"></image> <image src="https://cdn.uviewui.com/uview/swiper/1.jpg"></image>
</h4> </h4>
<view class="proj-detail"> <view class="proj-detail">
<view class="detail-upper"> <view class="detail-upper">
<h5 style="font-size: 16px">{{ item.title }}</h5> <h5 style="font-size: 16px">{{ item.name }}</h5>
<l-starRate v-model="item.star" :disabled="true"></l-starRate> <l-starRate v-model="item.star" :disabled="true"></l-starRate>
<view class="icons"> <view class="icons">
<uni-icons color="#c0c0c0" type="eye-filled"></uni-icons><span>3</span> <uni-icons color="#c0c0c0" type="eye-filled"></uni-icons>
<uni-icons color="#c0c0c0" type="chat-filled" style="margin-left: 5rpx"></uni-icons><span>3</span> <span>3</span>
<uni-icons color="#c0c0c0" type="hand-up-filled" style="margin-left: 5rpx"></uni-icons><span>3</span> <uni-icons color="#c0c0c0" type="chat-filled" style="margin-left: 5rpx"></uni-icons>
<span>3</span>
<uni-icons color="#c0c0c0" type="hand-up-filled" style="margin-left: 5rpx"></uni-icons>
<span>3</span>
</view> </view>
</view> </view>
<view class="detail-lower"> <view class="detail-lower">
@ -71,11 +69,11 @@
<span>{{ item.user }}</span> <span>{{ item.user }}</span>
<view class="bar"> <view class="bar">
<liu-progressbar <liu-progressbar
:progress="item.percent" :progress="item.percent"
color="#000" color="#000"
:height="'10rpx'" :height="'10rpx'"
bgColor="#1989FA" bgColor="#1989FA"
:textInside="false" :textInside="false"
/> />
</view> </view>
</view> </view>
@ -87,298 +85,273 @@
</template> </template>
<script> <script>
export default { import { getStudentStudyWorkList } from '@/api/eduApp'
data() {
return { export default {
statusList: [ data() {
{ text: '全部', id: 0 }, return {
{ text: '已完成', id: 1 }, statusList: [
{ text: '未完成', id: 2 }, { text: '全部', id: 0 },
], { text: '已完成', id: 1 },
// { text: '未完成', id: 2 }
totalStatus: { ],
statusCount: 0, //
keyword: '', totalStatus: {
learnType: '', statusCount: 0,
outDateStatus: '', keyword: '',
qualStatus: '', learnType: '',
signupStatus: '' outDateStatus: '',
qualStatus: '',
signupStatus: ''
},
//
learnTypeRange: [
{ text: '学习类型', value: '' },
{ text: '不学', value: 1 },
{ text: '要学', value: 2 }
],
outDateStatusRange: [
{ text: '逾期状态', value: '' },
{ text: '临期', value: 1 },
{ text: '过期', value: 2 }
],
qualStatusRange: [
{ text: '合格状态', value: '' },
{ text: '合格', value: 1 },
{ text: '不及格', value: 2 }
],
signupStatusRange: [
{ text: '报名状态', value: '' },
{ text: '报了', value: 1 },
{ text: '没报', value: 2 }
],
//
projList: [
{
id: 1,
img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '应急抢险',
star: 5,
avatar: '/static/eduImg/avatar.jpg',
user: '管理员',
percent: 71
}, },
// {
learnTypeRange: [ id: 2,
{ text: '学习类型', value: '' }, img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
{ text: '不学', value: 1 }, title: '应急抢险',
{ text: '要学', value: 2 }, star: 3,
], avatar: '/static/eduImg/avatar.jpg',
outDateStatusRange: [ user: '管理员',
{ text: '逾期状态', value: '' }, percent: 33
{ text: '临期', value: 1 }, },
{ text: '过期', value: 2 }, {
], id: 3,
qualStatusRange: [ img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
{ text: '合格状态', value: '' }, title: '应急抢险',
{ text: '合格', value: 1 }, star: 2,
{ text: '不及格', value: 2 }, avatar: '/static/eduImg/avatar.jpg',
], user: '管理员',
signupStatusRange: [ percent: 94
{ text: '报名状态', value: '' }, },
{ text: '报了', value: 1 }, {
{ text: '没报', value: 2 }, id: 4,
], img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
// title: '应急抢险',
projList: [ star: 4,
{ avatar: '/static/eduImg/avatar.jpg',
id: 1, user: '管理员',
img: 'https://cdn.uviewui.com/uview/swiper/1.jpg', percent: 76
title: '应急抢险', },
star: 5, {
avatar: '/static/eduImg/avatar.jpg', id: 5,
user: '管理员', img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
percent: 71 title: '应急抢险',
}, star: 1,
{ avatar: '/static/eduImg/avatar.jpg',
id: 2, user: '管理员',
img: 'https://cdn.uviewui.com/uview/swiper/1.jpg', percent: 63
title: '应急抢险', },
star: 3, {
avatar: '/static/eduImg/avatar.jpg', id: 6,
user: '管理员', img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
percent: 33 title: '应急抢险',
}, star: 5,
{ avatar: '/static/eduImg/avatar.jpg',
id: 3, user: '管理员',
img: 'https://cdn.uviewui.com/uview/swiper/1.jpg', percent: 52
title: '应急抢险', },
star: 2, {
avatar: '/static/eduImg/avatar.jpg', id: 7,
user: '管理员', img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
percent: 94 title: '应急抢险',
}, star: 4,
{ avatar: '/static/eduImg/avatar.jpg',
id: 4, user: '管理员',
img: 'https://cdn.uviewui.com/uview/swiper/1.jpg', percent: 18
title: '应急抢险', }
star: 4, ]
avatar: '/static/eduImg/avatar.jpg', }
user: '管理员', },
percent: 76 mounted() {
}, this.getList()
{ },
id: 5, methods: {
img: 'https://cdn.uviewui.com/uview/swiper/1.jpg', async getList() {
title: '应急抢险', const params = {
star: 1, userId: 31
avatar: '/static/eduImg/avatar.jpg',
user: '管理员',
percent: 63
},
{
id: 6,
img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '应急抢险',
star: 5,
avatar: '/static/eduImg/avatar.jpg',
user: '管理员',
percent: 52
},
{
id: 7,
img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '应急抢险',
star: 4,
avatar: '/static/eduImg/avatar.jpg',
user: '管理员',
percent: 18
},
]
}
},
methods: {
chooseStatus(count) {
this.totalStatus.statusCount = count
console.log(this.totalStatus)
},
toggleSearch() {
console.log(this.totalStatus)
},
statusChange(item) {
console.log(this.totalStatus)
},
toggleDetail(id) {
uni.navigateTo({
url: `/pages/YNEduApp/learnProj/learnProjDetail?id=${id}`
})
},
leftClick() {
uni.navigateTo({
url: '/pages/YNEduApp/index/index'
})
} }
} const res = await getStudentStudyWorkList(params)
} this.projList = res.data
console.log('🚀 ~ getList ~ res:', res)
},
chooseStatus(count) {
this.totalStatus.statusCount = count
console.log(this.totalStatus)
},
toggleSearch() {
console.log(this.totalStatus)
},
statusChange(item) {
console.log(this.totalStatus)
},
toggleDetail(id) {
uni.navigateTo({
url: `/pages/YNEduApp/learnProj/learnProjDetail?id=${id}`
})
},
leftClick() {
uni.navigateTo({
url: '/pages/YNEduApp/index/index'
})
}
}
}
</script> </script>
<style lang="scss"> <style lang="scss">
.page {
width: 100vw;
height: 100vh;
background-color: #f8f8f8;
box-sizing: border-box;
padding: 0 10px;
.page{ .status-secs {
width: 100%;
display: flex;
align-items: center;
margin-bottom: 1vh;
width: 100vw; view {
height: 100vh; box-sizing: border-box;
background-color: #F8F8F8; padding: 0 15rpx;
box-sizing: border-box; font-size: 18px;
padding: 0 10px; color: #9ea2ac;
font-weight: bold;
}
.status-secs{ .active {
font-size: 28px;
color: #000;
}
}
width: 100%; .drops {
display: flex; width: 100%;
align-items: center; margin-top: 1vh;
display: flex;
}
.project-cont {
width: 100%;
height: 10rpx;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.single-proj {
width: 49%;
height: 30vh;
margin-bottom: 1vh; margin-bottom: 1vh;
border-radius: 10px;
overflow: hidden;
display: flex;
flex-direction: column;
background-color: #fff;
view{ .img {
width: 100%;
box-sizing: border-box; height: 45%;
padding: 0 15rpx;
font-size: 18px;
color: #9EA2AC;
font-weight: bold;
image {
width: 100%;
height: 100%;
}
} }
.active{ .proj-detail {
flex: 1;
font-size: 28px;
color: #000;
}
}
.drops{
width: 100%;
margin-top: 1vh;
display: flex;
}
.project-cont{
width: 100%;
height: 10rpx;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.single-proj{
width: 49%;
height: 30vh;
margin-bottom: 1vh;
border-radius: 10px;
overflow: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-color: #fff;
.img{
.detail-upper {
width: 100%; width: 100%;
height: 45%; height: 65%;
border-bottom: 1px solid #dfdfdf;
image{ box-sizing: border-box;
padding: 5px;
width: 100%;
height: 100%;
}
}
.proj-detail{
flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around;
.detail-upper{ .icons {
font-size: 12px;
color: #c0c0c0;
display: flex;
align-items: center;
width: 100%; span {
height: 65%; padding-left: 5rpx;
border-bottom: 1px solid #DFDFDF; }
}
}
.detail-lower {
flex: 1;
box-sizing: border-box;
padding: 5px;
display: flex;
align-items: center;
.avatar {
width: 5vh;
height: 5vh;
border-radius: 50%;
overflow: hidden;
margin-right: 10rpx;
image {
width: 100%;
height: 100%;
}
}
.progress {
flex: 1;
box-sizing: border-box; box-sizing: border-box;
padding: 5px; font-size: 12px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
.icons{ .bar {
font-size: 12px;
color: #C0C0C0;
display: flex;
align-items: center;
span{
padding-left: 5rpx;
}
}
}
.detail-lower{
flex: 1;
box-sizing: border-box;
padding: 5px;
display: flex;
align-items: center;
.avatar{
width: 5vh;
height: 5vh;
border-radius: 50%;
overflow: hidden;
margin-right: 10rpx;
image{
width: 100%;
height: 100%;
}
}
.progress{
flex: 1; flex: 1;
box-sizing: border-box;
font-size: 12px;
display: flex;
flex-direction: column;
justify-content: space-around;
.bar{
flex: 1;
}
} }
} }
} }
} }
} }
} }
}
</style> </style>

View File

@ -2,13 +2,13 @@
<view class="page"> <view class="page">
<u-navbar title="学习项目" @leftClick="leftClick" placeholder /> <u-navbar title="学习项目" @leftClick="leftClick" placeholder />
<view class="proj-cont"> <view class="proj-cont">
<h2 style="margin-bottom: 15rpx">这是标题</h2> <h2 style="margin-bottom: 15rpx">{{ name }}</h2>
<span style="font-size: 12px; color: #b0b0b0">合格标准学习进度完成100%考试及格一场练习通过一场</span> <span style="font-size: 12px; color: #b0b0b0">合格标准{{ eligibility }}</span>
<view class="user-info"> <view class="user-info">
<view class="info-lef"> <view class="info-lef">
<view class="avatar"> <view class="avatar">
<image src="/static/eduImg/avatar.jpg"></image> <image src="/static/eduImg/avatar.jpg"></image>
<span style="font-size: 18px">马晓峰</span> <span style="font-size: 18px">{{ createUserName }}</span>
</view> </view>
<view style="display: flex; align-items: center"> <view style="display: flex; align-items: center">
<l-starRate v-model="starRate" :disabled="true" style="margin-right: 1vw"></l-starRate> <l-starRate v-model="starRate" :disabled="true" style="margin-right: 1vw"></l-starRate>
@ -19,7 +19,7 @@
<view class="rig-up"> <view class="rig-up">
<view> <view>
培训内容 培训内容
<span>6</span> <span>{{ listStageContentNum }}</span>
</view> </view>
<view style="margin-left: 2vw"> <view style="margin-left: 2vw">
观看记录 观看记录
@ -149,11 +149,18 @@
</template> </template>
<script> <script>
import { studyWorkAll } from '@/api/eduApp'
import config from 'config'
export default { export default {
data() { data() {
return { return {
projId: '', projId: '',
starRate: 4, starRate: 4,
name: '',
createUserName: '',
listStageContentNum: 0,
eligibility: '',
learnIconObj: { color: '#1A63AC', size: '18', type: 'calendar' }, learnIconObj: { color: '#1A63AC', size: '18', type: 'calendar' },
pracIconObj: { color: '#38B022', size: '18', type: 'compose' }, pracIconObj: { color: '#38B022', size: '18', type: 'compose' },
theoryLearnList: [ theoryLearnList: [
@ -188,9 +195,35 @@ export default {
}, },
onLoad(params) { onLoad(params) {
this.projId = params.id this.projId = params.id
console.log(this.projId) console.log('🚀 ~ onLoad ~ this.projId:', this.projId, config)
this.getStudyWorkAll()
}, },
methods: { methods: {
//
async getStudyWorkAll() {
let params = { userId: '31', id: this.projId, type: '1' }
// uni.request({
// method: 'post',
// url: config.bmwUrl + '/studyWork/StudyWorkAll',
// data: params,
// header: {
// 'Content-Type': 'application/x-www-form-urlencoded',
// Authorization: 'Bearer' + uni.getStorageSync('App-Token')
// },
// dataType: 'json',
// success: res => {
// console.log('🚀 ~ getStudyWorkAll ~ res:', res)
// }
// })
const res = await studyWorkAll(params)
this.name = res.name
this.createUserName = res.createUserName
this.listStageContentNum = res.listStageContentNum
this.eligibility = res.eligibility
console.log('🚀 ~ getStudyWorkAll ~ res:', res)
},
toggleTheoryLearn(id) { toggleTheoryLearn(id) {
console.log(id) console.log(id)
uni.navigateTo({ uni.navigateTo({

View File

@ -12,17 +12,17 @@
</div> </div>
<div class="total" @click="openSelect"> <div class="total" @click="openSelect">
<u-icon name="/static/images/quanbufenlei.png" size="15" /> <u-icon name="/static/images/quanbufenlei.png" size="15" />
<div class="num">{{ allNum }}</div> <div class="num">{{ nowNum }}/{{ allNum }}</div>
</div> </div>
</div> </div>
<div class="question-wrapper" v-for="(item, index) in questionList" :key="index"> <div class="question-wrapper" v-for="(item, index) in questionList" :key="index">
<div v-if="item.examType !== 2"> <div v-if="item.examType !== 2">
<div class="title">{{ item.paperTopic }}{{ item.examType == 1 ? '(单选题)' : '(判断题)' }}</div> <div class="title">{{ nowNum }}.{{ item.paperTopic }}{{ item.examType == 1 ? '(单选题)' : '(判断题)' }}</div>
<u--image <u--image
v-if="item.analyUrl" v-if="item.paperTopicUrl"
:showLoading="true" :showLoading="true"
:src="item.analyUrl" :src="config.imgUrl + item.paperTopicUrl || ''"
width="60px" width="60px"
height="60px" height="60px"
style="margin-bottom: 10px" style="margin-bottom: 10px"
@ -81,8 +81,8 @@
</div> </div>
<div v-if="item.isSelect"> <div v-if="item.isSelect">
<div>正确答案{{ item.correctGrade.join('、') }}</div> <div>正确答案{{ item.correctGrade.split('').join('、') }}</div>
<div>你的答案{{ item.select.join('、') }}</div> <div>你的答案{{ item.select && item.select.join('、') }}</div>
<div class="analysis">知识点</div> <div class="analysis">知识点</div>
<div class="analysis-container">{{ item.answerAnaly }}</div> <div class="analysis-container">{{ item.answerAnaly }}</div>
@ -104,6 +104,7 @@
</div> </div>
<div class="btn"> <div class="btn">
<u-button <u-button
v-show="nowNum > 1"
type="primary" type="primary"
size="small" size="small"
shape="circle" shape="circle"
@ -114,6 +115,7 @@
</div> </div>
<div class="btn"> <div class="btn">
<u-button <u-button
v-show="nowNum < allNum"
type="primary" type="primary"
size="small" size="small"
shape="circle" shape="circle"
@ -162,10 +164,10 @@
:key="index" :key="index"
class="topic-wrapper" class="topic-wrapper"
:class="{ correct: item.isCorrect, error: item.isError }" :class="{ correct: item.isCorrect, error: item.isError }"
@click="handleJump(null, index)" @click="handleJump('jump', item.index)"
> >
<div v-if="currentIndex == index">*</div> <div v-if="currentIndex == item.index">*</div>
<div class="topic">{{ index + 1 }}</div> <div class="topic">{{ item.index }}</div>
</div> </div>
</div> </div>
</view> </view>
@ -184,6 +186,8 @@ import {
savePracticeDuration, // savePracticeDuration, //
updateRemoveRecordData // updateRemoveRecordData //
} from '@/api/eduApp' } from '@/api/eduApp'
import config from 'config'
export default { export default {
data() { data() {
return { return {
@ -192,6 +196,7 @@ export default {
isNew: 1, // isNew: 1, //
isOutOfOrder: 1, // isOutOfOrder: 1, //
isError: false, // isError: false, //
nowNum: 0, //
showModal: false, showModal: false,
showModalSelect: false, showModalSelect: false,
// //
@ -216,10 +221,10 @@ export default {
onLoad(opt) { onLoad(opt) {
opt = JSON.parse(opt.params) opt = JSON.parse(opt.params)
this.practiceId = opt.practiceId this.practiceId = opt.practiceId
this.recordId = opt.recordId this.recordId = opt.recordId || ''
this.isNew = opt.isNew this.isNew = opt.isNew || ''
this.isOutOfOrder = opt.isOutOfOrder this.isOutOfOrder = opt.isOutOfOrder || ''
this.isError = opt.isError this.isError = opt.isError || ''
console.log('🚀 ~ onLoad ~ opt:', opt) console.log('🚀 ~ onLoad ~ opt:', opt)
}, },
mounted() { mounted() {
@ -238,12 +243,14 @@ export default {
const params = { const params = {
practiceId: this.practiceId, practiceId: this.practiceId,
recordId: this.recordId, recordId: this.recordId,
isNew: this.isNew isNew: this.isNew || '',
isMiss: this.isError ? 1 : ''
} }
const res = await getPracticeItData(params) const res = await getPracticeItData(params)
this.trueNum = res.data.trueNum this.trueNum = res.data.trueNum
this.falseNum = res.data.falseNum this.falseNum = res.data.falseNum
this.allNum = res.data.allNum this.allNum = res.data.allNum
this.nowNum = res.data.nowNum
console.log('🚀 ~ getPracticeItData ~ res:', res) console.log('🚀 ~ getPracticeItData ~ res:', res)
}, },
// //
@ -252,23 +259,33 @@ export default {
const params = { const params = {
practiceId: this.practiceId, practiceId: this.practiceId,
recordId: this.recordId, recordId: this.recordId,
isNew: this.isNew, isNew: this.isNew || '',
isOutOfOrder: this.isOutOfOrder isOutOfOrder: this.isOutOfOrder || '',
isMiss: this.isError ? 1 : ''
} }
const res = await getPracticeQuestion(params) const res = await getPracticeQuestion(params)
// this.questionList = res.data this.recordId = res.data.recordId
this.questionList.push(res.data) this.questionList.push(res.data)
console.log('🚀 ~ getPracticeQuestion ~ res:', res) console.log('🚀 ~ getPracticeQuestion ~ res:', res)
console.log('🚀 ~ getPracticeQuestion ~ this.questionList:', this.questionList) console.log('🚀 ~ getPracticeQuestion ~ this.questionList:', this.questionList)
}, },
// //
async handleJump(item, index) { async handleJump(item, index) {
if (item === 'prev') {
this.nowNum -= 1
} else if (item === 'next') {
this.nowNum += 1
} else if (item === 'jump') {
this.nowNum = index
}
this.currentIndex = index this.currentIndex = index
this.questionList = [] this.questionList = []
const params = { const params = {
recordId: this.recordId, recordId: this.recordId || '',
operate: item || '', operate: item || '',
sort: index + 1 || '' sort: this.nowNum,
isMiss: this.isError ? 1 : ''
} }
const res = await changeQuestion(params) const res = await changeQuestion(params)
this.questionList.push(res.data) this.questionList.push(res.data)
@ -277,10 +294,13 @@ export default {
// - // -
async getPracticeQuestionList() { async getPracticeQuestionList() {
const params = { const params = {
id: this.practiceId recordId: this.recordId,
id: this.practiceId,
isMiss: this.isError ? 1 : ''
} }
const res = await getPracticeQuestionList(params) const res = await getPracticeQuestionList(params)
console.log('🚀 ~ getPracticeQuestionList ~ res:', res) console.log('🚀 ~ getPracticeQuestionList ~ res:', res)
this.questionListSelect = res.data
}, },
// - // -
startTimer() { startTimer() {
@ -326,7 +346,7 @@ export default {
// - // -
this.questionList[0].listOption[index].isCorrect = true this.questionList[0].listOption[index].isCorrect = true
// +1 // +1
// this.trueNum++ this.trueNum++
} else { } else {
// //
this.questionList[0].select = option.optionIdent this.questionList[0].select = option.optionIdent
@ -341,7 +361,7 @@ export default {
} }
}) })
// +1 // +1
// this.falseNum++ this.falseNum++
} }
const params = { const params = {
practiceId: this.practiceId, practiceId: this.practiceId,
@ -378,12 +398,12 @@ export default {
// //
this.questionList[0].isSelect = true this.questionList[0].isSelect = true
const select = this.questionList[0].select const select = this.questionList[0].select
const correctGrade = this.questionList[0].correctGrade const correctGrade = this.questionList[0].correctGrade.split('')
// //
const isCorrect = select.sort().toString() === correctGrade.sort().toString() const isCorrect = select.sort().toString() === correctGrade.sort().toString()
if (isCorrect) { if (isCorrect) {
// +1 // +1
// this.trueNum++ this.trueNum++
// //
this.questionList[0].listOption.forEach(item => { this.questionList[0].listOption.forEach(item => {
if (item.isCheck) { if (item.isCheck) {
@ -398,7 +418,7 @@ export default {
}) })
} else { } else {
// +1 // +1
// this.falseNum++ this.falseNum++
// //
this.questionList[0].isError = true this.questionList[0].isError = true
// //
@ -410,6 +430,15 @@ export default {
} }
}) })
} }
const params = {
practiceId: this.practiceId,
recordId: this.recordId,
questionId: this.questionList[0].questionId,
selectAnswer: select.join(''),
isTrue: isCorrect ? 1 : 0
}
console.log('🚀 ~ handleOk ~ params-多选:', params)
insertPracticeAnswerById(params)
} }
}, },
// //

View File

@ -102,8 +102,6 @@ export default {
const params = { const params = {
practiceId: item.id, practiceId: item.id,
recordId: item.recordId, recordId: item.recordId,
isNew: 0,
isOutOfOrder: 1,
isError: true isError: true
} }
uni.navigateTo({ uni.navigateTo({

View File

@ -141,17 +141,17 @@ export default {
isError: false isError: false
} }
if (type === 1) { if (type === 1) {
params.isOutOfOrder = 0 params.isOutOfOrder = '0'
params.isNew = 0 params.isNew = '0'
} else if (type === 2) { } else if (type === 2) {
params.isOutOfOrder = 0 params.isOutOfOrder = '0'
params.isNew = 1 params.isNew = '1'
} else if (type === 3) { } else if (type === 3) {
params.isOutOfOrder = 1 params.isOutOfOrder = 1
params.isNew = 0 params.isNew = '0'
} else if (type === 4) { } else if (type === 4) {
params.isOutOfOrder = 1 params.isOutOfOrder = '1'
params.isNew = 1 params.isNew = '1'
} }
console.log('params', params) console.log('params', params)
uni.navigateTo({ uni.navigateTo({