mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-11-13 22:11:42 +08:00
style(components): 优化底部导航栏样式与热图交互
1. 给底部导航激活项添加水平内边距,调整TabbarItem默认内边距 2. 替换热图格子点击回调,改为展示格式化日期与发布篇数的提示
This commit is contained in:
@@ -119,10 +119,14 @@ function getDayColor(day: { count: number, isEmpty: boolean }): string {
|
|||||||
return intensityColors[4]
|
return intensityColors[4]
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDayTip(day: { date: string, count: number, isEmpty: boolean }): string {
|
/** 点击格子:toast 展示该日日期与发布篇数 */
|
||||||
|
function handleDayClick(day: IHeatmapCell) {
|
||||||
if (day.isEmpty)
|
if (day.isEmpty)
|
||||||
return ''
|
return
|
||||||
return `${day.date}:${day.count} 篇`
|
uni.showToast({
|
||||||
|
title: `${dayjs(day.date).format('YYYY年MM月DD日')} 发布 ${day.count} 篇`,
|
||||||
|
icon: 'none',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 累计总数 */
|
/** 累计总数 */
|
||||||
@@ -172,7 +176,7 @@ function changeYear(value: number) {
|
|||||||
{{ columnMonths[ci] }}
|
{{ columnMonths[ci] }}
|
||||||
</view>
|
</view>
|
||||||
<view v-for="(day, di) in column" :key="di" class="day-cell mt-1 box-border h-6 w-6 rounded"
|
<view v-for="(day, di) in column" :key="di" class="day-cell mt-1 box-border h-6 w-6 rounded"
|
||||||
:style="{ backgroundColor: getDayColor(day) }" @click="getDayTip(day)" />
|
:style="{ backgroundColor: getDayColor(day) }" @click="handleDayClick(day)" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function isActive(index: number) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="overflow-hidden box-border py-0.5 flex flex-col items-center justify-center rounded-full" :class="customClass">
|
<view class="overflow-hidden box-border py-0.5 px-2 flex flex-col items-center justify-center rounded-full" :class="customClass">
|
||||||
<template v-if="item.iconType === 'uiLib'">
|
<template v-if="item.iconType === 'uiLib'">
|
||||||
<!-- TODO: 以下内容请根据选择的UI库自行替换 -->
|
<!-- TODO: 以下内容请根据选择的UI库自行替换 -->
|
||||||
<!-- 如:<wd-icon name="home" /> (https://wot-design-uni.cn/component/icon.html) -->
|
<!-- 如:<wd-icon name="home" /> (https://wot-design-uni.cn/component/icon.html) -->
|
||||||
|
|||||||
@@ -108,7 +108,7 @@
|
|||||||
<view v-for="(item, index) in noRightTabbarList" :key="index" class="text-gray-900 flex-1"
|
<view v-for="(item, index) in noRightTabbarList" :key="index" class="text-gray-900 flex-1"
|
||||||
:style="{ color: getColorByIndex(index) }" @click="handleClick(index)">
|
:style="{ color: getColorByIndex(index) }" @click="handleClick(index)">
|
||||||
<TabbarItem :item="item" :index="index"
|
<TabbarItem :item="item" :index="index"
|
||||||
:custom-class="isActive(index)?'relative uh-global-card-glass border':''" />
|
:custom-class="isActive(index)?'relative uh-global-card-glass border px-6':''" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="rightButton.item"
|
<view v-if="rightButton.item"
|
||||||
|
|||||||
Reference in New Issue
Block a user