修改配色,修改功能

This commit is contained in:
2026-02-08 15:43:32 +08:00
parent 17e32d7cc1
commit fa1a8e083e
14 changed files with 441 additions and 119 deletions

View File

@@ -1,6 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "日期计算与农历转换",
"navigationBarBackgroundColor": "#f5f6fa",
"navigationBarBackgroundColor": "#EBF4F8",
"navigationBarTextStyle": "black"
}

View File

@@ -34,7 +34,27 @@ Page({
todayLunar: '',
todayGanZhi: '',
todayAnimal: '',
todayTerm: ''
todayTerm: '',
showHelp: false
},
onShareAppMessage() {
return {
title: '实用的日期推算与农历转换工具',
path: '/pages/date-calc/date-calc'
}
},
onShareTimeline() {
return {
title: '实用的日期推算与农历转换工具'
}
},
toggleHelp() {
this.setData({
showHelp: !this.data.showHelp
});
},
onLoad() {

View File

@@ -1,11 +1,49 @@
<!--pages/date-calc/date-calc.wxml-->
<view class="container">
<!-- 帮助说明面板 -->
<view class="history-panel {{showHelp ? 'show' : ''}}" catchtouchmove="preventTouchMove" style="z-index: 200;">
<view class="history-mask" bindtap="toggleHelp"></view>
<view class="history-content help-content">
<view class="history-header">
<text class="history-title">功能说明</text>
<text class="history-clear" bindtap="toggleHelp">关闭</text>
</view>
<scroll-view scroll-y class="history-list help-list">
<view class="help-section">
<view class="help-item">
<text class="help-icon">📅</text>
<view class="help-text">
<text class="help-h1">日期推算</text>
<text class="help-p">设定一个开始日期,输入往后(+)或往前(-)推算的天数,即可计算出目标日期。底部提供常用快捷按钮。</text>
</view>
</view>
<view class="help-item">
<text class="help-icon">⏳</text>
<view class="help-text">
<text class="help-h1">间隔计算</text>
<text class="help-p">选择两个日期,计算它们之间相差多少天,并自动换算为周数和月数。</text>
</view>
</view>
<view class="help-item">
<text class="help-icon">🌙</text>
<view class="help-text">
<text class="help-h1">农历转换</text>
<text class="help-p">支持公历(阳历)与农历(阴历)互转,并显示干支纪年、生肖、节气等传统信息。</text>
</view>
</view>
<button class="share-btn-large" open-type="share">分享给好友</button>
</view>
</scroll-view>
</view>
</view>
<!-- 顶部 Tab 切换 -->
<view class="tab-header">
<view class="tab-pill {{currentTab === 0 ? 'active' : ''}}" hover-class="tab-hover" bindtap="switchTab" data-index="{{0}}">日期推算</view>
<view class="tab-pill {{currentTab === 1 ? 'active' : ''}}" hover-class="tab-hover" bindtap="switchTab" data-index="{{1}}">间隔计算</view>
<view class="tab-pill {{currentTab === 2 ? 'active' : ''}}" hover-class="tab-hover" bindtap="switchTab" data-index="{{2}}">农历转换</view>
<view class="help-btn" bindtap="toggleHelp">❓</view>
</view>
<!-- ========== 模式1: 日期推算 ========== -->

View File

@@ -25,22 +25,23 @@ page {
/* ========== Tab 切换 ========== */
.tab-header {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
background: #dfe9ed; /* Slightly darker than page bg */
padding: 8rpx;
border-radius: 60rpx;
display: flex;
background: #ffffff; /* Changed to white */
padding: 6rpx;
border-radius: 16rpx; /* Reduced radius */
margin-bottom: 40rpx;
align-items: center;
gap: 8rpx;
gap: 4rpx; /* Reduced gap */
box-shadow: 0 4rpx 12rpx rgba(17, 97, 107, 0.1);
}
.tab-pill {
flex: 1;
text-align: center;
padding: 24rpx 0;
border-radius: 50rpx;
font-size: 28rpx;
color: #7f8c8d;
padding: 16rpx 8rpx; /* Added horizontal padding */
border-radius: 12rpx; /* Reduced radius */
font-size: 24rpx; /* Reduced font size to create more space */
color: #7BBDB6; /* Color 02 */
font-weight: 500;
white-space: nowrap;
transition: all 0.2s ease;
@@ -48,11 +49,155 @@ page {
z-index: 1;
}
.help-btn {
width: 64rpx; /* Reduced width */
height: 64rpx; /* Reduced height */
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
color: #11616B;
}
/* Modal Styles Copied & Adapted */
.history-panel {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
opacity: 0;
transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
pointer-events: none;
visibility: hidden;
}
.history-panel.show {
z-index: 1000;
opacity: 1;
pointer-events: auto;
visibility: visible;
}
.history-mask {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.4);
backdrop-filter: blur(4px);
}
.history-content {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: #EBF4F8; /* Color 03 */
border-radius: 36rpx 36rpx 0 0;
max-height: 80vh;
display: flex;
flex-direction: column;
box-shadow: 0 -8rpx 30rpx rgba(17, 97, 107, 0.15);
transform: translateY(100%);
transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.history-panel.show .history-content {
transform: translateY(0);
}
.history-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 36rpx 40rpx;
border-bottom: 2rpx solid rgba(17, 97, 107, 0.1);
}
.history-title {
color: #11616B; /* Color 01 */
font-size: 34rpx;
font-weight: 600;
letter-spacing: 1rpx;
}
.history-clear {
color: #DC8B70; /* Color 05 */
font-size: 28rpx;
padding: 8rpx 24rpx;
border-radius: 20rpx;
background: rgba(220, 139, 112, 0.15); /* Color 05 faint */
}
/* Help specific */
.help-list {
padding: 0;
}
.help-section {
display: flex;
flex-direction: column;
gap: 40rpx;
padding: 30rpx 40rpx 60rpx;
box-sizing: border-box;
}
.help-item {
display: flex;
gap: 24rpx;
align-items: flex-start;
}
.help-icon {
font-size: 44rpx;
width: 60rpx;
text-align: center;
padding-top: 4rpx;
}
.help-text {
flex: 1;
display: flex;
flex-direction: column;
}
.help-h1 {
font-size: 30rpx;
font-weight: bold;
color: #11616B; /* Color 01 */
margin-bottom: 12rpx;
}
.help-p {
font-size: 26rpx;
color: #2d3436;
line-height: 1.6;
opacity: 0.8;
}
.share-btn-large {
background-color: #11616B !important; /* Color 01 */
color: white !important;
border-radius: 16rpx !important;
font-size: 30rpx !important;
font-weight: 500 !important;
margin-top: 40rpx;
width: 100% !important;
box-shadow: 0 8rpx 20rpx rgba(17, 97, 107, 0.25);
display: flex;
align-items: center;
justify-content: center;
padding: 24rpx 0;
}
.tab-pill.active {
background: #11616B; /* Color 01 */
color: #ffffff;
font-weight: 600;
box-shadow: 0 4rpx 12rpx rgba(17, 97, 107, 0.3);
box-shadow: 0 2rpx 8rpx rgba(17, 97, 107, 0.2);
transform: none;
}
@@ -378,7 +523,7 @@ page {
align-items: center;
gap: 8rpx;
padding: 12rpx 24rpx;
border-radius: 30rpx;
border-radius: 12rpx; /* Reduced radius */
background: var(--primary-bg);
transition: all 0.2s;
border: 1rpx solid transparent; /* 防止抖动 */