import QtQuick import QtQuick.Controls 2.5 import QtQuick.Layouts 1.3 import "backend.js" as Backend Item { property string back_content: "ask content"; property string move_content: ""; property int uid: 0 property string strArea:"" property string strNo:"" width: 1920 height: 1080 visible: true FontLoader { id: alibaba source: "qrc:/components/font/Alibaba-PuHuiTi-Bold.ttf" } FontLoader { id: fontawesome source: "qrc:/components/font/fontawesome-webfont.ttf" } signal loginSuccess(var userName, var password) function loginUser(uname, pword) { var ret = Backend.validateUserCredentials(uname, pword) var message = "" if (ret) { message = "用户名或密码输入错误" subPopup.popMessage = message subPopup.open() return } appModel.userLogin(uname, pword); page_car.visible = true page_car.stack = stack stack.push(page_car) } function carManage(){ stack.pop() } function workManage(){ page_work.visible=true; page_work.stack=stack; stack.push(page_work) } function carSelect(id) { appModel.connectCar(id) } function track() { // appModel.track() } function unTrack() { console.log('1111111'); appModel.leaveCar() appModel.ready = false stack.pop() page_detail.update() stack.pop() } Popup { id: subPopup property alias popMessage: message.text background: Rectangle { id: subPopupBg implicitWidth: 1920 implicitHeight: 60 color: popupBgColorErr } y: (parent.height - 60) modal: true focus: true closePolicy: Popup.CloseOnPressOutside Text { id: message anchors.centerIn: parent font.pointSize: 12 color: popupTextColor font.family: alibaba.name } onOpened: subPopupClose.start() } Timer { id: subPopupClose interval: 3000 onTriggered: subPopup.close() } Rectangle { anchors.fill: parent Image { fillMode: Image.PreserveAspectFit source: 'qrc:/images/bg.png' } color: 'transparent' } Rectangle { width: parent.width height: 80 color: 'transparent' z: 99 Image { anchors.horizontalCenter: parent.horizontalCenter fillMode: Image.PreserveAspectFit source: 'qrc:/images/banner.png' } Text { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter text: textTitle font.family: alibaba.name font.pointSize: 24 color: mainTextColor } } StackView { id: stack initialItem: page_login anchors.fill: parent } LoginPage { id: page_login visible: false } CarPage { id: page_car visible: false } WorkPage { id: page_work visible:false } DetailPage { id: page_detail visible: false } Dialog { id: backDialog visible: false modal: true x: (parent.width - width) / 2 y: (parent.height - height) / 2 closePolicy: Popup.NoAutoClose implicitWidth: 600 implicitHeight: 300 Text { text: back_content font.pointSize: 24 font.family: alibaba.name color: '#000000' anchors.horizontalCenter: parent.horizontalCenter y: 100 } Row { height: parent.height anchors.horizontalCenter: parent.horizontalCenter y: 200 CButton { id: quitButton textHeight: 50 fontHeight: 0.4 width: 150 height: 50 color: pressed ? textClickedColor : mainAppColor text: "确定" onClicked: { appModel.controlCar(uid); backDialog.visible = false; // videoWindow.close() // rootItem.qmlSignalQuit() } } spacing: 50 CButton { id: cancelBtn textHeight: 50 fontHeight: 0.4 width: 150 height: 50 color: pressed ? textClickedColor : mainAppColor text: "取消" onClicked: { appModel.cancelControl() backDialog.visible = false } } } } Dialog { id: trackDialog visible: false modal: true x: (parent.width - width) / 2 y: (parent.height - height) / 2 closePolicy: Popup.NoAutoClose implicitWidth: 600 implicitHeight: 300 Text { text: back_content font.pointSize: 24 font.family: alibaba.name color: '#000000' anchors.horizontalCenter: parent.horizontalCenter y: 100 } Row { height: parent.height anchors.horizontalCenter: parent.horizontalCenter y: 200 CButton { id: yesBtn textHeight: 50 fontHeight: 0.4 width: 150 height: 50 color: pressed ? textClickedColor : mainAppColor text: "是" onClicked: { track(); trackDialog.visible = false; // videoWindow.close() // rootItem.qmlSignalQuit() } } spacing: 50 CButton { id: noBtn textHeight: 50 fontHeight: 0.4 width: 150 height: 50 color: pressed ? textClickedColor : mainAppColor text: "否" onClicked: { unTrack(); trackDialog.visible = false } } } } Dialog { id: moveErrorDlg visible: false modal: true x: (parent.width - width) / 2 y: (parent.height - height) / 2 closePolicy: Popup.NoAutoClose implicitWidth: 600 implicitHeight: 300 Text { text: move_content font.pointSize: 24 font.family: alibaba.name color: '#000000' anchors.horizontalCenter: parent.horizontalCenter y: 100 } Row { height: parent.height anchors.horizontalCenter: parent.horizontalCenter y: 200 CButton { id: exbutton textHeight: 50 fontHeight: 0.4 width: 150 height: 50 color: pressed ? textClickedColor : mainAppColor text: "确定" onClicked: { appModel.controlCar(uid); backDialog.visible = false; // videoWindow.close() // rootItem.qmlSignalQuit() } } } } }