qml基本控件

Switch

import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Switch {
    id: switchBtn

    property real m_width: 116
    property real m_height: 64
    property real m_radius: 36
    property real m_borderW: 5

    anchors.verticalCenter: parent.verticalCenter
    style: SwitchStyle {
          groove: Rectangle {
                  implicitWidth: m_width
                  implicitHeight: m_height
                  radius: m_radius
                  color: switchBtn.checked ? "#16bf86" : "#d8d8d8"
          }
          handle: Rectangle {
              anchors.verticalCenter: parent.verticalCenter
              implicitWidth: m_height
              implicitHeight: m_height
              radius: m_radius
              color: "white"
              border.color: switchBtn.checked ? "#16bf86" : "#d8d8d8"
              border.width: m_borderW
          }
    }
}

Slider

import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Slider {
    id: root

    property string m_color: ""
    property real m_width: 487
    property real m_height: 12
    property real m_handleWidth: 64

    style: SliderStyle {
          groove: Rectangle {
              implicitWidth: m_width
              implicitHeight: m_height
              color: "#d8d8d8"
              radius: m_height/2

              Rectangle {
                  width: root.value*m_width
                  height: m_height
                  radius: m_height/2
                  color: m_color
              }
          }
          handle: Rectangle {
              anchors.centerIn: parent
              color: "white"
              implicitWidth: m_handleWidth
              implicitHeight: m_handleWidth
              radius: m_handleWidth/2
              border.width: 1
              border.color: "#959595"
          }
      }
}

ShortMessageDlg

import QtQuick 2.9

Rectangle {
    id: rect
    anchors.horizontalCenter: parent.horizontalCenter
    y: window.height
    width: msgText.width+20
    height: msgText.height+10
    color: "#48484a"
    radius: 10

    property string msg: ""
    property alias is_running: shortMsgAni.running

    Text {
        id: msgText
        anchors.centerIn: parent
        text: msg
        font.family: fontCfg.alibaba_regular_font
        font.pixelSize: 30
        color: "white"
    }

    SequentialAnimation {
        id: shortMsgAni
        running: false

        onStopped: {
            rect.y = window.height
            rect.opacity = 1.0
        }

        NumberAnimation {
            target: rect
            properties: "y"
            to: 380
            duration: 500
        }

        NumberAnimation {
            target: rect
            properties: "opacity"
            to: 0.0
            duration: 3000
        }
    }
}

ScrollBar,参考源码,为了解决Flickable的contentHeight过高,导致的滑动条过短问题

/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL3$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or later as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file. Please review the following information to
** ensure the GNU General Public License version 2.0 requirements will be
** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

// 为了解决flickable的contentHeight过高,导致的滑动条过短问题
import QtQuick 2.9
import QtQuick.Controls 2.2

ScrollBar {
    id: control

    property Flickable flickable

    implicitWidth: Math.max(background ? background.implicitWidth : 0,
                            contentItem.implicitWidth + leftPadding + rightPadding)
    implicitHeight: Math.max(background ? background.implicitHeight : 0,
                             contentItem.implicitHeight + topPadding + bottomPadding)

    visible: control.policy !== ScrollBar.AlwaysOff

    padding: 2
    active: true
    size: flickable.visibleArea.heightRatio > 0.1 ? flickable.visibleArea.heightRatio : 0.1
    position: flickable.visibleArea.yPosition

    contentItem: Rectangle {
        implicitWidth: control.interactive ? 6 : 2
        implicitHeight: control.interactive ? 6 : 2

        color: "#16bf86"
        radius: width/2

        states: State {
            name: "active"
            when: flickable.movingVertically
            PropertyChanges { target: control; opacity: 1.0 }
        }

        transitions: Transition {
            from: "active"
            SequentialAnimation {
                PauseAnimation { duration: 450 }
                NumberAnimation { target: control; duration: 200; property: "opacity"; to: 0.0 }
            }
        }
    }
}

RadioButton

import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

RadioButton {
    anchors.verticalCenter: parent.verticalCenter
    checked: false
    style: RadioButtonStyle {
        indicator: Rectangle {
                              implicitWidth: 30
                              implicitHeight: 30
                              radius: 15
                              border.color: "lightgray"
                              border.width: 6
                              Rectangle {
                                  anchors.fill: parent
                                  visible: control.checked
                                  color: "#16bf86"
                                  radius: 15
                                  anchors.margins: 5
                              }
                      }
    }
}

参数滑动选择器

import QtQuick 2.9

PathView {
    id: pathView

    property real m_width: 46

    width: m_width
    height: 76*3
    highlightMoveDuration: 0
    clip: true
    pathItemCount: 3
    preferredHighlightBegin: 0.5
    preferredHighlightEnd: 0.5
    dragMargin: width / 2
    path: Path {
        startX: pathView.width / 2
        startY:0
        PathLine {
            x: pathView.width / 2
            y: pathView.height
        }
    }
}

SwipeView滑动回弹

/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL3$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or later as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file. Please review the following information to
** ensure the GNU General Public License version 2.0 requirements will be
** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Templates 2.2 as T

T.SwipeView {
    id: control

    implicitWidth: Math.max(background ? background.implicitWidth : 0,
                            contentItem.implicitWidth + leftPadding + rightPadding)
    implicitHeight: Math.max(background ? background.implicitHeight : 0,
                             contentItem.implicitHeight + topPadding + bottomPadding)

    contentItem: ListView {
        id: listView
        model: control.contentModel
        interactive: control.interactive
        currentIndex: control.currentIndex
        spacing: control.spacing
        orientation: control.orientation
        snapMode: ListView.SnapOneItem
        boundsBehavior: Flickable.DragOverBounds
        highlightRangeMode: ListView.StrictlyEnforceRange
        preferredHighlightBegin: 0
        preferredHighlightEnd: 0
        highlightMoveDuration: 250
        maximumFlickVelocity: 4 * (control.orientation === Qt.Horizontal ? width : height)
    }
}

消息弹框MessageDialog

import QtQuick 2.9
import QtQuick.Controls 2.2

