diff --git a/src/pages.json b/src/pages.json index d501a2f4..0a5b0b96 100644 --- a/src/pages.json +++ b/src/pages.json @@ -261,6 +261,15 @@ "titleNView": false } } + }, + { + "path": "pages/charts/index", + "style": { + "navigationBarTitleText": "", + "app-plus": { + "titleNView": false + } + } } ], "tabBar": { diff --git a/src/pages/charts/index.vue b/src/pages/charts/index.vue index 47921944..a88a0cc2 100644 --- a/src/pages/charts/index.vue +++ b/src/pages/charts/index.vue @@ -25,7 +25,8 @@ - + + top·2 {{chartsList[1].userName}} {{chartsList[1].score}} @@ -33,7 +34,8 @@ - + + top·1 {{chartsList[0].userName}} {{chartsList[0].score}} @@ -41,7 +43,8 @@ - + + top·3 {{chartsList[2].userName}} {{chartsList[2].score}} @@ -113,17 +116,18 @@ @@ -142,11 +146,12 @@ @@ -169,6 +174,7 @@ getLeaderBoardCrsCntApi } from "@/api/leaderBoard.js" // 我的排行榜 + import { getUserInfo } from '@/common/common'; import { reactive, ref, @@ -178,7 +184,7 @@ watch } from 'vue'; import common from '@/common/common'; - const userId = ("USER001"); + const userId = ref(""); const itemIndex = ref(0); const learnTimeList = ref([]) const practCntList = ref([]) @@ -215,30 +221,33 @@ itemIndex.value = 0; tabAct.value = index; tableLastName.value = item.name; - if (tableLastName.value == '学习时长') { + if (tableLastName.value.includes('学习时长') ) { tableLastName.value = '学习时长(h)' } - if (tableLastName.value == '学习时长') { + if (tableLastName.value.includes('学习时长')) { allChartsList.value = learnTimeList.value; - chartsList.value = learnTimeList.value.annual.list || []; + chartsList.value = learnTimeList.value.annual?learnTimeList.value.annual.list:[]; myselfObj.value = allChartsList.value.annual?allChartsList.value.annual.self:{}; - myselfObj.value.score = allChartsList.value.annual.self.annlStdyTmLen; + myselfObj.value.score = allChartsList.value.annual?allChartsList.value.annual.self.annlStdyTmLen:""; chartsList.value.forEach(item => item.score = item.annlStdyTmLen) - } else if (tableLastName.value == '练习次数') { + } else if (tableLastName.value == '练习次数') { allChartsList.value = practCntList.value; - chartsList.value = practCntList.value.annual.list || []; + chartsList.value = practCntList.value.annual?practCntList.value.annual.list:[]; myselfObj.value = allChartsList.value.annual?allChartsList.value.annual.self:{}; - myselfObj.value.score = allChartsList.value.annual.self.annlPractCnt; + myselfObj.value.score = allChartsList.value.annual?allChartsList.value.annual.self.annlPractCnt:""; + chartsList.value.forEach(item => item.score = item.annlPractCnt); } else if (tableLastName.value == '考试次数') { allChartsList.value = examCntList.value; - chartsList.value = examCntList.value.annual.list || []; + chartsList.value = examCntList.value.annual?examCntList.value.annual.list:[]; myselfObj.value = allChartsList.value.annual?allChartsList.value.annual.self:{}; - myselfObj.value.score = allChartsList.value.annual.self.annlExamCnt; + myselfObj.value.score = allChartsList.value.annual?allChartsList.value.annual.self.annlExamCnt:""; + chartsList.value.forEach(item => item.score = item.annlExamCnt); } else if (tableLastName.value == '通关课程数') { allChartsList.value = crsCntList.value; - chartsList.value = crsCntList.value.annual.list || []; + chartsList.value = crsCntList.value.annual?crsCntList.value.annual.list:[]; myselfObj.value = allChartsList.value.annual?allChartsList.value.annual.self:{}; - myselfObj.value.score = allChartsList.value.annual.self.annlCrsCnt; + myselfObj.value.score = allChartsList.value.annual?allChartsList.value.annual.self.annlCrsCnt:""; + chartsList.value.forEach(item => item.score = item.annlCrsCnt); } if (chartsList.value.length > 3) { newChartsList.value = chartsList.value.slice(3).concat(); @@ -266,11 +275,16 @@ myselfObj.value.score = myselfObj.value.annlCrsCnt; } } else if (item.value == 'month') { + console.log('month') chartsList.value = allChartsList.value.month ? allChartsList.value.month.list : []; myselfObj.value = allChartsList.value.month ? allChartsList.value.month.self : {}; - if (tableLastName.value == '学习时长') { + console.log(chartsList.value,'chartsList.value') + console.log(myselfObj.value,'myselfObj.value') + if (tableLastName.value.includes('学习时长')) { chartsList.value.forEach(item => item.score = item.thisMonthStdyTmLen); myselfObj.value.score = myselfObj.value.thisMonthStdyTmLen; + console.log(chartsList.value,'chartsList.valueMonth') + console.log(myselfObj.value,'myselfObj.valueMonth') } else if (tableLastName.value == '练习次数') { chartsList.value.forEach(item => item.score = item.thisMonthPractCnt); myselfObj.value.score = myselfObj.value.thisMonthPractCnt; @@ -284,9 +298,11 @@ } else if (item.value == 'week') { chartsList.value = allChartsList.value.week ? allChartsList.value.week.list : []; myselfObj.value = allChartsList.value.week ? allChartsList.value.week.self : {}; - if (tableLastName.value == '学习时长') { + if (tableLastName.value.includes('学习时长')) { chartsList.value.forEach(item => item.score = item.thisWeekStdyTmLen); myselfObj.value.score = myselfObj.value.thisWeekStdyTmLen; + console.log(chartsList.value,'chartsList.valueWeek') + console.log(myselfObj.value,'myselfObj.valueWeek') } else if (tableLastName.value == '练习次数') { chartsList.value.forEach(item => item.score = item.thisWeekPractCnt); myselfObj.value.score = myselfObj.value.thisWeekPractCnt; @@ -298,91 +314,24 @@ myselfObj.value.score = myselfObj.value.thisWeekCrsCnt; } } + if (chartsList.value.length > 3) { + newChartsList.value = chartsList.value.slice(3).concat(); + } else { + newChartsList.value = chartsList.value; + } } + const userInfo = computed(() => getUserInfo()) + userId.value = userInfo.value.userId; + console.log(userId.value,'userId') onMounted(() => { - - //挡板数据代码 - // let tempList = { - // annual: [{ - // userName: "江心", - // score: 94, - // dept: "吉林银行吉林分行", - // userId: "USER001", - // imgAddr: "/static/images/charts/avator.png" - // }, - // { - // userName: "李婉儿", - // score: 98, - // dept: "吉林银行吉林分行" - // }, - // { - // userName: "百里里", - // score: 88, - // dept: "吉林银行吉林分行" - // }, - // { - // userName: "黎明", - // score: 94, - // dept: "吉林银行吉林分行", - // imgAddr: "/static/images/charts/avator.png" - // }, - // { - // userName: "张伟", - // score: 91, - // dept: "吉林银行吉林分行" - // }, - // { - // userName: "俞小凡", - // score: 89, - // dept: "吉林银行吉林分行", - // imgAddr: "/static/images/charts/avator.png" - // }, - // { - // userName: "黎明", - // score: 94, - // dept: "吉林银行吉林分行" - // }, - // { - // userName: "张伟", - // score: 91, - // dept: "吉林银行吉林分行" - // }, - // { - // userName: "俞小凡", - // score: 89, - // dept: "吉林银行吉林分行" - // }, - // { - // userName: "江月心", - // score: 10, - // dept: "吉林银行吉林分行" - // } - // ] - // } - // learnTimeList.value = tempList; - // allChartsList.value = learnTimeList.value; - // chartsList.value = tempList.annual; - // console.log(chartsList.value, '1111111') - // chartsList.value.score = learnTimeList.value.annual.annlStdyTmLen; - // console.log(chartsList.value, '222222') - // myselfObj.value = chartsList.value.filter(item => item.userId == userId) - // console.log(myselfObj.value, '3333') - // if (chartsList.value.length > 3) { - // newChartsList.value = chartsList.value.slice(3).concat(); - // } else { - // newChartsList.value = chartsList.value; - // } - // console.log(learnTimeList.value, 'learnTimeList') - //挡板数据代码 - console.log(myselfObj.value,'78787878') getLeaderBoardStdyTmApi().then(res => { console.log(res, 'getLeaderBoardStdyTmApi') learnTimeList.value = res.body || []; allChartsList.value = learnTimeList.value; chartsList.value = allChartsList.value.annual?allChartsList.value.annual.list:[]; myselfObj.value = allChartsList.value.annual?allChartsList.value.annual.self:{}; - // chartsList.value[0].dept = "吉林银行吉林分行" - // myselfObj.value.dept = "吉林银行吉林分行" + chartsList.value[0].dept = "吉林银行吉林分行" + myselfObj.value.dept = "吉林银行吉林分行" console.log(chartsList.value,'chartsList.value') console.log(myselfObj.value,myselfObj.value,'myselfObj.value') chartsList.value.forEach(item => item.score = item.annlStdyTmLen); @@ -862,7 +811,7 @@ color: #0066FF; font-style: italic; font-weight: 600; - margin-top: 15rpx + margin-top: 20rpx } .my-rank-name { diff --git a/src/pages/course/components/talkingItem.vue b/src/pages/course/components/talkingItem.vue index 7b7b6e08..c8f65178 100644 --- a/src/pages/course/components/talkingItem.vue +++ b/src/pages/course/components/talkingItem.vue @@ -1,6 +1,17 @@ - + @@ -8,15 +63,272 @@ export default { data() { return { - + } }, methods: { - + } } - + .exam-ranking { + position: relative; + height: 100vh; + width: 100vw; + overflow: hidden; + box-sizing: border-box; + padding-top: $top-height; + + // background:url(@/static/images/examRanking/bg.png) no-repeat top center; + .bg-box { + position: absolute; + top: 0; + left: 0; + width: 100vw; + height: 412rpx; + z-index: 1; + } + + .ranking-box { + height: calc(100% - $top-height); + overflow: hidden; + position: absolute; + top: $top-height; + width: 100%; + z-index: 2; + } + + .nav-div { + position: relative; + overflow: hidden; + height: 70rpx; + + .back_div { + margin-right: 10rpx; + position: absolute; + left: 25rpx; + top: 0; + padding: 15rpx; + + .back-icon { + position: relative; + width: 40rpx; + height: 40rpx; + cursor: pointer; + } + + .back-icon::before, + .back-icon::after { + content: ''; + position: absolute; + transition: all 0.3s ease; + } + + .back-icon::after { + top: 25%; + left: 25%; + width: 40%; + height: 40%; + border-top: 4rpx solid #000; + border-left: 4rpx solid #000; + transform: rotate(-45deg); + } + } + } + + .title-view { + height: 180rpx; + position: relative; + padding-left: 79rpx; + padding-top: 20rpx; + + .cup-image { + position: absolute; + right: 90rpx; + bottom: 0; + width: 178rpx; + height: 159rpx; + } + + .title-desc { + color: #666; + line-height: 34rpx; + font-size: 25rpx; + } + + .title-image { + width: 308rpx; + height: 88rpx; + } + } + + .ranking-body { + height: calc(100% - 170rpx - 180rpx - 70rpx); + overflow: hidden; + background-color: #fff; + border-radius: 31rpx 31rpx 0 0; + padding-top: 20rpx; + box-sizing: border-box; + .scroll-items-view{ + height: calc(100% - 54rpx); + } + } + + .list-item { + height: 108rpx; + border-bottom: 2rpx solid #efefef; + overflow: hidden; + + &.list-header { + height: 54rpx; + line-height: 54rpx; + color: #999; + font-size: 25rpx; + border-bottom: 0; + .rank-column { + height: 54rpx; + line-height: 54rpx; + color: #999; + font-weight: normal; + font-size: 25rpx; + font-style: initial; + text-indent: 0; + } + .user-column { + padding: 0; + } + .score-column { + line-height: 54rpx; + color: #999; + font-weight: normal; + font-size: 25rpx; + } + } + + &.item-1 { + border-bottom: 0; + margin-bottom: 8rpx; + background: linear-gradient(90deg, #fbf9f5 0%, #fffffd 100%); + .rank-column{ + color: #ffffff00; + background: url(@/static/images/examRanking/no-1.png) no-repeat ; + background-position: 40rpx center; + background-size: 44rpx 66rpx; + text-indent: 8rpx; + } + } + + &.item-2 { + border-bottom: 0; + margin-bottom: 8rpx; + background: linear-gradient(90deg, #f4f8f9 0%, #f7fbfe 100%); + .rank-column{ + color: #ffffff00; + background: url(@/static/images/examRanking/no-2.png) no-repeat ; + background-position: 40rpx center; + background-size: 44rpx 66rpx; + text-indent: 8rpx; + } + } + + &.item-3 { + border-bottom: 0; + margin-bottom: 8rpx; + background: linear-gradient(90deg, #faf6f5 0%, #fcfbfc 100%); + .rank-column{ + color: #ffffff00; + background: url(@/static/images/examRanking/no-3.png) no-repeat ; + background-position: 40rpx center; + background-size: 44rpx 66rpx; + text-indent: 8rpx; + } + } + + &.item-me{ + border-bottom: 0; + .rank-column { + color: #06f; + } + } + + .rank-column { + width: 170rpx; + padding-left: 40rpx; + float: left; + font-weight: 600; + line-height: 92rpx; + height: 108rpx; + color: #333; + font-size: 38rpx; + font-style: italic; + text-indent: 8rpx; + } + + .user-column { + width: 450rpx; + float: left; + padding: 15rpx 0; + + .avatar-box{ + width: 77rpx; + height: 77rpx; + overflow: hidden; + float: left; + background-color: #eee; + border-radius: 50%; + .avatar-image{ + width: 77rpx; + height: 77rpx; + } + } + .user-name{ + float: left; + width: calc(100% - 77rpx); + padding-left: 18rpx; + padding-right: 18rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + height: 40rpx; + line-height: 40rpx; + font-size: 29rpx; + color: #000; + font-weight: 500; + } + .user-org{ + float: left; + width: calc(100% - 77rpx); + padding-left: 18rpx; + padding-right: 18rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + height: 34rpx; + line-height: 34rpx; + font-size: 25rpx; + color: #999; + } + } + + .score-column { + width: 75rpx; + text-align: right; + float: left; + font-weight: 600; + line-height: 108rpx; + color: #333; + font-size: 31rpx; + } + } + .ranking-self { + height: 170rpx; + overflow: hidden; + background-color: #f5f9ff; + padding-top: 4rpx; + } + } + \ No newline at end of file diff --git a/src/pagesB.json b/src/pagesB.json index c578ab53..bba0f995 100644 --- a/src/pagesB.json +++ b/src/pagesB.json @@ -17,6 +17,15 @@ "titleNView": false } } - } + }, + { + "path": "pages/charts/index", + "style": { + "navigationBarTitleText": "", + "app-plus": { + "titleNView": false + } + } + }, ] } \ No newline at end of file diff --git a/src/static/images/examRanking/bg.png b/src/static/images/examRanking/bg.png new file mode 100644 index 00000000..a6e313c3 Binary files /dev/null and b/src/static/images/examRanking/bg.png differ diff --git a/src/static/images/examRanking/cup.png b/src/static/images/examRanking/cup.png new file mode 100644 index 00000000..acf36b85 Binary files /dev/null and b/src/static/images/examRanking/cup.png differ diff --git a/src/static/images/examRanking/no-1.png b/src/static/images/examRanking/no-1.png new file mode 100644 index 00000000..9896fd58 Binary files /dev/null and b/src/static/images/examRanking/no-1.png differ diff --git a/src/static/images/examRanking/no-2.png b/src/static/images/examRanking/no-2.png new file mode 100644 index 00000000..711edf2f Binary files /dev/null and b/src/static/images/examRanking/no-2.png differ diff --git a/src/static/images/examRanking/no-3.png b/src/static/images/examRanking/no-3.png new file mode 100644 index 00000000..11871aa0 Binary files /dev/null and b/src/static/images/examRanking/no-3.png differ diff --git a/src/static/images/examRanking/no1.png b/src/static/images/examRanking/no1.png new file mode 100644 index 00000000..3e6e3f52 Binary files /dev/null and b/src/static/images/examRanking/no1.png differ diff --git a/src/static/images/examRanking/no2.png b/src/static/images/examRanking/no2.png new file mode 100644 index 00000000..d97f0d0b Binary files /dev/null and b/src/static/images/examRanking/no2.png differ diff --git a/src/static/images/examRanking/no3.png b/src/static/images/examRanking/no3.png new file mode 100644 index 00000000..d3fa9493 Binary files /dev/null and b/src/static/images/examRanking/no3.png differ diff --git a/src/static/images/examRanking/title.png b/src/static/images/examRanking/title.png new file mode 100644 index 00000000..0f70b9be Binary files /dev/null and b/src/static/images/examRanking/title.png differ