This commit is contained in:
hero920103 committed 2026-10-11 23:25:36 +08:00
1 parent 48f3bd997c
commit 184d5b0403
9 files changed
+513 -115

No files matched your search

+29 -10
View File
@@ -7,8 +7,8 @@
<view class="hero-info">
<view class="hero-title-row">
<text class="hero-title">本周日程</text>
<text class="hero-unit">(项)</text>
<text class="hero-count">{{ weekCount }}</text>
<!-- <text class="hero-unit">(项)</text> -->
<!-- <text class="hero-count">{{ weekCount }}</text> -->
</view>
<text class="hero-sub">{{ heroRangeLabel }}</text>
</view>
@@ -55,10 +55,10 @@
>{{ cell.day }}</view>
<view class="cal-dots">
<view
v-for="n in dotCount(cell.key)"
:key="n"
v-for="(dot, di) in dayDots(cell.key)"
:key="di"
class="cal-dot"
:class="{ on: cell.key === selectedKey }"
:class="[dot, { on: cell.key === selectedKey }]"
/>
</view>
</view>
@@ -246,8 +246,12 @@ const selectedLabel = computed(() => {
return `${d.getMonth() + 1}月${d.getDate()}日 ${week}`
})
function dotCount(key) {
return Math.min(3, (dayMap.value[key] || []).length)
/** 日历标记点:未完成(蓝)靠左优先排,已完成(绿)靠后,最多 3 个 */
function dayDots(key) {
const list = dayMap.value[key] || []
const pending = list.filter((item) => !item.completed)
const done = list.filter((item) => item.completed)
return pending.concat(done).slice(0, 3).map((item) => (item.completed ? 'done' : 'pending'))
}
/** 时间展示:全天显示「全天」,其余显示开始时间或起止区间 */
@@ -525,10 +529,25 @@ function openDetail(id) {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background: $color-primary;
background: $color-danger;
&.on {
background: #ffffff;
/* 未完成:红色 */
&.pending {
background: $color-danger;
}
/* 已完成:绿色 */
&.done {
background: $color-success;
}
/* 选中日:红点转浅红、绿点转浅绿,保证在深蓝底上的对比度 */
&.pending.on {
background: #fca5a5;
}
&.done.on {
background: #6ee7b7;
}
}