summaryrefstree
path: root/usr/bin/qml_link/AppLink/App_Navi_GuideSetting.qml
blob: 20468d26fb5755fdb996e08ac209ada5f0eb9fd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
import QtQuick 2.0
import "Com"
import "../eventsList.js" as EventsList
import "../layoutList.js" as Layout
import "../windowsList.js" as WindowsList
import Label 2.0

HMIWindow{

    id:app_GuideSetting
    //windowImgSource:imagePath+"Common/M8X_Background.png"
    title: bLanguageType?"导航":"Navigation"     //qsTr("导航") + applinkControl.qsEmptyString
    property bool bLanguageType : true
    property bool bList1VoiceGuideStatus:false
    property bool bList2EEyeStatus:false
    property bool bList3MagViewStatus:false
    property bool bList4ShowTMCStatus: false
    property bool bList5TMCAvoidStatus: false

    property bool bList1VoiceGuideStatusPre:false
    property bool bList2EEyeStatusPre:false
    property bool bList3MagViewStatusPre:false
    property bool bList4ShowTMCStatusPre: false
    property bool bList5TMCAvoidStatusPre: false
    property bool bGetExpiredate: false
    property int  iMsgType:0
    onSignal_returnClick:{
        ScreenManager.backward(Layout.APPLINK)
    }

    onVisibleChanged: {
        if(visible){
            bLanguageType = applinkControl.getLanguageType()
            bList1VoiceGuideStatus = applinkControl.QML_NIF_Gid_GetVoiceGuideStatus()
            bList2EEyeStatus = applinkControl.QML_NIF_Gid_GetEEyeStatus()
            bList3MagViewStatus = applinkControl.QML_NIF_Gid_GetMagViewStatus()
            bList4ShowTMCStatus = applinkControl.QML_NIF_Tmc_GetShowSwitch()
            bList5TMCAvoidStatus = applinkControl.QML_NIF_Tmc_GetAvoidSwitch()
            bList1VoiceGuideStatusPre = bList1VoiceGuideStatus
            bList2EEyeStatusPre = bList2EEyeStatus
            bList3MagViewStatusPre = bList3MagViewStatus
            bList4ShowTMCStatusPre = bList4ShowTMCStatus
            bList5TMCAvoidStatusPre = bList5TMCAvoidStatus
        }else{
            if(bList1VoiceGuideStatusPre != bList1VoiceGuideStatus){
                applinkControl.QML_NIF_Gid_SaveVoiceGuideStatus(bList1VoiceGuideStatus)
            }
            if(bList2EEyeStatusPre != bList2EEyeStatus){
                applinkControl.QML_NIF_Gid_SaveEEyeStatus(bList2EEyeStatus)
            }
            if(bList3MagViewStatusPre != bList3MagViewStatus){
                applinkControl.QML_NIF_Gid_SaveMagViewStatus(bList3MagViewStatus)
            }
            if(bList4ShowTMCStatusPre != bList4ShowTMCStatus){
                applinkControl.QML_NIF_Tmc_SetShowSwitch(bList4ShowTMCStatus)
            }
            if(bList5TMCAvoidStatusPre != bList5TMCAvoidStatus){
                applinkControl.QML_NIF_Tmc_SetAvoidSwitch(bList5TMCAvoidStatus)
            }
        }
    }
    HMIButton{
        y: 1041-160
        btnIcon: imagePath+"Navi/common/M8X_icon_close.png"
        btnImg:pressed?imagePath+"Navi/common/M8X_Function_close_Button_p.png":imagePath+"Navi/common/M8X_Function_close_Button.png"
        onClicked:{
            applinkControl.QML_CloseAppLink()
            //ScreenManager.changeForm(Layout.FM_CLOSE,WindowsList.APP_GUIDE_SETTING)
        }
    }
    //切换到大分类设施选择画页按钮
    HMIButton{
        id: allBtn
        x: 90
        y: 1041-160
        enabled: false
        btnImg:  imagePath+"M8X_Function_1_Button_NoSwitch.png"
        btnImgOnPressed:  imagePath+"M8X_Function_1_Button_NoSwitch_p.png"
    }
    HMIButton{
        y: 1041-160
        btnIcon: imagePath+"Navi/common/M8X_icon_close.png"
        btnImg:pressed?imagePath+"Navi/common/M8X_Function_close_Button_p.png":imagePath+"Navi/common/M8X_Function_close_Button.png"
        onClicked:{
        }
    }
//    HMIButtonComplex{
//        id: confirmButton
//        x: 90
//        y: 1041-160
//        btnIcon: imagePath+"Navi/common/M8X_icon_OK.png"
//        btnImg:  imagePath+"Navi/common/M8X_Function_1_Button_NoSwitch.png"
//        btnImgOnPressed:  imagePath+"Navi/common/M8X_Function_1_Button_NoSwitch_p.png"
//        icon_y: 14
//        label_y: 53
//        //labelText:qsTr("OK") + systemCtrlLink.emptyString *-*
//        labelText: "确定"
//        labelPixelSize: 18
//        onClicked:
//        {
//            iMsgType = 12
//            msg_PopUp.visible = true
//            msg_timer.start()
//            applinkControl.QML_NIF_Gid_SaveVoiceGuideStatus(bList1VoiceGuideStatus)
//            applinkControl.QML_NIF_Gid_SaveEEyeStatus(bList2EEyeStatus)
//            applinkControl.QML_NIF_Gid_SaveMagViewStatus(bList3MagViewStatus)
//    //            bList1VoiceGuideStatusPre = bList1VoiceGuideStatus
//    //            bList2EEyeStatusPre = bList2EEyeStatus
//    //            bList3MagViewStatusPre = bList3MagViewStatus
//        }
//    }
    //tags
        HMIButton {
            id: tag1
            x: 0
            y: 965-160
            btnImg:tag1.pressed?imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_Tag_Button_w319_p.png":imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_Tag_Button_w318.png"
            labelText : qsTr("显示") + applinkControl.qsEmptyString
            labelSize : 30
            onClicked:
            {
                ScreenManager.replace(Layout.APPLINK,WindowsList.APP_DISPLAY_SETTING)
            }
        }

        HMIButton {
            id: tag2
            x: 321
            y: 965-160
            btnImg:imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_Tag_Button_w318_p.png"
            enabled:false            
            labelText: qsTr("导航") + applinkControl.qsEmptyString
            labelSize : 30
        }

        HMIButton {
            id: tag3
            x: 641
            y: 965-160
            btnImg:tag3.pressed?imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_Tag_Button_w319_p.png":imagePath+"Navi/TypeB_Search/Search_B-09_seach_gjz_select/M8X_Tag_Button_w319.png"
            labelText: qsTr("其他") + applinkControl.qsEmptyString
            labelSize : 30
            onClicked:
            {
                ScreenManager.replace(Layout.APPLINK,WindowsList.APP_OTHER_SETTING)
            }
        }


    HMIListView {
        id: listView
        x: 58
        y: 241-160
        width: 842
        height: 80*5
        snapMode:ListView.SnapToItem
        model:modelData
        currentIndex:0
        delegate:delegate_List
        boundsBehavior: Flickable.StopAtBounds
    }
    Component{
        id: delegate_List
        Item {
            width: 842
            height: 80
        HMIButton{
            id:listPushed
            btnImg:listPushed.pressed?imagePath+"Navi/common/M8X_list_78_p.png":imagePath+"Navi/common/M8X_list_78.png"
            Image{
                id:listChoose
                x:758
                source:
                    switch(index)
                    {
                    case 0:
                        bList1VoiceGuideStatus == true?imagePath+"Navi/common/M8X_choice_box_check.png":imagePath+"Navi/common/M8X_choice_box.png"
                        break;
                    case 1:
                        bList2EEyeStatus == true?imagePath+"Navi/common/M8X_choice_box_check.png":imagePath+"Navi/common/M8X_choice_box.png"
                        break;
                    case 2:
                        bList3MagViewStatus == true?imagePath+"Navi/common/M8X_choice_box_check.png":imagePath+"Navi/common/M8X_choice_box.png"
                        break;
                    case 3:
                        bList4ShowTMCStatus == true?imagePath+"Navi/common/M8X_choice_box_check.png":imagePath+"Navi/common/M8X_choice_box.png"
                        break;
                    case 4:
                        bList5TMCAvoidStatus == true?imagePath+"Navi/common/M8X_choice_box_check.png":imagePath+"Navi/common/M8X_choice_box.png"
                        break;
                    default:
                        break;
                    }
            }
            HMILabel{
                id:listText
                x:84
                width:parent.width
                height:parent.height
                horizontalAlignment: Label.AlignLeft
                font.pixelSize: 30
                text:
                    switch(index)
                    {
                    case 0:
                        qsTr("导航声音") + applinkControl.qsEmptyString
                        break;
                    case 1:
                        qsTr("电子眼提示") + applinkControl.qsEmptyString
                        break;
                    case 2:
                        qsTr("交叉点扩大图") + applinkControl.qsEmptyString
                        break;
                    case 3:
                        qsTr("实时路况显示") + applinkControl.qsEmptyString
                        break;
                    case 4:
                        qsTr("实时路况规避") + applinkControl.qsEmptyString
                        break;
                    default:
                        break;
                    }
            }

            onClicked: {
                switch(index)
                {
                case 0:
                    bList1VoiceGuideStatus = !bList1VoiceGuideStatus
                    break;
                case 1:
                    bList2EEyeStatus = !bList2EEyeStatus
                    break;
                case 2:
                    bList3MagViewStatus = !bList3MagViewStatus
                    break;
                case 3:
                    if(bList4ShowTMCStatus)
                    {
                        bList4ShowTMCStatus = !bList4ShowTMCStatus
                    }
                    else
                    {
                        applinkControl.QML_NIF_Tmcpay_RequestAuthcode(applinkControl.QML_GetTmcPayGetStr())
                    }

                    break;
                case 4:
                    bList5TMCAvoidStatus = !bList5TMCAvoidStatus
                    break;
                default:
                    break;
                }
            }
        }
    }
    }

    Item{
        id:item_select
        x:58
        y:482
        width: 844
        height: 80

        Image{
            id: checktext
            width: 654
            height: 78
            source: imagePath+"Navi/Type_P_BaiduMusic/P_02_BaiduMusic_Search/M8X_list_78_w654.png"
            HMILabel{
                anchors.left: parent.left
                anchors.leftMargin: 84
                width: 570
                height: 78
                elide: Text.ElideRight
                font.pixelSize: 30
                text: qsTr("实时路况有效期") + applinkControl.qsEmptyString
                horizontalAlignment: Text.AlignLeft
                color: "white"
                clip:true
            }
        }

        HMIButton{
            id: checkbtn
            anchors.top: checktext.top
            anchors.left: checktext.left
            anchors.leftMargin: 658
            width: 186
            height: 78
            btnImg: imagePath+"Navi/Type_P_BaiduMusic/P_02_BaiduMusic_Search/M8X_Settings_Button.png"
            btnImgOnPressed: imagePath+"Navi/Type_P_BaiduMusic/P_02_BaiduMusic_Search/M8X_Settings_Button_p.png"
            labelText: qsTr("查询") + applinkControl.qsEmptyString
            labelSize: 30
            elideMode: Text.ElideRight

            onClicked: {
                applinkControl.QML_NIF_Tmcpay_ExpireDate(applinkControl.QML_GetTmcPayGetStr())
                bGetExpiredate = false
                wait_timer.start()
            }
        }
    }

    App_Com_TMC_Pay{
        id:pay
        aPayVisible:false
    }

    App_Com_Newspopup{
        id:popMsg_NoService
        labelCount: 2
        newspopText1: qsTr("您尚未开通实时路况服务,请联系客服人员!")  + applinkControl.qsEmptyString
        newspopText2: qsTr("客服电话:")  + applinkControl.qsEmptyString
        visible:false
        bIsTouchClear:false
        //backgroundImage : ""
        yOffset : -75
        bHasButton: true
        newspopText1Height:applinkControl.getLanguageType()?34:68
        yOffset2 : applinkControl.getLanguageType()?0:20
    }

    App_Com_Newspopup{
        id:popMsg_ExpireDate
        labelCount: 2
        newspopText1: qsTr("付费账号 ")  + applinkControl.qsEmptyString
        newspopText2: qsTr("您的实时路况服务有效期至 ")  + applinkControl.qsEmptyString
        visible:false
        bIsTouchClear:false
        //backgroundImage : ""
        yOffset : -75
        bHasButton: true
        newspopText2Height:applinkControl.getLanguageType()?34:70
        yOffset2 : applinkControl.getLanguageType()?0:-10
    }

    App_Com_Newspopup{
        id:popMsg_tmcCheck
        labelCount: 2
        newspopText1: qsTr("暂时无法查询实时路况服务有效期")  + applinkControl.qsEmptyString
        newspopText2: qsTr("请打开\“实时路况显示\”开关后再进行尝试 ")  + applinkControl.qsEmptyString
        visible:false
        bIsTouchClear:false
        //backgroundImage : ""
        yOffset : -75
        bHasButton: true
        newspopText2Height:applinkControl.getLanguageType()?34:70
        yOffset2 : applinkControl.getLanguageType()?0:-10
    }
    ListModel{
        id:modelData
        ListElement{
            name: "导航声音"
        }
        ListElement{
            name: "电子眼提示"
        }
        ListElement{
            name: "交叉点扩大图"
        }
        ListElement{
            name: "实时路况显示"
        }
        ListElement{
            name: "实时路况规避"
        }
    }

    HMIListViewBar{
        id: listViewBar
        listView:listView
        scrollBarX:779
        scrollBarY:118
        scrollBarHeight: 290
        visible: false
        clip:true
    }

    App_Com_Newspopup{
        id:msg_PopUp
        labelCount:1
        newspopText1: qsTr(applinkControl.QML_getMessageString(iMsgType)) + applinkControl.qsEmptyString
        bIsTouchClear:applinkControl.QML_getMessageTouchClearFlag(iMsgType)
    }
    Timer{
        id:msg_timer
        interval: applinkControl.QML_getMessageTime(iMsgType)
        onTriggered: {
            iMsgType = 0
            msg_PopUp.visible = false
        }
    }

    Timer{
        id:wait_timer
        interval: 10000
        onTriggered: {
            if (!bGetExpiredate)
            {
                popMsg_tmcCheck.visible = true
            }
        }
    }

    Connections{
        target:applinkControl
        onSignalLanguageChanged:{
            if(visible){
                bLanguageType = applinkControl.getLanguageType()
            }
        }

        onSignal_TMC_Net_Error:{
            if(visible){
                bGetExpiredate = true
                msg_PopUp.visible = true
                iMsgType = 26
                msg_timer.restart()
            }
        }

        onSignal_TMC_Auth_Success:{
            if(visible){
                applinkControl.QML_NIF_Tmc_SetTermToken(authcode)
                bList4ShowTMCStatus = !bList4ShowTMCStatus
                //applinkControl.QML_NIF_Tmcpay_SetPayInfo(applinkControl.QML_GetTmcPaySetStr())
            }
        }

        onSignal_TMC_Need_Pay:{
            if(visible){
                applinkControl.QML_SetTmcPayQrStr()
                pay.aPayVisible = true
            }
        }

        onSignal_TMC_Auth_Fail:{
            if(visible){
                popMsg_NoService.newspopText2 = qsTr("客服电话:")  +  applinkControl.QML_GetTmcSupportTel() + applinkControl.qsEmptyString
                popMsg_NoService.visible = true
            }
        }

        onSignal_TMC_Get_Support:{
            if(visible){
                bGetExpiredate = true
            }
        }

        onSignal_TMC_Get_Expiredate:{
            if(visible){
                bGetExpiredate = true
                popMsg_ExpireDate.newspopText1 = qsTr("付费账号 ")  + id + applinkControl.qsEmptyString
                popMsg_ExpireDate.newspopText2 =  qsTr("您的实时路况服务有效期至 ")  + date + applinkControl.qsEmptyString
                popMsg_ExpireDate.visible = true
            }
        }
    }
}