提交修改
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
const api = require('../../../services/api')
|
||||
const app = getApp()
|
||||
Page({
|
||||
data: { name: '', category: 'study', cycleType: 'daily', dailyGoal: '', privacy: 2, submitting: false },
|
||||
data: { name: '', category: 'study', cycleType: 'daily', dailyGoal: '', privacy: 2, submitting: false, themeMode: 'light' },
|
||||
onShow() {
|
||||
this.setData({ themeMode: app.globalData.themeMode })
|
||||
},
|
||||
onNameInput(e) { this.setData({ name: e.detail.value }) },
|
||||
onGoalInput(e) { this.setData({ dailyGoal: e.detail.value }) },
|
||||
setCategory(e) { this.setData({ category: e.currentTarget.dataset.cat }) },
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<view class="form">
|
||||
<view data-theme="{{themeMode}}"><view class="form">
|
||||
<text class="label">名称 *</text>
|
||||
<input class="input-field" value="{{name}}" bindinput="onNameInput" placeholder="如「每天背单词」" style="margin-bottom:20px" />
|
||||
|
||||
@@ -29,4 +29,4 @@
|
||||
</view>
|
||||
|
||||
<button class="btn-primary" style="margin-top:32px" loading="{{submitting}}" disabled="{{submitting}}" bindtap="onSubmit">创建打卡项</button>
|
||||
</view>
|
||||
</view></view>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
.form { padding: 16px; }
|
||||
.label { font-size: 13px; color: #86868B; margin-bottom: 6px; display: block; }
|
||||
.label { font-size: 13px; color: var(--color-text-secondary); margin-bottom: 6px; display: block; }
|
||||
.category-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
|
||||
.cat-item { padding: 12px 8px; border-radius: 10px; border: 2px solid #E5E5EA; background: #f8f8fa; text-align: center; font-size: 14px; }
|
||||
.cat-item.active { border-color: #FF6B35; background: #FFF0EB; font-weight: 600; }
|
||||
.cat-item { padding: 12px 8px; border-radius: 10px; border: 2px solid var(--color-border); background: var(--color-input-bg); text-align: center; font-size: 14px; color: var(--color-text); }
|
||||
.cat-item.active { border-color: var(--color-primary); background: var(--color-active-bg); font-weight: 600; }
|
||||
.cycle-row { display: flex; gap: 8px; }
|
||||
.cycle-item { padding: 8px 16px; border-radius: 8px; border: 1.5px solid #E5E5EA; background: #f8f8fa; font-size: 14px; }
|
||||
.cycle-item.active { border-color: #FF6B35; background: #FFF0EB; font-weight: 600; }
|
||||
.cycle-item { padding: 8px 16px; border-radius: 8px; border: 1.5px solid var(--color-border); background: var(--color-input-bg); font-size: 14px; color: var(--color-text); }
|
||||
.cycle-item.active { border-color: var(--color-primary); background: var(--color-active-bg); font-weight: 600; }
|
||||
.privacy-row { display: flex; gap: 8px; }
|
||||
.privacy-item { padding: 8px 16px; border-radius: 8px; border: 1.5px solid #E5E5EA; background: #f8f8fa; font-size: 14px; }
|
||||
.privacy-item.active { border-color: #FF6B35; background: #FFF0EB; font-weight: 600; }
|
||||
.privacy-item { padding: 8px 16px; border-radius: 8px; border: 1.5px solid var(--color-border); background: var(--color-input-bg); font-size: 14px; color: var(--color-text); }
|
||||
.privacy-item.active { border-color: var(--color-primary); background: var(--color-active-bg); font-weight: 600; }
|
||||
@@ -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