feat(leaderboard): 新增耐力榜(全局单次最久 top10) + 领奖台日期两行 + 顶部哲理文案
- 云函数支持 endurance 周期:遍历全部 records 取 max(duration) 及 bestDate - 客户端新增耐力榜 tab(maxRank=10),未上榜时在底部 my-bar 显示最佳成绩+产生时间 - 领奖台底座(耐力榜)单次日期拆成「日期+时间」两行,统一三阶底座高度修复第3名贴顶 - 领奖台顶部新增哲理文案,配置进 config.js(leaderboardPodiumSlogan),斜体金句卡片样式
This commit is contained in:
@@ -149,6 +149,37 @@ const _buildFromScan = async (latestByOpenid, period, limit, myOpenid) => {
|
|||||||
for (const doc of latestByOpenid.values()) {
|
for (const doc of latestByOpenid.values()) {
|
||||||
const openid = doc._openid || 'unknown'
|
const openid = doc._openid || 'unknown'
|
||||||
const records = doc.records || {}
|
const records = doc.records || {}
|
||||||
|
|
||||||
|
if (period === 'endurance') {
|
||||||
|
// 全局单次最久:遍历该用户全部月份的 records,取 max(duration) 那条,
|
||||||
|
// 并记下其 r.date 作为"产生时间"。不做日/月/年过滤、不累加。
|
||||||
|
let bestDuration = 0
|
||||||
|
let bestDate = ''
|
||||||
|
let total = 0
|
||||||
|
for (const monthKey of Object.keys(records)) {
|
||||||
|
const arr = records[monthKey]
|
||||||
|
if (!Array.isArray(arr)) continue
|
||||||
|
for (const r of arr) {
|
||||||
|
if (!r || typeof r.date !== 'string') continue
|
||||||
|
total++
|
||||||
|
const dur = Number(r.duration) || 0
|
||||||
|
if (dur > bestDuration) { bestDuration = dur; bestDate = r.date }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (bestDuration > 0) {
|
||||||
|
const profile = doc.profile || {}
|
||||||
|
userMap.set(openid, {
|
||||||
|
openid,
|
||||||
|
duration: bestDuration,
|
||||||
|
bestDate,
|
||||||
|
sessions: total,
|
||||||
|
nickname: profile.nickname || '',
|
||||||
|
avatarUrl: profile.avatarUrl || ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
let duration = 0
|
let duration = 0
|
||||||
let sessions = 0
|
let sessions = 0
|
||||||
|
|
||||||
@@ -208,6 +239,7 @@ const _buildFromScan = async (latestByOpenid, period, limit, myOpenid) => {
|
|||||||
name: _displayName(item),
|
name: _displayName(item),
|
||||||
duration: item.duration,
|
duration: item.duration,
|
||||||
sessions: item.sessions,
|
sessions: item.sessions,
|
||||||
|
bestDate: item.bestDate || '',
|
||||||
avatarUrl: item.avatarUrl || ''
|
avatarUrl: item.avatarUrl || ''
|
||||||
}))
|
}))
|
||||||
|
|
||||||
@@ -231,6 +263,7 @@ const _buildFromScan = async (latestByOpenid, period, limit, myOpenid) => {
|
|||||||
name: _displayName(myEntryRaw),
|
name: _displayName(myEntryRaw),
|
||||||
duration: myEntryRaw.duration,
|
duration: myEntryRaw.duration,
|
||||||
sessions: myEntryRaw.sessions,
|
sessions: myEntryRaw.sessions,
|
||||||
|
bestDate: myEntryRaw.bestDate || '',
|
||||||
avatarUrl: myEntryRaw.avatarUrl || ''
|
avatarUrl: myEntryRaw.avatarUrl || ''
|
||||||
} : null
|
} : null
|
||||||
|
|
||||||
@@ -294,7 +327,7 @@ const _serveFromSnapshot = async (period, limit, myOpenid) => {
|
|||||||
*/
|
*/
|
||||||
const _rebuildSnapshots = async () => {
|
const _rebuildSnapshots = async () => {
|
||||||
const latestByOpenid = await _fetchLatestByOpenid(true)
|
const latestByOpenid = await _fetchLatestByOpenid(true)
|
||||||
for (const p of ['day', 'month', 'year']) {
|
for (const p of ['day', 'month', 'year', 'endurance']) {
|
||||||
const result = await _buildFromScan(latestByOpenid, p, SNAPSHOT_TOP, null)
|
const result = await _buildFromScan(latestByOpenid, p, SNAPSHOT_TOP, null)
|
||||||
console.log('[leaderboard] rebuilt', p, 'rankedLen=', (result && result.ranked) ? result.ranked.length : 'undef')
|
console.log('[leaderboard] rebuilt', p, 'rankedLen=', (result && result.ranked) ? result.ranked.length : 'undef')
|
||||||
await _persistSnapshot(p, result)
|
await _persistSnapshot(p, result)
|
||||||
@@ -328,7 +361,7 @@ exports.main = async (event) => {
|
|||||||
const { period, maxRank, force } = event || {}
|
const { period, maxRank, force } = event || {}
|
||||||
const limit = Math.max(1, Math.min(parseInt(maxRank) || DEFAULT_MAX_RANK, 500))
|
const limit = Math.max(1, Math.min(parseInt(maxRank) || DEFAULT_MAX_RANK, 500))
|
||||||
if (!period) return { err: 'missing period' }
|
if (!period) return { err: 'missing period' }
|
||||||
if (period !== 'day' && period !== 'month' && period !== 'year') return { err: 'invalid period' }
|
if (period !== 'day' && period !== 'month' && period !== 'year' && period !== 'endurance') return { err: 'invalid period' }
|
||||||
|
|
||||||
const myOpenid = cloud.getWXContext().OPENID
|
const myOpenid = cloud.getWXContext().OPENID
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ module.exports = {
|
|||||||
version: 'v3.02',
|
version: 'v3.02',
|
||||||
|
|
||||||
/** 最后更新日期,外显在设置页「关于」 */
|
/** 最后更新日期,外显在设置页「关于」 */
|
||||||
updatedAt: '2026-07-29',
|
updatedAt: '2026-07-31',
|
||||||
|
|
||||||
/** 开发者名称 / 微信号,设置页点击可复制 */
|
/** 开发者名称 / 微信号,设置页点击可复制 */
|
||||||
developer: '三口一瓶',
|
developer: '三口一瓶',
|
||||||
@@ -21,6 +21,12 @@ module.exports = {
|
|||||||
/** 排行榜最大显示人数 */
|
/** 排行榜最大显示人数 */
|
||||||
leaderboardMaxRank: 50,
|
leaderboardMaxRank: 50,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 耐力榜领奖台顶部文案。哲理注脚,点出"撑得越久不一定越好"的价值观,
|
||||||
|
* 与耐力榜(比谁单次撑最久)形成反差。仅耐力榜领奖台顶部显示,改这里即可。
|
||||||
|
*/
|
||||||
|
leaderboardPodiumSlogan: '平板支撑不是一场和时间的恋爱。撑得越久,不一定越好;真正重要的,是每一秒都没有辜负身体。',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 语音合成(TTS)参数 - 直接改这里调整音色/音量/语速,无需改逻辑代码。
|
* 语音合成(TTS)参数 - 直接改这里调整音色/音量/语速,无需改逻辑代码。
|
||||||
* 设置页可选男声/女声,客户端按选择取下面对应的一组传给 tts 云函数。
|
* 设置页可选男声/女声,客户端按选择取下面对应的一组传给 tts 云函数。
|
||||||
|
|||||||
@@ -9,11 +9,13 @@ Page({
|
|||||||
theme: { primary: '#FF6B35', primaryLight: '#FF8C5A', primaryBg: '#FFF3ED', primaryRgb: '255,107,53' },
|
theme: { primary: '#FF6B35', primaryLight: '#FF8C5A', primaryBg: '#FFF3ED', primaryRgb: '255,107,53' },
|
||||||
themeStyle: themeMod.BASE_VARS,
|
themeStyle: themeMod.BASE_VARS,
|
||||||
periods: [
|
periods: [
|
||||||
{ key: 'day', label: '日榜' },
|
{ key: 'day', label: '日榜', maxRank: config.leaderboardMaxRank },
|
||||||
{ key: 'month', label: '月榜' },
|
{ key: 'month', label: '月榜', maxRank: config.leaderboardMaxRank },
|
||||||
{ key: 'year', label: '年榜' }
|
{ key: 'year', label: '年榜', maxRank: config.leaderboardMaxRank },
|
||||||
|
{ key: 'endurance', label: '耐力', maxRank: 10 }
|
||||||
],
|
],
|
||||||
activePeriod: 'day',
|
activePeriod: 'day',
|
||||||
|
podiumSlogan: config.leaderboardPodiumSlogan,
|
||||||
rankedList: [],
|
rankedList: [],
|
||||||
myEntry: null,
|
myEntry: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -68,6 +70,8 @@ Page({
|
|||||||
this._fetchSeq = (this._fetchSeq || 0) + 1
|
this._fetchSeq = (this._fetchSeq || 0) + 1
|
||||||
const seq = this._fetchSeq
|
const seq = this._fetchSeq
|
||||||
const period = this.data.activePeriod
|
const period = this.data.activePeriod
|
||||||
|
const periodObj = this.data.periods.find(p => p.key === period)
|
||||||
|
const maxRank = (periodObj && periodObj.maxRank) || config.leaderboardMaxRank
|
||||||
|
|
||||||
// 乐观缓存:命中该 period 的近期缓存就先秒显旧数据,后台再静默拉新。
|
// 乐观缓存:命中该 period 的近期缓存就先秒显旧数据,后台再静默拉新。
|
||||||
// 命中时不进 loading 骨架屏(避免旧数据被空白覆盖),用 refreshing 标记
|
// 命中时不进 loading 骨架屏(避免旧数据被空白覆盖),用 refreshing 标记
|
||||||
@@ -91,7 +95,7 @@ Page({
|
|||||||
name: 'leaderboard',
|
name: 'leaderboard',
|
||||||
data: {
|
data: {
|
||||||
period,
|
period,
|
||||||
maxRank: config.leaderboardMaxRank,
|
maxRank,
|
||||||
force: !!force
|
force: !!force
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
@@ -116,15 +120,35 @@ Page({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_applyResult(result) {
|
_applyResult(result) {
|
||||||
const list = (result.ranked || []).map(item => ({
|
const isEndurance = this.data.activePeriod === 'endurance'
|
||||||
...item,
|
const list = (result.ranked || []).map(item => {
|
||||||
durationText: util.formatDuration(item.duration)
|
const base = { ...item, durationText: util.formatDuration(item.duration) }
|
||||||
}))
|
if (isEndurance) {
|
||||||
const myEntry = result.myEntry ? {
|
const { date, time } = this._splitBestDate(item.bestDate)
|
||||||
|
base.subText = this._formatBestDate(item.bestDate)
|
||||||
|
base.subDate = date
|
||||||
|
base.subTime = time
|
||||||
|
} else {
|
||||||
|
base.subText = `${item.sessions}次`
|
||||||
|
}
|
||||||
|
return base
|
||||||
|
})
|
||||||
|
const myEntry = result.myEntry ? (() => {
|
||||||
|
const base = {
|
||||||
...result.myEntry,
|
...result.myEntry,
|
||||||
durationText: util.formatDuration(result.myEntry.duration),
|
durationText: util.formatDuration(result.myEntry.duration),
|
||||||
isMe: true
|
isMe: true
|
||||||
} : null
|
}
|
||||||
|
if (isEndurance) {
|
||||||
|
const { date, time } = this._splitBestDate(result.myEntry.bestDate)
|
||||||
|
base.subText = this._formatBestDate(result.myEntry.bestDate)
|
||||||
|
base.subDate = date
|
||||||
|
base.subTime = time
|
||||||
|
} else {
|
||||||
|
base.subText = `${result.myEntry.sessions}次`
|
||||||
|
}
|
||||||
|
return base
|
||||||
|
})() : null
|
||||||
const empty = list.length === 0 && !myEntry
|
const empty = list.length === 0 && !myEntry
|
||||||
this.setData({
|
this.setData({
|
||||||
rankedList: list,
|
rankedList: list,
|
||||||
@@ -141,11 +165,34 @@ Page({
|
|||||||
_applyLocal() {
|
_applyLocal() {
|
||||||
const period = this.data.activePeriod
|
const period = this.data.activePeriod
|
||||||
const allRecords = Object.values(storage.getRecords()).flat()
|
const allRecords = Object.values(storage.getRecords()).flat()
|
||||||
|
const profile = storage.getProfile()
|
||||||
|
const localName = profile.nickname || '我'
|
||||||
|
|
||||||
|
// 耐力榜本地兜底:取本地全部记录里单次最久 + 其日期
|
||||||
|
if (period === 'endurance') {
|
||||||
|
let bestDuration = 0
|
||||||
|
let bestDate = ''
|
||||||
|
allRecords.forEach(r => {
|
||||||
|
const dur = Number(r.duration) || 0
|
||||||
|
if (dur > bestDuration) { bestDuration = dur; bestDate = r.date }
|
||||||
|
})
|
||||||
|
if (bestDuration > 0) {
|
||||||
|
const { date, time } = this._splitBestDate(bestDate)
|
||||||
|
const entry = {
|
||||||
|
rank: 1, openid: 'local', name: localName, nickname: profile.nickname || '',
|
||||||
|
duration: bestDuration, durationText: util.formatDuration(bestDuration),
|
||||||
|
bestDate, subText: this._formatBestDate(bestDate), subDate: date, subTime: time
|
||||||
|
}
|
||||||
|
this.setData({ rankedList: [entry], myEntry: { ...entry, isMe: true }, loading: false, refreshing: false, empty: false })
|
||||||
|
} else {
|
||||||
|
this.setData({ loading: false, refreshing: false, empty: true })
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const today = storage.getToday()
|
const today = storage.getToday()
|
||||||
const thisMonth = today.substring(0, 7)
|
const thisMonth = today.substring(0, 7)
|
||||||
const thisYear = String(new Date().getFullYear())
|
const thisYear = String(new Date().getFullYear())
|
||||||
const profile = storage.getProfile()
|
|
||||||
const localName = profile.nickname || '我'
|
|
||||||
|
|
||||||
let duration = 0
|
let duration = 0
|
||||||
let sessions = 0
|
let sessions = 0
|
||||||
@@ -166,6 +213,26 @@ Page({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 把记录里的 "YYYY-MM-DD HH:MM:SS" 截成 "YYYY-MM-DD HH:MM"(去掉秒),
|
||||||
|
* 纯日期串原样返回。耐力榜用其展示单次的"产生时间"。
|
||||||
|
*/
|
||||||
|
_formatBestDate(s) {
|
||||||
|
if (!s || typeof s !== 'string') return ''
|
||||||
|
if (s.length >= 16) return s.substring(0, 16)
|
||||||
|
return s
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 把 "YYYY-MM-DD HH:MM"(来自 _formatBestDate)拆成
|
||||||
|
* { date: 'YYYY-MM-DD', time: 'HH:MM' },供领奖台底座两行展示耐力榜的"单次日期"。
|
||||||
|
*/
|
||||||
|
_splitBestDate(s) {
|
||||||
|
const f = this._formatBestDate(s)
|
||||||
|
if (f && f.length >= 11) return { date: f.substring(0, 10), time: f.substring(11) }
|
||||||
|
return { date: f || '', time: '' }
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分享给朋友 — 排行榜页。把用户当前名次写进标题,有"攀比"属性,
|
* 分享给朋友 — 排行榜页。把用户当前名次写进标题,有"攀比"属性,
|
||||||
* 分享欲望会强一些。
|
* 分享欲望会强一些。
|
||||||
@@ -175,7 +242,7 @@ Page({
|
|||||||
const s = config.share.leaderboard
|
const s = config.share.leaderboard
|
||||||
// myEntry.rank 依赖云函数返回,缺失时回退静态 title,避免出现"排第 undefined"
|
// myEntry.rank 依赖云函数返回,缺失时回退静态 title,避免出现"排第 undefined"
|
||||||
if (me && me.rank) {
|
if (me && me.rank) {
|
||||||
const periodLabel = { day: '日', month: '月', year: '年' }[this.data.activePeriod] || ''
|
const periodLabel = { day: '日', month: '月', year: '年', endurance: '耐力' }[this.data.activePeriod] || ''
|
||||||
return {
|
return {
|
||||||
title: s.titleTemplate.replace('{period}', periodLabel).replace('{rank}', me.rank),
|
title: s.titleTemplate.replace('{period}', periodLabel).replace('{rank}', me.rank),
|
||||||
path: s.path
|
path: s.path
|
||||||
|
|||||||
@@ -41,6 +41,9 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<block wx:else>
|
<block wx:else>
|
||||||
|
<!-- 耐力榜领奖台顶部文案:哲理注脚,点出"撑得越久不一定越好" -->
|
||||||
|
<view class="podium-slogan" wx:if="{{activePeriod === 'endurance'}}">{{podiumSlogan}}</view>
|
||||||
|
|
||||||
<!-- Podium: top 3 (only when there are at least 3 entries) -->
|
<!-- Podium: top 3 (only when there are at least 3 entries) -->
|
||||||
<view class="podium" wx:if="{{rankedList.length >= 3}}">
|
<view class="podium" wx:if="{{rankedList.length >= 3}}">
|
||||||
<!-- 2nd -->
|
<!-- 2nd -->
|
||||||
@@ -51,7 +54,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<text class="podium-name">{{rankedList[1].name}}</text>
|
<text class="podium-name">{{rankedList[1].name}}</text>
|
||||||
<text class="podium-dur">{{rankedList[1].durationText}}</text>
|
<text class="podium-dur">{{rankedList[1].durationText}}</text>
|
||||||
<view class="podium-base podium-base--second"><text class="podium-base__label">{{rankedList[1].sessions}}次</text></view>
|
<view class="podium-base podium-base--second"><view class="podium-base__label {{activePeriod === 'endurance' ? 'is-two' : ''}}"><block wx:if="{{activePeriod === 'endurance'}}"><text class="podium-base__date">{{rankedList[1].subDate}}</text><text class="podium-base__time">{{rankedList[1].subTime}}</text></block><text wx:else>{{rankedList[1].subText}}</text></view></view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 1st -->
|
<!-- 1st -->
|
||||||
<view class="podium-slot podium-slot--first rank-item--enter" style="animation-delay: 0ms;">
|
<view class="podium-slot podium-slot--first rank-item--enter" style="animation-delay: 0ms;">
|
||||||
@@ -62,7 +65,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<text class="podium-name podium-name--first">{{rankedList[0].name}}</text>
|
<text class="podium-name podium-name--first">{{rankedList[0].name}}</text>
|
||||||
<text class="podium-dur podium-dur--first">{{rankedList[0].durationText}}</text>
|
<text class="podium-dur podium-dur--first">{{rankedList[0].durationText}}</text>
|
||||||
<view class="podium-base podium-base--first"><text class="podium-base__label">{{rankedList[0].sessions}}次</text></view>
|
<view class="podium-base podium-base--first"><view class="podium-base__label {{activePeriod === 'endurance' ? 'is-two' : ''}}"><block wx:if="{{activePeriod === 'endurance'}}"><text class="podium-base__date">{{rankedList[0].subDate}}</text><text class="podium-base__time">{{rankedList[0].subTime}}</text></block><text wx:else>{{rankedList[0].subText}}</text></view></view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 3rd -->
|
<!-- 3rd -->
|
||||||
<view class="podium-slot podium-slot--third rank-item--enter" style="animation-delay: 120ms;">
|
<view class="podium-slot podium-slot--third rank-item--enter" style="animation-delay: 120ms;">
|
||||||
@@ -72,7 +75,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<text class="podium-name">{{rankedList[2].name}}</text>
|
<text class="podium-name">{{rankedList[2].name}}</text>
|
||||||
<text class="podium-dur">{{rankedList[2].durationText}}</text>
|
<text class="podium-dur">{{rankedList[2].durationText}}</text>
|
||||||
<view class="podium-base podium-base--third"><text class="podium-base__label">{{rankedList[2].sessions}}次</text></view>
|
<view class="podium-base podium-base--third"><view class="podium-base__label {{activePeriod === 'endurance' ? 'is-two' : ''}}"><block wx:if="{{activePeriod === 'endurance'}}"><text class="podium-base__date">{{rankedList[2].subDate}}</text><text class="podium-base__time">{{rankedList[2].subTime}}</text></block><text wx:else>{{rankedList[2].subText}}</text></view></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -91,7 +94,7 @@
|
|||||||
<view class="avatar avatar--sm {{item.avatarUrl ? 'has-avatar' : ''}}"><image class="avatar__img" src="{{item.avatarUrl || icons.peopleFill}}" mode="{{item.avatarUrl ? 'aspectFill' : 'aspectFit'}}"></image></view>
|
<view class="avatar avatar--sm {{item.avatarUrl ? 'has-avatar' : ''}}"><image class="avatar__img" src="{{item.avatarUrl || icons.peopleFill}}" mode="{{item.avatarUrl ? 'aspectFill' : 'aspectFit'}}"></image></view>
|
||||||
<view class="rank-info">
|
<view class="rank-info">
|
||||||
<text class="rank-name">{{item.name}}</text>
|
<text class="rank-name">{{item.name}}</text>
|
||||||
<text class="rank-sessions">{{item.sessions}}次</text>
|
<text class="rank-sessions">{{item.subText}}</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="rank-dur">{{item.durationText}}</text>
|
<text class="rank-dur">{{item.durationText}}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -104,7 +107,7 @@
|
|||||||
<view class="avatar avatar--sm my-bar__avatar {{myEntry.avatarUrl ? 'has-avatar' : ''}}"><image class="avatar__img" src="{{myEntry.avatarUrl || icons.peopleFill}}" mode="{{myEntry.avatarUrl ? 'aspectFill' : 'aspectFit'}}"></image></view>
|
<view class="avatar avatar--sm my-bar__avatar {{myEntry.avatarUrl ? 'has-avatar' : ''}}"><image class="avatar__img" src="{{myEntry.avatarUrl || icons.peopleFill}}" mode="{{myEntry.avatarUrl ? 'aspectFill' : 'aspectFit'}}"></image></view>
|
||||||
<view class="rank-info">
|
<view class="rank-info">
|
||||||
<text class="rank-name">我 ({{myEntry.name}})</text>
|
<text class="rank-name">我 ({{myEntry.name}})</text>
|
||||||
<text class="rank-sessions">{{myEntry.sessions}}次</text>
|
<text class="rank-sessions">{{myEntry.subText}}</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="rank-dur">{{myEntry.durationText}}</text>
|
<text class="rank-dur">{{myEntry.durationText}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -69,6 +69,23 @@
|
|||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 耐力榜领奖台顶部文案:哲理注脚,主色呼应 + 金句卡片质感 */
|
||||||
|
.podium-slogan {
|
||||||
|
position: relative;
|
||||||
|
margin: 8rpx 32rpx 4rpx;
|
||||||
|
padding: 22rpx 28rpx 24rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 1.65;
|
||||||
|
color: var(--text);
|
||||||
|
font-weight: 500;
|
||||||
|
font-style: italic;
|
||||||
|
background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.10), rgba(var(--primary-rgb), 0.03));
|
||||||
|
border: 1rpx solid rgba(var(--primary-rgb), 0.16);
|
||||||
|
border-radius: 18rpx;
|
||||||
|
box-shadow: 0 4rpx 14rpx rgba(var(--primary-rgb), 0.10);
|
||||||
|
}
|
||||||
|
|
||||||
/* ---- podium (top 3) ---- */
|
/* ---- podium (top 3) ---- */
|
||||||
.podium {
|
.podium {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -194,14 +211,32 @@
|
|||||||
stepped base heights (the podium itself is bottom-aligned via flex-end). */
|
stepped base heights (the podium itself is bottom-aligned via flex-end). */
|
||||||
.podium-base__label {
|
.podium-base__label {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 4rpx;
|
||||||
right: 0;
|
right: 4rpx;
|
||||||
bottom: 10rpx;
|
bottom: 6rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
line-height: 1;
|
line-height: 1.15;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 耐力榜副标签(单次日期)在领奖台底座上拆成「日期 + 时间」两行。
|
||||||
|
缩小字号 + 抬高最矮的第 3 名底座(48→64rpx),三阶统一为 96/80/64,
|
||||||
|
让两行文字在各级底座内都垂直居中、不贴顶(含微信字体缩放余量)。 */
|
||||||
|
.podium-base__date {
|
||||||
|
font-size: 18rpx;
|
||||||
|
line-height: 1.15;
|
||||||
|
}
|
||||||
|
.podium-base__time {
|
||||||
|
font-size: 16rpx;
|
||||||
|
line-height: 1.1;
|
||||||
|
opacity: 0.85;
|
||||||
|
margin-top: 2rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.podium-dur {
|
.podium-dur {
|
||||||
@@ -232,12 +267,12 @@
|
|||||||
box-shadow: 0 6rpx 18rpx rgba(250, 140, 22, 0.30), inset 0 2rpx 4rpx rgba(255, 255, 255, 0.45);
|
box-shadow: 0 6rpx 18rpx rgba(250, 140, 22, 0.30), inset 0 2rpx 4rpx rgba(255, 255, 255, 0.45);
|
||||||
}
|
}
|
||||||
.podium-base--second {
|
.podium-base--second {
|
||||||
height: 64rpx;
|
height: 80rpx;
|
||||||
background: linear-gradient(180deg, rgba(201, 205, 212, 0.50), rgba(140, 140, 140, 0.16));
|
background: linear-gradient(180deg, rgba(201, 205, 212, 0.50), rgba(140, 140, 140, 0.16));
|
||||||
box-shadow: 0 6rpx 18rpx rgba(140, 140, 140, 0.22), inset 0 2rpx 4rpx rgba(255, 255, 255, 0.45);
|
box-shadow: 0 6rpx 18rpx rgba(140, 140, 140, 0.22), inset 0 2rpx 4rpx rgba(255, 255, 255, 0.45);
|
||||||
}
|
}
|
||||||
.podium-base--third {
|
.podium-base--third {
|
||||||
height: 48rpx;
|
height: 64rpx;
|
||||||
background: linear-gradient(180deg, rgba(232, 160, 106, 0.50), rgba(212, 107, 8, 0.16));
|
background: linear-gradient(180deg, rgba(232, 160, 106, 0.50), rgba(212, 107, 8, 0.16));
|
||||||
box-shadow: 0 6rpx 18rpx rgba(212, 107, 8, 0.22), inset 0 2rpx 4rpx rgba(255, 255, 255, 0.45);
|
box-shadow: 0 6rpx 18rpx rgba(212, 107, 8, 0.22), inset 0 2rpx 4rpx rgba(255, 255, 255, 0.45);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user