From 69bf186f0e24af36c18de5e8f2b0c8046d6de5c4 Mon Sep 17 00:00:00 2001 From: Timi Date: Wed, 10 Dec 2025 15:02:17 +0800 Subject: [PATCH] adaptation dark mode --- miniprogram/components/calendar/index.less | 7 +- .../pages/main/journal-creater/index.less | 10 +- .../pages/main/journal-creater/index.wxml | 2 +- .../pages/main/journal-date/index.less | 231 +++++++++--------- .../pages/main/journal-date/index.wxml | 117 ++++----- .../pages/main/journal-editor/index.less | 1 + miniprogram/pages/main/journal-map/index.less | 3 +- miniprogram/pages/main/journal-map/index.wxml | 1 - miniprogram/pages/main/journal/index.less | 1 + miniprogram/pages/main/moment/index.less | 1 + miniprogram/theme.wxss | 22 +- 11 files changed, 195 insertions(+), 201 deletions(-) diff --git a/miniprogram/components/calendar/index.less b/miniprogram/components/calendar/index.less index fcceb87..753f69a 100644 --- a/miniprogram/components/calendar/index.less +++ b/miniprogram/components/calendar/index.less @@ -7,9 +7,10 @@ flex-direction: column; .year { + color: var(--theme-text-secondary); display: flex; padding: 16rpx 32rpx; - background: var(--theme-bg-secondary); + background: transparent; align-items: center; margin-bottom: 24rpx; justify-content: space-between; @@ -71,12 +72,12 @@ .day { display: flex; position: relative; + background: transparent; align-items: center; aspect-ratio: 1; border-radius: 12rpx; flex-direction: column; justify-content: center; - background: var(--theme-bg-card); .number { color: var(--theme-text); @@ -97,7 +98,7 @@ &.has-journal { background: var(--theme-bg-journal); - .day-number { + .number { color: var(--theme-wx); font-weight: bold; } diff --git a/miniprogram/pages/main/journal-creater/index.less b/miniprogram/pages/main/journal-creater/index.less index 8231fff..81408b6 100644 --- a/miniprogram/pages/main/journal-creater/index.less +++ b/miniprogram/pages/main/journal-creater/index.less @@ -53,6 +53,7 @@ color: var(--theme-wx); margin: 0; font-size: 80rpx; + background: transparent; } .thumbnail { @@ -85,15 +86,6 @@ position: absolute; font-size: 45rpx; } - - .delete { - top: 10rpx; - right: 10rpx; - color: rgba(0, 0, 0, .7); - z-index: 3; - position: absolute; - font-size: 45rpx; - } } } } diff --git a/miniprogram/pages/main/journal-creater/index.wxml b/miniprogram/pages/main/journal-creater/index.wxml index 4841ae7..11f49c3 100644 --- a/miniprogram/pages/main/journal-creater/index.wxml +++ b/miniprogram/pages/main/journal-creater/index.wxml @@ -76,7 +76,7 @@ disabled="{{isSubmitting}}" bind:tap="addMedia" > - + diff --git a/miniprogram/pages/main/journal-date/index.less b/miniprogram/pages/main/journal-date/index.less index 92b9546..a4c5d1e 100644 --- a/miniprogram/pages/main/journal-date/index.less +++ b/miniprogram/pages/main/journal-date/index.less @@ -21,147 +21,146 @@ box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, .15); } } +} - .date-detail { - height: 61.8vh; +.date-detail { + height: 61.8vh; + display: flex; + border-radius: 24rpx 24rpx 0 0; + flex-direction: column; + + .detail-content { + flex: 1; display: flex; - background: var(--theme-bg-card); - border-radius: 24rpx 24rpx 0 0; + overflow: hidden; flex-direction: column; - .detail-content { - flex: 1; + .header { display: flex; - overflow: hidden; - flex-direction: column; + padding: 24rpx 24rpx 4rpx; + flex-shrink: 0; + align-items: flex-start; + justify-content: space-between; - .header { + .info { + flex: 1; display: flex; - padding: 24rpx 24rpx 4rpx; - flex-shrink: 0; - align-items: flex-start; - justify-content: space-between; + flex-direction: column; - .info { - flex: 1; - display: flex; - flex-direction: column; - - .date { - color: var(--theme-text); - font-size: 32rpx; - font-weight: 600; - margin-bottom: 8rpx; - } - - .count { - color: var(--theme-text-secondary); - font-size: 26rpx; - } + .date { + color: var(--theme-text); + font-size: 32rpx; + font-weight: 600; + margin-bottom: 8rpx; } - .actions { - gap: 16rpx; - display: flex; - flex-shrink: 0; - align-items: center; - - .indicator { - color: var(--theme-text-secondary); - padding: 8rpx 16rpx; - font-size: 24rpx; - border-radius: 24rpx; - background: var(--theme-bg); - } + .count { + color: var(--theme-text-secondary); + font-size: 26rpx; } } - .journals-swiper { - flex: 1; + .actions { + gap: 16rpx; + display: flex; + flex-shrink: 0; + align-items: center; - .swiper-item-wrapper { - height: 100%; + .indicator { + color: var(--theme-text-secondary); + padding: 8rpx 16rpx; + font-size: 24rpx; + border-radius: 24rpx; + background: var(--theme-bg); + } + } + } + + .journals-swiper { + flex: 1; + + .swiper-item-wrapper { + height: 100%; + display: flex; + padding: 0 24rpx; + box-sizing: border-box; + + .journal-item { + flex: 1; display: flex; - padding: 0 24rpx; - box-sizing: border-box; + background: var(--theme-bg); + flex-direction: column; - .journal-item { - flex: 1; + .journal-header { display: flex; - background: var(--theme-bg); - flex-direction: column; + margin-top: 16rpx; + flex-shrink: 0; + align-items: center; + justify-content: space-between; - .journal-header { - display: flex; - margin-top: 16rpx; - flex-shrink: 0; - align-items: center; - justify-content: space-between; - - .location { - flex: 1; - color: var(--theme-text); - overflow: hidden; - font-size: 28rpx; - white-space: nowrap; - text-overflow: ellipsis; - } - - .time { - color: var(--theme-text-secondary); - font-size: 24rpx; - margin-left: 16rpx; - flex-shrink: 0; - } - } - - .idea { - color: var(--theme-text); - display: block; - font-size: 28rpx; - line-height: 1.6; - flex-shrink: 0; - } - - .items-scroll { + .location { flex: 1; - height: 0; - margin-top: 16rpx; + color: var(--theme-text); + overflow: hidden; + font-size: 28rpx; + white-space: nowrap; + text-overflow: ellipsis; + } - .items { + .time { + color: var(--theme-text-secondary); + font-size: 24rpx; + margin-left: 16rpx; + flex-shrink: 0; + } + } - .wrapper { - position: relative; - column-gap: 8rpx; - column-count: 3; + .idea { + color: var(--theme-text); + display: block; + font-size: 28rpx; + line-height: 1.6; + flex-shrink: 0; + } - .item { - overflow: hidden; - break-inside: avoid; - margin-bottom: 8rpx; - background: var(--theme-bg-card); + .items-scroll { + flex: 1; + height: 0; + margin-top: 16rpx; - &.thumbnail { - width: 100%; - display: block; - } + .items { - &.video { - position: relative; + .wrapper { + position: relative; + column-gap: 8rpx; + column-count: 3; - &::after { - top: 50%; - left: 53%; - width: 0; - height: 0; - content: ""; - position: absolute; - transform: translate(-50%, -50%); - border-top: 16rpx solid transparent; - border-left: 24rpx solid rgba(255, 255, 255, .9); - border-bottom: 16rpx solid transparent; - pointer-events: none; - } + .item { + overflow: hidden; + break-inside: avoid; + margin-bottom: 8rpx; + background: var(--theme-bg-card); + + &.thumbnail { + width: 100%; + display: block; + } + + &.video { + position: relative; + + &::after { + top: 50%; + left: 53%; + width: 0; + height: 0; + content: ""; + position: absolute; + transform: translate(-50%, -50%); + border-top: 16rpx solid transparent; + border-left: 24rpx solid rgba(255, 255, 255, .9); + border-bottom: 16rpx solid transparent; + pointer-events: none; } } } diff --git a/miniprogram/pages/main/journal-date/index.wxml b/miniprogram/pages/main/journal-date/index.wxml index 0c56d44..2cff1b7 100644 --- a/miniprogram/pages/main/journal-date/index.wxml +++ b/miniprogram/pages/main/journal-date/index.wxml @@ -7,62 +7,63 @@ 加载中... - - - - - - - {{selectedDate.displayDate}} - {{selectedDate.journals.length}} 条日记 - - - - {{currentJournalIndex + 1}}/{{selectedDate.journals.length}} - - - - - - - - - - 📍 {{item.location}} - {{item.time}} - - {{item.idea}} - - - - - - - - - - - - - - - - + + + + + + + {{selectedDate.displayDate}} + {{selectedDate.journals.length}} 条日记 + + + + {{currentJournalIndex + 1}}/{{selectedDate.journals.length}} + + + + + + + + + + 📍 {{item.location}} + {{item.time}} + + {{item.idea}} + + + + + + + + + + + + + + + + diff --git a/miniprogram/pages/main/journal-editor/index.less b/miniprogram/pages/main/journal-editor/index.less index 2754536..4a52b7c 100644 --- a/miniprogram/pages/main/journal-editor/index.less +++ b/miniprogram/pages/main/journal-editor/index.less @@ -50,6 +50,7 @@ color: var(--theme-wx); margin: 0; font-size: 80rpx; + background: transparent; } .thumbnail { diff --git a/miniprogram/pages/main/journal-map/index.less b/miniprogram/pages/main/journal-map/index.less index a456f48..4a71096 100644 --- a/miniprogram/pages/main/journal-map/index.less +++ b/miniprogram/pages/main/journal-map/index.less @@ -45,7 +45,6 @@ .location { flex: 1; color: #999; - display: flex; overflow: hidden; font-size: 24rpx; white-space: nowrap; @@ -91,7 +90,7 @@ z-index: 999; display: flex; position: fixed; - background: #FFF; + background: var(--theme-bg-card); box-shadow: 0 -2rpx 20rpx rgba(0, 0, 0, .15); border-radius: 24rpx 24rpx 0 0; flex-direction: column; diff --git a/miniprogram/pages/main/journal-map/index.wxml b/miniprogram/pages/main/journal-map/index.wxml index 0417b0b..811ddb8 100644 --- a/miniprogram/pages/main/journal-map/index.wxml +++ b/miniprogram/pages/main/journal-map/index.wxml @@ -8,7 +8,6 @@ longitude="{{centerLng}}" scale="{{scale}}" markers="{{markers}}" - show-location bindmarkertap="onMarkerTap" bindcallouttap="onCalloutTap" > diff --git a/miniprogram/pages/main/journal/index.less b/miniprogram/pages/main/journal/index.less index 484ed57..ec2c849 100644 --- a/miniprogram/pages/main/journal/index.less +++ b/miniprogram/pages/main/journal/index.less @@ -35,6 +35,7 @@ } .text { + color: var(--theme-text-primary); width: calc(100% - 32px - 2rem); padding: 8px 16px; margin: .5rem 1rem 1rem 1rem; diff --git a/miniprogram/pages/main/moment/index.less b/miniprogram/pages/main/moment/index.less index 87e7a36..04a8850 100644 --- a/miniprogram/pages/main/moment/index.less +++ b/miniprogram/pages/main/moment/index.less @@ -127,6 +127,7 @@ } &.form { + padding-bottom: 32rpx; .content { padding: 16rpx 32rpx; diff --git a/miniprogram/theme.wxss b/miniprogram/theme.wxss index 7df10db..a83caf9 100644 --- a/miniprogram/theme.wxss +++ b/miniprogram/theme.wxss @@ -9,18 +9,18 @@ page { --theme-wx: #07C160; /* === 背景色 === */ - --theme-bg-primary: #FFFFFF; + --theme-bg-primary: #FFF; --theme-bg-secondary: #F5F5F5; - --theme-bg-card: #FFFFFF; - --theme-bg-journal: #fff2c8; + --theme-bg-card: #FFF; + --theme-bg-journal: #fff2C8; --theme-bg-overlay: rgba(0, 0, 0, .1); --theme-bg-menu: rgba(255, 255, 255, .95); /* === 文字颜色 === */ - --theme-text-primary: #000000; - --theme-text-secondary: #777777; - --theme-text-tertiary: #999999; - --theme-text-disabled: #CCCCCC; + --theme-text-primary: #333; + --theme-text-secondary: #777; + --theme-text-tertiary: #999; + --theme-text-disabled: #CCC; /* === 边框颜色 === */ --theme-border-light: rgba(0, 0, 0, .1); @@ -69,10 +69,10 @@ page[data-weui-theme="dark"] { --theme-bg-menu: rgba(40, 40, 40, .95); /* === 文字颜色 === */ - --theme-text-primary: #FFFFFF; - --theme-text-secondary: #AAAAAA; - --theme-text-tertiary: #888888; - --theme-text-disabled: #666666; + --theme-text-primary: #FFF; + --theme-text-secondary: #AAA; + --theme-text-tertiary: #888; + --theme-text-disabled: #666; /* === 边框颜色 === */ --theme-border-light: rgba(255, 255, 255, .1);