// 通用信息卡片组件 import QtQuick import Felgo 4.0 Rectangle { id: root property string titleText: "" property string contentText: "" property string subContentText: "" property string iconSource: "" property int iconSize: 50 property bool showSettingsIcon: false property var extraContent: [] color: app.cardColor radius: 5 Column { anchors.centerIn: parent spacing: 5 // 图标 AppImage { id: icon anchors.horizontalCenter: parent.horizontalCenter anchors.topMargin: 30 width: root.iconSize height: root.iconSize source: root.iconSource fillMode: Image.PreserveAspectFit cache: true } // 标题 AppText { id: title anchors.horizontalCenter: parent.horizontalCenter text: root.titleText color: app.fontColor font.bold: true fontSize: 16 } // 主内容 AppText { id: content anchors.horizontalCenter: parent.horizontalCenter text: root.contentText color: "gray" fontSize: 10 } // 副内容 AppText { anchors.horizontalCenter: parent.horizontalCenter text: root.subContentText color: "gray" fontSize: 10 visible: root.subContentText !== "" } // 额外内容列表 Repeater { model: root.extraContent.length AppText { anchors.horizontalCenter: parent.horizontalCenter text: root.extraContent[index].text color: root.extraContent[index].color fontSize: 10 } } // 设置图标 AppImage { id: settingsIcon anchors.horizontalCenter: parent.horizontalCenter anchors.topMargin: 5 width: 30 height: 30 source: "../../assets/set.svg" fillMode: Image.PreserveAspectFit visible: root.showSettingsIcon } } }