Commit 6d70ad27 authored by lyong's avatar lyong

优化产测wifi

parent 203587ef
......@@ -5,57 +5,46 @@
<!-- </div> -->
<div id="wifiHmoe" class="screen">
<div style="left:10;top: 10;width: 460;height: 55; background-color: #99D0F7;">
<text class="fontsize40" id="title_TEXT"
style="left:0;top: 0;width: 460;height: 55;text-align: center; background-color: transparent;color: black;">{{
<text class="fontsize40" id="title_TEXT" style="left:0;top: 0;width: 460;height: 55;text-align: center; background-color: transparent;color: black;">{{
title_TEXT }}</text>
</div>
<div style="left:0;top: 70;width: 480;height: 55; background-color: transparent;">
<text class="fontsize16" id="Reminder_TEXT"
style="left:0;top: 0;width: 480;height: 55;text-align: center; background-color: transparent;color: black;">{{
<text class="fontsize16" id="Reminder_TEXT" style="left:0;top: 0;width: 480;height: 55;text-align: center; background-color: transparent;color: black;">{{
Reminder_TEXT }}</text>
</div>
<div style="left:10;top: 130;width: 460;height: 55; background-color: #99D0F7;">
<text class="fontsize24" id="wifiInfo_TEXT"
style="left:0;top: 10;width: 460;height: 55;text-align: center; background-color: transparent;color: #357E43">{{
<text class="fontsize24" id="wifiInfo_TEXT" style="left:0;top: 10;width: 460;height: 55;text-align: center; background-color: transparent;color: #357E43">{{
wifiInfo_TEXT }}</text>
</div>
<div style="left:10;top: 195;width: 460;height: 55; background-color: transparent">
<text class="fontsize24" id="wifiInfoWarn_TEXT"
style="left:0;top: 10;width: 460;height: 55;text-align: center; background-color: transparent;color: #E2E64D">{{
<text class="fontsize24" id="wifiInfoWarn_TEXT" style="left:0;top: 10;width: 460;height: 55;text-align: center; background-color: transparent;color: #E2E64D">{{
wifiInfoWarn_TEXT }}</text>
</div>
<div style="left:10;top: 260;width: 480;height: 96; background-color: transparent;">
<text class="fontsize24" id="wifiInfoState_TEXT"
style="left: 0;top: 36;width: 350;height: 40;text-align: center; background-color: transparent;color: #ffffff">{{
<text class="fontsize24" id="wifiInfoState_TEXT" style="left: 0;top: 36;width: 350;height: 40;text-align: center; background-color: transparent;color: #ffffff">{{
wifiInfoState_TEXT }}</text>
<div style="top:0; left:360 ; width: 100;height: 96;background-color: #FF9700;">
<text class="testReturn" id="id_startscanWifi" onpress="touchedScreen"
onclick="touchedStartScanWifiButton" style="top: 0;color: #000000;">开始扫描</text>
<text class="testReturn" id="id_startscanWifi" onpress="touchedScreen" onclick="touchedStartScanWifiButton" style="top: 0;color: #000000;">开始测试</text>
</div>
<div id="id_startscanWifiHide"
style="top:-480; left:360 ; width: 100;height: 96;background-color: #FF9700;"></div>
<div id="id_startscanWifiHide" style="top:-480; left:360 ; width: 100;height: 96;background-color: #FF9700;" onclick="noclickBuntton"></div>
</div>
<div style="left:10;top: 366;width: 460;height: 96; background-color: transparent;">
<div style="left:10 ; width: 100;height: 96;background-color: #858282;">
<text class="testReturn" id="id_back" onpress="touchedScreen" onclick="touchedBackButton"
style="color: #000000; top: 15;">back</text>
<text class="testReturn" id="id_back" onpress="touchedScreen" onclick="touchedBackButton" style="color: #000000; top: 15;">back</text>
</div>
<div style="left:130 ; width: 100;height: 96;background-color: #858282;">
<text class="testReturn" id="id_ng" onpress="touchedScreen" onclick="touchedNGButton"
style="color: #F44236;top: 15;">NG</text>
<text class="testReturn" id="id_ng" onpress="touchedScreen" onclick="touchedNGButton" style="color: #F44236;top: 15;">NG</text>
</div>
<div id="id_yes" style="top:-480; left:360 ; width: 100;height: 96;background-color: #FF9700;">
<text class="testReturn" onpress="touchedScreen" onclick="touchedYesButton"
style="color: #000000;top: 15;left: 0; ">PASS</text>
<text class="testReturn" onpress="touchedScreen" onclick="touchedYesButton" style="color: #000000;top: 15;left: 0; ">PASS</text>
</div>
<div style="left:250 ; width: 100;height: 96;background-color: #858282;">
<text class="testReturn" id="id_scanWifiList" onpress="touchedScreen" onclick="touchedscanWifiList"
style="color: #000000;">WIFI列表</text>
<text class="testReturn" id="id_scanWifiList" onpress="touchedScreen" onclick="touchedscanWifiList" style="color: #000000;">WIFI列表</text>
</div>
</div>
......@@ -63,31 +52,25 @@
<div id="id_enableWLANChooseOnDiv" class="screen" style="top: -480;">
<div style="left:10;top: 10;width: 460;height: 35; background-color: transparent;">
<text class="fontsize24" id="title_TEXT"
style="left:0;top: 0;width: 460;height: 35;text-align: center; background-color: transparent;color: black;">{{
<text class="fontsize24" id="title_TEXT" style="left:0;top: 0;width: 460;height: 35;text-align: center; background-color: transparent;color: black;">{{
title_TEXT }}</text>
</div>
<list id="id_enableWLANPageList" direction="vertical" style="top:55;left:30;height:300;width: 420;">
<list-item id="id_enableWLANListItemTemplate" style="top:0;height:1100;width: 420;">
<div style="top:0;width: 420;background-color: #000000;height:1100;"
id="id_enableWLANListItemSearchDiv"></div>
<div style="top:0;width: 420;background-color: #000000;height:1100;" id="id_enableWLANListItemSearchDiv"></div>
</list-item>
</list>
<div style="left:10;top: 366;width: 460;height: 96; background-color: transparent;">
<div style="left:60 ; width: 150;height: 96;background-color: #858282;">
<text class="testReturn" id="id_backWifiList" onpress="touchedScreen" onclick="touchedDetailsBackButton"
style="top: 25; color: #000000; width: 150;font-size: 34;">back</text>
<text class="testReturn" id="id_backWifiList" onpress="touchedScreen" onclick="touchedDetailsBackButton" style="top: 25; color: #000000; width: 150;font-size: 34;">back</text>
</div>
<div style="top:0; left:250; width: 150;height: 96;background-color: #FF9700;">
<text class="testReturn" id="id_startscanWifi_List" onpress="touchedScreen"
onclick="touchedStartScanWifiDetailsButton"
style="top: 25;color: #000000; width: 150;font-size: 34;">开始扫描</text>
<text class="testReturn" id="id_startscanWifi_List" onpress="touchedScreen" onclick="touchedStartScanWifiDetailsButton" style="top: 25;color: #000000; width: 150;font-size: 34;">开始扫描</text>
</div>
<div id="id_startscanWifi_List_hide"
style="top:-480; left:250; width: 150;height: 96;background-color: #FF9700;">
<div id="id_startscanWifi_List_hide" style="top:-480; left:250; width: 150;height: 96;background-color: #FF9700;" onclick="noclickBuntton">
</div>
</div>
......@@ -97,22 +80,17 @@
<div class="totalPageDiv" id="id_wlanEnterPasswordPage" style="top:-480;background-color: #000000;"
onrelease="onKeyboardRelease">
<div class="totalPageDiv" id="id_wlanEnterPasswordPage" style="top:-480;background-color: #000000;" onrelease="onKeyboardRelease">
<!-- <div class="titleDiv" onclick="backToWirelessNetworkBasicPage">
<image class="backPng" :src="backPngSrc"></image>
<text class="titleFontsize" id="titleWlanEnterPasswordText">{{crtTitleWlanEnterPasswordText}}</text>
</div> -->
<div style="left:10;top: 10;width: 460;height: 96; background-color: transparent;">
<div style="left:60 ; width: 150;height: 96;background-color: #858282;">
<text class="testReturn" id="id_backWifiList_InputPassword" onpress="touchedScreen"
onclick="touchedDetailsBackInputPasswordButton"
style="top: 25; color: red; width: 150;font-size: 34;">back</text>
<text class="testReturn" id="id_backWifiList_InputPassword" onpress="touchedScreen" onclick="touchedDetailsBackInputPasswordButton" style="top: 25; color: red; width: 150;font-size: 34;">back</text>
</div>
<div style="top:0; left:250; width: 150;height: 96;background-color: #FF9700;">
<text class="testReturn" id="id_startscanWifi_List_InputPassword" onpress="touchedScreen"
onclick="touchedStartScanWifiDetailsInputPasswordButton"
style="top: 25;color: #000000; width: 150;font-size: 34;">connect</text>
<text class="testReturn" id="id_startscanWifi_List_InputPassword" onpress="touchedScreen" onclick="touchedStartScanWifiDetailsInputPasswordButton" style="top: 25;color: #000000; width: 150;font-size: 34;">connect</text>
</div>
<div id="id_hide" style="top:0; left:250; width: 150;height: 96;background-color: #FF9700;">
......@@ -121,13 +99,11 @@
<div class="wlanEnterPasswordBox" id="id_wlanEnterPasswordBox" style="top:80;">
<!-- <text class="fontsize22" id="passwordText">{{crtPasswordText}}</text> -->
<text class="fontsize22" id="titleWlanEnterPasswordText"
style="top: 30; left: 12; text-align: left;width: 480;">{{crtTitleWlanEnterPasswordText}}</text>
<text class="fontsize22" id="titleWlanEnterPasswordText" style="top: 30; left: 12; text-align: left;width: 480;">{{crtTitleWlanEnterPasswordText}}</text>
<div class="wlanEnterPasswordShowDiv" id="id_wlanEnterPasswordShowDiv">
<div class="wlanEnterPasswordShowLoadDiv" style=""></div>
<text class="fontsize22Left" id="enterPasswordReminderText">{{crtEnterPasswordReminderText}}</text>
<text class="fontsize22Left" id="enterPasswordShowText"
style="top:-480">{{crtEnterPasswordShowText}}</text>
<text class="fontsize22Left" id="enterPasswordShowText" style="top:-480">{{crtEnterPasswordShowText}}</text>
<text class="fontsize22Left" id="enterPasswordShowInvisiableText">{{
crtEnterPasswordShowInvisiableText}}</text>
<image class="visibilityPng" :src="visibilityPngSrc"></image>
......@@ -139,146 +115,114 @@
<div class="keyboardBox">
<div class="keyboardDiv">
<div class="row1" style="top:0">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="0" style="left:0">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="0" style="left:0">
<text class="txt">Q</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="1" style="left:46">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="1" style="left:46">
<text class="txt">W</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="2" style="left:92">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="2" style="left:92">
<text class="txt">E</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="3" style="left:138">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="3" style="left:138">
<text class="txt">R</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="4" style="left:184">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="4" style="left:184">
<text class="txt">T</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="5" style="left:230">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="5" style="left:230">
<text class="txt">Y</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="6" style="left:276">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="6" style="left:276">
<text class="txt">U</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="7" style="left:322">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="7" style="left:322">
<text class="txt">I</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="8" style="left:368">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="8" style="left:368">
<text class="txt">O</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="9" style="left:414">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="9" style="left:414">
<text class="txt">P</text>
</div>
</div>
<div class="row1" style="top:47">
<div class="key" style="left:23" onclick="onKeyboardClick" onpress="onKeyboardPress"
onrelease="onKeyboardRelease" value="10">
<div class="key" style="left:23" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="10">
<text class="txt">A</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="11" style="left:69">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="11" style="left:69">
<text class="txt">S</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="12" style="left:115">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="12" style="left:115">
<text class="txt">D</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="13" style="left:161">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="13" style="left:161">
<text class="txt">F</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="14" style="left:207">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="14" style="left:207">
<text class="txt">G</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="15" style="left:253">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="15" style="left:253">
<text class="txt">H</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="16" style="left:299">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="16" style="left:299">
<text class="txt">J</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="17" style="left:345">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="17" style="left:345">
<text class="txt">K</text>
</div>
<div class="key" style="left:391" onclick="onKeyboardClick" onpress="onKeyboardPress"
onrelease="onKeyboardRelease" value="18">
<div class="key" style="left:391" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="18">
<text class="txt">L</text>
</div>
</div>
<div class="row1" style="top:94">
<div id="ABC" style="width:65" onclick="onKeyboardClick" onpress="onKeyboardPress"
onrelease="onKeyboardRelease" special="ABC">
<div id="ABC" style="width:65" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" special="ABC">
<text id="ABC_txt">ABC</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="20" style="left:69">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="20" style="left:69">
<text class="txt">Z</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="21" style="left:115">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="21" style="left:115">
<text class="txt">X</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="22" style="left:161">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="22" style="left:161">
<text class="txt">C</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="23" style="left:207">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="23" style="left:207">
<text class="txt">V</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="24" style="left:253">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="24" style="left:253">
<text class="txt">B</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="25" style="left:299">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="25" style="left:299">
<text class="txt">N</text>
</div>
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
value="26" style="left:345">
<div class="key" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" value="26" style="left:345">
<text class="txt">M</text>
</div>
<div id="backspace" style="left:391;width:65" onclick="onKeyboardClick" onpress="onKeyboardPress"
onrelease="onKeyboardRelease" special="backspace">
<div id="backspace" style="left:391;width:65" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" special="backspace">
<text id="backspace_txt">back</text>
</div>
</div>
<div class="row1" style="top:141">
<div id="Num123" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
special="Num123">
<div id="Num123" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" special="Num123">
<text id="Num123_txt">123</text>
</div>
<div class="space" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
special="space" style="left:69">
<div class="space" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" special="space" style="left:69">
<text class="space_txt">Space</text>
</div>
<div class="enter" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease"
special="enter" style="left:391">
<div class="enter" onclick="onKeyboardClick" onpress="onKeyboardPress" onrelease="onKeyboardRelease" special="enter" style="left:391">
<text class="enter_txt">Go</text>
</div>
</div>
<image class="totalKeyBoardBgPng" :src="totalKeyBoardBgPngSrc"></image>
<image class="keyBoardGoPng" :src="keyBoardGoPngSrc"></image>
<image class="keyBoardGoFeedbackPng" id="id_keyBoardGoFeedbackPng" style="top:-480"
:src="keyBoardGoFeedbackPngSrc"></image>
<image class="keyBoardGoFeedbackPng" id="id_keyBoardGoFeedbackPng" style="top:-480" :src="keyBoardGoFeedbackPngSrc"></image>
<image id="id_upperOrLowerCaseAtIcon" style="top:-480" :src="upperOrLowerCaseAtIconSrc"></image>
<image id="id_backSpaceFeedbackPng" style="top:-480" :src="backSpaceFeedbackPngSrc">
</image>
......@@ -316,15 +260,18 @@
var initWifisig = undefined;
var pathflag = 1;
var initpngPath = pathflag == 1 ? "./../RE860A" : "./../re860a-v1.0";
var idtimerOutScanWifiList = null;
var scanWifiFlag = false;
var connectWifiFlag = false;
export default {
data: {
title_TEXT: "WIFI",
initWifissid: "Midea_WifiBT",
initWifipwd: "",
initencryptedMode:"",
Reminder_TEXT: "请配置SSID为Midea_WifiBT,密码为的WIFI路由器,且确保路由器能连上外网",
initWifipwd: "12345678",
initencryptedMode: "WPA",
Reminder_TEXT: "请配置SSID为Midea_WifiBT,密码为12345678的WIFI路由器,且确保路由器能连上外网",
wifiInfo_TEXT: "Midea_WifiBT",
wifiInfoWarn_TEXT: "Midea_WifiBT信号强度需要大于-38dB",
wifiInfoState_TEXT: " ",
......@@ -1140,16 +1087,9 @@
"./../RE860A/images/settings/passwordVisiable.png",
];
},
InterValTime: function () {
//console.log("=========================InterValTime====================");
wifiEventJS.connect_wifi(this.initWifissid, this.initWifipwd,this.initencryptedMode);
updateMainConnectWifiShowUI: function () {
this.$setY("id_hide", 0)
var wifiInfo = wifiEventJS.getWifiInfo(this.initWifissid);
if (wifiInfo) {
this.initWifipwd = (this.initWifipwd == "") ? "" : this.initWifipwd
......@@ -1157,37 +1097,42 @@
this.wifiInfo_TEXT = this.initWifissid + "当前信号强度:" + wifiInfo.signalLevel;
this.wifiInfoWarn_TEXT = this.initWifissid + "信号强度需要大于-38dB";
var connectStatus = wifiInfo.isConnected;
// this.wifiInfoState_TEXT = connectStatus ? "WIFI测试成功" : "WIFI测试失败"
// this.wifiInfoState_TEXT = connectStatus ? "WIFI测试成功" : "WIFI测试失败"
this.$setTextColor("wifiInfoState_TEXT", connectStatus ? "#ff0000" : "#000000");
//console.log("SSID: " + wifiInfo.ssid);
//console.log("Signal Level: " + wifiInfo.signalLevel + " dBm");
//console.log("Is Encrypted: " + (wifiInfo.isEncrypted ? "Yes" : "No"));
//console.log("Is Connected: " + (wifiInfo.isConnected ? "WIFI测试成功" : "WIFI测试失败"));
console.log("SSID: " + wifiInfo.ssid);
console.log("Signal Level: " + wifiInfo.signalLevel + " dBm");
console.log("Is Encrypted: " + (wifiInfo.isEncrypted ? "Yes" : "No"));
console.log("Is Connected: " + (wifiInfo.isConnected ? "WIFI测试成功" : "WIFI测试失败"));
if (wifiInfo.isConnected) {
if (wifiInfo.signalLevel > -38) {
//console.log("okok");
console.log("okok");
this.$setY("id_yes", 0);
this.wifiInfoState_TEXT ="WIFI测试成功"
this.wifiInfoState_TEXT = "WIFI测试成功"
return;
} else {
//console.log("no");
console.log("no");
this.$setY("id_yes", -480);
// this.wifiInfoState_TEXT = connectStatus + "但是信号强度需要大于-38dB"
}
//成功
}
else {
this.$setY("id_yes", -480);
}
} else {
//console.log("No WiFi information available.");
console.log("No WiFi information available.");
}
this.wifiInfoState_TEXT ="WIFI测试失败"
this.wifiInfoState_TEXT = "WIFI测试失败"
},
InterValTime: function () {
console.log("=========================InterValTime====================");
// wifiEventJS.connect_wifi(this.initWifissid, this.initWifipwd, this.initencryptedMode);
this.goToConnectWifi();
},
onShow: function () {
......@@ -1197,8 +1142,9 @@
this.$setOpacity("id_hide", 0.5)
document.setAttribute('id_enableWLANPageList', 'list-set-edge-flash', false);
wifiEventJS.connect_wifi(this.initWifissid, this.initWifipwd,this.initencryptedMode);
// wifiEventJS.enableWLANSwitch();
// wifiEventJS.connect_wifi(this.initWifissid, this.initWifipwd, this.initencryptedMode);
this.goToConnectWifi();
// wifiEventJS.enableWLANSwitch();
this.testTimer = this.$setTimeout(this.InterValTime, 5000, [], this);
if (this.firstLoadInit == 1) {
......@@ -1217,7 +1163,7 @@
this.refreshTimeFormatFlag(this.timeFormatFlag);
this.refreshTimeValue();
require("factory_testAtuo.js").atuoFactoryTest("factoryTestWifi");
require("factory_testAtuo.js").atuoFactoryTest("factoryTestWifi");
},
onReady: function () {
......@@ -1237,8 +1183,8 @@
this.setPickPara("setTimePicker12Minute", 40, 26);
this.setPickPara("setTimePickerAMPM", 40, 26);
var process = require("@system.process")
if (process.platform == "win32") {
var process = require("@system.process")
if (process.platform == "win32") {
globalThat.$FontPath = "./../re860a-v1.0/GothamMedium.ttf";
} else {
globalThat.$FontPath = "./../RE860A/GothamMedium.ttf";
......@@ -1252,20 +1198,20 @@
// this.proxy = new InstallationGeneralSettingProxy(this);
// this.mounted = true;
//}
////console.log("this.proxy=" + this.proxy);
//console.log("this.proxy=" + this.proxy);
////console.log("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'''''''''''''''''''''''''''''''''''''''''''''''''");
//console.log("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'''''''''''''''''''''''''''''''''''''''''''''''''");
//this.proxy.emit("onInstallationEnableWLANSwitch");
// document.setAttribute('id_dateTimeBasicPageList', 'list-set-edge-flash', false)
},
onHide: function () {
//console.log(this.$uri + "===========onHide=============");
console.log(this.$uri + "===========onHide=============");
this.clearTimer();
},
onQuit: function () {
//console.log(this.$uri + "===========onQuit=============");
console.log(this.$uri + "===========onQuit=============");
this.clearTimer();
},
clearTimer: function () {
......@@ -1277,7 +1223,7 @@
touchedYesButton: function (node, topNode, x, y) {
globalThis.factoryTest.wifi = 1;
var yesJumpPage = require("factoryYesJumpPage.js");
//console.log("=====yesJumpPage.yesGoToNextPage(factoryTestWifi);")
console.log("=====yesJumpPage.yesGoToNextPage(factoryTestWifi);")
yesJumpPage.yesGoToNextPage("factoryTestWifi");
},
touchedNGButton: function (node, topNode, x, y) {
......@@ -1292,8 +1238,9 @@
});
},
touchedscanWifiList: function (node, topNode, x, y) {
//console.log("================touchedscanWifiList===============");
wifiEventJS.enableWLANSwitch();
console.log("================touchedscanWifiList===============");
// wifiEventJS.enableWLANSwitch();
this.scanWifiList();
factoryDivPageJump.movePage("id_enableWLANChooseOnDiv");
},
//touchedStartScanWifiButton: function (node, topNode, x, y) {
......@@ -1304,14 +1251,14 @@
// wifiEventJS.enableWLANSwitch();
//},
hideShowConnectbutton: function (option) {
//console.log("hideShowConnectbutton option=" + option);
console.log("hideShowConnectbutton option=" + option);
switch (option) {
case 0:
//console.log("id_startscanWifiHide --> 0");
console.log("id_startscanWifiHide --> 0");
this.$setY("id_startscanWifiHide", 0)
break;
case 1:
//console.log("id_startscanWifiHide -->1");
console.log("id_startscanWifiHide -->1");
this.$setY("id_startscanWifiHide", -480)
break;
default:
......@@ -1320,48 +1267,100 @@
},
touchedStartScanWifiButton: function (node, topNode, x, y) {
//console.log("touchedStartScanWifiButton");
//console.log("====================================================");
console.log("touchedStartScanWifiButton");
console.log("====================================================");
this.goToConnectWifi();
},
preInitMainConnectWifiShowUI: function () {
this.initWifipwd = (this.initWifipwd == "") ? "" : this.initWifipwd
this.Reminder_TEXT = "请配置SSID为" + this.initWifissid + "密码为" + this.initWifipwd + "的WIFI路由器,且确保路由器能连上外网";
this.wifiInfo_TEXT = this.initWifissid + "当前信号强度:";
this.wifiInfoWarn_TEXT = this.initWifissid + "信号强度需要大于-38dB";
this.wifiInfoState_TEXT = " ";
},
goToConnectWifi: function () {
console.log("re goToConnectWifi");
if (connectWifiFlag) return; // 正在连接,直接忽略
connectWifiFlag = true; // 上锁
this.preInitMainConnectWifiShowUI();
this.hideShowConnectbutton(0);
wifiEventJS.connect_wifi(this.initWifissid, this.initWifipwd,this.initencryptedMode);
wifiEventJS.enableWLANScanValue();
wifiEventJS.connect_wifi(this.initWifissid, this.initWifipwd, this.initencryptedMode);
setTimeout(() => {
this.hideShowConnectbutton(1);
this.updateMainConnectWifiShowUI();
connectWifiFlag = false; // 解锁,允许再次点击
}, 5000);
},
hideShowConnectListbutton: function (option) {
//console.log("hideShowConnectbutton option=" + option);
console.log("hideShowConnectbutton option=" + option);
switch (option) {
case 0:
//console.log("id_startscanWifi_List_hide --> 0");
console.log("id_startscanWifi_List_hide --> 0");
this.$setY("id_startscanWifi_List_hide", 0)
break;
case 1:
//console.log("id_startscanWifi_List_hide -->1");
console.log("id_startscanWifi_List_hide -->1");
this.$setY("id_startscanWifi_List_hide", -480)
break;
default:
break;
}
},
noclickBuntton: function (node, topNode, x, y) {
},
touchedStartScanWifiDetailsButton: function (node, topNode, x, y) {
//console.log("========touchedStartScanWifiDetailsButton=======");
this.hideShowConnectListbutton(0)
wifiEventJS.enableWLANSwitch();
// scanWifiList: function () {
// if (scanWifiFlag == true)
// return;
// if (idtimerOutScanWifiList != null) {
// clearTimeout(idtimerOutScanWifiList);
// idtimerOutScanWifiList = null;
// }
// idtimerOutScanWifiList = setTimeout(() => {
// var scanWifiFlag = true;
// console.log("========scanWifiList=======");
// this.hideShowConnectListbutton(0)
// wifiEventJS.enableWLANSwitch();
// setTimeout(() => {
// this.hideShowConnectListbutton(1);
// scanWifiFlag = false;
// }, 5000);
// }, 100);
// },
scanWifiList: function () {
if (scanWifiFlag) return; // 正在扫描中,直接忽略
scanWifiFlag = true; // 上锁
this.hideShowConnectListbutton(0); // 显示“扫描中”遮罩
// 5 秒后无论结果如何都结束
setTimeout(() => {
this.hideShowConnectListbutton(1);
this.hideShowConnectListbutton(1); // 放开按钮
scanWifiFlag = false; // 解锁,允许下一次
}, 5000);
wifiEventJS.enableWLANSwitch(); // 真正开始扫描
},
touchedStartScanWifiDetailsButton: function (node, topNode, x, y) {
console.log("========touchedStartScanWifiDetailsButton=======");
this.scanWifiList();
},
touchedDetailsBackButton: function (node, topNode, x, y) {
//console.log("========touchedDetailsBackButton=======");
console.log("========touchedDetailsBackButton=======");
factoryDivPageJump.movePage("wifiHmoe");
},
touchedStartScanWifiDetailsInputPasswordButton: function (node, topNode, x, y) {
//console.log("========touchedStartScanWifiDetailsInputPasswordButton=======");
console.log("========touchedStartScanWifiDetailsInputPasswordButton=======");
//wifiEventJS.enableWLANSwitch();
factoryDivPageJump.movePage("wifiHmoe");
var factory_testWifi = require("factory_testWifi.js");
......@@ -1370,7 +1369,7 @@
},
touchedDetailsBackInputPasswordButton: function (node, topNode, x, y) {
//console.log("========touchedDetailsBackInputPasswordButton=======");
console.log("========touchedDetailsBackInputPasswordButton=======");
factoryDivPageJump.movePage("id_enableWLANChooseOnDiv");
},
......@@ -1475,7 +1474,7 @@
break;
}
default: {
//console.log("id is not defined!");
console.log("id is not defined!");
break;
}
}
......@@ -1610,20 +1609,20 @@
},
chooseLanguagePickSelVal: function (node, value) {
//console.log("choosed language=" + value);
console.log("choosed language=" + value);
this.chooseLanguagePickSel = value;
// userData.languageChooseFlag = value;
},
chooseCountryPickSelVal: function (node, value) {
//console.log("choosed country=" + value);
console.log("choosed country=" + value);
this.chooseCountryPickSel = value;
// userData.countryChooseValue = value;
},
chooseTimeZonePickSelVal: function (node, value) {
//console.log("choosed timeZone=" + value);
console.log("choosed timeZone=" + value);
this.chooseTimeZonePickSel = value;
// userData.timeZoneChooseValue = value;
},
......@@ -1634,7 +1633,7 @@
var yearNum = userData.setTime.setYear;
var monthNum = userData.setTime.setMonth;
var maxDayNum = this.checkMonthToMaxDay(yearNum, monthNum);
//console.log("maxDayNum=" + maxDayNum);
console.log("maxDayNum=" + maxDayNum);
switch (maxDayNum) {
case 28: {
this.setTimePickerDayOpt = this.setTimePickerDayOptMax28;
......@@ -1661,7 +1660,7 @@
break;
}
default: {
//console.log("This month day is error!");
console.log("This month day is error!");
break;
}
}
......@@ -1672,10 +1671,10 @@
var maxDay = 0;
if (yeatValue % 4 == 0 && yeatValue % 100 != 0 || yeatValue % 400 == 0) {
leapOrCommonFlag = 1;
//console.log("This year is a leap year!")
console.log("This year is a leap year!")
} else {
leapOrCommonFlag = 0;
//console.log("This year is a common year!")
console.log("This year is a common year!")
}
switch (monthValue) {
case 1: { }
......@@ -1704,7 +1703,7 @@
break;
}
default:
//console.log("This year num is error!");
console.log("This year num is error!");
break;
}
return maxDay;
......@@ -1749,9 +1748,9 @@
} else {
this.setTimePickerDaySel = dayNum - 1;
}
//console.log("this.setTimePickerYearSel=" + this.setTimePickerYearSel);
//console.log("this.setTimePickerMonthSel=" + this.setTimePickerMonthSel);
//console.log("this.setTimePickerDaySel=" + this.setTimePickerDaySel);
console.log("this.setTimePickerYearSel=" + this.setTimePickerYearSel);
console.log("this.setTimePickerMonthSel=" + this.setTimePickerMonthSel);
console.log("this.setTimePickerDaySel=" + this.setTimePickerDaySel);
},
loadToSet12HTimeValuePage: function () {
......@@ -1800,33 +1799,33 @@
this.setTimePickerYearSel = value;
userData.setTime.setYear = this.setTimePickerYearSel + 2020;
this.setDayOpt();
//console.log("this.setTimePickerYearSel=" + this.setTimePickerYearSel);
//console.log("year val=" + userData.setTime.setYear);
console.log("this.setTimePickerYearSel=" + this.setTimePickerYearSel);
console.log("year val=" + userData.setTime.setYear);
},
setTimePickerMonthVal: function (node, value) {
this.setTimePickerMonthSel = value;
userData.setTime.setMonth = this.setTimePickerMonthSel + 1;
this.setDayOpt();
//console.log("this.setTimePickerMonthSel=" + this.setTimePickerMonthSel);
//console.log("month val=" + userData.setTime.setMonth);
console.log("this.setTimePickerMonthSel=" + this.setTimePickerMonthSel);
console.log("month val=" + userData.setTime.setMonth);
},
setTimePickerDayVal: function (node, value) {
var fixValue = 0;
if (value >= this.setTimePickerDayOpt.length) {
//console.log("This is a error value=" + value);
//console.log("in setTimePickerDayVal functions value is error!");
console.log("This is a error value=" + value);
console.log("in setTimePickerDayVal functions value is error!");
fixValue = this.setTimePickerDayOpt.length - 1;
this.setTimePickerDaySel = fixValue - 1;
//console.log("After fix ,this value=" + fixValue);
console.log("After fix ,this value=" + fixValue);
this.setTimePickerDaySel = fixValue;
} else {
this.setTimePickerDaySel = value;
}
userData.setTime.setDay = this.setTimePickerDaySel + 1;
//console.log("this.setTimePickerDaySel=" + this.setTimePickerDaySel);
//console.log("day val=" + userData.setTime.setDay);
console.log("this.setTimePickerDaySel=" + this.setTimePickerDaySel);
console.log("day val=" + userData.setTime.setDay);
},
setTimePicker24HourVal: function (node, value) {
......@@ -1837,8 +1836,8 @@
} else {
userData.AMPMFlag = 1;
}
//console.log("this.setTimePicker24HourSel=" + this.setTimePicker24HourSel);
//console.log("hour val=" + userData.setTime.setHour);
console.log("this.setTimePicker24HourSel=" + this.setTimePicker24HourSel);
console.log("hour val=" + userData.setTime.setHour);
},
setTimePicker12HourVal: function (node, value) {
......@@ -1856,23 +1855,23 @@
}
}
userData.setTime.setHour = hourValue;
//console.log("this.setTimePicker12HourSel=" + this.setTimePicker12HourSel);
//console.log("hour val=" + userData.setTime.setHour);
console.log("this.setTimePicker12HourSel=" + this.setTimePicker12HourSel);
console.log("hour val=" + userData.setTime.setHour);
},
setTimePickerMinuteVal: function (node, value) {
this.setTimePickerMinuteSel = value;
userData.setTime.setMinute = this.setTimePickerMinuteSel;
//console.log("this.setTimePickerMinuteSel=" + this.setTimePickerMinuteSel);
//console.log("minute val=" + userData.setTime.setMinute);
console.log("this.setTimePickerMinuteSel=" + this.setTimePickerMinuteSel);
console.log("minute val=" + userData.setTime.setMinute);
},
setTimePickerAMPMVal: function (node, value) {
this.setTimePickerAMPMSel = value;
userData.AMPMFlag = this.setTimePickerAMPMSel;
//console.log("this.setTimePickerAMPMSel=" + this.setTimePickerAMPMSel);
//console.log("AMPM val=" + userData.AMPMFlag);
//console.log("userData.setTime.setHour=" + userData.setTime.setHour);
console.log("this.setTimePickerAMPMSel=" + this.setTimePickerAMPMSel);
console.log("AMPM val=" + userData.AMPMFlag);
console.log("userData.setTime.setHour=" + userData.setTime.setHour);
},
leftAreaButtonClick: function (node, topnode, x, y) {
......@@ -1887,7 +1886,7 @@
var special = node.attributes.special;
if (special) {
// //console.log("special=" + special);
// console.log("special=" + special);
if (special == "backspace") {
if (this.output.length >= 1) {
this.output = this.output.slice(0, -1);
......@@ -1918,8 +1917,8 @@
if (this.output.length > 18) { //设置一个最大的范围,最多输入多少位? 暂时设置最多18位
return;
}
//console.log("special=" + special);
//console.log("this.letterOrSOrBSymbolFlag=" + this.letterOrSOrBSymbolFlag);
console.log("special=" + special);
console.log("this.letterOrSOrBSymbolFlag=" + this.letterOrSOrBSymbolFlag);
if (ch) {
this.output += this.keyBoardValueArray[this.letterOrSOrBSymbolFlag][ch];
this.invisiableOutput += "`";
......@@ -1933,7 +1932,7 @@
this.invisiableOutput += "`";
}
if (special == "enter" && this.output.length >= 8) {
//console.log("send onInstallationGeneralSettingConnectWifi signal!");
console.log("send onInstallationGeneralSettingConnectWifi signal!");
factoryDivPageJump.movePage("wifiHmoe");
var factory_testWifi = require("factory_testWifi.js");
......@@ -1944,7 +1943,7 @@
}
}
//console.log("this.output=" + this.output);
console.log("this.output=" + this.output);
if (this.input_id == "username") {
document.setAttribute("username", "text", this.output)
this.username = this.output;
......@@ -1974,8 +1973,8 @@
// this.setOpacity(node, 0.5)
var ch = node.attributes.value;
var special = node.attributes.special;
//console.log("ch=" + ch);
//console.log("special=" + special);
console.log("ch=" + ch);
console.log("special=" + special);
if (this.output.length < 8 && special == "enter") {
//this.$setY("id_hide", 0)
......@@ -2003,7 +2002,7 @@
this.$setY("id_normalKeyboardPng", setPngY);
var normalPngName = "./images/settings/keyboardSlices/" + this.concatenationFieldName[this
.letterOrSOrBSymbolFlag] + "LineFeedback" + ch + ".png";
//console.log("normalPngName=" + normalPngName);
console.log("normalPngName=" + normalPngName);
this.normalKeyboardPngSrc = normalPngName;
}
......@@ -2074,19 +2073,19 @@
windowWlanButtonBoxClick: function (node, topNode, x, y) {
//console.log("send onWindowWlanButtonBoxClick signal!");
console.log("send onWindowWlanButtonBoxClick signal!");
// //this.proxy.emit("onInstallationWindowWlanButtonBoxClick");
//this.evenSimu("onWindowButtonBoxClick")
},
windowWlanButtonCancelBoxClick: function (node, topNode, x, y) {
//console.log("send onInstallationWindowWlanButtonCancelBoxClick signal!");
console.log("send onInstallationWindowWlanButtonCancelBoxClick signal!");
// //this.proxy.emit("onInstallationWindowWlanButtonCancelBoxClick");
// this.evenSimu("onWindowWlanButtonCancelBoxClick")
},
enableCancelAtiveWLANClick: function (node, topNode, x, y) {
//console.log("send onEnableCancelAtiveWLANClick signal!");
console.log("send onEnableCancelAtiveWLANClick signal!");
////this.proxy.emit("onEnableCancelAtiveWLANClick");
// this.evenSimu("onEnableWLANSwitchClick")
......@@ -2106,7 +2105,7 @@
gotoCountrySetPageClick: function (node, topNode, x, y) {
//this.proxy.emit("onInstallationGeneralSettingGotoCountrySetPageClick");
//this.evenSimu("onGeneralSettingGotoCountrySetPageClick")
//console.log("send onInstallationGeneralSettingGotoCountrySetPageClick signal!");
console.log("send onInstallationGeneralSettingGotoCountrySetPageClick signal!");
},
chooseCountryBackClick: function (node, topNode, x, y) {
......@@ -2115,20 +2114,20 @@
}
//this.proxy.emit("onChooseCountryBackClick");
// this.evenSimu("onCountrySetConfirmButtonClick")
//console.log("send onChooseCountryBackClick signal!");
console.log("send onChooseCountryBackClick signal!");
},
countrySetConfirmButtonClick: function (node, topNode, x, y) {
//this.proxy.emit("onInstallationCountrySetConfirmButtonClick");
// this.evenSimu("onCountrySetConfirmButtonClick")
//console.log("send onInstallationCountrySetConfirmButtonClick signal!");
console.log("send onInstallationCountrySetConfirmButtonClick signal!");
},
backToWirelessNetworkBasicPage: function (node, topNode, x, y) {
if (x > 120) {
return;
}
//console.log("send onBackToWirelessNetworkBasicPage signal!");
console.log("send onBackToWirelessNetworkBasicPage signal!");
//this.proxy.emit("onBackToWirelessNetworkBasicPage");
},
......@@ -2138,18 +2137,18 @@
}
//this.proxy.emit("onChooseTimeZoneBackClick");
// this.evenSimu("onTimeZoneSetConfirmButtonClick")
//console.log("send onChooseTimeZoneBackClick signal!");
console.log("send onChooseTimeZoneBackClick signal!");
},
timeZoneSetConfirmButtonClick: function (node, topNode, x, y) {
//this.proxy.emit("onInstallationTimeZoneSetConfirmButtonClick");
// this.evenSimu("onTimeZoneSetConfirmButtonClick")
//console.log("send onInstallationTimeZoneSetConfirmButtonClick signal!");
console.log("send onInstallationTimeZoneSetConfirmButtonClick signal!");
},
gotoTimeZoneSetPageClick: function (node, topNode, x, y) {
//this.proxy.emit("onInstallationGeneralSettingGotoTimeZoneSetPageClick");
//this.evenSimu("onInstallationGeneralSettingGotoTimeZoneSetPageClick")
//console.log("send onInstallationGeneralSettingGotoTimeZoneSetPageClick signal!");
console.log("send onInstallationGeneralSettingGotoTimeZoneSetPageClick signal!");
},
refreshDateTimePage: function (dateFlag, timeFlag) {
if (dateFlag == 0) {
......@@ -2195,7 +2194,7 @@
},
gotoSetDateFormatPage: function () {
//console.log("run gotoSetDateFormatPage function!");
console.log("run gotoSetDateFormatPage function!");
this.showDateFormatFlag = 1 - this.showDateFormatFlag;
this.showTimeFormatFlag = 0;
this.refreshDateTimePage(this.showDateFormatFlag, this.showTimeFormatFlag);
......@@ -2203,7 +2202,7 @@
gotoSetDateValuePage: function () {
this.loadToSetDateValuePage();
//console.log("send onInstallationOnGotoGeneralSettingSetDateValuePage signal!");
console.log("send onInstallationOnGotoGeneralSettingSetDateValuePage signal!");
//this.proxy.emit("onInstallationOnGotoGeneralSettingSetDateValuePage");
this.evenSimu("onInstallationGotoGeneralSettingSetDateValuePage")
......@@ -2212,17 +2211,17 @@
backToDateTimePageClick: function (node, topNode, x, y) {
// this.saveDateValue();
//this.proxy.emit("onBackToDateTimePageClick");
//console.log("send onBackToDateTimePageClick signal!");
console.log("send onBackToDateTimePageClick signal!");
},
dateSetConfirmButtonClick: function (node, topNode, x, y) {
// this.saveDateValue();
//this.proxy.emit("onInstallationDateSetConfirmButtonClick");
this.evenSimu("onInstallationDateSetConfirmButtonClick")
//console.log("send onInstallationDateSetConfirmButtonClick signal!");
console.log("send onInstallationDateSetConfirmButtonClick signal!");
},
evenSimu: function (emitName, value) {
//console.log("{evenSimu}emitName=" + emitName + " value=" + value)
console.log("{evenSimu}emitName=" + emitName + " value=" + value)
switch (emitName) {
case "onInstallationGotoGeneralSettingSetDateValuePage": {
this.$setY(this.activePage, -480);
......@@ -2269,7 +2268,7 @@
break;
}
default: {
//console.log("undefined emitName:" + emitName);
console.log("undefined emitName:" + emitName);
break;
}
}
......@@ -2278,18 +2277,18 @@
// this.saveTimeValue();
//this.proxy.emit("installationOnTimeSetConfirmButtonClick");
this.evenSimu("installationOnTimeSetConfirmButtonClick")
//console.log("send installationOnTimeSetConfirmButtonClick signal!");
console.log("send installationOnTimeSetConfirmButtonClick signal!");
},
setTime24HConfirmButtonClick: function (node, topNode, x, y) {
// this.saveTimeValue();
//this.proxy.emit("installationOnTimeSetConfirmButtonClick");
this.evenSimu("installationOnTimeSetConfirmButtonClick")
//console.log("send installationOnTimeSetConfirmButtonClick signal!");
console.log("send installationOnTimeSetConfirmButtonClick signal!");
},
gotoSetTimeFormatPage: function () {
//console.log("run gotoSetTimeFormatPage function!");
console.log("run gotoSetTimeFormatPage function!");
this.showDateFormatFlag = 0;
this.showTimeFormatFlag = 1 - this.showTimeFormatFlag;
......@@ -2302,7 +2301,7 @@
} else if (userData.timeFormatFlag == 1) {
this.loadToSet24HTimeValuePage();
}
//console.log("send onInstallationOnGotoSetTimeValuePage signal!");
console.log("send onInstallationOnGotoSetTimeValuePage signal!");
//this.proxy.emit("onInstallationOnGotoSetTimeValuePage");
this.evenSimu("onInstallationOnGotoSetTimeValuePage")
},
......@@ -2319,15 +2318,15 @@
},
clickDateTimeList: function (node, topNode, x, y) {
// //console.log(x);
// //console.log(y);
// console.log(x);
// console.log(y);
var id = this.$eval(topNode, "id")
//console.log("clicked id=" + id);
console.log("clicked id=" + id);
if (id == undefined) {
return;
}
var clickValue = Number(id.replace("id_dateTimeListAreaCover", ""));
//console.log("clickValue=" + clickValue);
console.log("clickValue=" + clickValue);
if (Number.isNaN(clickValue)) {
return;
}
......@@ -2379,7 +2378,7 @@
}
break;
default:
//console.log("clickDateTimeList clickValue error!");
console.log("clickDateTimeList clickValue error!");
break;
}
},
......@@ -2393,11 +2392,11 @@
return '0' + num.toString();
} else {
// 如果是小于0或三位数以上的数,这里可以根据需要处理
//console.log('Number is not within expected range');
console.log('Number is not within expected range');
}
},
chooseDateFormatClick: function (node, topNode, x, y) {
//console.log("send onChooseDateFormatClick signal!");
console.log("send onChooseDateFormatClick signal!");
//this.proxy.emit("onChooseDateFormatClick");
this.evenSimu("onChooseDateFormatClick")
},
......@@ -2443,7 +2442,7 @@
return '0' + num.toString();
} else {
// 如果是小于0或三位数以上的数,这里可以根据需要处理
//console.log('Number is not within expected range');
console.log('Number is not within expected range');
}
},
......@@ -2455,9 +2454,9 @@
this.dateMonth = userData.time.month;
this.dateDay = userData.time.day;
//console.log("show userData.time.year " + userData.time.year);
//console.log("show userData.time.month " + userData.time.month);
//console.log("show userData.time.day " + userData.time.day);
console.log("show userData.time.year " + userData.time.year);
console.log("show userData.time.month " + userData.time.month);
console.log("show userData.time.day " + userData.time.day);
if (this.dateFormatFlag == 0) {
......@@ -2467,13 +2466,13 @@
this.crtDateValue = this.padNumberWithZero(this.dateDay) + "-" + this.padNumberWithZero(this
.dateMonth) + "-" + this.dateYear;
}
//console.log(this.crtDateValue);
console.log(this.crtDateValue);
},
saveDateTimeToRTC: function () {
var process = require("@system.process");
if (process.platform == "win32") {
//console.log("process.platform == win32,can't run so function!Please retry on Linux board!");
console.log("process.platform == win32,can't run so function!Please retry on Linux board!");
} else {
librtc.ctrl("set", {
year: userData.setTime.setYear,
......@@ -2515,8 +2514,8 @@
userData.setTime.setHour = hourValue;
userData.time.hour = userData.setTime.setHour;
userData.time.minute = userData.setTime.setMinute;
//console.log("userData.time.hour=" + userData.time.hour);
//console.log("userData.setTime.setHour=" + userData.setTime.setHour);
console.log("userData.time.hour=" + userData.time.hour);
console.log("userData.setTime.setHour=" + userData.setTime.setHour);
this.refreshTimeValue();
this.saveDateTimeToRTC();
},
......@@ -2565,14 +2564,14 @@
this.crtTimeValue = this.padNumberWithZero(this.timeHour) + ":" + this.padNumberWithZero(this
.timeMinute);
}
//console.log(+this.crtTimeValue);
console.log(+this.crtTimeValue);
},
dateOverturnSetConfirmButtonClick: function (node, topNode, x, y) {
// this.saveDateValue();
//this.proxy.emit("onInstallationOnDateOverturnSetConfirmButtonClick");
this.evenSimu("onInstallationOnDateOverturnSetConfirmButtonClick")
//console.log("send onInstallationOnDateOverturnSetConfirmButtonClick signal!");
console.log("send onInstallationOnDateOverturnSetConfirmButtonClick signal!");
},
......@@ -2641,8 +2640,8 @@
gotoGeneralSettingsDateTimePage: function () {
this.refreshDateValue();
this.refreshTimeValue();
//console.log("====================================test date time picker value=========================================");
//console.log("send onInstallationGotoGeneralSettingsDateTimePage signal!");
console.log("====================================test date time picker value=========================================");
console.log("send onInstallationGotoGeneralSettingsDateTimePage signal!");
//this.proxy.emit("onInstallationGotoGeneralSettingsDateTimePage");
// this.evenSimu("onGotoGeneralSettingsDateTimePage");
},
......@@ -3718,7 +3717,8 @@
color: #ffffff;
background-color: transparent;
}
.fontsize16 {
.fontsize16 {
font-size: 16;
text-align: center;
text-overflow: ellipsis;
......
......@@ -228,7 +228,7 @@
yesJumpPage.testCode(this)
require("factory_testAtuo.js").initMianPage(this);
},
initShow: function () {
this.snShow();
......@@ -260,6 +260,7 @@
//console.log("wifiEventJS.enableWLANScanValue()================================================1");
if (onestart) {
var wifiEventJS = require("factory_testWifi.js");
if(globalThis.factoryTest.wifi != 0)
wifiEventJS.enableWLANScanValue();
//console.log("wifiEventJS.enableWLANScanValue()================================================2");
onestart = 0;
......
......@@ -110,7 +110,7 @@ function parseWifiScanResults(output) {
} else if (!flags.includes('[ESS]')) {
encryptedMode = 'Unknown'; // 非开放网络但未识别类型
}
// console.debug("ssid:" + ssid + " signalLevel:" + signalLevel + " isEncrypted:" + isEncrypted + " encryptedMode:" + encryptedMode);
// console.debug("ssid:" + ssid + " signalLevel:" + signalLevel + " isEncrypted:" + isEncrypted + " encryptedMode:" + encryptedMode);
results.push({
ssid: ssid || '', // 如果 SSID 为空,则设为空字符串
signalLevel: signalLevel,
......@@ -138,14 +138,14 @@ function parseWifiScanResults(output) {
function onGotoWlanEnterPasswordPageEvent(value, signal, encrypted) {
//console.log("receive onGotoWlanEnterPasswordPage singal!");
console.log("receive onGotoWlanEnterPasswordPage singal!");
// var activePage = that.activePage;
that.crtTitleWlanEnterPasswordText = value; //刷新标题
that.crtTitleWlanConnectingText = value;
connectWifiSSID = value;
signalLevel = signal;
_encryptedMode = encrypted;
//console.log("==========signalLevel :" + signalLevel + "connectWifiSSID :" + connectWifiSSID + "=======");
console.log("==========signalLevel :" + signalLevel + "connectWifiSSID :" + connectWifiSSID + "=======");
that.crtEnterPasswordShowText = "";
that.crtEnterPasswordShowInvisiableText = "";
that.output = ""; //每次从外面进入页面时,还原已经输入的字符
......@@ -157,7 +157,7 @@ function onGotoWlanEnterPasswordPageEvent(value, signal, encrypted) {
// function connect_wifi(ssid, psk) {
function connect_wifi(ssid, psk, mode) {
//console.log("===============connect_wifi: " + ssid + "===psk: " + psk + "===mode: " + mode);
console.log("===============connect_wifi: " + ssid + "===psk: " + psk + "===mode: " + mode);
writeWpaConf.set(ssid, psk, mode)
systemCtrl.executeSystemCommand("/tmp/wlanInit.sh &") //重启wifi连接
return
......@@ -184,7 +184,7 @@ function connect_wifi(ssid, psk, mode) {
// }
// else {
//console.log("ssid: " + ssid + "psk " + psk + "mode " + mode);
console.log("ssid: " + ssid + "psk " + psk + "mode " + mode);
// writeWpaConf.set(ssid, psk, mode)
// systemCtrl.executeSystemCommand("/tmp/wlanInit.sh &") //重启wifi连接
// // return
......@@ -203,7 +203,7 @@ function diConnectWifi() {
}
function WifiNoActive() {
//console.log("=====WifiNoActive=====");
console.log("=====WifiNoActive=====");
userData.wlanSsid = null;
userData.wlanSignalLevel = 0;
......@@ -217,7 +217,7 @@ function WifiNoActive() {
systemCtrl.executeSystemCommand("ifconfig wlan0 down")
}
function refreshWifiList(wifi_list) {
function scanRefreshWifiList(wifi_list) {
var enableWLANListItemSearchDiv = document.getElementById('id_enableWLANListItemSearchDiv')
......@@ -231,7 +231,7 @@ function refreshWifiList(wifi_list) {
width: 420,
}, enableWLANListItemSearchDiv)
}
//console.log("=====refreshWifiListlog=====1");
console.log("=====refreshWifiListlog=====1");
// if (wifi_list_div) {
// wifi_div.removeChild(wifi_list_div)
// }
......@@ -242,7 +242,7 @@ function refreshWifiList(wifi_list) {
width: 420,
"background-color": "#000000",
}, wifi_div)
//console.log("=====refreshWifiListlog=====2");
console.log("=====refreshWifiListlog=====2");
var top = 0;
for (var i = 0; i < wifi_list.length; i++) {
// if (wifi_list[i].ssid == userData.wlanSsid) {
......@@ -252,7 +252,7 @@ function refreshWifiList(wifi_list) {
var signalLevel = wifi_list[i].signalLevel
var isEncrypted = wifi_list[i].isEncrypted
var encryptedMode = wifi_list[i].encryptedMode
//console.log("========ssid:" + ssid + " signalLevel:" + signalLevel + " isEncrypted:" + isEncrypted + " encryptedMode:" + encryptedMode + "=====")
console.log("========ssid:" + ssid + " signalLevel:" + signalLevel + " isEncrypted:" + isEncrypted + " encryptedMode:" + encryptedMode + "=====")
if (ssid.length == 0)
continue
......@@ -304,9 +304,9 @@ function refreshWifiList(wifi_list) {
onclick: function (node, topNode, x, y) {
// node.attributes.text = "selected";
// systemCtrl.executeSystemCommand("/mnt/app/quicknode/shell/eAplay.sh /mnt/app/voice_click.wav");
//console.log("node.attributes.text = " + this.attributes.text + " node.attributes.signalValue = " + this.attributes.signalValue);
//console.log("click wlan_list_item"); //需要添加一个点击事件
//console.log("this.attributes.ssid = " + this.attributes.ssid);
console.log("node.attributes.text = " + this.attributes.text + " node.attributes.signalValue = " + this.attributes.signalValue);
console.log("click wlan_list_item"); //需要添加一个点击事件
console.log("this.attributes.ssid = " + this.attributes.ssid);
onGotoWlanEnterPasswordPageEvent(this.attributes.ssid, this.attributes.signalValue, this.attributes.encryptedMode);
// proxy.emit("onGotoWlanEnterPasswordPage", this.attributes.text, this.attributes.signalValue);
}
......@@ -345,24 +345,25 @@ function refreshWifiList(wifi_list) {
wifi_list_div.setAttribute('height', top)
wifi_div.setAttribute('height', top)
//console.log("top=", top)
console.log("top=", top)
// that.$setHeight("id_enableWLANListItemTemplate",top);
}
function enableWLANSwitch() {
//console.log("Is @@@@@@@@@@@@@@@@@@@@@@@@@@#3333333")
console.log("Is @@@@@@@@@@@@@@@@@@@@@@@@@@#3333333")
// if (!userData.enableWLANSwitchFlag) {
// return;
// }
var process = require("@system.process")
if (process.platform == "win32") {
//console.log("its win32.")
console.log("its win32.")
return;
}
console.log("resultsWifiList:")
if (resultsWifiList && oneFlag) {
refreshWifiList(resultsWifiList)
scanRefreshWifiList(resultsWifiList)
oneFlag = 0;
}
......@@ -372,11 +373,14 @@ function enableWLANSwitch() {
systemCtrl.executeSystemCommand("wpa_cli -p /tmp/wpa_supplicant/sockets scan_results > /tmp/scan_result.txt")
var content = fs.read("/tmp/scan_result.txt", "r")
//console.log("====================content")
console.log("====================content")
if (content) {
resultsWifiList = parseWifiScanResults(content)
//console.log(JSON.stringify(resultsWifiList))
refreshWifiList(resultsWifiList)
var listScanValue = parseWifiScanResults(content)
if (listScanValue.length > 0) {
resultsWifiList = listScanValue;
console.log(JSON.stringify(resultsWifiList))
scanRefreshWifiList(resultsWifiList)
}
}
}, 5000)
......@@ -386,30 +390,32 @@ function enableWLANSwitch() {
function getWifiInfo(ssid) {
//console.log("getWifiInfo called with SSID: " + ssid);
console.log("getWifiInfo called with SSID: " + ssid);
if (!resultsWifiList) {
//console.log("resultsWifiList is not available.");
console.log("resultsWifiList is not available.");
return null; // 如果 resultsWifiList 为空,则返回 null
}
// console.log("!!GET resultsWifiList: " + resultsWifiList);
// 遍历 resultsWifiList 查找指定 SSID
let foundWifi = null;
for (let i = 0; i < resultsWifiList.length; i++) {
if (resultsWifiList[i].ssid === ssid) {
//console.log("Found SSID: " + ssid);
console.log("Found SSID: " + ssid);
foundWifi = resultsWifiList[i];
break;
}
}
if (!foundWifi) {
//console.log("SSID not found: " + ssid);
console.log("SSID not found: " + ssid);
return {
ssid: ssid,
signalLevel: null, // 信号强度为空
isEncrypted: null, // 加密状态为空
isConnected: false // 未连接
};
} else {
console.log("Found WiFi: " + JSON.stringify(foundWifi));
}
// 检查当前 WiFi 状态
......@@ -445,9 +451,9 @@ function getWifiInfo(ssid) {
function onInstallationGeneralSettingConnectWifi(value) {
//console.log("receive onInstallationGeneralSettingConnectWifi singal!");
console.log("receive onInstallationGeneralSettingConnectWifi singal!");
//console.log("Send cmd to connect wifi,connecting...");
console.log("Send cmd to connect wifi,connecting...");
if (value != undefined) {
connectWifiPassword = value;
......@@ -463,7 +469,7 @@ function onInstallationGeneralSettingConnectWifi(value) {
var passWordBytes = Array.from(passWordCode, char => char.charCodeAt(0));
var passWordHexString = passWordBytes.map(byte => byte.toString(16).padStart(2, '0')).join('|');
cmdStr += passWordHexString + "|";
//console.log("aaaaaaaaaaaaaaaaaaaaaaaa==================")
console.log("aaaaaaaaaaaaaaaaaaaaaaaa==================")
var msdk6ACmdArr = cloudComSerial.serialMsdkCmdArrayPack(0x6A, cmdStr);
cloudComSerial.sendCmd(msdk6ACmdArr);
......@@ -476,13 +482,13 @@ function onInstallationGeneralSettingConnectWifi(value) {
connectingWifiTimer = setInterval(function () {
var dotContext = ["", ".", "..", "..."];
// console.debug("================test=============")
// console.debug("================test=============")
if (connectingState == 0) {
connectTimeout++;
} else {
connectTimeout = 0;
//console.log("wifi connect success!");
console.log("wifi connect success!");
setAreaButtonDivOn();
......@@ -497,7 +503,7 @@ function onInstallationGeneralSettingConnectWifi(value) {
}
if (connectTimeout > 60) {
//console.log("wifi connect timeout!");
console.log("wifi connect timeout!");
setAreaButtonDivOn();
WifiNoActive();
......@@ -512,9 +518,9 @@ function onInstallationGeneralSettingConnectWifi(value) {
//使用wpa模式去连wifi
connectWifiByWpa(connectWifiSSID, connectWifiPassword, function (result) {
if (result == 0) {
//console.log("Connect wifi success");
console.log("Connect wifi success");
setTimeout(() => {
// console.debug("Will send 0xF3 request to msdk");
// console.debug("Will send 0xF3 request to msdk");
//向msdk发送0xF3请求联网命令
var msdk17CmdArr = cloudComSerial.serialMsdkCmdArrayPack(0xF3, "01")
cloudComSerial.sendCmd(msdk17CmdArr);
......@@ -523,7 +529,7 @@ function onInstallationGeneralSettingConnectWifi(value) {
connectingState = 1
// gotoConnectSuccessPage()
} else {
//console.log("Connect wifi failed");
console.log("Connect wifi failed");
//跳转失败页面
connectTimeout = 70
// gotoConnectFailedPage()
......@@ -539,28 +545,33 @@ function ConnectWifi(value) {
var ssid = connectWifiSSID;
var pwd = value;
var encrypte = _encryptedMode;
// //console.log("ConnectWifi: " + ssid + "pwd: " + pwd + "encrypte: " + encrypte);
// console.log("ConnectWifi: " + ssid + "pwd: " + pwd + "encrypte: " + encrypte);
// var factory_wifi = require("factory_wifi.js");
// factory_wifi.testWifiConnect(ssid, pwd);
// connect_wifi(ssid,pwd);
that.initWifissid = ssid;
that.initWifipwd = pwd;
that.initencryptedMode = encrypte;
// //console.log("that.initWifissid: " + that.initWifissid + "that.initWifipwd: " + that.initWifipwd + "that.initencryptedMode: " + that.initencryptedMode);
// console.log("that.initWifissid: " + that.initWifissid + "that.initWifipwd: " + that.initWifipwd + "that.initencryptedMode: " + that.initencryptedMode);
that.InterValTime();
// //console.log("===================ConnectWifi: " + that.initWifissid + "--pwd: " + that.initWifipwd);
// console.log("===================ConnectWifi: " + that.initWifissid + "--pwd: " + that.initWifipwd);
}
function enableWLANScanValue() {
//console.log("Is @@@@@@@@@@@@@@@@@@@@@@@@@@#3333333")
console.log("Is @@@@@@@@@@@@@@@@@@@@@@@@@@#3333333")
// if (!userData.enableWLANSwitchFlag) {
// return;
// }
var process = require("@system.process")
if (process.platform == "win32") {
//console.log("its win32.")
console.log("its win32.")
return;
}
console.log("resultsWifiList:")
if (resultsWifiList && oneFlag) {
scanRefreshWifiList(resultsWifiList)
oneFlag = 0;
}
systemCtrl.executeSystemCommand("rm -fr /tmp/scan_result.txt")
systemCtrl.executeSystemCommand("wpa_cli -p /tmp/wpa_supplicant/sockets scan")
......@@ -569,13 +580,22 @@ function enableWLANScanValue() {
systemCtrl.executeSystemCommand("wpa_cli -p /tmp/wpa_supplicant/sockets scan_results > /tmp/scan_result.txt")
var content = fs.read("/tmp/scan_result.txt", "r")
if (content) {
resultsWifiList = parseWifiScanResults(content)
//console.log(JSON.stringify(resultsWifiList))
var listScanValue = parseWifiScanResults(content)
if (listScanValue.length > 0) {
resultsWifiList = listScanValue;
console.log(JSON.stringify(resultsWifiList))
}
// resultsWifiList = parseWifiScanResults(content)
// console.log(JSON.stringify(resultsWifiList))
// refreshWifiList(resultsWifiList)
}
}, 5000)
}
//touchedStartScanWifiDetailsButton 点击开始扫描
//touchedscanWifiList 进入wifi列表页面
module.exports = {
enableWLANSwitch: enableWLANSwitch,
connect_wifi: connect_wifi,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment