|
楼主 |
发表于 2017-9-15 11:06:59
|
显示全部楼层
这是全部的js代码,看问题在哪里:
define(function(require){
var $ = require("jquery");
var justep = require("$UI/system/lib/justep");
require("cordova!cordova-plugin-sim");
var Model = function() {
this.callParent();
};
Model.prototype.modelLoad = function(event){
var imsi="abc123";
document.addEventListener("deviceready", androidOnDeviceReady, false);
function androidOnDeviceReady()
{
window.plugins.sim.getSimInfo(androidSuccessCallback, errorCallback);
}
function androidSuccessCallback(result)
{
imsi=result.subscriberId;
}
justep.Baas.sendRequest(
{
"url":"/hxzc/Jvyggh",
"action":"dlyzaction",
"async":false,
"params":{"imsi":imsi},
"success":function(data)
{
if(data.bs=="部门人员")
{
alert("欢迎登陆!!")
justep.Shell.showPage(require.toUrl("./main.w"));
// justep.Shell.closePage(require.toUrl("./index.w"));
};
if(data.bs=="不存在")
{
alert("对不起!你没有申请账号!")
justep.Shell.closePage(require.toUrl("./index.w"));
}
// data.loadData(ret);
}
})
};
return Model;
});
w文件的源码是这个:
<?xml version="1.0" encoding="utf-8"?>
<div xmlns="http://www.w3.org/1999/xhtml" component="$UI/system/components/justep/window/window" design="device:m;" xid="window" class="window">
<div component="$UI/system/components/justep/model/model" xid="model" style="top:119px;left:267px;height:auto;" onLoad="modelLoad" autoLoad="true">
<div component="$UI/system/components/justep/data/baasData" autoLoad="true" xid="baasData1" queryAction="queryYggh" saveAction="saveYggh" url="/hxzc/jvyggh" tableName="yggh" idColumn="yggh"><column label="id" name="id" type="Integer" xid="default1"></column>
<column label="ygxm" name="ygxm" type="String" xid="default2"></column>
<column label="yggh" name="yggh" type="String" xid="default3"></column>
<column label="dlma" name="dlma" type="String" xid="default4"></column>
<column label="ssdw" name="ssdw" type="String" xid="default5"></column>
<column label="zhjb" name="zhjb" type="String" xid="default6"></column>
<column label="ssbm" name="ssbm" type="String" xid="default7"></column>
<column label="ssgs" name="ssgs" type="String" xid="default8"></column>
<column label="ygzw" name="ygzw" type="String" xid="default9"></column>
<column label="yzm" name="yzm" type="String" xid="default10"></column>
<column label="sj" name="sj" type="String" xid="default11"></column>
<column label="aqxy" name="aqxy" type="String" xid="default12"></column>
<column label="zt" name="zt" type="String" xid="default13"></column>
<column label="Error" name="Error" type="String" xid="default14"></column>
<column label="Errortime" name="Errortime" type="String" xid="default15"></column>
<column label="sf" name="sf" type="String" xid="default16"></column>
<column label="appv" name="appv" type="String" xid="default17"></column>
<column label="appv1" name="appv1" type="String" xid="default18"></column>
<column label="yxmm" name="yxmm" type="String" xid="default19"></column>
<column label="imsi" name="imsi" type="String" xid="default20"></column></div></div>
<div component="$UI/system/components/justep/panel/panel"
class="x-panel x-full" xid="panel1">
<div class="x-panel-top" xid="top1">
<div component="$UI/system/components/justep/titleBar/titleBar" title="系 统 登 陆"
class="x-titlebar">
<div class="x-titlebar-left">
</div>
<div class="x-titlebar-title">系 统 登 陆</div>
<div class="x-titlebar-right reverse">
</div>
</div>
</div>
<div class="x-panel-content" xid="content1"/>
<div class="x-panel-bottom" xid="bottom1"><div component="$UI/system/components/justep/button/buttonGroup" class="btn-group x-card btn-group-justified" tabbed="true" xid="buttonGroup1" style="height:49px;"></div></div></div>
</div> |
|