练习-联调

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

@ -44,23 +44,21 @@
></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">
@ -87,13 +85,15 @@
</template> </template>
<script> <script>
import { getStudentStudyWorkList } from '@/api/eduApp'
export default { export default {
data() { data() {
return { return {
statusList: [ statusList: [
{ text: '全部', id: 0 }, { text: '全部', id: 0 },
{ text: '已完成', id: 1 }, { text: '已完成', id: 1 },
{ text: '未完成', id: 2 }, { text: '未完成', id: 2 }
], ],
// //
totalStatus: { totalStatus: {
@ -108,22 +108,22 @@
learnTypeRange: [ learnTypeRange: [
{ text: '学习类型', value: '' }, { text: '学习类型', value: '' },
{ text: '不学', value: 1 }, { text: '不学', value: 1 },
{ text: '要学', value: 2 }, { text: '要学', value: 2 }
], ],
outDateStatusRange: [ outDateStatusRange: [
{ text: '逾期状态', value: '' }, { text: '逾期状态', value: '' },
{ text: '临期', value: 1 }, { text: '临期', value: 1 },
{ text: '过期', value: 2 }, { text: '过期', value: 2 }
], ],
qualStatusRange: [ qualStatusRange: [
{ text: '合格状态', value: '' }, { text: '合格状态', value: '' },
{ text: '合格', value: 1 }, { text: '合格', value: 1 },
{ text: '不及格', value: 2 }, { text: '不及格', value: 2 }
], ],
signupStatusRange: [ signupStatusRange: [
{ text: '报名状态', value: '' }, { text: '报名状态', value: '' },
{ text: '报了', value: 1 }, { text: '报了', value: 1 },
{ text: '没报', value: 2 }, { text: '没报', value: 2 }
], ],
// //
projList: [ projList: [
@ -189,11 +189,22 @@
avatar: '/static/eduImg/avatar.jpg', avatar: '/static/eduImg/avatar.jpg',
user: '管理员', user: '管理员',
percent: 18 percent: 18
}, }
] ]
} }
}, },
mounted() {
this.getList()
},
methods: { methods: {
async getList() {
const params = {
userId: 31
}
const res = await getStudentStudyWorkList(params)
this.projList = res.data
console.log('🚀 ~ getList ~ res:', res)
},
chooseStatus(count) { chooseStatus(count) {
this.totalStatus.statusCount = count this.totalStatus.statusCount = count
console.log(this.totalStatus) console.log(this.totalStatus)
@ -219,51 +230,40 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.page { .page {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
background-color: #F8F8F8; background-color: #f8f8f8;
box-sizing: border-box; box-sizing: border-box;
padding: 0 10px; padding: 0 10px;
.status-secs { .status-secs {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 1vh; margin-bottom: 1vh;
view { view {
box-sizing: border-box; box-sizing: border-box;
padding: 0 15rpx; padding: 0 15rpx;
font-size: 18px; font-size: 18px;
color: #9EA2AC; color: #9ea2ac;
font-weight: bold; font-weight: bold;
} }
.active { .active {
font-size: 28px; font-size: 28px;
color: #000; color: #000;
} }
} }
.drops { .drops {
width: 100%; width: 100%;
margin-top: 1vh; margin-top: 1vh;
display: flex; display: flex;
} }
.project-cont { .project-cont {
width: 100%; width: 100%;
height: 10rpx; height: 10rpx;
display: flex; display: flex;
@ -271,7 +271,6 @@
flex-wrap: wrap; flex-wrap: wrap;
.single-proj { .single-proj {
width: 49%; width: 49%;
height: 30vh; height: 30vh;
margin-bottom: 1vh; margin-bottom: 1vh;
@ -282,30 +281,24 @@
background-color: #fff; background-color: #fff;
.img { .img {
width: 100%; width: 100%;
height: 45%; height: 45%;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.proj-detail { .proj-detail {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.detail-upper { .detail-upper {
width: 100%; width: 100%;
height: 65%; height: 65%;
border-bottom: 1px solid #DFDFDF; border-bottom: 1px solid #dfdfdf;
box-sizing: border-box; box-sizing: border-box;
padding: 5px; padding: 5px;
display: flex; display: flex;
@ -313,24 +306,18 @@
justify-content: space-around; justify-content: space-around;
.icons { .icons {
font-size: 12px; font-size: 12px;
color: #C0C0C0; color: #c0c0c0;
display: flex; display: flex;
align-items: center; align-items: center;
span { span {
padding-left: 5rpx; padding-left: 5rpx;
} }
} }
} }
.detail-lower { .detail-lower {
flex: 1; flex: 1;
box-sizing: border-box; box-sizing: border-box;
padding: 5px; padding: 5px;
@ -338,7 +325,6 @@
align-items: center; align-items: center;
.avatar { .avatar {
width: 5vh; width: 5vh;
height: 5vh; height: 5vh;
border-radius: 50%; border-radius: 50%;
@ -346,16 +332,12 @@
margin-right: 10rpx; margin-right: 10rpx;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.progress { .progress {
flex: 1; flex: 1;
box-sizing: border-box; box-sizing: border-box;
font-size: 12px; font-size: 12px;
@ -364,21 +346,12 @@
justify-content: space-around; justify-content: space-around;
.bar { .bar {
flex: 1; 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({