// 确定开始烹饪吗
Popup {
    id: msgDialog
    visible: false
    width: window.width
    height: window.height
    modal: true
    closePolicy: Popup.NoAutoClose
    padding: 0
    scale: 0

    property int currDlgType: -1
    property string m_tipStr: ""        // 自定义用语

    signal sig_ok(var type)

    function f_openDlgByType(type, tipStr)
    {
        if (msgDialog.visible) {
            return
        }

        if (arguments[1]) {
            m_tipStr = tipStr
        }

        switch (type) {
        case 0: // 确定开始烹饪吗
            msgLoader.sourceComponent = startCookCom
            break;
        case 1: // USB与电源板通讯故障
            msgLoader.sourceComponent = comErrorCom
            break;
        case 2: // 确定取消保温吗
            msgLoader.sourceComponent = cancelKeepWarmCom
            break;
        case 3: // 确定取消清洗吗
            msgLoader.sourceComponent = cancelCleanCom
            break;
        case 4: // 确定取消烹饪吗
            msgLoader.sourceComponent = cancelCookCom
            break;
        case 5: // 底部传感器故障
            msgLoader.sourceComponent = sensorErrorCom
            break;
        case 6: // 确定开始保温吗
            msgLoader.sourceComponent = startKeepWarmCom
            break;
        case 7: // 确定开始清洗吗
            msgLoader.sourceComponent = startCleanCom
            break;
        case 8: // 预约时间小于烹饪时长
            msgLoader.sourceComponent = reserveTimeLessThanCookingCom
            break;
        case 9: // 是否切换为标准版本
            msgLoader.sourceComponent = 2
            break;
        case 10: // 检测到内锅移出,将停止加热
            msgLoader.sourceComponent = removeCapCom
            break;
        case 11: // 正在烹饪中
            msgLoader.sourceComponent = cookingCom
            break;
        case 12: // 称重传感器故障
            msgLoader.sourceComponent = weightErrorCom
            break;
        case 13: // 确定退出食谱烹饪吗
            msgLoader.sourceComponent = quitCookCom
            break;
        case 14: // 顶部传感器故障
            msgLoader.sourceComponent = topSensorErrorCom
            break;
        case 15: // 下载菜谱成功/自定义用语
            msgLoader.sourceComponent = downloadCom
            break;
        case 16: // 网络连接成功
            msgLoader.sourceComponent = wifiSuccessCom
            break;
        case 17: // 网络连接失败
            msgLoader.sourceComponent = wifiFailCom
            break;
        case 18: // 请输入正确手机号码
            msgLoader.sourceComponent = phoneNumberCom
            break;
        case 19: // 请阅读并勾选协议
            msgLoader.sourceComponent = protocolCom
            break;
        case 20: // 验证码已发送,请查看手机
            msgLoader.sourceComponent = verifyCom1
            break;
        case 21: // 登录成功
            msgLoader.sourceComponent = verifyCom2
            break;
        case 22: // 短信验证码暂时不可用,请稍后重试
            msgLoader.sourceComponent = verifyCom3
            break;
        case 23: // 确定开始预约吗?
            msgLoader.sourceComponent = startReserveCom
            break;
        case 24: // 确定取消预约吗?
            msgLoader.sourceComponent = cancelReserveCom
            break;
        case 25: // 网络连接断开
            msgLoader.sourceComponent = wifiDisconnectCom
            break;
        case 26: // 请下压关盖
            msgLoader.sourceComponent = closeCapCom
            break;
        case 27: // 请盖上玻璃盖
            msgLoader.sourceComponent = closeGlassCapCom
            break;
        case 28: // 请盖上压力盖
            msgLoader.sourceComponent = closePressCapCom
            break;
        case 29: // 请盖上烘烤盖
            msgLoader.sourceComponent = closeBakeCapCom
            break;
        case 30: // wifi联网故障
            msgLoader.sourceComponent = wifiErrorCom
            break;
        case 31: // 正在烹饪中,请先取消烹饪 再开始新烹饪
            msgLoader.sourceComponent = startNewCookCom
            break;
        case 32: // 正在预约中,请先取消预约 再开始新烹饪
            msgLoader.sourceComponent = startNewCookCom1
            break;
        case 33: // 厨房闹钟计时完成!
            msgLoader.sourceComponent = alarmFinishCom
            break;
        case 34: // 非强制升级
            msgLoader.sourceComponent = noForceUpdateCom
            break;
        case 35: // 强制升级
            msgLoader.sourceComponent = forceUpdateCom
            break;
        case 36: // 食材过轻
            msgLoader.sourceComponent = foodLightCom
            break;
        case 37: // 食材过重
            msgLoader.sourceComponent = foodWeightCom
            break;
        }

        currDlgType = type
        msgDialog.open();
    }

    enter: Transition {
        NumberAnimation {property: "scale"; from: 0.0; to: 1.0; duration: 250}
    }

    exit: Transition {
        NumberAnimation {property: "scale"; from: 1.0; to: 0.0; duration: 250}
    }

    background: Item {
        width: 800
        height: 480
    }

    contentItem: Loader {
        id: msgLoader
        width: 800
        height: 480
    }

    // 确定开始烹饪吗
    Component {
        id: startCookCom

        Rectangle {
            anchors.fill: parent
            color: "white"

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/cookCap.png"
            }

            Text {
                y: 238
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("确定开始烹饪吗?")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484A"
            }

            Rectangle {
                x: 182
                y: 360
                width: 136
                height: 76
                radius: 38
                color: "#c7c7cc"

                Text {
                    anchors.centerIn: parent
                    text: qsTr("取消")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 36
                    color: "white"
                }

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 167
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        sig_ok(currDlgType)
                    }
                }
            }
        }
    }

    // 预约时间小于烹饪时长
    Component {
        id: reserveTimeLessThanCookingCom

        Rectangle {
            anchors.fill: parent
            color: "white"

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/cookCap.png"
            }

            Text {
                y: 238
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("确定开始烹饪吗?")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484A"
            }

            Text {
                y: 290
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("提示:预约时间小于烹饪时长")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "#48484A"
            }

            Rectangle {
                x: 182
                y: 360
                width: 136
                height: 76
                radius: 38
                color: "#c7c7cc"

                Text {
                    anchors.centerIn: parent
                    text: qsTr("取消")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 36
                    color: "white"
                }

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 167
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        sig_ok(currDlgType)
                    }
                }
            }
        }
    }

    // USB与电源板通讯故障
    Component {
        id: comErrorCom

        Rectangle {
            anchors.fill: parent
            color: "white"
            radius: 20

            Image {
                x: 336
                y: 60
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/errorTip.png"
            }

            Text {
                y: 209
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("UIB与电源板通讯故障")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484a"
            }

            Text {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 260
                text: qsTr("请拨打售后服务热线 400-8899717")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "#48484a"
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 15
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }
        }
    }

    // 确定取消保温吗
    Component {
        id: cancelKeepWarmCom

        Rectangle {
            anchors.fill: parent
            color: "white"
            radius: 20

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/cancelKeepWarm.png"
            }

            Text {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 238
                text: qsTr("确定取消保温吗?")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484a"
            }

            Rectangle {
                x: 182
                y: 360
                width: 136
                height: 76
                radius: 38
                color: "#c7c7cc"

                Text {
                    anchors.centerIn: parent
                    text: qsTr("取消")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 36
                    color: "white"
                }

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 167
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        sig_ok(currDlgType)
                    }
                }
            }
        }
    }

    // 确定取消清洗吗
    Component {
        id: cancelCleanCom

        Rectangle {
            anchors.fill: parent
            color: "white"
            radius: 20

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/cancel_cleanIcon.png"
            }

            Text {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 238
                text: qsTr("确定取消清洗吗?")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484a"
            }

            Rectangle {
                x: 182
                y: 360
                width: 136
                height: 76
                radius: 38
                color: "#c7c7cc"

                Text {
                    anchors.centerIn: parent
                    text: qsTr("取消")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 36
                    color: "white"
                }

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 167
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        sig_ok(currDlgType)
                    }
                }
            }
        }
    }

    // 确定取消烹饪吗
    Component {
        id: cancelCookCom

        Rectangle {
            anchors.fill: parent
            color: "white"
            radius: 20

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/cancelCookCap.png"
            }

            Text {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 238
                text: qsTr("确定取消烹饪吗?")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484a"
            }

            Rectangle {
                x: 182
                y: 360
                width: 136
                height: 76
                radius: 38
                color: "#c7c7cc"

                Text {
                    anchors.centerIn: parent
                    text: qsTr("取消")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 36
                    color: "white"
                }

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 167
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        sig_ok(currDlgType)
                    }
                }
            }
        }
    }

    // 底部传感器故障
    Component {
        id: sensorErrorCom

        Rectangle {
            anchors.fill: parent
            color: "white"
            radius: 20

            Image {
                x: 336
                y: 60
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/errorTip1.png"
            }

            Text {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 204
                text: qsTr("底部传感器故障")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484a"
            }

            Text {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 260
                text: qsTr("请拨打售后服务热线 400-8899717")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "#48484a"
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 15
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }
        }
    }

    // 确定开始保温吗
    Component {
        id: startKeepWarmCom

        Rectangle {
            anchors.fill: parent
            color: "white"
            radius: 20

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/keepWarmIcon.png"
            }

            Text {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 238
                text: qsTr("确定开始保温吗?")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484a"
            }

            Rectangle {
                x: 182
                y: 360
                width: 136
                height: 76
                radius: 38
                color: "#c7c7cc"

                Text {
                    anchors.centerIn: parent
                    text: qsTr("取消")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 36
                    color: "white"
                }

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 167
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        sig_ok(currDlgType)
                    }
                }
            }
        }
    }

    // 确定开始清洗吗
    Component {
        id: startCleanCom

        Rectangle {
            anchors.fill: parent
            color: "white"
            radius: 20

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/cleanIcon.png"
            }

            Text {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 238
                text: qsTr("确定开始清洗吗?")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484a"
            }

            Rectangle {
                x: 182
                y: 360
                width: 136
                height: 76
                radius: 38
                color: "#c7c7cc"

                Text {
                    anchors.centerIn: parent
                    text: qsTr("取消")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 36
                    color: "white"
                }

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 167
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        sig_ok(currDlgType)
                    }
                }
            }
        }
    }

    // 检测到内锅移出,将停止加热
    Component {
        id: removeCapCom

        Rectangle {
            anchors.fill: parent
            color: "white"
            radius: 20

            Image {
                x: 313
                y: 63
                width: 126
                height: 120
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/capRemove.png"
            }

            Text {
                x: 169
                y: 206
                text: qsTr("检测到内锅移出,将停止加热")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "black"
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 442
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 41
                m_text: qsTr("返回")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 158
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 41
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        sig_ok(currDlgType)
                    }
                }
            }
        }
    }

    // 正在烹饪中
    Component {
        id: cookingCom

        Rectangle {
            anchors.fill: parent
            color: "white"
            radius: 20

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/cookCap.png"
            }

            Text {
                y: 238
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("正在烹饪中,请先取消烹饪再关机")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "black"
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 15
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }
        }
    }

    // 称重传感器故障
    Component {
        id: weightErrorCom

        Rectangle {
            anchors.fill: parent
            color: "white"
            radius: 20

            Image {
                x: 350
                y: 70
                width: 80
                height: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/errorTip.png"
            }

            Text {
                x: 268
                y: 172
                text: qsTr("称重传感器故障")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "black"
            }

            Text {
                x: 228
                y: 230
                text: qsTr("请拨打售后服务热线")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "black"
            }

            Text {
                x: 286
                y: 286
                text: qsTr("400-8899717")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "black"
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 21
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 41
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }
        }
    }

    // 确定退出食谱烹饪吗
    Component {
        id: quitCookCom

        Rectangle {
            anchors.fill: parent
            color: "white"

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/quitCookIcon.png"
            }

            Text {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 238
                text: qsTr("确定退出食谱烹饪吗?")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "black"
            }

            Rectangle {
                x: 191
                y: 360
                width: 136
                height: 76
                radius: 38
                color: "#c7c7cc"

                Text {
                    anchors.centerIn: parent
                    text: qsTr("取消")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 36
                    color: "white"
                }

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 158
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        sig_ok(currDlgType)
                    }
                }
            }
        }
    }

    // 顶部传感器故障
    Component {
        id: topSensorErrorCom

        Rectangle {
            anchors.fill: parent
            color: "white"
            radius: 20

            Image {
                x: 350
                y: 70
                width: 80
                height: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/errorTip.png"
            }

            Text {
                x: 268
                y: 172
                text: qsTr("顶部传感器故障")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "black"
            }

            Text {
                x: 228
                y: 230
                text: qsTr("请拨打售后服务热线")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "black"
            }

            Text {
                x: 286
                y: 286
                text: qsTr("400-8899717")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "black"
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 21
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 41
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }
        }
    }

    // 网络连接成功
    Component {
        id: wifiSuccessCom

        Item {
            anchors.fill: parent

            Rectangle {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 382
                width: 180
                height: 60
                color: "#3a3a3c"
                radius: 18

                Text {
                    anchors.centerIn: parent
                    text: qsTr("网络连接成功")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 24
                    color: "white"
                }
            }

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    msgDialog.close()
                }
            }

            Timer {
                interval: 3000
                running: visible
                repeat: false

                onTriggered: {
                    msgDialog.close()
                }
            }
        }
    }

    // 网络连接失败
    Component {
        id: wifiFailCom

        Item {
            anchors.fill: parent

            Rectangle {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 382
                width: 180
                height: 60
                color: "#3a3a3c"
                radius: 18

                Text {
                    anchors.centerIn: parent
                    text: qsTr("网络连接失败")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 24
                    color: "white"
                }
            }

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    msgDialog.close()
                }
            }

            Timer {
                interval: 3000
                running: visible
                repeat: false

                onTriggered: {
                    msgDialog.close()
                }
            }
        }
    }

    // 网络连接断开
    Component {
        id: wifiDisconnectCom

        Item {
            anchors.fill: parent

            Rectangle {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 382
                width: 180
                height: 60
                color: "#3a3a3c"
                radius: 18

                Text {
                    anchors.centerIn: parent
                    text: qsTr("网络连接断开")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 24
                    color: "white"
                }
            }

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    msgDialog.close()
                }
            }

            Timer {
                interval: 3000
                running: visible
                repeat: false

                onTriggered: {
                    msgDialog.close()
                }
            }
        }
    }

    // 请输入正确手机号码
    Component {
        id: phoneNumberCom

        Item {
            anchors.fill: parent

            Rectangle {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 382
                width: 240
                height: 60
                color: "#3a3a3c"
                radius: 18

                Text {
                    anchors.centerIn: parent
                    text: qsTr("请输入正确手机号码")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 24
                    color: "white"
                }
            }

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    msgDialog.close()
                }
            }

            Timer {
                interval: 3000
                running: visible
                repeat: false

                onTriggered: {
                    msgDialog.close()
                }
            }
        }
    }

    // 请阅读并勾选协议
    Component {
        id: protocolCom

        Item {
            anchors.fill: parent

            Rectangle {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 382
                width: 228
                height: 60
                color: "#3a3a3c"
                radius: 18

                Text {
                    anchors.centerIn: parent
                    text: qsTr("请阅读并勾选协议")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 24
                    color: "white"
                }
            }

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    msgDialog.close()
                }
            }

            Timer {
                interval: 3000
                running: visible
                repeat: false

                onTriggered: {
                    msgDialog.close()
                }
            }
        }
    }

    // 验证码已发送,请查看手机
    Component {
        id: verifyCom1

        Item {
            anchors.fill: parent

            Rectangle {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 382
                width: 324
                height: 60
                color: "#3a3a3c"
                radius: 18

                Text {
                    anchors.centerIn: parent
                    text: qsTr("验证码已发送,请查看手机")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 24
                    color: "white"
                }
            }

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    msgDialog.close()
                }
            }

            Timer {
                interval: 3000
                running: visible
                repeat: false

                onTriggered: {
                    msgDialog.close()
                }
            }
        }
    }

    // 登录成功
    Component {
        id: verifyCom2

        Item {
            anchors.fill: parent

            Rectangle {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 382
                width: 132
                height: 60
                color: "#3a3a3c"
                radius: 18

                Text {
                    anchors.centerIn: parent
                    text: qsTr("登录成功")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 24
                    color: "white"
                }
            }

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    msgDialog.close()
                }
            }

            Timer {
                interval: 3000
                running: visible
                repeat: false

                onTriggered: {
                    msgDialog.close()
                    stackView.clear()
                    stackView.push(swipeViewCom)
                }
            }
        }
    }

    // 短信验证码暂时不可用,请稍后重试
    Component {
        id: verifyCom3

        Item {
            anchors.fill: parent

            Rectangle {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 382
                width: 420
                height: 60
                color: "#3a3a3c"
                radius: 18

                Text {
                    anchors.centerIn: parent
                    text: qsTr("短信验证码暂时不可用,请稍后重试")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 24
                    color: "white"
                }
            }

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    msgDialog.close()
                }
            }

            Timer {
                interval: 3000
                running: visible
                repeat: false

                onTriggered: {
                    msgDialog.close()
                }
            }
        }
    }

    // 确定开始预约吗?
    Component {
        id: startReserveCom

        Rectangle {
            anchors.fill: parent
            color: "white"

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/reverseDlg.png"
            }

            Text {
                y: 238
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("确定开始预约吗?")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "black"
            }

            Rectangle {
                x: 191
                y: 360
                width: 136
                height: 76
                radius: 38
                color: "#c7c7cc"

                Text {
                    anchors.centerIn: parent
                    text: qsTr("取消")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 36
                    color: "white"
                }

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 158
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        sig_ok(currDlgType)
                    }
                }
            }
        }
    }

    // 确定取消预约吗?
    Component {
        id: cancelReserveCom

        Rectangle {
            anchors.fill: parent
            color: "white"

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/cancelReserve.png"
            }

            Text {
                y: 238
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("确定取消预约吗?")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "black"
            }

            Rectangle {
                x: 191
                y: 360
                width: 136
                height: 76
                radius: 38
                color: "#c7c7cc"

                Text {
                    anchors.centerIn: parent
                    text: qsTr("取消")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 36
                    color: "white"
                }

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 158
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        sig_ok(currDlgType)
                    }
                }
            }
        }
    }

    // 下载成功/自定义用语
    Component {
        id: downloadCom

        Item {
            anchors.fill: parent

            Rectangle {
                anchors.horizontalCenter: parent.horizontalCenter
                y: 382
                width: m_text.width+60
                height: 60
                color: "#3a3a3c"
                radius: 18

                Text {
                    id: m_text
                    anchors.centerIn: parent
                    text: m_tipStr
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 24
                    color: "white"
                }
            }

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    msgDialog.close()
                }
            }

            Timer {
                interval: 3000
                running: visible
                repeat: false

                onTriggered: {
                    msgDialog.close()
                }
            }
        }
    }

    // 请下压关盖
    Component {
        id: closeCapCom

        Rectangle {
            anchors.fill: parent

            AnimatedImage {
                asynchronous: true
                cache: false
                anchors.verticalCenter: parent.verticalCenter
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/03提示-关上上盖锁.gif"
            }

            Text {
                x: 365
                anchors.verticalCenter: parent.verticalCenter
                text: qsTr("请下压关盖")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "#48484A"
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 15
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }
        }
    }

    // 请盖上玻璃盖
    Component {
        id: closeGlassCapCom

        Rectangle {
            anchors.fill: parent

            AnimatedImage {
                asynchronous: true
                cache: false
                anchors.verticalCenter: parent.verticalCenter
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/05提示-盖上玻璃盖.gif"
            }

            Text {
                x: 365
                anchors.verticalCenter: parent.verticalCenter
                text: qsTr("请盖上玻璃盖")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "#48484A"
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 15
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }
        }
    }

    // 请盖上压力盖
    Component {
        id: closePressCapCom

        Rectangle {
            anchors.fill: parent

            AnimatedImage {
                asynchronous: true
                cache: false
                anchors.verticalCenter: parent.verticalCenter
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/05提示-盖上压力盖.gif"
            }

            Text {
                x: 365
                anchors.verticalCenter: parent.verticalCenter
                text: qsTr("请盖上压力盖")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "#48484A"
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 15
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }
        }
    }

    // 请盖上烘烤盖
    Component {
        id: closeBakeCapCom

        Rectangle {
            anchors.fill: parent

            AnimatedImage {
                asynchronous: true
                cache: false
                anchors.verticalCenter: parent.verticalCenter
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/05提示-盖上烘烤盖.gif"
            }

            Text {
                x: 365
                anchors.verticalCenter: parent.verticalCenter
                text: qsTr("请盖上烘烤盖")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "#48484A"
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 15
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }
        }
    }

    // 正在烹饪中,请先取消烹饪 再开始新烹饪
    Component {
        id: startNewCookCom

        Rectangle {
            anchors.fill: parent

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/cookCap.png"
            }

            Text {
                y: 238
                horizontalAlignment: Text.AlignHCenter
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("正在烹饪中,请先取消烹饪\n再开始新烹饪")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484A"
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 15
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }
        }
    }

    // 正在预约中,请先取消预约 再开始新烹饪
    Component {
        id: startNewCookCom1

        Rectangle {
            anchors.fill: parent

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/reverseDlg1.png"
            }

            Text {
                y: 238
                horizontalAlignment: Text.AlignHCenter
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("正在预约中,请先取消预约\n再开始新烹饪")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484A"
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 15
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }
        }
    }

    // 厨房闹钟计时完成!
    Component {
        id: alarmFinishCom

        Rectangle {
            anchors.fill: parent

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/alarm3.png"
            }

            Text {
                y: 238
                horizontalAlignment: Text.AlignHCenter
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("厨房闹钟计时完成!")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484A"
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 15
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }
        }
    }

    // wifi联网故障
    Component {
        id: wifiErrorCom

        Rectangle {
            anchors.fill: parent

            Image {
                x: 336
                y: 60
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/wifi_error_dlg.png"
            }

            Text {
                y: 194
                horizontalAlignment: Text.AlignHCenter
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("Wi-Fi联网故障")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484A"
            }

            Text {
                y: 245
                horizontalAlignment: Text.AlignHCenter
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("请先断电后重新启动产品,若仍出现故障\n请拨打售后服务热线400-8899717")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 36
                color: "#48484A"
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 15
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }
        }
    }

    // 非强制升级
    Component {
        id: noForceUpdateCom

        Rectangle {
            anchors.fill: parent

            Item {
                width: parent.width
                height: 90

                Text {
                    anchors.centerIn: parent
                    text: m_tipStr
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 36
                    color: "#48484A"
                }
            }

            // 升级简介
            Flickable {
                id: updateFlick
                anchors.top: parent.top
                anchors.topMargin: 90
                anchors.horizontalCenter: parent.horizontalCenter
                width: 740
                height: 244
                contentWidth: 740
                contentHeight: updateTipText.height
                clip: true

                Text {
                    id: updateTipText
                    width: parent.width
                    text: {
                        if (m_tipStr === qsTr("菜谱更新")) {
                            var fileName = appPath+"/ota/recipeUpdate/updateTip.json"
                            var updateTipMap = uiproc_data_interaction.getUpdateTip(fileName)
                            return updateTipMap.content
                        } else {
                            fileName = appPath+"/ota/systemUpdate/updateTip.json"
                            updateTipMap = uiproc_data_interaction.getUpdateTip(fileName)
                            return updateTipMap.content
                        }
                    }

                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 32
                    color: "#48484A"
                    lineHeightMode: Text.FixedHeight
                    lineHeight: 48
                    wrapMode: Text.WordWrap
                }
            }

            // 跳过
            Rectangle {
                x: 182
                y: 374
                width: 136
                height: 76
                radius: 38
                color: "#c7c7cc"

                Text {
                    anchors.centerIn: parent
                    text: qsTr("跳过")
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 36
                    color: "white"
                }

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }

            // 更新
            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 167
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 6
                m_text: qsTr("更新")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        if (m_tipStr === qsTr("菜谱更新")) {
                            funcPage.f_downloadUpdateFile(updateInfo.recipeInfo.download_url, 1)
                        } else {
                            funcPage.f_downloadUpdateFile(updateInfo.sysInfo.download_url, 2)
                        }

//                        stackView.push(updateCom)
                    }
                }
            }
        }
    }

    // 强制升级
    Component {
        id: forceUpdateCom

        Rectangle {
            anchors.fill: parent

            Item {
                width: parent.width
                height: 90

                Text {
                    anchors.centerIn: parent
                    text: m_tipStr
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 36
                    color: "#48484A"
                }
            }

            // 升级简介
            Flickable {
                id: updateFlick
                anchors.top: parent.top
                anchors.topMargin: 90
                anchors.horizontalCenter: parent.horizontalCenter
                width: 740
                height: 244
                contentWidth: 740
                contentHeight: updateTipText.height
                clip: true

                Text {
                    id: updateTipText
                    width: parent.width
                    text: {
                        if (m_tipStr === qsTr("菜谱更新")) {
                            var fileName = appPath+"/ota/recipeUpdate/updateTip.json"
                            var updateTipMap = uiproc_data_interaction.getUpdateTip(fileName)
                            return updateTipMap.content
                        } else {
                            fileName = appPath+"/ota/systemUpdate/updateTip.json"
                            updateTipMap = uiproc_data_interaction.getUpdateTip(fileName)
                            return updateTipMap.content
                        }
                    }
                    font.family: fontCfg.alibaba_regular_font
                    font.pixelSize: 32
                    color: "#48484A"
                    lineHeightMode: Text.FixedHeight
                    lineHeight: 48
                    wrapMode: Text.WordWrap
                }
            }

            // 更新
            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 15
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 6
                m_text: qsTr("更新")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        if (m_tipStr === qsTr("菜谱更新")) {
                            funcPage.f_downloadFile(updateInfo.recipeInfo.download_url, "", -1)
                        } else {
                            funcPage.f_downloadFile(updateInfo.sysInfo.download_url, "", -1)
                        }

//                        stackView.push(updateCom)
                    }
                }
            }
        }
    }

    // 食材过轻
    Component {
        id: foodLightCom

        Rectangle {
            anchors.fill: parent
            color: "white"

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/cookCap.png"
            }

            Text {
                y: 238
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("食材过轻,返回重新称重")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484A"
            }

            Ui_ArcDisplayBtn {
                anchors.left: parent.left
                anchors.leftMargin: 167
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 167
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("忽略")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        sig_ok(currDlgType)
                    }
                }
            }
        }
    }

    // 食材过重
    Component {
        id: foodWeightCom

        Rectangle {
            anchors.fill: parent
            color: "white"

            Image {
                x: 336
                y: 80
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/cookCap.png"
            }

            Text {
                y: 238
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("食材过重,返回重新称重")
                font.family: fontCfg.alibaba_medium_font
                font.weight: Font.Medium
                font.pixelSize: 36
                color: "#48484A"
            }

            Ui_ArcDisplayBtn {
                anchors.left: parent.left
                anchors.leftMargin: 167
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("确定")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        msgDialog.close()
                    }
                }
            }

            Ui_ArcDisplayBtn {
                anchors.right: parent.right
                anchors.rightMargin: 167
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 20
                m_text: qsTr("忽略")

                MouseArea {
                    anchors.fill: parent
                    onClicked: {
                        // 播放语音
                        if (isVoiceOpen) {
                            uiproc_data_interaction.playAudio(voiceObj.voice3)
                        }

                        sig_ok(currDlgType)
                    }
                }
            }
        }
    }
}

