|
|
@@ -1,17 +1,20 @@
|
|
|
<!--
|
|
|
每月挑战 - 月排名列表
|
|
|
-http://localhost:5173/card/#/pages/mytz/rankList
|
|
|
+http://localhost:5173/card/#/pages/mytz/rankList?id=3
|
|
|
https://oss-mbh5.colormaprun.com/card/#/pages/mytz/rankList
|
|
|
-->
|
|
|
<template>
|
|
|
<view class="body">
|
|
|
<view v-if="pageReady" class="content uni-column">
|
|
|
<view class="page-top uni-column">
|
|
|
- <my-topbar :mcName="ecName" class="topbar-color" @btnBackClick="btnBack"
|
|
|
+ <my-topbar :mcName="title" class="topbar-color" @btnBackClick="btnBack"
|
|
|
@btnInfoClick="btnInfo"></my-topbar>
|
|
|
|
|
|
<view class="topContent uni-row uni-jcse">
|
|
|
- <view class="tc-month">{{curMonth}}</view>
|
|
|
+ <view class="tc-monthBox uni-column uni-jcc" @click="onMonthBoxClick">
|
|
|
+ <view class="tc-monthName">{{selectMonthName}}</view>
|
|
|
+ <view class="tc-monthRank">查询排行榜</view>
|
|
|
+ </view>
|
|
|
<view class="tc-count uni-column">
|
|
|
<text>挑战次数</text>
|
|
|
<text>{{realNum}}/{{targetNum}}</text>
|
|
|
@@ -36,6 +39,19 @@ https://oss-mbh5.colormaprun.com/card/#/pages/mytz/rankList
|
|
|
<my-popup ref="mypopup" :config="cardConfigData.popupRuleConfig"
|
|
|
:dataList="cardConfigData.popupRuleList"></my-popup>
|
|
|
|
|
|
+ <uni-popup ref="popupMonthPick" :mask-click="false" maskBackgroundColor="rgba(0, 0, 0, 0.6)">
|
|
|
+ <view class="uni-column uni-jcse popupMonthPick">
|
|
|
+ <view class="uni-row uni-jcsb pmp-top">
|
|
|
+ <view class="pmp-title">选择月排行榜</view>
|
|
|
+ <view class="pmp-fullyear" @click="onMonthPick(0)">查看全年</view>
|
|
|
+ </view>
|
|
|
+ <view class="uni-row uni-jcsa pmp-main">
|
|
|
+ <view v-for="index in 12" :key="index" :class="index <= currentMonth ? 'tc-monthBox-small' : 'tc-monthBox-small-gray'">
|
|
|
+ <view class="tc-monthName-small" @click="onMonthPick(index)">{{index}}月</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -71,7 +87,10 @@ https://oss-mbh5.colormaprun.com/card/#/pages/mytz/rankList
|
|
|
ecName: '', // 卡片名称
|
|
|
ecDesc: '', // 卡片简介
|
|
|
|
|
|
- month: '', // 月名称
|
|
|
+ currentYear: 0,
|
|
|
+ currentMonth: 0,
|
|
|
+ selectYear: 0,
|
|
|
+ selectMonth: 0,
|
|
|
realNum: 0, // 实际完赛次数
|
|
|
targetNum: 0, // 要求完赛次数
|
|
|
|
|
|
@@ -90,11 +109,22 @@ https://oss-mbh5.colormaprun.com/card/#/pages/mytz/rankList
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- curMonth() {
|
|
|
- var currentDate = new Date();
|
|
|
- var currentMonth = currentDate.getMonth() + 1; // 月份从0开始,所以要加1
|
|
|
- return `${currentMonth}月`;
|
|
|
- }
|
|
|
+ selectMonthName() {
|
|
|
+ if (this.selectMonth > 0) {
|
|
|
+ return `${this.selectMonth}月`;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return this.selectYear;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ title() {
|
|
|
+ if (this.selectMonth > 0) {
|
|
|
+ return `${this.selectMonth}月挑战赛`;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return `${this.selectYear}年挑战赛`;
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
onLoad(query) { // 类型非必填,可自动推导
|
|
|
// console.log(query);
|
|
|
@@ -110,6 +140,8 @@ https://oss-mbh5.colormaprun.com/card/#/pages/mytz/rankList
|
|
|
this.rankKey += "-" + this.ecId;
|
|
|
console.log("rankKey:", this.rankKey);
|
|
|
|
|
|
+ this.getCurYearMonth();
|
|
|
+
|
|
|
cardfunc.init(this, this.token, this.ecId);
|
|
|
cardfunc.getCardConfig(this.cardConfigQueryCallback, localCardConfig);
|
|
|
},
|
|
|
@@ -117,6 +149,16 @@ https://oss-mbh5.colormaprun.com/card/#/pages/mytz/rankList
|
|
|
onReady() {},
|
|
|
onUnload() {},
|
|
|
methods: {
|
|
|
+ getCurYearMonth() {
|
|
|
+ const currentDate = new Date();
|
|
|
+ const currentYear = currentDate.getFullYear();
|
|
|
+ const currentMonth = currentDate.getMonth() + 1; // 月份从0开始,所以要加1
|
|
|
+ // console.log("[getCurYearMonth]", currentYear, currentMonth);
|
|
|
+ this.currentYear = currentYear;
|
|
|
+ this.currentMonth = currentMonth;
|
|
|
+ this.selectYear = currentYear;
|
|
|
+ this.selectMonth = currentMonth;
|
|
|
+ },
|
|
|
cardConfigQueryCallback(cardconfig) {
|
|
|
this.loadConfig(cardconfig);
|
|
|
this.getCardBaseQuery();
|
|
|
@@ -257,15 +299,15 @@ https://oss-mbh5.colormaprun.com/card/#/pages/mytz/rankList
|
|
|
// console.log("cupProgress:", this.cupProgress);
|
|
|
},
|
|
|
getCupStyle(type) {
|
|
|
- if (!(this.month > 0)) {
|
|
|
+ if (!(this.selectMonth >= 0)) {
|
|
|
return '';
|
|
|
}
|
|
|
|
|
|
let group = 1;
|
|
|
if (type == 'cup') {
|
|
|
- return `background-image: url("static/cup/${group}/${this.month}.png")`;
|
|
|
+ return `background-image: url("static/cup/${group}/${this.selectMonth}.png")`;
|
|
|
} else if (type == 'cup-gray') {
|
|
|
- return `background-image: url("static/cup/${group}/${this.month}h.png"); height:${this.cupProgress}% ;`;
|
|
|
+ return `background-image: url("static/cup/${group}/${this.selectMonth}h.png"); height:${this.cupProgress}% ;`;
|
|
|
}
|
|
|
},
|
|
|
// 卡片基本信息查询
|
|
|
@@ -300,7 +342,10 @@ https://oss-mbh5.colormaprun.com/card/#/pages/mytz/rankList
|
|
|
"token": this.token,
|
|
|
},
|
|
|
method: "POST",
|
|
|
- data: {},
|
|
|
+ data: {
|
|
|
+ year: this.selectYear,
|
|
|
+ month: this.selectMonth,
|
|
|
+ },
|
|
|
success: (res) => {
|
|
|
// console.log("getCurrentMonthlyChallengeQuery", res);
|
|
|
if (checkResCode(res)) {
|
|
|
@@ -311,7 +356,6 @@ https://oss-mbh5.colormaprun.com/card/#/pages/mytz/rankList
|
|
|
}
|
|
|
|
|
|
const data = res.data.data;
|
|
|
- this.month = data.month;
|
|
|
this.realNum = data.realNum;
|
|
|
// this.realNum = 2;
|
|
|
this.targetNum = data.targetNum;
|
|
|
@@ -335,6 +379,8 @@ https://oss-mbh5.colormaprun.com/card/#/pages/mytz/rankList
|
|
|
},
|
|
|
method: "POST",
|
|
|
data: {
|
|
|
+ year: this.selectYear,
|
|
|
+ month: this.selectMonth,
|
|
|
dispArrStr: this.dispArrStr
|
|
|
},
|
|
|
success: (res) => {
|
|
|
@@ -358,6 +404,25 @@ https://oss-mbh5.colormaprun.com/card/#/pages/mytz/rankList
|
|
|
onTabClick(val) {
|
|
|
// console.log("onTabClick: ", val);
|
|
|
this.tabCurrent = val;
|
|
|
+ },
|
|
|
+ onMonthBoxClick() {
|
|
|
+ this.$refs.popupMonthPick.open();
|
|
|
+ },
|
|
|
+ onMonthPick(month) {
|
|
|
+ // console.log("[onMonthPick] month", month);
|
|
|
+ if (month <= this.currentMonth) {
|
|
|
+ this.selectMonth = month;
|
|
|
+ this.$refs.popupMonthPick.close();
|
|
|
+
|
|
|
+ this.getCurrentMonthlyChallengeQuery();
|
|
|
+ this.monthRankDetailQuery();
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "暂无该月记录",
|
|
|
+ duration: 1000
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -389,16 +454,23 @@ https://oss-mbh5.colormaprun.com/card/#/pages/mytz/rankList
|
|
|
height: 130px;
|
|
|
}
|
|
|
|
|
|
- .tc-month {
|
|
|
+ .tc-monthBox {
|
|
|
width: 80px;
|
|
|
height: 80px;
|
|
|
background: url("/static/mytz/month_bg.png") no-repeat center;
|
|
|
background-size: contain;
|
|
|
color: #ff870d;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tc-monthName {
|
|
|
+ margin-top: 18px;
|
|
|
font-size: 22px;
|
|
|
font-weight: 700;
|
|
|
- text-align: center;
|
|
|
- line-height: 100px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tc-monthRank {
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: 500;
|
|
|
}
|
|
|
|
|
|
.tc-count {
|
|
|
@@ -440,4 +512,59 @@ https://oss-mbh5.colormaprun.com/card/#/pages/mytz/rankList
|
|
|
width: 100%;
|
|
|
flex-grow: 1;
|
|
|
}
|
|
|
+
|
|
|
+ .popupMonthPick {
|
|
|
+ width: 90vw;
|
|
|
+ height: 200px;
|
|
|
+ background-color: #FEFBF6;
|
|
|
+ border-radius: 25px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .pmp-top {
|
|
|
+ width: 90%;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .pmp-main {
|
|
|
+ width: 90%;
|
|
|
+ height: 120px;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ }
|
|
|
+
|
|
|
+ .pmp-title {
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+
|
|
|
+ .pmp-fullyear {
|
|
|
+ padding: 5px 10px;
|
|
|
+ border-radius: 8px;
|
|
|
+ border: 1px solid rgba(255, 135, 13, 1);
|
|
|
+ color: #FF870D;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tc-monthBox-small {
|
|
|
+ width: 50px;
|
|
|
+ height: 50px;
|
|
|
+ flex-shrink: 0;
|
|
|
+ background: url("/static/mytz/month_bg.png") no-repeat center;
|
|
|
+ background-size: contain;
|
|
|
+ color: #ff870d;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tc-monthBox-small-gray {
|
|
|
+ width: 50px;
|
|
|
+ height: 50px;
|
|
|
+ flex-shrink: 0;
|
|
|
+ background: url("/static/mytz/month_bg_gray.png") no-repeat center;
|
|
|
+ background-size: contain;
|
|
|
+ color: #C4C4C4;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tc-monthName-small {
|
|
|
+ margin-top: 20px;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 700;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
</style>
|