import QtQuick 2.0 import "../com/neusoft/auto/widgets" import "../eventsList.js" as EventsList import "../layoutList.js" as Layout import "../windowsList.js" as WindowsList import Label 2.0 HMIWindow { id:carlinkcontacts_page property int curContactIndex: 0 property string aTozCurrent: "" Component.onCompleted: { console.log("***********************************CARLINK_CONTACTS***********************************") windowID = WindowsList.CARLINK_CONTACTS } onVisibleChanged: { bFullWindow = true } HMILabel { x:24 y:128-128 width:700 height:56 text:"Contacts" color: "white" font.pixelSize: 28 verticalAlignment: Label.AlignVCenter horizontalAlignment: Label.AlignLeft } HMIButton { id:icon_back x:500 y:128-128 width: 400 height: 56 btnImg:icon_back.pressed?("qrc:MATERIAL/MATERIAL_M8X_ICON_BACK_P"+bgImageStyle) :("qrc:MATERIAL/MATERIAL_M8X_ICON_BACK"+bgImageStyle) onClicked: { ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_MAIN) } } Item { x:20 y:56 width:700 height: 640 HMIListView { id:contact_people anchors.fill: parent clip:true model:carlinkCtrl.getPhoneListFromDB delegate: phone_Number keyNavigationWraps: true orientation: ListView.Vertical highlightFollowsCurrentItem: true snapMode: ListView.SnapOneItem rightMargin: 0 scrollBar:true scrollBar_edge:0 scrollBar_width:4 spacing: 2 scrollBar_img:"qrc:MATERIAL/MATERIAL_M8X_SLIDER_BAR"+bgImageStyle } Component { id:phone_Number HMIButton { id:contact_List enabled: col1=='1'?false:true height: 62 btnImg:"qrc:MATERIAL/MATERIAL_M8X_LIST"+bgImageStyle //"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_BK"+bgImageStyle Image { height: 62 visible: (curContactIndex == index) ? true:false source:(contact_List.pressed)?("qrc:MATERIAL/MATERIAL_M8X_LIST_P"+bgImageStyle):("qrc:MATERIAL/MATERIAL_M8X_LIST_C"+bgImageStyle) } Item { x:col1=='1'?52-34:73-34 y:211-190 width: 670 height: 37 HMILabel { anchors.fill: parent font.pixelSize:24 text:col0 horizontalAlignment: Label.AlignLeft elide:Label.ElideRight } HMILabel { x:100//120 //73-34-120 y: 211-210 width: 520 height: 37 font.pixelSize:24 text:col1 } } onPressed: { if (curContactIndex != index) { curContactIndex = index } } onClicked: { ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_CONTACTS_NEW_MSG) carlinkCtrl.getCarlinkMsgContactUserid(col1); carlinkCtrl.setCurrentPhoneNum(col1); carlinkCtrl.setCurrentPhoneName(col0); } } } } HMIButton { id:icon_contact x:60//96-15//60 y:822-128//849-131//822-128 width:124// 71//124 height:66//23// 66 labelText: "Contact" btnImg:"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4_P"+bgImageStyle onClicked: { //ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_CONTACTS) } } HMIButton { id:icon_interact x:200//200 y:822-128 width: 124//46 height:66// 23//66 labelText: "Interact" btnImg:icon_interact.pressed?("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4_P"+bgImageStyle) :("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4"+bgImageStyle) onClicked: { ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_CONTACTS_ALL_LIST) //ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_CONTACTS_NOTUPLOAD)//for test } } HMIButton { id:icon_synchro x:340//360-15 y:822-128//849-131//822-128 width: 124 height: 66 labelText: "Synchro" btnImg:icon_synchro.pressed?("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4_P"+bgImageStyle) :("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4"+bgImageStyle) onClicked: { //carlinkCtrl.sLPphoneBookListModelClear(); carlinkCtrl.setIsSynchroPopupDisplay(true); carlinkCtrl.selectPhoneBookList(); } } Column{ x:695 id: firstRow anchors{top:parent.top;topMargin:50} Repeater{ model:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","#"] HMILabel{ width:23 height: 24 font.pixelSize: 22 color:aTozCurrent== qsTr(modelData)?"white":"gray" text:qsTr(modelData); HMIMouseArea{ anchors.fill: parent onPressed: { console.debug(modelData) aTozCurrent = modelData contact_people.positionViewAtIndex(carlinkCtrl.getCLInitialSearchIndex(aTozCurrent), ListView.Beginning) } } } } } Connections { target: carlinkCtrl onSigSynchroFaildChanged: { console.log("=============================contacts update failed=============") carlinkCtrl.showPromptInfo ("网络异常" , true); } onSigContactsNotuploadChanged: { console.log("=============================contacts update failed=============") ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_CONTACTS_NOTUPLOAD) } onSigUpdateDBChanged: { contact_people.model=carlinkCtrl.getPhoneListFromDB } onSigSynchroSuccessChanged: { // contact_people.model=carlinkCtrl.getPhoneListFromDB } } CarLink_Synchro_Popup{ id : synchro popvisible : carlinkCtrl.isSynchroPopupDisplay popimageY : bMaxWindow ? 300 : 125 popheight : bMaxWindow ? 700 : 325 } }