模仿iphone全局设置页面GlobalDialog

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtGraphicalEffects 1.0
import "qrc:/UI"

// 确定开始烹饪吗
Popup {
    id: msgDialog
    visible: false
    width: window.width
    height: window.height
    modal: true
    closePolicy: Popup.NoAutoClose
    padding: 0

    contentItem: Loader {
        id: msgLoader
        width: 800
        height: 480
        sourceComponent: noWifiGlobalCom
    }

    // 未登陆负一屏
    Component {
        id: noWifiGlobalCom

        Item {
            anchors.fill: parent

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    msgDialog.close()
                    mouse.accepted = true
                }
            }

            FastBlur {
                anchors.fill: parent
                source: stackView.currentItem
                radius: 64
            }

            Rectangle {
                anchors.fill: parent
                color: "#48484a"
                opacity: 0.4
            }

            Item {
                anchors.fill: parent

                Image {
                    id: loginImg
                    x: 58
                    y: 58
                    fillMode: Image.PreserveAspectFit
                    source: isLogin ? (userInfo.faceImage === "" ? "qrc:/PIC/pics/noLogin1.png" : userInfo.faceImage) : "qrc:/PIC/pics/noLogin1.png"
                }

                // 未登录 >
                Text {
                    anchors.left: loginImg.right
                    anchors.leftMargin: 20
                    y: 84
                    text: isLogin ? userInfo.userName : qsTr("未登录 >")
                    font.family: fontCfg.alibaba_medium_font
                    font.weight: Font.Medium
                    font.pixelSize: 24
                    color: "white"

                    MouseArea {
                        anchors.fill: parent
                        propagateComposedEvents: true
                        onClicked: {
                            if (!isLogin) {
                                stackView.push(wifiSearchCom)
                                mouse.accepted = false
                            }
                        }
                    }
                }

                // 网络未连接,去连网 >
                Text {
                    anchors.right: wifiImg.left
                    anchors.rightMargin: 10
                    y: 84
                    text: currWifiStatus ? wifiMap.wifiName : qsTr("网络未连接,去连网 >")
                    font.family: fontCfg.alibaba_medium_font
                    font.weight: Font.Medium
                    font.pixelSize: 24
                    color: "white"

                    MouseArea {
                        anchors.fill: parent
                        propagateComposedEvents: true
                        onClicked: {
                            if (currWifiStatus !== 1) {
                                stackView.push(wifiSearchCom)
                                mouse.accepted = false
                            }
                        }
                    }
                }

                Image {
                    id: wifiImg
                    x: 693
                    y: 75
                    fillMode: Image.PreserveAspectFit
                    source: {
                        if (wifiMap.wifi_connect === 1) {
                            if (currWifiStatus === 1) {
                                var pw = f_getWifiPower(wifiMap.wifi_power)
                                return f_setWifiUrl(pw)
                            } else {
                                return "qrc:/PIC/pics/wifi_error4.png"
                            }
                        } else {
                            return  "qrc:/PIC/pics/wifi_error.png"
                        }
                    }
                }

                // 厨房闹钟
                Rectangle {
                    x: 58
                    y: 162
                    width: 260
                    height: 120
                    radius: 18
                    color: Qt.rgba(0,0,0,0.75)

                    MouseArea {
                        anchors.fill: parent
                        propagateComposedEvents: true
                        onClicked: {
                            // 播放语音
                            if (isVoiceOpen) {
                                uiproc_data_interaction.playAudio(voiceObj.voice3)
                            }

                            stackView.push(alarmCom)
                            mouse.accepted = false
                        }
                    }

                    Image {
                        x: 32
                        y: 30
                        fillMode: Image.PreserveAspectFit
                        source: is_setAlarm === 1 ? "qrc:/PIC/pics/alarm2.png" : "qrc:/PIC/pics/alarm1.png"
                    }

                    Text {
                        x: 132
                        y: 44
                        text: {
                               if (is_setAlarm === 1) {
                                   var min = Math.floor(alarmTime/60)
                                   var sec = alarmTime%60
                                   min = min.toString().length < 2 ? "0"+min : min
                                   sec = sec.toString().length < 2 ? "0"+sec : sec
                                   return min+":"+sec
                               } else {
                                   return qsTr("厨房闹钟")
                               }
                        }
                        font.family: fontCfg.alibaba_regular_font
                        font.pixelSize: 24
                        color: "white"
                    }
                }

                // 热锅
                Rectangle {
                    x: 58
                    y: 302
                    width: 120
                    height: 120
                    radius: 18
                    color: Qt.rgba(0,0,0,0.75)

                    MouseArea {
                        anchors.fill: parent
                        propagateComposedEvents: true
                        onClicked: {
                            // 播放语音
                            if (isVoiceOpen) {
                                uiproc_data_interaction.playAudio(voiceObj.voice3)
                            }

                            stackView.push(commonCookCom)
                            var obj = {}
                            obj.cookType = 13
                            obj.name = qsTr("热锅")
                            sig_sendCommonPageInfo(obj)
                            mouse.accepted = false
                        }
                    }

                    Image {
                        x: 37
                        y: 18
                        fillMode: Image.PreserveAspectFit
                        source: "qrc:/PIC/pics/cook2.png"
                    }

                    Text {
                        x: 36
                        y: 67
                        text: qsTr("热锅")
                        font.family: fontCfg.alibaba_regular_font
                        font.pixelSize: 24
                        color: "white"
                    }
                }

                // 搅拌
                Rectangle {
                    x: 198
                    y: 302
                    width: 120
                    height: 120
                    radius: 18
                    color: Qt.rgba(0,0,0,0.75)

                    MouseArea {
                        anchors.fill: parent
                        propagateComposedEvents: true
                        onClicked: {
                            // 播放语音
                            if (isVoiceOpen) {
                                uiproc_data_interaction.playAudio(voiceObj.voice3)
                            }

                            stackView.push(commonCookCom)
                            var obj = {}
                            obj.cookType = 15
                            obj.name = qsTr("搅拌")
                            sig_sendCommonPageInfo(obj)
                            mouse.accepted = false
                        }
                    }

                    Image {
                        x: 37
                        y: 24
                        fillMode: Image.PreserveAspectFit
                        source: "qrc:/PIC/pics/cook3.png"
                    }

                    Text {
                        x: 36
                        y: 67
                        text: qsTr("搅拌")
                        font.family: fontCfg.alibaba_regular_font
                        font.pixelSize: 24
                        color: "white"
                    }
                }

                // 收汁
                Rectangle {
                    x: 338
                    y: 302
                    width: 120
                    height: 120
                    radius: 18
                    color: Qt.rgba(0,0,0,0.75)

                    MouseArea {
                        anchors.fill: parent
                        propagateComposedEvents: true
                        onClicked: {
                            // 播放语音
                            if (isVoiceOpen) {
                                uiproc_data_interaction.playAudio(voiceObj.voice3)
                            }

                            stackView.push(commonCookCom)
                            var obj = {}
                            obj.cookType = 11
                            obj.name = qsTr("收汁")
                            sig_sendCommonPageInfo(obj)
                            mouse.accepted = false
                        }
                    }

                    Image {
                        x: 37
                        y: 18
                        fillMode: Image.PreserveAspectFit
                        source: "qrc:/PIC/pics/cook1.png"
                    }

                    Text {
                        x: 36
                        y: 67
                        text: qsTr("收汁")
                        font.family: fontCfg.alibaba_regular_font
                        font.pixelSize: 24
                        color: "white"
                    }
                }

                // 语音
                Rectangle {
                    x: 338
                    y: 162
                    width: 120
                    height: 120
                    radius: 18
                    color: Qt.rgba(0,0,0,0.75)

                    MouseArea {
                        anchors.fill: parent
                        onClicked: {
                            isVoiceOpen = !isVoiceOpen
                            uiproc_data_interaction.setVoiceSwitch(isVoiceOpen)
                            mouse.accepted = true
                        }
                    }

                    Image {
                        anchors.centerIn: parent
                        fillMode: Image.PreserveAspectFit
                        source: isVoiceOpen ? "qrc:/PIC/pics/audio2.png" : "qrc:/PIC/pics/audio1.png"
                    }
                }

                // 音量
                Rectangle {
                    id: bkgRect
                    x: 479
                    y: 162
                    width: 120
                    height: 260
                    radius: 18
                    color: Qt.rgba(0,0,0,0.75)

                    layer.enabled: true
                    layer.effect: OpacityMask {
                        maskSource: Rectangle {
                            width: bkgRect.width
                            height: bkgRect.height
                            radius: bkgRect.radius
                        }
                    }

//                    Component.onCompleted: {
//                        soundRect.height = voiceValue*bkgRect.height
//                    }

                    MouseArea {
                        anchors.fill: parent
                        onMouseYChanged: {
                            soundRect.height = bkgRect.height-mouseY
                            if (soundRect.height > bkgRect.height) {
                                soundRect.height = bkgRect.height
                            } else if (soundRect.height < 0) {
                                soundRect.height = 0
                            }

                            var val = Math.round(soundRect.height*100/bkgRect.height)
                            uiproc_data_interaction.setVolumn(val)
                            voiceValue = soundRect.height/bkgRect.height
                        }
                    }

                    Rectangle {
                        id: soundRect
                        anchors.bottom: bkgRect.bottom
                        width: bkgRect.width
                        height: voiceValue*bkgRect.height
                        color: "white"
                    }

                    Image {
                        y: 170
                        anchors.horizontalCenter: parent.horizontalCenter
                        fillMode: Image.PreserveAspectFit
                        source: "qrc:/PIC/pics/sound1.png"
                    }
                }

                // 亮度
                Rectangle {
                    id: bkgRect1
                    x: 621
                    y: 162
                    width: 120
                    height: 260
                    radius: 18
                    color: Qt.rgba(0,0,0,0.75)

//                    Component.onCompleted: {
//                        // 读取亮度文件
//                        lightRect.height = brightnessValue*bkgRect1.height
//                    }

                    layer.enabled: true
                    layer.effect: OpacityMask {
                        maskSource: Rectangle {
                            width: bkgRect1.width
                            height: bkgRect1.height
                            radius: bkgRect1.radius
                        }
                    }

                    MouseArea {
                        anchors.fill: parent
                        onMouseYChanged: {
                            lightRect.height = bkgRect1.height-mouseY
                            if (lightRect.height > bkgRect1.height) {
                                lightRect.height = bkgRect1.height
                            } else if (lightRect.height < 0) {
                                lightRect.height = 0
                            }

                            var val = lightRect.height/bkgRect1.height+0.3
                            var lightStr = String(Math.round(val*255/1.3))
                            uiproc_data_interaction.writeLightFile(lightStr)
                            uiproc_data_interaction.setLightStr(lightStr)
                            brightnessValue = lightRect.height/bkgRect1.height
                        }
                    }

                    Rectangle {
                        id: lightRect
                        anchors.bottom: bkgRect1.bottom
                        width: bkgRect1.width
                        height: brightnessValue*bkgRect1.height
                        color: "white"
                    }

                    Image {
                        y: 170
                        anchors.horizontalCenter: parent.horizontalCenter
                        fillMode: Image.PreserveAspectFit
                        source: "qrc:/PIC/pics/light1.png"
                    }
                }
            }
        }
    }

    // 厨房闹钟
    Component {
        id: alarmCom

        Ui_Alarm {

        }
    }
}

