123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- import QtQuick
- import QtQuick.Controls 2.5
- import QtQuick.Layouts 1.3
- import "backend.js" as Backend
- Rectangle {
- id: detailForm
- width: parent.width
- height: parent.height
- color: 'transparent'
- property StackView stack: null
- property string name: ""
- property string uid: ""
- property int statue: 0
- property int loadingCount: 0
- Rectangle {
- width: 1440
- height: 820
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- color: 'transparent'
- border.color: mainAppColor
- border.width: 1
- radius: 5
- Rectangle {
- width: 1280
- height: 720
- color: 'transparent'
- //color: 'blue'
- anchors.top: parent.top
- anchors.topMargin: 50
- anchors.horizontalCenter: parent.horizontalCenter
- // anchors.verticalCenter: parent.verticalCenter
- // CAM Panel
- Image {
- id: panelImg
- width: 1280
- height: 720
- fillMode: Image.Stretch
- }
- Connections {
- target: PanelImage
- onCallQmlRefeshPanelImg: {
- panelImg.source = ""
- panelImg.source = "image://PanelImage"
- }
- }
- }
- Text {
- id: carName
- anchors {
- top: myIcon.bottom
- topMargin: 10
- horizontalCenter: parent.horizontalCenter
- }
- text: name
- color: '#eaf4fc'
- font.family: alibaba.name
- // anchors.topMargin: 5
- font.pointSize: 20
- }
- // Text {
- // id: carConnState
- // anchors {
- // top: carName.bottom
- // topMargin: 10
- // horizontalCenter: parent.horizontalCenter
- // }
- // text: !appModel.ready ? "未连接" : "已连接"
- // color: '#eaf4fc'
- // font.family: alibaba.name
- // font.pointSize: 20
- // }
- Row {
- anchors.top: parent.bottom
- anchors.topMargin: 50
- anchors.horizontalCenter: parent.horizontalCenter
- CButton {
- id: connectButton
- textHeight: 50
- fontHeight: 0.4
- width: 180
- height: 50
- color: pressed ? textClickedColor : mainAppColor
- text: appModel.ready ? "断开" : "连接"
- onClicked: {
- if (!appModel.ready) {
- connectButton.visible = false
- loading.start()
- carSelect(uid)
- backButton.visible = false
- } else {
- connectButton.visible = false
- disconn.start()
- appModel.leaveCar()
- appModel.ready = false
- }
- }
- }
- spacing: 50
- CButton {
- id: backButton
- textHeight: 50
- fontHeight: 0.4
- width: 180
- height: 50
- color: pressed ? textClickedColor : mainAppColor
- text: "返回"
- onClicked: {
- connectButton.enabled = true
- // carConnState.text = ""
- stack.pop()
- }
- visible: true
- }
- }
- Timer {
- id: loading
- interval: 5000
- onTriggered: {
- connectButton.visible = true
- // loadingCount++
- // carConnState.text = "连接中" + Backend.dot(loadingCount)
- // if (loadingCount === 4)
- // loadingCount = 0
- }
- }
- Timer {
- id: disconn
- interval: 5000
- onTriggered: {
- connectButton.visible = true
- backButton.visible = true
- }
- }
- Component.onCompleted: {
- }
- }
- }
|