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() { 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 Rectangle { width: 1280 height: 720 color: 'transparent' anchors.top: parent.top anchors.topMargin: 0 anchors.horizontalCenter: parent.horizontalCenter //visible:false visible:true // CAM BackImg //aaa Image { id: backImg visible: true width: 1280 height: 720 fillMode: Image.Stretch } Connections { target: BackImage onCallQmlRefeshBackImg: { backImg.source = "" backImg.source = "image://BackImage" } } } CButton { id: carButton x:10 y:200 textHeight: 50 fontHeight: 0.4 width: 50 height: 200 visible:false color: pressed ? textClickedColor : mainAppColor Text{ text: "\n 场\n 地\n 管\n 理" wrapMode: Text.WordWrap font.pointSize: 20 color:"white" verticalAlignment: Text.AlignVCenter } onClicked:workManage(); } Row { height: parent.height anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.bottom 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: 500 onTriggered: { connectButton.visible = true //connectButton.text="连接" backButton.visible=true } } Timer { id: disconn interval: 500 onTriggered: { connectButton.visible = true //connectButton.text="断开" backButton.visible = true } } CButton { id: backButton 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() } } }