This commit is contained in:
Pengxiansen
2025-02-17 10:28:12 +08:00
parent 685bc58c2e
commit 911ff98491
28 changed files with 249 additions and 186 deletions

View File

@@ -1,100 +1,138 @@
<template>
<view class="growth">
<page-title :showBack="true">专业力必修</page-title>
<view class="title">
<view class="title-text" @click="openTip">
<view style="margin-right: 8rpx">专业力必修</view>
<u-icon name="question-circle-fill" color="#686868" size="20"></u-icon>
</view>
<view v-if="selectData" class="select" @click="show = true">
<image src="../../static/images/icon/qiehuan.jpg"></image>
<view>切换</view>
</view>
</view>
<u-navbar
title="专业力必修"
bgColor="rgba(0,0,0,0)"
:safeAreaInsetTop="true"
placeholder
leftIconColor="#fff"
autoBack
fixed
titleStyle="color:#fff"
>
<template slot="right">
<view class="select-growth" @click="show = true">
<u-image
width="30rpx"
height="30rpx"
src="@/static/images/growth/qiehuan.png"
></u-image>
<div style="margin-left: 4px">切换岗位</div>
</view>
</template>
</u-navbar>
<!-- 有数据 -->
<template v-if="selectData">
<view class="container">
<view class="growth-name">{{ selectData.growthName }}</view>
<view class="growth-state">
<view>学习状态</view>
<view
:style="{
color:
selectData.learningState === 0
? '#fe9400'
: selectData.learningState === 1
? '#6ba158'
: '#0079ee',
}"
>{{
<view class="growth-name">
{{ selectData.growthName }}
</view>
<view class="growth-state">
<view
:style="{
color:
selectData.learningState === 0
? "未开始"
? '#fe9400'
: selectData.learningState === 1
? "已完成"
: "进行中"
}}</view
? '#6ba158'
: '#ff8726',
}"
>{{
selectData.learningState === 0
? "学习未开始"
: selectData.learningState === 1
? "学习已完成"
: "学习进行中"
}}</view
>
</view>
<view class="growth-tip">
<view class="growth-tip-content">
<view class="tip-title"> 说明 </view>
<view class="tip-content">
{{ selectData.description || "暂无说明" }}</view
>
</view>
<view class="growth-tip">
<view class="tip-title">
<image src="../../static/images/shuoming.jpg" />
<view>说明</view>
</view>
<view class="tip-text">
{{ selectData.description || "暂无说明" }}
</view>
</view>
<view class="growth-progress">
<view class="progress-title">
<view class="line"></view>
<view class="text">{{ `学习进度` }}</view>
<view class="line"></view>
</view>
<view class="growth-progress">
<view class="progress-title">
<image src="../../static/images/jindu.jpg" />
<view>学习进度</view>
<view class="progress-total">
{{ `总任务:${selectData.totalTaskNum}` }}
</view>
<view class="progress-card">
<view class="progress-card-item">
<view
style="
display: flex;
justify-content: space-between;
align-items: center;
"
>
<view class="label">必修进度</view>
<view class="rate">{{ requiredTaskCompletionRate }}%</view>
</view>
<view class="progress">
<u-line-progress
active-color="#0077EC"
:showText="false"
inactive-color="#E5E7EB"
:percentage="requiredTaskCompletionRate"
height="3"
></u-line-progress>
</view>
</view>
<view class="progress-text">
<view class="total">总任务{{ selectData.totalTaskNum }}</view>
<view class="progress-item">
<view class="label"> 必修进度</view>
<view class="value">
<u-line-progress
active-color="#2979ff"
:showText="false"
inactive-color="#a6d0f9"
:percentage="requiredTaskCompletionRate"
height="20rpx"
></u-line-progress>
</view>
<view class="text">{{ requiredTaskCompletionRate }}%</view>
<view class="progress-card-item">
<view
style="
display: flex;
justify-content: space-between;
align-items: center;
"
>
<view class="label">选修进度</view>
<view class="rate">{{ electiveTaskCompletionRate }}%</view>
</view>
<view class="progress-item">
<view class="label"> 选修进度</view>
<view class="value">
<u-line-progress
active-color="#2979ff"
:showText="false"
inactive-color="#a6d0f9"
:percentage="electiveTaskCompletionRate"
height="20rpx"
></u-line-progress>
</view>
<view class="text">{{ electiveTaskCompletionRate }}%</view>
<view class="progress">
<u-line-progress
active-color="#0077EC"
:showText="false"
inactive-color="#E5E7EB"
:percentage="electiveTaskCompletionRate"
height="3"
></u-line-progress>
</view>
<view class="progress-item">
<view class="label"> 总进度</view>
<view class="value">
<u-line-progress
active-color="#2979ff"
:showText="false"
inactive-color="#a6d0f9"
:percentage="totalTaskCompletionRate"
height="20rpx"
></u-line-progress>
</view>
<view class="text">{{ totalTaskCompletionRate }}%</view>
</view>
<view class="progress-card-item">
<view
style="
display: flex;
justify-content: space-between;
align-items: center;
"
>
<view class="label">总进度</view>
<view class="rate">{{ totalTaskCompletionRate }}%</view>
</view>
<view class="progress">
<u-line-progress
active-color="#0077EC"
:showText="false"
inactive-color="#E5E7EB"
:percentage="totalTaskCompletionRate"
height="3"
></u-line-progress>
</view>
</view>
</view>
<view class="confirm" @click="loaddetail">
<view>学习</view>
</view>
</view>
<view class="confirm" @click="loaddetail">
<view>{{
selectData.learningState == 2 ? "继续学习" : "开始学习"
}}</view>
</view>
</template>
<!-- 无数据 -->
@@ -180,18 +218,14 @@ export default {
});
},
methods: {
toBack() {
uni.navigateBack();
},
// 切换任务
select({ value }) {
this.selectData = value[0];
this.show = false;
},
openTip() {
uni.showModal({
showCancel: false,
content:
"根据您所在的组织、标准岗位、任职资格等级,已为您匹配专业力必修任务,抓紧时间学习吧~",
});
},
// 学习任务跳转详情
loaddetail(task) {
let taskUrl = "";
@@ -215,110 +249,131 @@ export default {
</script>
<style lang="scss" scoped>
page {
background-color: #fff;
}
.growth {
.container {
margin: 0 20rpx;
background-image: linear-gradient(to bottom, #e2eefd 0rpx, #fff 200rpx);
border: 1rpx solid #e2eefd;
border-radius: 20rpx 20rpx 0 0;
padding: 16rpx 28rpx;
.confirm {
background-image: url(@/static/images/growth/bg.png);
background-size: 100% 100%;
background-repeat: no-repeat;
min-height: 100vh;
font-family: PingFang SC;
.select-growth {
display: flex;
align-items: center;
justify-content: center;
width: 188rpx;
height: 60rpx;
background: rgba(255, 255, 255, 0.2);
border-radius: 30rpx;
font-size: 26rpx;
color: #ffffff;
}
.confirm {
display: flex;
justify-content: center;
margin-top: 114rpx;
view {
width: 560rpx;
height: 88rpx;
line-height: 88rpx;
text-align: center;
background: linear-gradient(0deg, #266eff 0%, #528bff 100%);
box-shadow: 0px 5rpx 15rpx 0rpx rgba(42, 112, 255, 0.5);
border-radius: 44rpx;
font-weight: 700;
font-size: 32rpx;
color: #ffffff;
}
}
.growth-progress {
margin-top: 35rpx;
.progress-card {
background: #ffffff;
padding: 30rpx 27rpx 21rpx 27rpx;
margin: 42rpx 50rpx 0 50rpx;
box-shadow: 0px 10px 15px 0px rgba(44, 106, 231, 0.2);
border-radius: 16rpx;
.progress-card-item {
.label {
font-weight: 700;
font-size: 28rpx;
color: #333333;
}
.rate {
font-weight: 700;
font-size: 30rpx;
color: #0077ec;
}
.progress {
margin-top: 17rpx;
margin-bottom: 44rpx;
}
}
}
.progress-total {
text-align: center;
font-size: 28rpx;
color: #ffffff;
margin-top: 14rpx;
}
.progress-title {
display: flex;
justify-content: center;
padding: 45rpx 0 30rpx 0;
view {
width: 190rpx;
height: 64rpx;
border-radius: 10rpx;
background-color: #0079ee;
box-sizing: border-box;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
}
}
.progress-item {
display: flex;
align-items: center;
margin-bottom: 28rpx;
.label {
width: 160rpx;
}
.value {
flex: 1;
.line {
width: 40rpx;
height: 6rpx;
background: #ffffff;
border-radius: 3rpx;
opacity: 0.8;
margin: 0 32rpx;
}
.text {
color: #0079ee;
margin-left: 8rpx;
font-size: 36rpx;
color: #ffffff;
opacity: 0.8;
}
}
.progress-title {
margin-top: 34rpx;
}
.progress-text {
padding-left: 14rpx;
.total {
margin: 64rpx 0 56rpx 0;
}
.growth-tip {
background-image: url(@/static/images/growth/card-top.png);
background-size: 100%;
background-repeat: no-repeat;
margin: 38rpx 26rpx 0 26rpx;
padding: 45rpx 24rpx 0 24rpx;
.growth-tip-content {
background: linear-gradient(0deg, #dfe9ff 0%, #ffffff 100%);
border-radius: 0px 0px 16px 16px;
word-wrap: break-word;
.tip-title {
margin-left: 38rpx;
font-weight: 700;
color: #2f3f5a;
}
}
.tip-title,
.progress-title {
display: flex;
align-items: center;
image {
width: 44rpx;
height: 44rpx;
}
view {
font-weight: 650;
.tip-content {
margin: 0 37rpx 0 46rpx;
padding-bottom: 37rpx;
font-size: 28rpx;
color: #333333;
margin-left: 10rpx;
line-height: 42px;
}
}
.tip-text {
margin-top: 28rpx;
color: #333333;
line-height: 60rpx;
}
.growth-name {
font-size: 28rpx;
color: #0079ee;
white-space: nowrap; /* 防止文本换行 */
overflow: hidden; /* 隐藏溢出的内容 */
text-overflow: ellipsis; /* 显示省略符号来代表被修剪的文本 */
}
.growth-state {
display: flex;
align-items: center;
font-size: 28rpx;
justify-content: end;
margin-top: 40rpx;
color: #333333;
}
}
.title {
.growth-name {
font-size: 30rpx;
color: #ffffff;
line-height: 40rpx;
margin: 24rpx 98rpx 24rpx 47rpx;
}
.growth-state {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 40rpx;
}
.title-text {
display: flex;
align-items: center;
}
.select {
display: flex;
flex-direction: column;
font-size: 20rpx;
align-items: center;
image {
width: 30rpx;
height: 30rpx;
justify-content: flex-end;
font-size: 28rpx;
justify-content: end;
view {
padding: 16rpx 26rpx;
background: #ffffff;
border-radius: 50rpx 0px 0px 50rpx;
}
}
}