fix(scan): 修复新大陆扫码广播读取条码失败
This commit is contained in:
parent
26c7085ab2
commit
63755eab5c
@ -281,7 +281,8 @@ export default {
|
|||||||
if (!self.isPageActive) return;
|
if (!self.isPageActive) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
plus.android.importClass('android.content.Intent');
|
// 广播回调里的 intent 需要按实例导入,否则 getStringExtra 不可用
|
||||||
|
plus.android.importClass(intent);
|
||||||
const scanResult = intent.getStringExtra(config.dataKey);
|
const scanResult = intent.getStringExtra(config.dataKey);
|
||||||
|
|
||||||
console.log(`${config.name}扫码结果:`, scanResult);
|
console.log(`${config.name}扫码结果:`, scanResult);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user