A頁面html
mui.ajax('http://14.50.2.49:80/default/AppLogin?Prm=' + Prm, { data: {}, //dataType: 'json', type: 'Post', timeout: 10000, success: function(data) { //var res = eval('('+data+')'); console.log(data.State + "==" + data); if(data.State == undefined) { var res = eval('(' + data + ')'); //console.log('成功1'+res.State); if(res.State == 0) { mui.toast("data.Desc:"+res.Desc); //console.log(JSON.parse(res.Data)); //console.log(res.Data); //console.log(res.Data.Uguid+"-"+res.Data.Token+"-"+res.Data.UCName+"-"+res.Data.OrgInfo.Orgguid); mui.openWindow({ url: 'mainIndex.html', id: 'mainIndex.html', extras: { UserIds:res.Data.Uguid, Tokens:res.Data.Token, UCNames:res.Data.UCName, Orgguids:res.Data.OrgInfo.Orgguid } }); } } else if(data.State == 3) { //console.log('帳戶密碼錯誤!'); mui.toast(data.Desc); } else { //console.log('登陸失敗'); mui.toast(data.Desc); } }, error: function(xhr, type, errorThrown) { mui.toast('失敗'); } });
B頁面 接收值web
mui.plusReady(function(){ //webview是個對象 var sData = plus.webview.currentWebview(); mui.toast(sData.name); //mui是選擇器 var name2 = mui('#Logname'); //注意:這裏雖然獲取的是一個id但賦值的時候也要用name2[0],這裏獲取的是一個數組 name2[0].innerHTML = sData.name; var age2 = mui('#age'); age2[0].innerHTML = sData.age; })