|
在开发过程中,出现启动就有按钮执行动作,什么情况?
W文件:
<div class="x-panel-bottom" xid="bottom1" style="font-size:small;">
<a component="$UI/system/components/justep/button/button" class="btn btn-default" xid="rescan" bind-click="doScanBle">
<i xid="i1" icon="icon-refreshing" class="icon-refreshing"/>
<span xid="span1" icon="icon-chevron-left">扫描蓝牙</span>
</a>
</div>
js文件:
};
justep.Shell.showPage(url, params);
};
//Scan Ble window
Model.prototype.doScanBle = function(event){
alert("Scan Ble");
justep.Shell.showPage('$UI/Pwm_h5/ble.w');
};
return Model;
});
2. Cordova 执行不正常,不继续也不跳过。
Model.prototype.scanBle = function(event){
alert("Scan BLE 0 ...");
if (! window.ble.isEnable()) {
alert("Scan BLE 0.1 ...");
window.ble.Enable(
function() {alert("Ble Avilible");},
function() {alert("Ble not ready");}
);
}
var dataBle = this.comp("dataBle");
alert("Scan BLE 1 ...");
window.ble.scan([], 15,
function(res) {
alert(res);
alert("Scan BLE 3 ...");
dataBle.loadData([ {
"id" : res.id,
"name" : res.name,
"rssi" : res.rssi
} ], true);
dataBle.refresh(true);
}, function(res) {
alert("error:" + JSON.stringify(res));
}
);
};
请各位大神指导。 |
|