提交修改
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
const api = require('../../../services/api')
|
||||
const app = getApp()
|
||||
Page({
|
||||
data: { item: null, streak: 0, records: [], year: 0, month: 0, days: [], loading: true, showActions: false },
|
||||
data: { item: null, streak: 0, records: [], year: 0, month: 0, days: [], loading: true, showActions: false, themeMode: 'light' },
|
||||
onShow() {
|
||||
this.setData({ themeMode: app.globalData.themeMode })
|
||||
},
|
||||
onLoad(options) {
|
||||
const now = new Date()
|
||||
this.setData({ id: options.id, year: now.getFullYear(), month: now.getMonth() + 1 })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<view wx:if="{{loading}}" class="loading">加载中...</view>
|
||||
<view wx:else>
|
||||
<view wx:else><view data-theme="{{themeMode}}">
|
||||
<!-- Actions button -->
|
||||
<view class="action-btn" bindtap="toggleActions">⋯</view>
|
||||
<view class="action-menu" wx:if="{{showActions}}">
|
||||
@@ -41,4 +41,4 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view></view>
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
.loading { text-align: center; padding: 40px; color: #86868B; }
|
||||
.card { background: white; border-radius: 12px; margin: 8px 16px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
|
||||
.loading { text-align: center; padding: 40px; color: var(--color-text-secondary); }
|
||||
.card { background: var(--color-card); border-radius: 12px; margin: 8px 16px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
|
||||
.action-btn { position: absolute; right: 16px; top: 12px; font-size: 20px; padding: 4px 8px; z-index: 10; }
|
||||
.action-menu { position: absolute; right: 16px; top: 44px; background: white; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 10; min-width: 120px; }
|
||||
.action-item { padding: 12px 16px; font-size: 14px; border-bottom: 0.5px solid #E5E5EA; }
|
||||
.action-menu { position: absolute; right: 16px; top: 44px; background: var(--color-card); border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 10; min-width: 120px; }
|
||||
.action-item { padding: 12px 16px; font-size: 14px; border-bottom: 0.5px solid var(--color-border); }
|
||||
.action-item:last-child { border-bottom: none; }
|
||||
.item-header { display: flex; align-items: center; gap: 12px; }
|
||||
.item-icon { width: 52px; height: 52px; border-radius: 14px; background: #FFF0EB; display: flex; align-items: center; justify-content: center; font-size: 26px; }
|
||||
.item-name { font-size: 18px; font-weight: 700; display: block; }
|
||||
.item-meta { font-size: 13px; color: #86868B; display: block; margin-top: 2px; }
|
||||
.item-goal { font-size: 13px; color: #86868B; display: block; margin-top: 2px; }
|
||||
.stats-row { display: flex; justify-content: space-around; background: white; border-radius: 12px; margin: 8px 16px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
|
||||
.item-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--color-active-bg); display: flex; align-items: center; justify-content: center; font-size: 26px; }
|
||||
.item-name { font-size: 18px; font-weight: 700; display: block; color: var(--color-text); }
|
||||
.item-meta { font-size: 13px; color: var(--color-text-secondary); display: block; margin-top: 2px; }
|
||||
.item-goal { font-size: 13px; color: var(--color-text-secondary); display: block; margin-top: 2px; }
|
||||
.stats-row { display: flex; justify-content: space-around; background: var(--color-card); border-radius: 12px; margin: 8px 16px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
|
||||
.stat { text-align: center; }
|
||||
.stat-num { font-size: 28px; font-weight: 700; color: #FF6B35; display: block; }
|
||||
.stat-lbl { font-size: 13px; color: #86868B; }
|
||||
.stat-num { font-size: 28px; font-weight: 700; color: var(--color-primary); display: block; }
|
||||
.stat-lbl { font-size: 13px; color: var(--color-text-secondary); }
|
||||
.calendar { padding: 16px; }
|
||||
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 16px; font-weight: 600; }
|
||||
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 16px; font-weight: 600; color: var(--color-text); }
|
||||
.cal-nav { font-size: 18px; padding: 4px 8px; }
|
||||
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
|
||||
.cal-weekday { font-size: 12px; color: #86868B; padding: 6px 0; }
|
||||
.cal-day { padding: 8px 0; font-size: 14px; border-radius: 8px; position: relative; }
|
||||
.cal-weekday { font-size: 12px; color: var(--color-text-secondary); padding: 6px 0; }
|
||||
.cal-day { padding: 8px 0; font-size: 14px; border-radius: 8px; position: relative; color: var(--color-text); }
|
||||
.cal-day.checked { font-weight: 600; }
|
||||
.cal-day.today { background: #FFF0EB; }
|
||||
.cal-dot { width: 6px; height: 6px; border-radius: 3px; background: #34C759; margin: 2px auto 0; }
|
||||
.cal-day.today { background: var(--color-active-bg); }
|
||||
.cal-dot { width: 6px; height: 6px; border-radius: 3px; background: var(--color-success); margin: 2px auto 0; }
|
||||
Reference in New Issue
Block a user