Gif播放

import QtQuick 2.0

Image {
    id: gifImg

    property string gifPath: "/recipe/gifImage/wifi_loading/"
    property int startImg: 19
    property int endImg: 38
    property int currImg: startImg
    property string imgSrc: "jiazai_000%1.png"

    function f_start()
    {
        currImg = startImg
        imgTimer.restart()
        gifImg.visible = true
    }

    function f_end()
    {
        imgTimer.stop()
        gifImg.visible = false
    }

    Timer {
        id: imgTimer
        interval: 50
        running: false
        repeat: true
        onTriggered: {
            gifImg.source = "file://"+appPath+gifPath+imgSrc.arg(currImg)
            currImg++
            if (currImg > endImg) {
                currImg = startImg
            }
        }
    }
}

ProgressBar

import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Item {
    width: m_width
    height: m_height

    property int m_width: 200
    property int m_height: 15
    property real m_value: 7

    property string m_proColor: "#ff9f0a"
    property string m_aniColor: "#ff9500"

    ProgressBar {
        anchors.centerIn: parent
        value: m_value
        minimumValue: 0
        maximumValue: 100
        orientation: Qt.Horizontal
        style: ProgressBarStyle {
            background: Rectangle {
                radius: m_height/2
                color: "#d8d8d8"
                implicitWidth: m_width
                implicitHeight: m_height

                Rectangle {
                    width: m_height
                    height: m_height
                    radius: m_height/2
                    color: m_proColor
                }
            }

            progress: Rectangle {
                visible: currentProgress*m_width > m_height ? true : false
                radius: m_height/2
                color: m_proColor

                Item {
                    x: 2
                    width: parent.width-4
                    height: parent.height
                    anchors.margins: 1
                    clip: true
                    Row {
                        Repeater {
                            Rectangle {
                                color: m_aniColor
                                width: 30
                                height: 10
                                rotation: 135
                            }
                            model: control.width / 30 + 2
                        }
                        XAnimator on x {
                            from: -60 ; to: 0
                            loops: Animation.Infinite
                            duration: 2000
                        }
                    }
                }
            }
        }
    }
}

