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 function refresh() { //connectButton.text="连接" if (!appModel.ready) connectButton.text="连接" else connectButton.text="断开" } function disconnect() { disconn.start() console.log("321312") } Rectangle { width: 1280 height: 720 anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter color: 'transparent' border.color: mainAppColor border.width: 1 radius: 5 // Image { // id: myIcon // width: 200 // height: 200 // anchors.horizontalCenter: parent.horizontalCenter // anchors.verticalCenter: parent.verticalCenter // fillMode: Image.PreserveAspectFit // source: 'qrc:/images/car1.png' // } Rectangle { width: 1280 height: 720 color: 'transparent' anchors.top: parent.top anchors.topMargin: 50 anchors.horizontalCenter: parent.horizontalCenter // anchors.verticalCenter: parent.verticalCenter // CAM Panel Image { id: panelImg visible: false width: 1280 height: 720 fillMode: Image.Stretch source:'qrc:/images/PanelImage.png' } } CButton { id: carButton x:10 y:200 textHeight: 50 fontHeight: 0.4 width: 50 height: 200 color: pressed ? textClickedColor : mainAppColor Text{ text: "\n 场\n 地\n 管\n 理" wrapMode: Text.WordWrap font.pointSize: 20 color:"white" // anchors.horizontalCenter: parent.horizontalCenter // horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } onClicked:workManage(); } /* Text { id: carName anchors { top: myIcon.bottom topMargin: 10 horizontalCenter: parent.horizontalCenter } text: name color: '#eaf4fc' font.family: alibaba.name 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 }*/ /* Image { id: model x:appModel.ModelX y:appModel.modelY width: 30 height: 30 fillMode: Image.Stretch source:'qrc:/images/PanelImage.png' } */ Row { height: parent.height anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.bottom // anchors.top:parent.top // anchors.topMargin: 20 // y:250 // x:100 spacing: 40 CButton { id: connectButton // anchors.topMargin: 50 y:10 textHeight: 50 fontHeight: 0.4 width: 250 height: 50 color: pressed ? textClickedColor : mainAppColor text: appModel.ready ? "断开" : "连接" onClicked: { if (!appModel.ready) { connectButton.visible = false loading.start() carSelect(uid) backButton.visible = false appModel.ready = true connectButton.text="断开" } else { connectButton.visible = false disconn.start() appModel.leaveCar() appModel.ready = false connectButton.text="连接" // stack.pop() } } } Timer { id: loading interval: 10000 onTriggered: { connectButton.visible = true //connectButton.text="连接" backButton.visible=true // loadingCount++ // carConnState.text = "连接中" + Backend.dot(loadingCount) // if (loadingCount === 4) // loadingCount = 0 } } Timer { id: disconn interval: 5000 onTriggered: { connectButton.visible = true //connectButton.text="断开" backButton.visible = true } } CButton { id: backButton // anchors.top: connectButton.bottom // anchors.topMargin: 30 // anchors.horizontalCenter: parent.horizontalCenter textHeight: 50 fontHeight: 0.4 width: 250 height: 50 y:10 visible:appModel.ready?false:true color: pressed ? textClickedColor : mainAppColor text: "返回" onClicked: { connectButton.enabled = true // carConnState.text = "" stack.pop() } } } Component.onCompleted: { loading.start() } } }