| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- <template>
- <view class="section">
- <view class="section-header">
- <text class="section-title">📝 我的任务({{ tasks.length }})</text>
- <view class="section-header-extra">
- <text class="task-family-count" @click="$emit('view-all')">家庭任务({{ familyTodoCount }})</text>
- <text class="section-more" @click="$emit('view-all')">全部 ›</text>
- </view>
- </view>
- <view v-if="tasks.length > 0" class="task-quick-list">
- <view
- v-for="task in tasks"
- :key="task.id"
- class="task-quick-item"
- :class="{ 'task-quick-item--overdue': task._isOverdue }"
- >
- <view class="task-quick-info">
- <text class="task-quick-title line-clamp-1">{{ task.title }}</text>
- <text class="task-quick-meta" v-if="!task._isOverdue">+{{ task.points }}CF</text>
- <text class="task-quick-meta task-quick-meta--overdue" v-else>已超期</text>
- </view>
- <button v-if="!task._isOverdue" class="btn-quick-complete" @click="$emit('complete', task)">{{ task._isLinked ? '去完成' : '完成' }}</button>
- <view v-else class="status-badge-overdue">⏰ 已超期</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: 'TaskQuickList',
- props: {
- tasks: {
- type: Array,
- default: function() { return [] }
- },
- familyTodoCount: {
- type: Number,
- default: 0
- }
- }
- }
- </script>
- <style scoped lang="scss">
- /* ④ 内容区 — 家庭动态(任务快捷列表);样式与 pages/index-home/index.vue 原内联区块一致 */
- .section {
- margin: 20rpx $uni-space-lg;
- }
- .section-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20rpx;
- }
- .section-title {
- font-size: calc(30rpx * var(--font-scale, 1));
- font-weight: bold;
- color: $facade-text-strong;
- }
- .section-more {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $brand-primary;
- }
- /* 家庭任务右侧计数标(家庭任务 + 全部) */
- .section-header-extra {
- display: flex;
- flex-direction: row;
- align-items: center;
- }
- .task-family-count {
- margin-right: 16rpx;
- padding: 4rpx 16rpx;
- border-radius: $radius-full;
- background: rgba($brand-primary, 0.08);
- color: $brand-primary;
- font-size: calc(22rpx * var(--font-scale, 1));
- font-weight: 600;
- line-height: 1.5;
- }
- /* 我的任务快捷列表 */
- .task-quick-list {
- display: flex;
- flex-direction: column;
- gap: 12rpx;
- }
- .task-quick-item {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- background: $app-surface;
- border-radius: 16rpx;
- padding: 18rpx 24rpx;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04);
- }
- .task-quick-info {
- display: flex;
- flex-direction: column;
- min-width: 0;
- flex: 1;
- }
- .task-quick-title {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $facade-text-strong;
- font-weight: 500;
- line-height: 1.4;
- }
- .task-quick-meta {
- font-size: calc(22rpx * var(--font-scale, 1));
- color: $brand-primary;
- margin-top: 4rpx;
- font-weight: bold;
- }
- .line-clamp-1 {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .btn-quick-complete {
- margin-left: 16rpx;
- padding: 8rpx 24rpx;
- background: linear-gradient(135deg, $brand-primary, $brand-primary-light);
- color: $app-surface;
- font-size: calc(24rpx * var(--font-scale, 1));
- font-weight: bold;
- border-radius: 24rpx;
- border: none;
- line-height: 1;
- height: 44rpx;
- flex-shrink: 0;
- }
- .btn-quick-complete::after {
- border: none;
- }
- /* 超期任务样式 */
- .task-quick-item--overdue .task-quick-meta--overdue {
- color: $status-danger-2;
- font-weight: bold;
- }
- .status-badge-overdue {
- margin-left: 16rpx;
- padding: 8rpx 20rpx;
- background: rgba(255,77,79,0.1);
- color: $status-danger-2;
- font-size: calc(24rpx * var(--font-scale, 1));
- font-weight: bold;
- border-radius: 24rpx;
- flex-shrink: 0;
- line-height: 1;
- height: 44rpx;
- display: flex;
- align-items: center;
- }
- </style>
|