CheckBox

import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

CheckBox {
    anchors.verticalCenter: parent.verticalCenter
    checked: false
    style: CheckBoxStyle {
        indicator: Rectangle {
                      implicitWidth: 30
                      implicitHeight: 30
                      radius: 3
                      border.color: control.activeFocus ? "darkblue" : "gray"
                      border.width: 1
                      Rectangle {
                          visible: control.checked
                          color: "#16bf86"
                          border.color: "#333"
                          radius: 1
                          anchors.margins: 4
                          anchors.fill: parent
                      }
        }
    }
}

TextEdit编辑

import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Rectangle {

    property string m_placeHolderText: ""
    property real m_fontSize: 30
    property alias m_text: textField.text
    property int m_echoMode: TextInput.Normal
    property alias m_textField: textField
    property int m_inputMethodHints: Qt.ImhNone
    property real m_leftMargin: height/2

    x: 110
    y: 15
    width: 580
    height: 60
    radius: height/2

    signal sig_focus(var focus)

    TextField {
        id: textField
        x: m_leftMargin
        height: parent.height
        width: parent.width-height
        placeholderText: m_placeHolderText
        font.pixelSize: m_fontSize
        font.family: fontCfg.alibaba_regular_font
        echoMode: m_echoMode
        inputMethodHints: m_inputMethodHints

        style: TextFieldStyle {
            textColor: "#777777"
            background: Rectangle {
                color: "transparent"
            }
        }

        onFocusChanged: {
            sig_focus(focus)
        }
    }
}

