Files
suixinkan_ios_new/suixinkan/Features/ScenicPromotion/Views/ScenicPromotionSettingsQueueBindingCard.swift

60 lines
1.9 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// ScenicPromotionSettingsQueueBindingCard.swift
// suixinkan
//
// Created by Codex on 2026/7/2.
//
import SwiftUI
///
struct ScenicPromotionSettingsQueueBindingCard: View {
@ObservedObject var viewModel: ScenicPromotionSettingsViewModel
var body: some View {
ScenicPromotionSettingsCard(
title: "排队打卡点绑定",
subtitle: "可多选,用于宣传页展示排队动态",
icon: "checklist.checked",
tint: AppDesign.primary
) {
Menu {
ForEach(viewModel.queuePoints) { point in
Button {
viewModel.toggleQueuePoint(point)
} label: {
Label(
"\(point.name) · \(point.areaName)",
systemImage: viewModel.selectedQueuePointIDs.contains(point.id) ? "checkmark.circle.fill" : "circle"
)
}
}
} label: {
ScenicPromotionSettingsSelectionField(
title: viewModel.selectedQueuePointNames,
subtitle: "\(viewModel.selectedQueuePointIDs.count) 个已选择",
icon: "chevron.down"
)
}
.buttonStyle(.plain)
if viewModel.selectedQueuePointIDs.isEmpty {
ScenicPromotionSettingsInlineNotice(
text: "提交前至少选择一个排队打卡点",
tint: AppDesign.warning
)
}
}
}
}
#if DEBUG
#Preview("排队绑定卡片") {
ScenicPromotionSettingsQueueBindingCard(
viewModel: ScenicPromotionPreviewSupport.settingsViewModel()
)
.padding()
.background(AppDesign.background)
}
#endif