import QtQuick 2.0 import Label 2.0 /* 本画页已不使用 */ import "../com/neusoft/auto/widgets" import "../eventsList.js" as EventsList import "../layoutList.js" as Layout import "../windowsList.js" as WindowsList import "./Func.js" as VrFunc Item { id:help_page_main /* 变量定义 */ property int help_kind:VrFunc.VR_NONE property string common_icon:"" property string common_title:"" property int line_height:20 /* 帮助主画面 */ Item{ id:help_main_list visible:help_kind == VrFunc.VR_NONE ?true:false /* 显示:您可以这样问我: */ HMILabel{ id:title_open x:320;y:30 width:400 height:50 text:qsTr("您可以这样问我:")+systemCtrl.emptyString; verticalAlignment: Label.AlignTop horizontalAlignment: Label.AlignLeft font.pixelSize:25 color: "white" } Item{ x:328;y:90 width: 444; height: 150 Component { id: mainListDelegate Item { width: mainGrid.cellWidth; height: mainGrid.cellHeight /* 压下背景 */ Image{ id:btn_push source: "../images/TypeG_VR/temp33_push.png" visible: module_Mouse.pressed?true:false } /* 压下/抬起 icon */ Image { x:15;y:15 source: module_Mouse.pressed?icon_sel:icon } /* 选项 */ HMILabel{ id:title_open x:40;y:10 width:150 height:100 text:m_text verticalAlignment: Label.AlignTop horizontalAlignment: Label.AlignHCenter font.pixelSize:25 color: module_Mouse.pressed?"red":"white" } MouseArea{ id:module_Mouse anchors.fill: parent onClicked: { //console.log("-----help module click---index:"+index) help_kind = index selectHelpModel() selectHelpIconAndTitle() } } } } GridView { id: mainGrid anchors.fill: parent cellWidth: 200; cellHeight: 40 model: mainModel delegate: mainListDelegate interactive:false } } ListModel { id:mainModel ListElement { m_text: "电话帮助" icon: "../images/TypeG_VR/temp28_tel-icon.png" icon_sel: "../images/TypeG_VR/temp17_icon-tell.png" } ListElement { m_text: "空调帮助" icon: "../images/TypeG_VR/temp25_A-C.png" icon_sel: "../images/TypeG_VR/temp17_icon-tell.png" } ListElement { m_text: "收音帮助" icon: "../images/TypeG_VR/temp32_radio-icon.png" icon_sel: "../images/TypeG_VR/temp17_icon-tell.png" } ListElement { m_text: "应用帮助" icon: "../images/TypeG_VR/temp23_app-icon.png" icon_sel: "../images/TypeG_VR/temp17_icon-tell.png" } ListElement { m_text: "媒体帮助" icon: "../images/TypeG_VR/temp20_video-icon.png" icon_sel: "../images/TypeG_VR/temp17_icon-tell.png" } ListElement { m_text: "设置帮助" icon: "../images/TypeG_VR/temp21_icon-set-help.png" icon_sel: "../images/TypeG_VR/temp17_icon-tell.png" } } } /* 各种帮助画面 */ Item{ id:help_common visible:help_kind != VrFunc.VR_NONE ?true:false /* icon */ /*Image{ id:commonIcon x:367;y:80 source: common_icon }*/ /* title */ HMILabel{ id:help_common_tile x:423;y:20 width:400 height:40 text:common_title // verticalAlignment: Label.AlignVCenter // horizontalAlignment: Label.AlignHCenter verticalAlignment: Label.AlignTop horizontalAlignment: Label.AlignLeft font.pixelSize:24 color: "white" } /* list */ Item { x:423;y:60 width: 400; height: 250 Component { id: commonDelegate Item { width: common_grid.cellWidth; height: common_grid.cellHeight HMILabel{ id:help_content_line width:400 height:line_height text:common_grid.model.line_text(index) verticalAlignment: Label.AlignTop horizontalAlignment: Label.AlignLeft font.pixelSize:15 color: "white" } } } GridView { id: common_grid anchors.fill: parent cellWidth: 400 cellHeight: line_height model: selectHelpModel() delegate: commonDelegate interactive:false } } } /* 打电话帮助信息 */ ListModel { id:phoneModel ListElement {} ListElement {} ListElement {} ListElement {} ListElement {} ListElement {} ListElement {} ListElement {} ListElement {} function line_text( index) { if ( line_text[ "text" ] == undefined) { line_text.text = [ qsTr( "打电话给某某" ) , qsTr( "给某某打电话" ) , qsTr( "查看某某的号码" ) , qsTr( "打电话给移动客服" ) , qsTr( "下载电话本" ) , qsTr( "打开电话本" ) , qsTr( "查看未接电话" ) , qsTr( "查看已接电话" ) , qsTr( "查看已拨电话" ) ] } return line_text.text [ index] } } /* 空调帮助信息 */ ListModel { id:acModel ListElement {} ListElement {} ListElement {} ListElement {} ListElement {} ListElement {} ListElement {} ListElement {} function line_text( index) { if ( line_text[ "text" ] == undefined) { line_text.text = [ qsTr( "打开/关闭空调" ) , qsTr( "空调制冷/制热" ) , qsTr( "空调内循环/外循环" ) , qsTr( "空调前窗除雾/后窗加热" ), qsTr( "空调温度设置为多少度" ), qsTr( "空调温度调高/调高多少度" ), qsTr( "空调温度调低/调低多少度" ), qsTr( "空调吹脚/吹脸/吹头吹脚" ) ] } return line_text.text [ index] } } /* 收音机帮助信息 */ ListModel { id:radioModel ListElement {} ListElement {} ListElement {} ListElement {} function line_text( index) { if ( line_text[ "text" ] == undefined) { line_text.text = [ qsTr( "调频/FM《频率》" ) , qsTr( "调幅/AM《频率》" ) , qsTr( "扫描/搜索电台" ) , qsTr( "向上搜索/向下搜索" ) ] } return line_text.text [ index] } } /* 应用帮助信息 */ ListModel { id:appModel ListElement {} ListElement {} ListElement {} ListElement {} function line_text( index) { if ( line_text[ "text" ] == undefined) { line_text.text = [ qsTr( "调频/FM《频率》" ) , qsTr( "调幅/AM《频率》" ) , qsTr( "扫描/搜索电台" ) , qsTr( "向上搜索/向下搜索" ) ] } return line_text.text [ index] } } /* 媒体帮助信息 */ ListModel { id:mediaModel ListElement {} ListElement {} ListElement {} ListElement {} ListElement {} ListElement {} ListElement {} function line_text( index) { if ( line_text[ "text" ] == undefined) { line_text.text = [ qsTr( "播放视频/图片/音乐" ) , qsTr( "快进/快退" ) , qsTr( "上一部/张/首,下一部/张/首" ) , qsTr( "全屏播放/退出全屏" ) , qsTr( "播放《电影名》/《音乐名》" ) , qsTr( "翻转/左翻转/右翻转" ) , qsTr( "放大/缩小图片" ) ] } return line_text.text [ index] } } /* 设置帮助信息 */ ListModel { id:setModel ListElement {} ListElement {} function line_text( index) { if ( line_text[ "text" ] == undefined) { line_text.text = [ qsTr( "背光亮度设置" ) , qsTr( "《白天/黑夜/自动》" ) ] } return line_text.text [ index] } } /*----------------------------------------------------------------------------*/ /*--------------------------------- 函数定义 ----------------------------------*/ /*----------------------------------------------------------------------------*/ /* 选择listmode */ function selectHelpModel() { switch (help_kind) { case VrFunc.VR_PHONE: return phoneModel case VrFunc.VR_AC: return acModel case VrFunc.VR_RADIO: return radioModel case VrFunc.VR_APPLICATION: return appModel case VrFunc.VR_MEDIA: return mediaModel case VrFunc.VR_SETTING: return setModel default: //console.log("selectHelpModel: the error help_kind="+help_kind) return phoneModel } } /* 选择icon和Title */ function selectHelpIconAndTitle() { switch (help_kind) { case VrFunc.VR_PHONE: common_icon = "../images/TypeG_VR/temp69_tel-icon.png" common_title = "打电话" break; case VrFunc.VR_AC: common_icon = "../images/TypeG_VR/temp66_A-C.png" common_title = "空调控制" break; case VrFunc.VR_RADIO: common_icon = "../images/TypeG_VR/temp72_radio.png" common_title = "收音机" break; case VrFunc.VR_APPLICATION: common_icon = "../images/TypeG_VR/temp75_app-icon.png" common_title = "应用" break; case VrFunc.VR_MEDIA: common_icon = "../images/TypeG_VR/temp63_video-icon.png" common_title = "多媒体" break; case VrFunc.VR_SETTING: common_icon = "../images/TypeG_VR/temp78_set-icon.png" common_title = "设置" break; default: //console.log("selectHelpIconAndTitle: the error help_kind="+help_kind) common_icon = "../images/TypeG_VR/temp78_set-icon.png" common_title = "设置" } } }