模仿iphone悬浮按钮

import QtQuick 2.9
import QtGraphicalEffects 1.0

Item {
    id: bk
    width: 120
    height: 120

    property Component contentObj: null;
    property Item m_sourceItem: stackView.currentItem

    signal sig_switchTabIndex()

    // 获取时
    function setHourDisp(time)
    {
        var min = Math.ceil(time/60)
        var hour = Math.floor(min/60)
        var hourStr = ""
        if (hour < 10) {
            hourStr = "0"+String(hour)
        } else {
            hourStr = String(hour)
        }

        return hourStr
    }

    // 获取分
    function setMinuteDisp(time)
    {
        var hourStr = setHourDisp(time)
        var hour = parseInt(hourStr)
        var min = Math.ceil((time-hour*3600)/60)
        var minStr = ""
        if (min < 10) {
            minStr = "0"+String(min)
        } else {
            minStr = String(min)
        }

        return minStr
    }

    // 判断是否在当前烹饪页面
    function isOnCurrCookPage()
    {
        if (recordCookPageParam.cookPage === setCookParam.cookPage) {
            if (recordCookPageParam.cookPage === 0) { // diy
                return true
            } else if (recordCookPageParam.cookPage === 1) { // 快捷菜单
                if (recordCookPageParam.customType === setCookParam.customType) {
                    return true
                } else {
                    return false
                }
            } else if (recordCookPageParam.cookPage === 2) { // 菜谱
                if (recordCookPageParam.currRecipeCode === setCookParam.currRecipeCode) {
                    return true
                } else {
                    return false
                }
            } else {
                return false
            }
        } else {
            return false
        }
    }

    FastBlur {
        id: blurId
        anchors.fill: bk
        radius: 50
        layer.enabled: true
        layer.effect: OpacityMask {
            maskSource: Rectangle {
                width: bk.width
                height: bk.height
                radius: 18
            }
        }

        source: ShaderEffectSource {
            sourceItem: m_sourceItem
            sourceRect: Qt.rect(bk.x,bk.y, bk.width, bk.height)
        }
    }

    Rectangle {
        width: 120
        height: 120
        radius: 18
        color: "#b2ffffff"
        border.width: 1
        border.color: "#4c48484A"

        Loader {
            anchors.fill: parent
            sourceComponent: currCookParm.work_state === 0 ? finishCom : cookingCom//contentObj
        }
    }

    MouseArea {
        anchors.fill: parent
        drag.target: airDlg
        drag.axis: Drag.XAndYAxis
        drag.minimumX: -30
        drag.maximumX: 710
        drag.minimumY: -30
        drag.maximumY: 390

        onClicked: {
//            console.log("_______________", JSON.stringify(setCookParam))
            if (currCookParm.work_state === 0) {
                isDispForAirDlg = false
            } else {
                isDispForAirDlg = true
            }

            if (setCookParam.cookPage === 2) { // 菜谱
                if (isOnCurrCookPage() === true) {
                    sig_switchTabIndex()
                } else {
                    currRecipeCode = setCookParam.currRecipeCode
                    currRecipeName = setCookParam.currRecipeName
                    stackView.push(cookStepCom)
                }
            } else if (setCookParam.cookPage === 0) { // diy
                if (isOnCurrCookPage() === false) {
                    stackView.clear()
                    stackView.push(swipeViewCom, {"swipe_index": 1})
                }
            } else if (setCookParam.cookPage === 1) { // 快捷菜单
                if (isOnCurrCookPage() === false) {
                    stackView.push(commonCookCom)
                }
            }
        }
    }

    // 烹饪完成
    Component {
        id: finishCom

        Item {
            anchors.fill: parent

            Image {
                y: 20
                anchors.horizontalCenter: parent.horizontalCenter
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/finishIcon1.png"
            }

            Text {
                y: 67
                anchors.horizontalCenter: parent.horizontalCenter
                text: qsTr("完成")
                font.family: fontCfg.alibaba_regular_font
                font.pixelSize: 24
                color: "#48484A"
            }
        }
    }

    // 烹饪中
    Component {
        id: cookingCom

        Item {
           anchors.fill: parent

           Component.onCompleted: {
               loadingImg.f_start()
           }

           Component.onDestruction: {
               loadingImg.f_end()
           }

           Ui_Gif {
               id: loadingImg
               anchors.horizontalCenter: parent.horizontalCenter
               y: 20
           }

           Text {
               y: 67
               anchors.horizontalCenter: parent.horizontalCenter
               text: setHourDisp(currCookParm.cook_time)+":"+setMinuteDisp(currCookParm.cook_time)
               font.family: fontCfg.din_medium_font
               font.weight: Font.Medium
               font.pixelSize: 30
               color: "#48484A"
           }
        }
    }
}

