联调我的排行榜接口
This commit is contained in:
+133
-183
@@ -100,7 +100,7 @@
|
||||
<text class="rank-other-last-sty rank-uni-sty">{{tableLastName}}</text>
|
||||
</template>
|
||||
</uni-list-item>
|
||||
<uni-list-item :key="index" v-if="newChartsList.length == 0">
|
||||
<uni-list-item :key="index" v-if="chartsList.length < 4">
|
||||
<template v-slot:header>
|
||||
<text style="width:100%;text-align: center;color: #999999;">暂无数据</text>
|
||||
</template>
|
||||
@@ -127,7 +127,7 @@
|
||||
</template>
|
||||
</uni-list-item>
|
||||
<view style="width: 100%;height: 200rpx;"></view>
|
||||
<uni-list-item class="rank-mine" v-if="myselfList.length < 1">
|
||||
<uni-list-item class="rank-mine" v-if="!myselfObj.userName">
|
||||
<!-- 自定义 header -->
|
||||
<template v-slot:header>
|
||||
<text class="rank-sty my-rank-title">我的排名</text>
|
||||
@@ -138,21 +138,21 @@
|
||||
<!-- 自定义 header -->
|
||||
<template v-slot:header>
|
||||
<text class="rank-sty my-rank-title">我的排名</text>
|
||||
<view class="my-rank-content">11</view>
|
||||
<view class="my-rank-content">{{myselfObj.position}}</view>
|
||||
</template>
|
||||
<!-- 自定义 body -->
|
||||
<template v-slot:body>
|
||||
<view style="width: 50%;text-align: center;">
|
||||
<image src="/static/images/charts/avator.png" class="avator"></image>
|
||||
<view style="float: left;margin-left: 18rpx;">
|
||||
<view class="my-rank-name">{{myselfList[0].userName}}</view>
|
||||
<view class="my-rank-belong">{{myselfList[0].dept}}</view>
|
||||
<view class="my-rank-name">{{myselfObj.userName}}</view>
|
||||
<view class="my-rank-belong">{{myselfObj.dept}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<!-- 自定义 footer-->
|
||||
<template v-slot:footer>
|
||||
<text class="my-rank-score">{{myselfList[0].score}}</text>
|
||||
<text class="my-rank-score">{{myselfObj.score}}</text>
|
||||
</template>
|
||||
</uni-list-item>
|
||||
</uni-list>
|
||||
@@ -184,7 +184,7 @@
|
||||
const practCntList = ref([])
|
||||
const examCntList = ref([])
|
||||
const crsCntList = ref([])
|
||||
const myselfList = ref([])
|
||||
const myselfObj = ref({})
|
||||
const tableLastName = ref("学习时长(h)");
|
||||
const taskRef = ref(null);
|
||||
const tabAct = ref(0);
|
||||
@@ -220,23 +220,26 @@
|
||||
}
|
||||
if (tableLastName.value == '学习时长') {
|
||||
allChartsList.value = learnTimeList.value;
|
||||
chartsList.value = learnTimeList.value.annual || [];
|
||||
chartsList.value.score = learnTimeList.value.annual.annlStdyTmLen || "";
|
||||
chartsList.value = learnTimeList.value.annual.list || [];
|
||||
myselfObj.value = allChartsList.value.annual?allChartsList.value.annual.self:{};
|
||||
myselfObj.value.score = allChartsList.value.annual.self.annlStdyTmLen;
|
||||
chartsList.value.forEach(item => item.score = item.annlStdyTmLen)
|
||||
} else if (tableLastName.value == '练习次数') {
|
||||
allChartsList.value = practCntList.value;
|
||||
chartsList.value = practCntList.value.annual || [];
|
||||
chartsList.value.score = practCntList.value.annual.annlPractCnt || "";
|
||||
chartsList.value = practCntList.value.annual.list || [];
|
||||
myselfObj.value = allChartsList.value.annual?allChartsList.value.annual.self:{};
|
||||
myselfObj.value.score = allChartsList.value.annual.self.annlPractCnt;
|
||||
} else if (tableLastName.value == '考试次数') {
|
||||
allChartsList.value = examCntList.value;
|
||||
chartsList.value = examCntList.value.annual || [];
|
||||
chartsList.value.score = examCntList.value.annual.annlExamCnt || "";
|
||||
chartsList.value = examCntList.value.annual.list || [];
|
||||
myselfObj.value = allChartsList.value.annual?allChartsList.value.annual.self:{};
|
||||
myselfObj.value.score = allChartsList.value.annual.self.annlExamCnt;
|
||||
} else if (tableLastName.value == '通关课程数') {
|
||||
allChartsList.value = crsCntList.value;
|
||||
chartsList.value = crsCntList.value.annual || [];
|
||||
chartsList.value.score = crsCntList.value.annual.annlCrsCnt || "";
|
||||
chartsList.value = crsCntList.value.annual.list || [];
|
||||
myselfObj.value = allChartsList.value.annual?allChartsList.value.annual.self:{};
|
||||
myselfObj.value.score = allChartsList.value.annual.self.annlCrsCnt;
|
||||
}
|
||||
//我的排名---接口待联调
|
||||
// myselfList.value = chartsList.value.myselfList || [];
|
||||
if (chartsList.value.length > 3) {
|
||||
newChartsList.value = chartsList.value.slice(3).concat();
|
||||
} else {
|
||||
@@ -247,202 +250,149 @@
|
||||
const itemFun = (index, item) => {
|
||||
itemIndex.value = index;
|
||||
if (item.value == 'annual') {
|
||||
chartsList.value = allChartsList.value.annual ? allChartsList.value.annual : [];
|
||||
if (tableLastName.value == '学习时长') {
|
||||
chartsList.value.score = chartsList.value.annlStdyTmLen || "";
|
||||
chartsList.value = allChartsList.value.annual ? allChartsList.value.annual.list : [];
|
||||
myselfObj.value = allChartsList.value.annual ? allChartsList.value.annual.self : {};
|
||||
if (tableLastName.value.includes('学习时长')) {
|
||||
chartsList.value.forEach(item => item.score = item.annlStdyTmLen);
|
||||
myselfObj.value.score = myselfObj.value.annlStdyTmLen;
|
||||
} else if (tableLastName.value == '练习次数') {
|
||||
chartsList.value.score = chartsList.value.annlPractCnt || "";
|
||||
chartsList.value.forEach(item => item.score = item.annlPractCnt);
|
||||
myselfObj.value.score = myselfObj.value.annlPractCnt;
|
||||
} else if (tableLastName.value == '考试次数') {
|
||||
chartsList.value.score = chartsList.value.annlExamCnt || "";
|
||||
chartsList.value.forEach(item => item.score = item.annlExamCnt);
|
||||
myselfObj.value.score = myselfObj.value.annlExamCnt;
|
||||
} else if (tableLastName.value == '通关课程数') {
|
||||
chartsList.value.score = chartsList.value.annlCrsCnt || "";
|
||||
chartsList.value.forEach(item => item.score = item.annlCrsCnt);
|
||||
myselfObj.value.score = myselfObj.value.annlCrsCnt;
|
||||
}
|
||||
} else if (item.value == 'month') {
|
||||
chartsList.value = allChartsList.value.month ? allChartsList.value.month : [];
|
||||
chartsList.value = allChartsList.value.month ? allChartsList.value.month.list : [];
|
||||
myselfObj.value = allChartsList.value.month ? allChartsList.value.month.self : {};
|
||||
if (tableLastName.value == '学习时长') {
|
||||
chartsList.value.score = chartsList.value.thisMonthStdyTmLen || "";
|
||||
chartsList.value.forEach(item => item.score = item.thisMonthStdyTmLen);
|
||||
myselfObj.value.score = myselfObj.value.thisMonthStdyTmLen;
|
||||
} else if (tableLastName.value == '练习次数') {
|
||||
chartsList.value.score = chartsList.value.thisMonthPractCnt || "";
|
||||
chartsList.value.forEach(item => item.score = item.thisMonthPractCnt);
|
||||
myselfObj.value.score = myselfObj.value.thisMonthPractCnt;
|
||||
} else if (tableLastName.value == '考试次数') {
|
||||
chartsList.value.score = chartsList.value.thisMonthExamCnt || "";
|
||||
chartsList.value.forEach(item => item.score = item.thisMonthExamCnt);
|
||||
myselfObj.value.score = myselfObj.value.thisMonthExamCnt;
|
||||
} else if (tableLastName.value == '通关课程数') {
|
||||
chartsList.value.score = chartsList.value.thisMonthCrsCnt || "";
|
||||
chartsList.value.forEach(item => item.score = item.thisMonthCrsCnt);
|
||||
myselfObj.value.score = myselfObj.value.thisMonthCrsCnt;
|
||||
}
|
||||
} else if (item.value == 'week') {
|
||||
chartsList.value = allChartsList.value.week ? allChartsList.value.week : [];;
|
||||
chartsList.value = allChartsList.value.week ? allChartsList.value.week.list : [];
|
||||
myselfObj.value = allChartsList.value.week ? allChartsList.value.week.self : {};
|
||||
if (tableLastName.value == '学习时长') {
|
||||
chartsList.value.score = chartsList.value.thisWeekStdyTmLen || "";
|
||||
chartsList.value.forEach(item => item.score = item.thisWeekStdyTmLen);
|
||||
myselfObj.value.score = myselfObj.value.thisWeekStdyTmLen;
|
||||
} else if (tableLastName.value == '练习次数') {
|
||||
chartsList.value.score = chartsList.value.thisWeekPractCnt || "";
|
||||
chartsList.value.forEach(item => item.score = item.thisWeekPractCnt);
|
||||
myselfObj.value.score = myselfObj.value.thisWeekPractCnt;
|
||||
} else if (tableLastName.value == '考试次数') {
|
||||
chartsList.value.score = chartsList.value.thisWeekExamCnt || "";
|
||||
chartsList.value.forEach(item => item.score = item.thisWeekExamCnt);
|
||||
myselfObj.value.score = myselfObj.value.thisWeekExamCnt;
|
||||
} else if (tableLastName.value == '通关课程数') {
|
||||
chartsList.value.score = chartsList.value.thisWeekCrsCnt || "";
|
||||
chartsList.value.forEach(item => item.score = item.thisWeekCrsCnt);
|
||||
myselfObj.value.score = myselfObj.value.thisWeekCrsCnt;
|
||||
}
|
||||
}
|
||||
//我的排名---接口待联调
|
||||
// myselfList.value = chartsList.value.myselfList || [];
|
||||
}
|
||||
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')
|
||||
myselfList.value = chartsList.value.filter(item => item.userId == userId)
|
||||
console.log(myselfList.value, '3333')
|
||||
myselfList.value[0].rank = "待定888888";
|
||||
if (chartsList.value.length > 3) {
|
||||
newChartsList.value = chartsList.value.slice(3).concat();
|
||||
} else {
|
||||
newChartsList.value = chartsList.value;
|
||||
}
|
||||
console.log(learnTimeList.value, 'learnTimeList')
|
||||
// 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')
|
||||
|
||||
//挡板数据代码
|
||||
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: "吉林银行吉林分行"
|
||||
},
|
||||
{
|
||||
userName: "黎明",
|
||||
score: 94,
|
||||
dept: "吉林银行吉林分行"
|
||||
},
|
||||
{
|
||||
userName: "张伟",
|
||||
score: 91,
|
||||
dept: "吉林银行吉林分行"
|
||||
},
|
||||
{
|
||||
userName: "俞小凡",
|
||||
score: 89,
|
||||
dept: "吉林银行吉林分行"
|
||||
},
|
||||
{
|
||||
userName: "江月心",
|
||||
score: 10,
|
||||
dept: "吉林银行吉林分行"
|
||||
}
|
||||
]
|
||||
}
|
||||
learnTimeList.value = tempList;
|
||||
learnTimeList.value = res.body || [];
|
||||
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')
|
||||
myselfList.value = chartsList.value.filter(item => item.userId == userId)
|
||||
console.log(myselfList.value, '3333')
|
||||
|
||||
myselfList.value[0].rank = "待定888888";
|
||||
//挡板数据代码
|
||||
|
||||
|
||||
// learnTimeList.value = res.body || [];
|
||||
// allChartsList.value = learnTimeList.value;
|
||||
// chartsList.value = allChartsList.value.annual?allChartsList.value.annual:[];
|
||||
// chartsList.value.score = learnTimeList.value.annual?learnTimeList.value.annual.annlStdyTmLen:"";
|
||||
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 = "吉林银行吉林分行"
|
||||
console.log(chartsList.value,'chartsList.value')
|
||||
console.log(myselfObj.value,myselfObj.value,'myselfObj.value')
|
||||
chartsList.value.forEach(item => item.score = item.annlStdyTmLen);
|
||||
myselfObj.value.score = myselfObj.value.annlStdyTmLen;
|
||||
if (chartsList.value.length > 3) {
|
||||
newChartsList.value = chartsList.value.slice(3).concat();
|
||||
} else {
|
||||
newChartsList.value = chartsList.value;
|
||||
}
|
||||
console.log(learnTimeList.value, 'learnTimeList')
|
||||
console.log(newChartsList.value, 'newChartsList')
|
||||
})
|
||||
getLeaderBoardPractCntApi().then(res => {
|
||||
console.log(res, 'getLeaderBoardPractCntApi')
|
||||
|
||||
Reference in New Issue
Block a user