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:stock_main property string stock_title_text: "" property int stock_step: 0 property int titlex: 30 property int titley: 50 property int fontsize: VrFunc.FONT_SIZE property string userCmd: vrCtrl.vrSttText property string getStockDate: "" property string getStockName: "" property string getStockCode: "" property string getStockCurPrice: "" property string getStockOpePrice: "" property string getStockCloPrice: "" property string getStockRiseVal: "" property string getStockRiseRate: "" property string getStockHighPrice: "" property string getStockLowPrice: "" Item{ visible:(stock_step == VrFunc.STOCK_WEB_PROMPT)|| (stock_step == VrFunc.STOCK_SHOW_WEBPIC)?true:false /* 股票显示 */ HMILabel{ id:titleText x:titlex y:titley width:540 height:30 text:stock_title_text + systemCtrl.emptyString//"你可以继续说话▪▪▪" verticalAlignment: Label.AlignVCenter horizontalAlignment: Label.AlignHCenter font.pixelSize:30//fontsize color: "white" } } Item { visible: stock_step == VrFunc.STOCK_SHOW_WEBPIC ? true : false Image{ y:titley+60 width:570 height:700 source:"qrc:MATERIAL/MATERIAL_M8X_LIST_78_W558_BG"+ bgImageStyle } Item { id:user_cmd x:titlex y:titley+120 width: 528 height: 74 Text { id:fake_text font.pixelSize: 30 visible:false text: userCmd } Image{ x:fake_text.width>480? 0:(480-fake_text.width) width: fake_text.width>480? 528:(fake_text.width+48) height: 74 source: userCmd != ""?"qrc:MATERIAL/MATERIAL_M8X_USER_BG"+bgImageStyle:"" HMILabel { anchors.fill: parent text:userCmd color:"white" font.pixelSize:30 //elide: Label.ElideRight wrapMode: Label.Wrap } } } } Item{ id:stock_info y:titley+250 width:558 height:400 visible:stock_step == VrFunc.STOCK_SHOW_WEBPIC ? true : false Item{ x:20 width: 530 height: 354 Image{ id:uu x:0 y:0 source:"qrc:MATERIAL/MATERIAL_M8X_SPEECH_LIST_BG_U"+bgImageStyle } Image{ id:aa x:0 y:12 source:"qrc:MATERIAL/MATERIAL_M8X_SPEECH_LIST_BG_A"+bgImageStyle } Image{ id:cc x:0 y:42 height:300 source:"qrc:MATERIAL/MATERIAL_M8X_SPEECH_LIST_BG_C"+bgImageStyle } Image{ x:0 y:cc.y+cc.height source:"qrc:MATERIAL/MATERIAL_M8X_SPEECH_LIST_BG_D"+bgImageStyle } } HMILabel{ id:stock_name x:50 y:30 width:420 height:30 text:getStockName+"("+getStockCode+")"//"科大讯飞"+"("+"002230"+")" horizontalAlignment:Text.AlignLeft font.pixelSize:30//fontsize color: "white" visible:true } //股票当前价格 HMILabel{ id:stockCurPrice x:50 y:90 width:330 height:90 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft font.pixelSize:60 text:getStockCurPrice + systemCtrl.emptyString //"88.880" color:(getStockRiseVal.indexOf("-") < 0) ? ((getStockRiseVal == "0.0") ? "white" : "red") : "green" } //比率 HMILabel{ id:stockRiseVal x:390 y:100 width: 150 height: 30 font.pixelSize: 28 horizontalAlignment:Text.AlignLeft text:getStockRiseVal + systemCtrl.emptyString // "+10.080" color:(getStockRiseVal.indexOf("-") < 0) ? ((getStockRiseVal == "0.0") ? "white" : "red") : "green" } HMILabel{ id:stockRiseRate x:390 y:140 width: 150 height: 30 font.pixelSize: 28 horizontalAlignment:Text.AlignLeft text:getStockRiseRate + systemCtrl.emptyString //"+10.000%" color:(getStockRiseVal.indexOf("-") < 0) ? ((getStockRiseVal == "0.0") ? "white" : "red") : "green" } Column{ spacing: 25 x:50 y:250 width: 64 height: 75 Repeater { id:price_ope_clo model: ["今开","昨收"] HMILabel{ width:64 height: 25 font.pixelSize: 24 horizontalAlignment:Text.AlignLeft text:qsTr(modelData); } } } HMILabel{ id:stockOpenPrice //今开 x:120 y:250 width:130 height:25 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft font.pixelSize:24 text:getStockOpePrice + systemCtrl.emptyString //"80.080" color:"white" } HMILabel{ id:stockClosePrice //昨收 x:120 y:300 width:130 height:25 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft font.pixelSize:24 text:getStockCloPrice + systemCtrl.emptyString// "30.050" color:"white" } Column{ spacing: 25 x:290 y:250 width: 64 height: 72 Repeater { id:stock_low_high model: ["最高","最低"] HMILabel{ width:64 height: 25 font.pixelSize: 24 text:qsTr(modelData); } } } HMILabel{ id:stockHighPrice //最高 x:360 y:250 width:130 height:25 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft font.pixelSize:24 text:getStockHighPrice + systemCtrl.emptyString //"30.050" color:"white" } HMILabel{ id:stockLowPrice //最低 x:360 y:300 width:130 height:25 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft font.pixelSize:24 text:getStockLowPrice + systemCtrl.emptyString //"80.080" color:"white" } HMILabel{ id:note_text //备注说明 x:25 y:364 width:558 height:20 verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft font.pixelSize:20 text:"数据由新浪网提供"+" 更新时间"+getStockDate//"2017-2-28"+"12:00" color:"gray" } } function stockExitVr() { systemCtrl.reqSource(Layout.HMI_SRC_VR,Layout.HMI_SRC_End,Layout.HMI_SRC_Front) } /*----------------------------------------------------------------------------*/ /*----------------- JavaScript Function Declaration Section ------------------*/ /*----------------------------------------------------------------------------*/ function stockInfo(result1,result2) { //console.log() switch (result1) { case "show_webpic": vrCtrl.mtd_StockTtsRequest() vrmain.vrPageType = VrFunc.VR_DELAY2S_CLOSE stock_step = VrFunc.STOCK_SHOW_WEBPIC titleText.horizontalAlignment = Label.AlignHCenter stock_title_text = "股票" getStockDate = vrCtrl.getStockDate() getStockName = vrCtrl.getStockName() getStockCode = vrCtrl.getStockCode() getStockCurPrice = vrCtrl.getStockCurPrice() getStockOpePrice = vrCtrl.getStockOpePrice() getStockCloPrice = vrCtrl.getStockCloPrice() getStockRiseVal = vrCtrl.getStockRiseVal() getStockRiseRate = vrCtrl.getStockRiseRate() getStockHighPrice = vrCtrl.getStockHighPrice() getStockLowPrice = vrCtrl.getStockLowPrice() break; case "web_prompt": case "show_weburl": default: stock_step = VrFunc.STOCK_WEB_PROMPT titleText.horizontalAlignment = Label.AlignLeft stock_title_text = "您可以这样说查询华晨中国的股票,或者说查询600609的股票" vrCtrl.ttsSpeak(stock_title_text, VrFunc.LIBTTS_PB_MODE_REPLACE) vrmain.ttsFinishKind = VrFunc.VR_TTS_KIND_NORMAL vrmain.vrPageType = VrFunc.VR_ERROR_PAGE break; } } }