收藏菜谱页面

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtGraphicalEffects 1.0
import "qrc:/Control/control"

Rectangle {
    id: cookBookRect
    width: window.width
    height: window.height
    color: "white"

    // 退出动画
    Transition {
        id: exitTran

        XAnimator {
            from: 0
            to: 800
            duration: 250
        }
    }

    // 进入动画
    Transition {
        id: enterTran

        XAnimator {
            from: 400
            to: 0
            duration: 250
        }
    }

    // 暂停动画
    Transition {
        id: pauseTran

        PauseAnimation {
            duration: 400
        }
    }

    Component.onCompleted: {
        var obj = {}
        obj.type = 0
        obj.is_local = true
        obj.query = String("select recipeData from recipe where isCollected = 1")
        var tag = uiproc_data_interaction.operateDB(obj)
        f_setRecipeList(tag)
    }

    // 设置菜谱列表
    function f_setRecipeList(recipeMap)
    {
        mealModel.clear()
        var recipeList = recipeMap.recipeContent
        for (var i in recipeList) {
            var obj = recipeList[i]
            mealModel.append({"name": obj.recipeCnName, "imageUrl": obj.recipeImg, "recipeId": obj.recipeCode})
        }
    }

    // 菜谱列表
    ListModel {
        id: mealModel
    }

    // frame
    GridView {
        id: grid
        x: 30
        topMargin: cookTypeRect.height
        cellWidth: 252; cellHeight: 290
        width: parent.width
        height: parent.height
        model: mealModel
        bottomMargin: 10

        displaced: Transition {
            NumberAnimation { properties: "x,y"; duration: 250 }
        }

        remove: Transition {
            NumberAnimation { property: "opacity"; to: 0; duration: 250 }
        }

        property real startYContent: 0 // 起始内容Y坐标
        property real startYTitle: 0    // 标题栏起始Y坐标

        onMovementStarted: {
            startYContent = contentY
            startYTitle = cookTypeRect.y
        }

        onContentYChanged: {
            cookTypeRect.y = startYTitle-(contentY-startYContent)
            if (cookTypeRect.y<-cookTypeRect.height) {
                cookTypeRect.y =-cookTypeRect.height
            } else if (cookTypeRect.y > 0) {
                cookTypeRect.y = 0
            }
        }

        delegate: Item {
              id: rect
              width: grid.cellWidth; height: grid.cellHeight

              Rectangle {
                  id: sourceRect
                  y: 10
                  width: 236
                  height: 273
                  radius: 18

                  MouseArea {
                      anchors.fill: parent
                      onClicked: {
                          currRecipeCode = recipeId
                          currRecipeName = name
                          stackView.pushEnter = enterTran
                          stackView.pushExit = pauseTran
                          stackView.push(cookDetailCom)
                      }
                  }

                  layer.enabled: true
                  layer.effect: OpacityMask {
                      maskSource: Rectangle {
                          width: sourceRect.width
                          height: sourceRect.height
                          radius: 18
                      }
                  }

                  Image {
                      id: recipeImg
                      width: 236
                      height: 273
                      sourceSize: Qt.size(236, 273)
                      source: imageUrl
                      smooth: false
                      asynchronous: true
                  }

                  FastBlur {
                      width: recipeImg.width
                      height: 66
                      anchors.bottom: recipeImg.bottom
                      radius: 50
                      source: ShaderEffectSource {
                          sourceItem: recipeImg
                          sourceRect: Qt.rect(0, 207, recipeImg.width, 66)
                      }
                  }

                  Rectangle {
                      width: recipeImg.width
                      height: 66
                      anchors.bottom: recipeImg.bottom
                      color: "#b2ffffff"

                      Text {
                          anchors.centerIn: parent
                          text: name
                          font.family: fontCfg.alibaba_regular_font
                          font.pixelSize: 30
                          color: "#3a3a3c"
                      }
                  }
              }

              Image {
                  id: deleteImg
                  anchors.left: sourceRect.left
                  anchors.leftMargin: 200
                  anchors.bottom: sourceRect.bottom
                  anchors.bottomMargin: 237
                  fillMode: Image.PreserveAspectFit
                  source:"qrc:/PIC/pics/delete.png"
                  visible: cookTypeRect.is_edit ? false : true

                  MouseArea {
                      anchors.fill: parent
                      onClicked: {
                          // 播放语音
                          if (isVoiceOpen) {
                              uiproc_data_interaction.playAudio(voiceObj.voice3)
                          }

                          var str = String("update recipe set isCollected = 0 where recipeCode = '%1'").arg(recipeId)
                          var ret = uiproc_data_interaction.commonOpeDB(str)
                          if (ret !== true) {
                              console.log("write MyCollect DataBase failed!")
                          } else {
                              mealModel.remove(index)
                          }
                      }
                  }
              }
        }
    }

    // 上一步
    Rectangle {
        id: cookTypeRect
        width: cookBookRect.width
        height: 90
        color: "white"

        property bool is_edit: true

        // 上一步
        Rectangle {
            id: imgRect
            anchors.verticalCenter: parent.verticalCenter
            width: 100
            height: parent.height
            color: "transparent"

            Image {
                x: 30
                anchors.verticalCenter: parent.verticalCenter
                fillMode: Image.PreserveAspectFit
                source: "qrc:/PIC/pics/lastStep.png"
            }

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    // 播放语音
                    if (isVoiceOpen) {
                        uiproc_data_interaction.playAudio(voiceObj.voice3)
                    }

                    stackView.popExit = exitTran
                    stackView.pop()
                }
            }
        }

        Text {
            anchors.centerIn: parent
            text: qsTr("我的收藏")
            font.family: fontCfg.alibaba_regular_font
            font.pixelSize: 36
            color: "#48484a"
        }

        Rectangle {
            anchors.right: parent.right
            anchors.rightMargin: 30
            width: 100
            height: parent.height
            color: "transparent"

            MouseArea {
                anchors.fill: parent
                onClicked: {
                    // 播放语音
                    if (isVoiceOpen) {
                        uiproc_data_interaction.playAudio(voiceObj.voice3)
                    }

                    cookTypeRect.is_edit = !cookTypeRect.is_edit
                }
            }

            // 编辑
            Image {
                anchors.verticalCenter: parent.verticalCenter
                anchors.right: parent.right
                fillMode: Image.PreserveAspectFit
                source: cookTypeRect.is_edit ? "qrc:/PIC/pics/edit.png" : "qrc:/PIC/pics/finish.png"
            }
        }
    }

    Ui_ScrollBar {
        id: vbar
        flickable: grid
        anchors.top: grid.top
        anchors.topMargin: 100
        anchors.bottom: grid.bottom
        anchors.bottomMargin: 20
        anchors.right: parent.right
        anchors.rightMargin: 10
    }
}

亮度值保证背光不熄灭设置

var val = value+0.3
var lightStr = String(Math.round(val*255/1.3))
uiproc_data_interaction.writeLightFile(lightStr)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值