Browse Source

#新增

1、新增我的档案模块

#修复
1、去除任务进度顶部培训分类
master
梁欣 3 months ago
parent
commit
2682c931e0
  1. 4
      src/manifest.json
  2. 6
      src/pages.json
  3. 17
      src/pages/promote/progress.vue
  4. 2
      src/pages/promote/promote.vue
  5. 253
      src/pages/user/archive.vue
  6. 2
      src/pages/user/paper.vue
  7. 1
      src/pages/user/user.vue
  8. BIN
      src/static/image/archiveBox.png

4
src/manifest.json

@ -3,8 +3,8 @@
"appid" : "__UNI__06C03D0",
//__UNI__06C03D0
"description" : "",
"versionName" : "1.33.11",
"versionCode" : "248",
"versionName" : "1.34.0",
"versionCode" : "249",
"transformPx" : false,
/* 5+App */
"app-plus" : {

6
src/pages.json

@ -501,6 +501,12 @@
"navigationBarTitleText": "我的活动"
}
},
{
"path": "pages/user/archive",
"style": {
"navigationBarTitleText": "我的档案"
}
},
{
"path": "pages/user/config",
"style": {

17
src/pages/promote/progress.vue

@ -1,11 +1,11 @@
<template>
<view class="min-height">
<scroll-view class="tab-box" scroll-x="true">
<view :class="['tab-item',{active:tabIndex === index}]" v-for="(item,index) in tabList" :key="index"
@click="handTab(index)">
{{ item.name }}
</view>
</scroll-view>
<!-- <scroll-view class="tab-box" scroll-x="true">-->
<!-- <view :class="['tab-item',{active:tabIndex === index}]" v-for="(item,index) in tabList" :key="index"-->
<!-- @click="handTab(index)">-->
<!-- {{ item.name }}-->
<!-- </view>-->
<!-- </scroll-view>-->
<view class="layout layout-train">
<view class="title-box">
<view class="title">培训任务</view>
@ -37,6 +37,7 @@
</view>
</view>
</view>
<uv-empty v-if="!trainList.length" text="暂无培训任务"/>
</view>
</view>
<uv-gap height="30rpx" bgColor="#f4f4f4"></uv-gap>
@ -122,6 +123,7 @@
:borderWidth="4"
></mprogress>
</view>
<uv-empty v-if="!examList.length" text="暂无考试任务"/>
</view>
</view>
<uv-gap height="30rpx" bgColor="#f4f4f4"></uv-gap>
@ -155,6 +157,7 @@
:borderWidth="4"
></mprogress>
</view>
<uv-empty v-if="!matchList.length" text="暂无竞赛任务"/>
</view>
</view>
</view>
@ -184,7 +187,7 @@ const handTab = (index) => {
const trainInfoList = ref([])
const getTrainInfoList = async () => {
const res = await trainInfoUserListReq()
const res = await trainInfoUserListReq({})
trainInfoList.value = []
if (res) {
trainInfoList.value = res.data

2
src/pages/promote/promote.vue

@ -413,7 +413,7 @@ export default {
item.progress = 50
item.color = '#57d801'
item.text = '进行中'
if (dayjs(item.endDate).isAfter(dayjs)) {
if (dayjs(item.endDate).isBefore(dayjs)) {
item.progress = 100
item.color = '#f29900'
item.text = '已完成'

253
src/pages/user/archive.vue

@ -0,0 +1,253 @@
<template>
<view class="min-height bg-gray-light">
<uv-tabs :list="activeTabList" @click="changeTab" :current="current" :scrollable="false"/>
<view v-if="list.length" class="p-20">
<template v-if="current === 0">
<view class="card mb-25 flex justify-start" v-for="(item, index) in list" :key="index">
<uv-image :src="item.cover" width="140rpx" height="140rpx" radius="10"/>
<view class="ml-20 flex flex-col justify-start items-start">
<uv-text :text="item.title" size="28rpx" lineHeight="40rpx" :lines="1"
align="left" bold
color="#000"></uv-text>
<uv-text v-if="item.endDate" :text="`结束日期:${item.endDate}`" size="24rpx"
lineHeight="40rpx" :lines="1"
align="left"
color="#AAA"></uv-text>
<uv-text :text="`已学:${(item.learnSec / 3600).toFixed(2)}个学时`" size="24rpx"
lineHeight="40rpx" :lines="1"
align="left"
color="#AAA"></uv-text>
</view>
</view>
</template>
<template v-else-if="current === 1">
<view class="card mb-20 flex justify-between" v-for="(item,index) in list" :key="index">
<view class="flex flex-col justify-start items-start">
<view class="name">
<uv-text :text="item.title" size="24rpx" lineHeight="40rpx" :lines="1" bold></uv-text>
</view>
<view class="flex justify-start items-center mt-20">
<view class="text-20 text-gray mr-35">{{ item.peopleNum }}</view>
<view class="text-20 text-gray">竞赛时间: {{ item.startDate }} ~ {{ item.endDate }}</view>
</view>
</view>
<mprogress
:progress="item.progress"
:activeColor="item.color"
:valueColor="item.color"
:valueFontSize="12"
:valueText="item.text"
:width="50"
:borderWidth="4"
></mprogress>
</view>
</template>
<template v-else-if="current === 2">
<view class="card mb-20 flex justify-between" v-for="(item,index) in list"
:key="index">
<view class="info info-1">
<view class="name">
<uv-text :text="item.title" size="24rpx" lineHeight="40rpx" :lines="1" bold></uv-text>
</view>
<view class="my-15 text-25 text-gray">考试类型: {{ ['线上', '线下'][item.type] }}</view>
<template v-if="item.type === 1 && item.trainExamPeopleInRoom">
<view v-if="item.trainExamPeopleInRoom.roomConfig" class="my-15 text-25 text-gray">考场:
{{ item.trainExamPeopleInRoom.roomConfig.position }}
</view>
<view v-if="item.trainExamPeopleInRoom.examSession" class="my-15 text-25 text-gray">考试时间:
{{ item.trainExamPeopleInRoom.examSession.startTime }} ~
{{ item.trainExamPeopleInRoom.examSession.endTime }}
</view>
</template>
<template v-if="item.type === 0">
<view class="my-15 text-25 text-gray" v-if="item.examDateMode === 0">考试截止日期: {{ item.examDate }}</view>
<view class="my-15 text-25 text-gray flex justify-start flex-col items-start" v-else>
<text>考试时间段:</text>
<text v-for="(item, index) in JSON.parse(item.examDateList)" :key="index">
{{ item.date.join('~') }}
</text>
</view>
</template>
<view class="my-15 text-25 text-gray" v-if="item.workTypeLists && item.workTypeLists.length > 0 && item.workTypeLists[0].course">考试科目:
{{
item.workTypeLists[0].course.title
}}({{
['初级', '中级', '高级', '技师', '高级技师'][item.workTypeLists[0].course.level]
}})
</view>
<view class="my-15 text-25 text-gray" v-if="!item.trainExamPeopleInfo">总分 {{ item.paper.totalPoint }} 合格分
{{ item.paper.passPoint }}
</view>
<view class="my-15 text-25 text-gray" v-else>
<template v-if="item.text === '已完成' && item.trainExamPeopleInfo.realScore">
<view v-if="item.type === 0 && item.trainId">
<text>考试得分 {{ item.trainExamPeopleInfo.score }}</text>
<text class="ml-15" v-if="item.trainExamPeopleInfo.inWhiteList === 0">平时分
{{ item.trainExamPeopleInfo.normalScore }}
</text>
<text class="ml-15">总分
{{ item.trainExamPeopleInfo.totalScore }}
</text>
<text class="ml-15">实际得分
{{ item.trainExamPeopleInfo.totalScore }}
</text>
</view>
<view v-else>
<text>考试得分 {{ item.trainExamPeopleInfo.score }}</text>
<text class="ml-15" v-if="item.type === 1">实操得分 {{ item.trainExamPeopleInfo.operateScore }}</text>
<text class="ml-15">总分
{{ item.trainExamPeopleInfo.realScore }}
</text>
</view>
<view class="mt-15"
:class="[item.trainExamPeopleInfo.totalScore >= 60 ? 'text-green' : 'text-red']"
v-if="item.showResult">{{
item.trainExamPeopleInfo.totalScore >= 60 ? '合格' : '不合格'
}}
</view>
</template>
</view>
<view class="my-15 text-25 text-gray"
v-if="item.trainExamPeopleInfo && item.trainExamPeopleInfo.highLevelStatus > 0">
<text>专家评审结果:</text>
<text class="ml-15"
:class="[item.trainExamPeopleInfo.highLevelStatus === 1 ? 'text-green' : 'text-red']">
{{ ['待审核', '已通过', '未通过'][item.trainExamPeopleInfo.highLevelStatus] }}
</text>
</view>
</view>
<mprogress
:progress="item.progress"
:activeColor="item.color"
:valueColor="item.color"
:valueFontSize="12"
:valueText="item.text"
:width="50"
:borderWidth="4"
></mprogress>
</view>
</template>
<template v-else-if="current === 3">
<view class="flex justify-start items-center bg-white p-20 my-20" v-for="(item, index) in list" :key="index">
<uv-image :src="item.url" height="150rpx" mode="heightFix" @click="handPreviewImage(item)"/>
<view class="flex ml-20 flex-col justify-start items-start">
<text>{{ item.title }}</text>
<text class="my-20 text-25 text-gray">获得时间: {{
dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss')
}}
</text>
<uv-button type="primary" shape="circle" size="mini" @click="save(item.url)">下载证书</uv-button>
</view>
</view>
</template>
</view>
<uv-empty v-else text="暂无数据"></uv-empty>
</view>
</template>
<script setup>
import {ref} from 'vue'
import {userTrainListReq} from "@/api/train";
import {matchListReq, userHasJoinMatchReq} from "@/api/match";
import dayjs from "dayjs";
import mprogress from "@/components/m-progress/mprogress.vue";
import {trainExamListReq} from "@/api/trainInfo";
import {trainUserPaperListReq} from "@/api/user";
const current = ref(0)
const activeTabList = [{name: '培训记录'}, {name: '竞赛记录'}, {name: '考试记录'}, {name: '申报记录'}]
const changeTab = ({index}) => {
current.value = index
if (current.value === 0) getTrainList()
else if (current.value === 1) getMatchList()
else if (current.value === 2) getExamList()
else if (current.value === 3) getPaperList()
}
const list = ref([])
const getTrainList = async () => {
const res = await userTrainListReq({
withProgress: true,
page: 1,
limit: 9999
})
if (res && res.data) {
list.value = res.data.list.filter(item => item.summary)
}
}
const getMatchList = async () => {
const {data} = await matchListReq({withAll: true})
list.value = data.filter(item => dayjs(item.endDate).isBefore(dayjs())).map(item => {
item.progress = 100
item.color = '#f29900'
item.text = '已完成'
return item
})
}
const getExamList = async () => {
const res = await trainExamListReq({
type: 0
})
if (res) {
list.value = res.data.filter(item => {
return (item.paper && item.trainExamPeopleInfo)
}).map(item => {
let progress = 0, text = '未完成', color = '#cacaca'
progress = 100
color = '#f29900'
text = '已完成'
item.progress = progress
item.color = color
item.text = text
item.showResult = true
return item
})
}
}
const getPaperList = async () => {
const {data} = await trainUserPaperListReq()
list.value = data
}
const handPreviewImage = (item) => {
uni.previewImage({
current: 0,
urls: [item.url]
})
}
const save = (url) => {
uni.showLoading({title: '下载中'})
uni.downloadFile({
url,
success: function (res) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function (res) {
uni.showToast({
title: '保存成功',
icon: 'success',
duration: 2000
})
uni.hideLoading()
console.log('保存成功')
},
fail: function (err) {
console.log(err)
}
})
},
complete: res => {
uni.hideLoading()
console.log(res)
}
})
}
getTrainList()
</script>

2
src/pages/user/paper.vue

@ -65,4 +65,4 @@ const save = (url) => {
onLoad(() => {
getList()
})
</script>F
</script>

1
src/pages/user/user.vue

@ -104,6 +104,7 @@ export default {
{icon: '/static/image/address.png?=1.0', title: '收货地址', url: '/pages/user/address/list'},
// {icon: '/static/image/s-3.png?=1.0', title: '', url: ''},
{icon: '/static/image/s-4.png?=1.0', title: '留言板', url: '/pages/user/msg'},
{icon: '/static/image/archiveBox.png', title: '我的档案', url: '/pages/user/archive'},
{icon: '/static/image/s-5.png?=1.0', title: '我的活动', url: '/pages/user/activity'},
{icon: '/static/image/s-8.png?=1.0', title: '认定预约报名', url: '/pages/user/signUp'},
{icon: '/static/image/s-9.png?=1.0', title: '我的专利', url: '/pages/user/patent'},

BIN
src/static/image/archiveBox.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Loading…
Cancel
Save