修改页面
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
Component({
|
||||
properties: {
|
||||
item: { type: Object, value: {} },
|
||||
done: { type: Boolean, value: false },
|
||||
streak: { type: Number, value: undefined },
|
||||
categoryLabel: { type: String, value: '' },
|
||||
cycleLabel: { type: String, value: '' },
|
||||
},
|
||||
methods: {
|
||||
onTap() {
|
||||
this.triggerEvent('tap', { id: this.data.item.id })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<view class="card {{status}}" data-id="{{item.id}}" bindtap="onTap">
|
||||
<view class="card-icon">{{item.icon || '📋'}}</view>
|
||||
<view class="card-body">
|
||||
<text class="card-name">{{item.name}}</text>
|
||||
<text class="card-meta">{{categoryLabel}} · {{cycleLabel}}</text>
|
||||
<text wx:if="{{done}}" class="done-badge">✓ 已打卡</text>
|
||||
</view>
|
||||
<view class="card-streak" wx:if="{{streak !== undefined}}">
|
||||
<text>🔥 {{streak}}天</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,26 @@
|
||||
.card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
margin: 0 12px 8px;
|
||||
padding: 14px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.04);
|
||||
}
|
||||
.card.paused { opacity: 0.6; }
|
||||
.card.archived { opacity: 0.4; }
|
||||
.card-icon {
|
||||
width: 44px; height: 44px;
|
||||
border-radius: 12px;
|
||||
background: #FFF0EB;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22px;
|
||||
margin-right: 14px;
|
||||
}
|
||||
.card-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
|
||||
.card-name { font-size: 16px; font-weight: 600; }
|
||||
.card-meta { font-size: 13px; color: #86868B; }
|
||||
.done-badge { font-size: 12px; color: #34C759; font-weight: 600; margin-top: 2px; }
|
||||
.card-streak { font-size: 14px; color: #FF6B35; font-weight: 600; }
|
||||
Reference in New Issue
Block a user