initScan() {
var that = this;
let _this = this;
let main = plus.android.runtimeMainActivity(); // 获取activity
var IntentFilter = plus.android.importClass('android.content.IntentFilter');
plus.android.importClass('com.nlscan.android.uhf.TagInfo');
let filter = new IntentFilter();
filter.addAction("nlscan.intent.action.uhf.ACTION_RESULT"); // 更改为你的广播动作
let receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', {
onReceive: function(context, intent) {
plus.android.importClass(intent);
let SCAN_BARCODE1 = intent.getParcelableArrayExtra("tag_info"); // 更改为你的广播标签
let epcIds = [];
for (const item of SCAN_BARCODE1) {
const epcId = item.plusGetAttribute("EpcId").join('');
epcIds.push(epcId);
}
console.log(epcIds);
}
});
main.registerReceiver(receiver, filter); // 注册广播接收器
}
// 分页查询业务
async getBusinessList(businessName, pageNo, pageSize) {
const app = getApp();
const param = {
'interfaceName': businessName,
'pageNo': pageNo,
'pageSize': pageSize
};
const res = await getApp().commonInterface('app_common_interface', param);
if (res['code'] == 0 && res['Msg'].length > 0) {
if (res['Msg'].length < this.pageSize) this.flag = false;
this.pageNo += 1;
return res['Msg'];
} else {
this.flag = false;
return [];
}
},