diff --git a/src/pages/HighQualityOperation/Home/index.less b/src/pages/HighQualityOperation/Home/index.less index f4a4473..b88e96e 100644 --- a/src/pages/HighQualityOperation/Home/index.less +++ b/src/pages/HighQualityOperation/Home/index.less @@ -561,11 +561,34 @@ .rank-list { padding: 4px 12px; position: relative; - height: 158px; + height: 156px; overflow-y: auto; + // &::-webkit-scrollbar { + // display: none; + // } + /*设置宽度,轨道颜色*/ &::-webkit-scrollbar { - display: none; + width: 6px; + height: 6px; + // padding-right: 3px; + } + + /*滚动条*/ + &::-webkit-scrollbar-thumb { + background: #cacfe6; + border-radius: 10px; + } + + /*增加悬停样式*/ + &::-webkit-scrollbar-thumb:hover { + background: #dcdfeb; + } + + /*滚动轨道样式*/ + &::-webkit-scrollbar-track-piece { + background: #eeeeee; + border-radius: 3px; } &>p { @@ -575,59 +598,81 @@ color: #9f9f9f; font-family: "黑体"; font-size: 14px; + display: flex; + justify-content: space-between; + align-items: center; + position: relative; - &>span:first-child { - padding-left: 19px; - padding-right: 23px; + &>span { + display: block; + text-align: center; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } - &>span:not(.people-rank):first-child { - padding-left: 19px; - padding-right: 40px; + .list-star { + position: absolute; + left: 14px; } - &>span:last-child { - padding-left: 23px; + .list-block { + width: 40px; } - &>span:not(.people-rank):last-child { - padding-left: 40px; + .list-person-block { + width: 30px; } - .star0, - .star1, - .star2 { + .list-province { + width: 60px; + } + + .list-score { + width: 50px; + } + + .list-person-score { + width: 16px; + } + + .list-name { + width: 60px; + } + + .star1 { + background-image: url("~@/assets/highQuality/star1.png"); + background-size: 100% 100%; + background-repeat: no-repeat; + height: 21px; + width: 20px; + position: absolute; + left: 8px; + top: 3px; + text-align: center; + line-height: 24px; color: #FFFFFF; font-weight: bold; - position: relative; - z-index: 1; } + .star2 { + .star1; + background-image: url("~@/assets/highQuality/star2.png"); + background-size: 100% 100%; + background-repeat: no-repeat; + } + .star3 { + .star1; + background-image: url("~@/assets/highQuality/star3.png"); + background-size: 100% 100%; + background-repeat: no-repeat; + } } &>p:last-child { border-bottom: 0; } - - .rank-list-star1 { - position: absolute; - top: 7px; - left: 24px; - z-index: 0; - height: 20px; - } - - .rank-list-star2 { - .rank-list-star1; - top: 37px; - } - - .rank-list-star3 { - .rank-list-star1; - top: 67px; - } - } } diff --git a/src/pages/HighQualityOperation/Home/index.tsx b/src/pages/HighQualityOperation/Home/index.tsx index be32b54..9553dd3 100644 --- a/src/pages/HighQualityOperation/Home/index.tsx +++ b/src/pages/HighQualityOperation/Home/index.tsx @@ -8,9 +8,6 @@ import material from '@/assets/highQuality/material.jpg' import bottom_button from '@/assets/highQuality/bottom_button.png' import partymember from '@/assets/highQuality/partymember.png' import partybranch from '@/assets/highQuality/partybranch.png' -import star1 from '@/assets/highQuality/star1.png' -import star2 from '@/assets/highQuality/star2.png' -import star3 from '@/assets/highQuality/star3.png' import card_img_2 from '@/assets/highQuality/card_img_2.png' import card_img_3 from '@/assets/highQuality/card_img_3.png' import card_img_4 from '@/assets/highQuality/card_img_4.png' @@ -22,8 +19,8 @@ import card_img_9 from '@/assets/highQuality/card_img_9.png' import topic_header_img from '@/assets/topic/topic_header_img.png' import topic_banner_default from '@/assets/topic/topic_banner_default.jpg' import topic_activity_default from '@/assets/topic/topic_activity_default.jpg' -import { downloadVideo, getClassroomList, getHomeBanner, getHomeContact, getHomeGraceful, getHomeProject, getHomeRight, submitAdvice } from './service'; -import { chunk, formatTime, getImageUrl, isEmpty, isNotEmpty, managerAuthority } from '../utils'; +import { downloadVideo, getClassroomList, getHomeBanner, getHomeContact, getHomeGraceful, getHomeProject, getHomeRight, getPersonScoreSort, getProvinceScoreSort, submitAdvice } from './service'; +import { chunk, formatTime, getImageUrl, isEmpty, managerAuthority } from '../utils'; import ExtendUpload from '@/utils/ExtendUpload'; import { getSessionUserData } from '@/utils/session'; import ReactPlayer from "react-player/file"; @@ -304,6 +301,10 @@ const Home: React.FC<{}> = () => { const [contactData, setContactData] = useState([]); //right total data const [totalContactData, setTotalContactData] = useState([]); + //person score + const [personScoreList, setPersonScoreList] = useState([]); + //province score + const [provinceScoreList, setProvinceScoreList] = useState([]); //bottom advice modalvisible const [adviceVisible, setAdviceVisible] = useState(false); //bottom advice modal data @@ -400,6 +401,23 @@ const Home: React.FC<{}> = () => { } }) } + //get learn score + const getLearnPersonScore = () => { + getPersonScoreSort().then(res => {//个人榜 + if (res?.code == 200) { + if (res?.data.length > 0) { + setPersonScoreList(res?.data); + } + } + }) + getProvinceScoreSort().then(res => {//子分公司榜 + if (res?.code == 200) { + if (res?.data.length > 0) { + setProvinceScoreList(res?.data); + } + } + }) + } //to detail const detailClick = (data: any) => { @@ -435,6 +453,7 @@ const Home: React.FC<{}> = () => { getProjectList(); getRightList(); getContactList(''); + getLearnPersonScore(); }, []) return ( @@ -599,14 +618,12 @@ const Home: React.FC<{}> = () => { 分子公司榜
- - - - {new Array(10).fill(0).map((item, index) => ( -

- {index + 1} - 山东 - 99 + {provinceScoreList.length > 0 && provinceScoreList.map((item, index) => ( +

+ {item.scoreSort} + + {item.province} + {item.score}

))}
@@ -616,14 +633,13 @@ const Home: React.FC<{}> = () => { 个人榜
- - - - {new Array(10).fill(0).map((item, index) => ( -

- {index + 1} - 山东 - 张三 99 + {personScoreList.length > 0 && personScoreList.map((item, index) => ( +

+ {item.scoreSort} + + {item.province} + {item.name} + {item.score}

))}
diff --git a/src/pages/HighQualityOperation/Home/service.ts b/src/pages/HighQualityOperation/Home/service.ts index 9aa69eb..331b0b3 100644 --- a/src/pages/HighQualityOperation/Home/service.ts +++ b/src/pages/HighQualityOperation/Home/service.ts @@ -126,4 +126,13 @@ export async function saveComment(data: any) { method: 'POST', data: { ...data }, }); +} +//获取个人排行榜 +export async function getPersonScoreSort() { + return request('/api/biz-service-ebtp-extend/v1/highqualityclient/getPersonScoreSort', { method: "POST" }); +} + +//获取省分排行榜 +export async function getProvinceScoreSort() { + return request('/api/biz-service-ebtp-extend/v1/highqualityclient/getProvinceScoreSort', { method: "POST" }); } \ No newline at end of file