越烽建设集团有限公司网站,赣州网站建设资讯,网站建设询价报告,网络技术服务合同1.问题描述
Scan Kit扫描专用底层码流接口需要鉴权#xff0c;鉴权失败后功能还能用吗#xff1f;
解决方案
如果已经申请过白名单#xff0c;因为异常导致的鉴权失败会优先放通#xff0c;保障业务成功。
2.问题描述
调用Scan Kit扫描专用底层码流接口会不会将二维码…1.问题描述
Scan Kit扫描专用底层码流接口需要鉴权鉴权失败后功能还能用吗
解决方案
如果已经申请过白名单因为异常导致的鉴权失败会优先放通保障业务成功。
2.问题描述
调用Scan Kit扫描专用底层码流接口会不会将二维码直接解出来
解决方案
不会解析用户数据Scan Kit接口只会检测二维码的位置不会尝试去解码。
3.问题描述
自定义扫码界面的时候相机显示的画面变型如何获取到一个合适的分辨率不变形
解决方案
请参考文档https://developer.huawei.com/consumer/cn/codelabsPortal/carddetails/tutorials_ScanKit-Codelab-Clientdemo-ArkTS。可通过监听组件onAreaChange方法获取手机屏幕宽高您可以根据实际情况按百分比进行设计。 关键代码示例
Column() {
XComponent({
id: componentId,
type: surface,
controller: this.mXComponentController
})
.onLoad(async () {
hilog.info(0x0001, TAG, onLoad is called);
// 获取XComponent组件的surfaceId
this.surfaceId this.mXComponentController.getXComponentSurfaceId();
hilog.info(0x0001, TAG, surfaceId: %{public}s, this.surfaceId)
let viewControl: customScan.ViewControl {
width: this.cameraWidth,
height: this.cameraHeight,
surfaceId: this.surfaceId
};
// 扫码结果放置到回调中处理
try {
customScan.start(viewControl, this.callback);
this.isFlashLightEnable true;
} catch (error) {
hilog.error(0x0001, TAG, start fail, error: %{public}s, JSON.stringify(error));
}
})
// XComponent宽、高、位置偏移量默认使用单位vp
.width(this.cameraWidth)
.height(this.cameraHeight)
.position({ x: this.cameraOffsetX, y: this.cameraOffsetY })
}
.height(100%)
.width(100%)
.onAreaChange((oldValue: Area, newValue: Area) {
// 获取当前组件宽高newValue返回width、height值单位vp计算XComponent组件大小
hilog.info(0x0001, TAG, newValue : %{public}s, , JSON.stringify(newValue));
this.calcArea(newValue.width as number, newValue.height as number);
})