標籤:usb 單位 style baseurl http color anim 網路 print
var http = mm("do_Http"); http.method = "POST"; // GET | POST http.timeout = 10000; // 逾時時間 : 單位 毫秒 http.contentType = "application/x-www-form-urlencoded"; // Content-Type http.url = baseUrl; http.body = "name=" + encodeURI(textf1.text) + "&pwd=" + textf2.text; deviceone.print(http.url) http.on("success", function(data) { deviceone.print(JSON.stringify(data)); nf.toast("登入成功"); do_DataCache.saveData("loginer", data); do_App.closePage(); do_App.openPage({ source : "source://view/index.ui", statusBarState : "transparent", animationType : "push_r2l" }); }); http.on("fail", function(data) { deviceone.print(JSON.stringify(data)); if (data.status == 404) { nf.toast("使用者名稱或密碼錯誤"); } else { nf.toast("網路問題"); } logbtn.animate(animLogB); logbtn.text = "登入"; logbtn.enabled = true; probar1.visible = false; textf1.enabled = true; textf2.enabled = true; }); http.request();
baseUrl = "http://192.168.1.75/yz_ws/WebServiceHb.asmx/CheckUser";
doviceone- http組件進行webservice的POST請求