diff --git a/api/examination/index.js b/api/examination/index.js index ef3a46f..8270475 100644 --- a/api/examination/index.js +++ b/api/examination/index.js @@ -80,7 +80,7 @@ export const getQuestionOptions = (params) => { // 伴宠师工作台-添加用户基本考核答案 export const addBaseAnswer = (data) => { return request({ - url: '/applet/examination/addBaseAnswer', + url: '/applet/examination/addBaseAnswerV2', headers: { isToken: true }, @@ -185,3 +185,18 @@ export const retakeExam = (params) => { }) } + + +// 伴宠师工作台-查询考试结果对象 +export const getAnswerBuildData = (userId) => { + return request({ + url: '/applet/examination/getAnswerBuildData', + headers: { + isToken: true + }, + method: 'get', + params : { + userId + } + }).then(res => res.data) +} \ No newline at end of file diff --git a/components/order/ServiceItems.vue b/components/order/ServiceItems.vue index 27fb4f7..10b5aa8 100644 --- a/components/order/ServiceItems.vue +++ b/components/order/ServiceItems.vue @@ -11,10 +11,10 @@ {{item.day}} | - {{ item.itemsText[0] }} {{ item.itemsText[0] }}+{{ item.itemsText[item.itemsText.length - 1] }}{{ item.itemsText.length }}项 + {{ item.itemsText[0] }} ¥{{item.price.toFixed(2)}} diff --git a/otherPages/authentication/examination/base.vue b/otherPages/authentication/examination/base.vue index b67c281..e07cb71 100644 --- a/otherPages/authentication/examination/base.vue +++ b/otherPages/authentication/examination/base.vue @@ -39,7 +39,8 @@ + + \ No newline at end of file diff --git a/otherPages/authentication/examination/errorDetail.vue b/otherPages/authentication/examination/errorDetail.vue index 4a50de4..b59de19 100644 --- a/otherPages/authentication/examination/errorDetail.vue +++ b/otherPages/authentication/examination/errorDetail.vue @@ -3,27 +3,56 @@ - - - {{ group.title }} + + + 选择题 + + + {{ `${question.title}` }} + + + {{ option.title }} + + + + + + + - - + + + + + 培训题 + + + {{ `${question.title}` }} + + + {{ question.userAppletAnswerTrain?.answer || '未作答' }} + {{ question.answer }} + + + + + + 驳回原因 + + {{ detail.reason }} - + - 剩余考试机会:{{ restTimes }}次 + 剩余考试机会:{{ restTimes - examNumber }} 重新考试 @@ -34,14 +63,16 @@ @@ -203,4 +194,102 @@ } } } + + .question-section { + margin-bottom: 40rpx; + } + + .section-title { + font-size: 32rpx; + font-weight: bold; + color: #333; + margin: 30rpx 0; + padding-left: 20rpx; + border-left: 8rpx solid #FFBF60; + } + + .question { + color: #000000; + } + + .option { + background-color: #F3F3F3; + color: #707070; + line-height: 37rpx; + padding: 23rpx; + border-radius: 28rpx; + position: relative; + + &+& { + margin-top: 20rpx; + } + + .icon { + position: absolute; + right: 45rpx; + bottom: 23rpx; + display: none; + } + + &.is-correct { + background-color: rgba($color: #05C160, $alpha: 0.08); + color: #05C160; + + .icon-correct { + display: block; + } + } + + &.is-error { + background-color: rgba($color: #FFEBCE, $alpha: 0.36); + color: #FF2A2A; + + .icon-error { + display: block; + } + } + } + + .textarea { + background-color: #F3F3F3; + padding: 23rpx; + border-radius: 16rpx; + margin-top: 20rpx; + + .answer-content { + font-size: 28rpx; + color: #333; + line-height: 1.6; + margin-bottom: 20rpx; + } + + .highlight { + color: #FF2A2A; + font-size: 28rpx; + line-height: 1.6; + padding-top: 20rpx; + border-top: 1px solid rgba(0, 0, 0, 0.1); + } + } + + .footer-btn { + position: fixed; + left: 0; + right: 0; + bottom: 0; + height: $bar-height; + background: #fff; + box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05); + } + + .btn { + width: 600rpx; + height: 80rpx; + line-height: 80rpx; + text-align: center; + background: #FFBF60; + color: #fff; + border-radius: 40rpx; + font-size: 32rpx; + } \ No newline at end of file diff --git a/otherPages/authentication/examination/start.vue b/otherPages/authentication/examination/start.vue index 2ad377b..3727815 100644 --- a/otherPages/authentication/examination/start.vue +++ b/otherPages/authentication/examination/start.vue @@ -30,15 +30,18 @@ - - - 剩余考试机会:{{ restTimes }}次 + + - - 开始考试 + + {{ canTakeExam ? '开始考试' : '暂无考试机会' }} @@ -48,15 +51,61 @@ import { ref, computed } from 'vue' import { useStore } from 'vuex' import { onLoad } from '@dcloudio/uni-app' + import { insertUser, udpateUser, getUserOne } from '@/api/userTeacher' + import dayjs from 'dayjs' const store = useStore() const petType = ref([]) const restTimes = ref() + const lastExamTime = ref('') + + //已考试次数 + const examNumber = ref(0) const configList = computed(() => { return store.getters.configList }) + const userId = computed(() => { + return store.state.user.userInfo.userId + }) + + // 计算下次考试时间 + const nextExamTime = computed(() => { + if (!lastExamTime.value) return '' + const nextTime = dayjs(lastExamTime.value).add(1, 'year') + return nextTime.format('YYYY年MM月DD日') + }) + + // 判断是否可以参加考试 + const canTakeExam = computed(() => { + + if((restTimes.value - examNumber.value) > 0){ + return true + } + + if (!lastExamTime.value) return true + const nextTime = dayjs(lastExamTime.value).add(1, 'year') + return dayjs().isAfter(nextTime) + }) + + const getInfo = async () => { + try { + if(!userId.value) { + return + } + + const data = await getUserOne(userId.value) + + examNumber.value = data.examNumber || 0 + lastExamTime.value = data.examTime + + petType.value = data.petType.split(',').map(n => parseInt(n)) + + } catch (err) { + console.log('--err', err) + } + } const petTypeImg = computed(() => { return store.getters.petTypeOptions. @@ -64,15 +113,19 @@ }) onLoad((option) => { - store.dispatch('fetchPetTypeOptions') - - petType.value = option.petType.split(',').map(n => parseInt(n)) - - // todo: fetch + store.dispatch('fetchPetTypeOptions') + getInfo() restTimes.value = parseInt(configList.value.pet_work_num.paramValueText || 0) }) const toNext = () => { + if (!canTakeExam.value) { + uni.showToast({ + title: `请于${nextExamTime.value}后再来考试`, + icon: 'none' + }) + return + } uni.navigateTo({ url: "/otherPages/authentication/examination/base" }) @@ -138,9 +191,29 @@ } } + .next-exam-time { + color: #FF2A2A; + } + .footer-btn { height: 163rpx; box-sizing: border-box; padding-bottom: 18rpx; } + + .btn { + width: 600rpx; + height: 80rpx; + line-height: 80rpx; + text-align: center; + background: #FFBF60; + color: #fff; + border-radius: 40rpx; + font-size: 32rpx; + + &-disabled { + background: #CCCCCC; + color: #FFFFFF; + } + } \ No newline at end of file diff --git a/otherPages/myOrdersManage/clock/index.vue b/otherPages/myOrdersManage/clock/index.vue index c050d0e..b45e0a3 100644 --- a/otherPages/myOrdersManage/clock/index.vue +++ b/otherPages/myOrdersManage/clock/index.vue @@ -197,7 +197,7 @@ 其他补充信息(必填) - 可记录一下今日趣事、宠物状况、提醒事项等 + 可记录一下今日趣事、宠物状况、提醒事项等,最少30个字