FluentUI/Gallery/res/qml/screen/SearchNearScreen.qml
yxdy 8d68f26b15
Some checks failed
Gallery App Build / Windows (push) Has been cancelled
Gallery App Build / macOS (push) Has been cancelled
Gallery App Build / Ubuntu (push) Has been cancelled
feat: 添加功能
2025-02-15 18:06:24 +08:00

236 lines
7.8 KiB
QML
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.

import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import FluentUI.Controls
import FluentUI.impl
ColumnLayout {
anchors.fill: parent
anchors.rightMargin: 10
// 输入框
RowLayout{
Layout.preferredHeight: 50
spacing: 15
TextBox{
Layout.fillWidth: true
Layout.leftMargin: 10
Layout.preferredHeight: 35
placeholderText: "关键词"
}
Button{
text: "搜索"
Layout.preferredWidth: 90
Layout.preferredHeight: 35
}
ComboBox{
model: ListModel {
id: model
ListElement { text: "1公里内" }
ListElement { text: "5公里内" }
ListElement { text: "10公里内" }
}
Layout.rightMargin: 10
}
}
ListModel{
id: tab_model
ListElement{
title: "充电站"
}
ListElement{
title: "加氢站"
}
ListElement{
title: "煤矿"
}
ListElement{
title: "陆港"
}
ListElement{
title: "收费站"
}
ListElement{
title: "服务区"
}
}
// 过滤条件
RowLayout{
spacing: 15
Layout.leftMargin: 10
Repeater {
model: tab_model
Rectangle{
width: 80
height: 30
color: "#0C53C0"
Label{
text: model.title
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: parent.color = "#60B0EF"
onExited: parent.color = "#0C53C0"
onClicked: {
console.log("cdz")
}
}
}
}
}
// 搜索结果
ColumnLayout{
Layout.fillHeight: true
Rectangle{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.leftMargin: 10
Layout.rightMargin: 10
Layout.topMargin: 10
Layout.bottomMargin: 10
color: "transparent"
border.color: "#ffffff"
border.width: 2
ColumnLayout{
anchors.fill: parent
Rectangle{
Layout.leftMargin: 2
Layout.topMargin: 2
Layout.preferredWidth: parent.width - 4
height: 60
color: "transparent"
ColumnLayout{
anchors.fill: parent
spacing: 5
RowLayout{
Layout.fillWidth: true
Label{
Layout.fillWidth: true
Layout.leftMargin: 5
text: "新电青丰1号站充电桩"
font.pointSize: 14
}
Label{
Layout.preferredWidth: 90
Layout.rightMargin: 5
text: "2.7km"
horizontalAlignment: Text.AlignRight
font.pointSize: 8
}
}
RowLayout{
Layout.fillWidth: true
Layout.fillHeight: true
spacing: 5
Label{
Layout.leftMargin: 5
Layout.fillWidth: true
text: "营业中充电桩6个空闲2个实时电价1元/kwh服务费1.2元/kwh"
font.pointSize: 8
}
Button{
text: "查看"
highlighted: true
}
Button{
text: "导航去"
highlighted: true
Layout.rightMargin: 5
}
}
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: parent.color = "#292929"
onExited: parent.color = "transparent"
}
Rectangle{
width: parent.width
height: 1
color: "#fff"
anchors.bottom: parent.bottom
}
}
Rectangle{
Layout.leftMargin: 2
Layout.topMargin: 2
Layout.preferredWidth: parent.width - 4
height: 60
color: "transparent"
ColumnLayout{
anchors.fill: parent
spacing: 5
RowLayout{
Layout.fillWidth: true
Label{
Layout.fillWidth: true
Layout.leftMargin: 5
text: "青河县鹏新矿业"
font.pointSize: 14
}
Label{
Layout.preferredWidth: 90
Layout.rightMargin: 5
text: "2.7km"
horizontalAlignment: Text.AlignRight
font.pointSize: 8
}
}
RowLayout{
Layout.fillWidth: true
Layout.fillHeight: true
spacing: 5
Label{
Layout.leftMargin: 5
Layout.fillWidth: true
text: "营业中煤炭价格300元/吨装载车辆35辆周边道路畅通"
font.pointSize: 8
}
Button{
text: "查看"
highlighted: true
}
Button{
text: "导航去"
highlighted: true
Layout.rightMargin: 5
}
}
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: parent.color = "#292929"
onExited: parent.color = "transparent"
}
Rectangle{
width: parent.width
height: 1
color: "#fff"
anchors.bottom: parent.bottom
}
}
Item{
Layout.fillHeight: true
}
}
}
}
}