``` tsx

interface IScanParam {
  scanType: 'qrCode'; //  'qrCode',
  // 扫描结果, needResult='1'，才有返回内容
  needResult: '0' | '1';
}

interface IScanResult {
  // 扫描结果, needResult='1'，才有返回内容
  resultStr: string; //  'https://domain.com'
}

private scan = () => {
  scanWithResult();
}

private scanWithResult = () => {
  scanWithResult().then((result) => {
    alert(result);
  }).catch((err) => {
    alert(JSON.stringify(err));
  });
}
```