主要更新uniapp相关功能

This commit is contained in:
hero920103 committed 2026-10-07 00:59:05 +08:00
1 parent aa92ca40a2
commit 5b4dbb2b46
65 files changed
+8532 -1921

No files matched your search

+29 -71
View File
@@ -8,9 +8,11 @@
<view class="content-block">
<view class="content-header">
<text class="info-label">日程内容</text>
<view class="status-tag" :class="item.completed ? 'done' : 'pending'">
<text>{{ item.completed ? '已完成' : '待办' }}</text>
</view>
<u-tag
:text="item.completed ? '已完成' : '待办'"
:type="item.completed ? 'success' : 'primary'"
size="mini"
/>
</view>
<text class="content-text">{{ item.content || '无内容' }}</text>
</view>
@@ -23,11 +25,14 @@
<view class="info-row channel-row">
<text class="info-label">提醒渠道</text>
<view class="channel-tags">
<text
<u-tag
v-for="channel in item.remindChannels"
:key="channel"
class="channel-tag"
>{{ getRemindChannelLabel(channel) }}</text>
:text="getRemindChannelLabel(channel)"
type="primary"
size="mini"
plain
/>
<text v-if="!item.remindChannels?.length" class="info-value muted">未设置</text>
</view>
</view>
@@ -45,17 +50,20 @@
</template>
<view v-if="item" class="footer">
<view class="btn-complete" @tap="onToggleComplete">
<FaIcon :name="item.completed ? 'rotate-left' : 'check'" :color="item.completed ? '#606266' : '#3c9cff'" :size="16" />
<text>{{ item.completed ? '标为待办' : '标记完成' }}</text>
<view class="footer-btn">
<u-button
:type="item.completed ? 'info' : 'primary'"
:icon="item.completed ? 'reload' : 'checkmark'"
:text="item.completed ? '标为待办' : '标记完成'"
:plain="item.completed"
@click="onToggleComplete"
/>
</view>
<view v-if="!item.completed" class="btn-edit" @tap="openEdit">
<FaIcon name="pen-to-square" color="#3c9cff" :size="16" />
<text>编辑</text>
<view v-if="!item.completed" class="footer-btn">
<u-button type="primary" plain icon="edit-pen" text="编辑" @click="openEdit" />
</view>
<view class="btn-delete" @tap="onDelete">
<FaIcon name="trash-can" color="#f56c6c" :size="16" />
<text>删除</text>
<view class="footer-btn">
<u-button type="error" plain icon="trash" text="删除" @click="onDelete" />
</view>
</view>
</view>
@@ -116,11 +124,13 @@ function openEdit() {
async function onToggleComplete() {
if (!item.value) return
const wasCompleted = item.value.completed
try {
const updated = await toggleScheduleComplete(item.value.id)
item.value = updated
await toggleScheduleComplete(item.value.id)
// toggle 接口只返回 is_finished,需重新拉取完整详情
await loadDetail()
uni.showToast({
title: updated.completed ? '已标记完成' : '已标为待办',
title: wasCompleted ? '已标为待办' : '已标记完成',
icon: 'none'
})
} catch (e) {
@@ -180,23 +190,6 @@ function onDelete() {
margin-bottom: 12rpx;
}
.status-tag {
padding: 4rpx 12rpx;
border-radius: $radius-sm;
font-size: 22rpx;
font-weight: 500;
&.pending {
background: $color-primary-bg;
color: $color-primary;
}
&.done {
background: #f0f9eb;
color: #67c23a;
}
}
.content-text {
display: block;
font-size: 30rpx;
@@ -244,14 +237,6 @@ function onDelete() {
flex: 1;
}
.channel-tag {
font-size: 24rpx;
color: $color-primary;
background: $color-primary-bg;
padding: 6rpx 16rpx;
border-radius: $radius-sm;
}
.meta-row {
display: flex;
flex-direction: column;
@@ -277,35 +262,8 @@ function onDelete() {
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.04);
}
.btn-complete,
.btn-edit,
.btn-delete {
.footer-btn {
flex: 1;
height: 88rpx;
border-radius: $radius-md;
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
font-size: 28rpx;
font-weight: 500;
}
.btn-complete {
background: $color-primary-bg;
color: $color-primary;
}
.btn-edit {
background: $color-bg-page;
color: $color-primary;
border: 1rpx solid $color-primary-bg;
}
.btn-delete {
background: $color-bg-page;
color: #f56c6c;
border: 1rpx solid #fde2e2;
}
.state-box {