优化:支持控制是否显示

This commit is contained in:
iqudoo
2026-04-30 11:17:05 +08:00
parent 8ebe8b0b34
commit f3c0856506
11 changed files with 142 additions and 26 deletions

41
dist/index.d.ts vendored
View File

@@ -6,6 +6,22 @@ interface ScanConfigOptions {
* 网页扫码canvas样式
*/
webCanvasStyle?: string,
/**
* 网页扫码类型,默认支持二维码和条码
*/
webScanType?: ('qrCode' | 'barCode')[],
/**
* 网页扫码canvas是否启用默认启用
*/
webCanvasEnabled?: boolean,
/**
* 网页扫码成功提示音地址,默认使用内置提示音
*/
webScanBeepAudio?: string,
/**
* 网页扫码成功提示音是否启用,默认启用
*/
webScanBeepEnabled?: boolean,
/**
* 微信JSSDK配置微信环境才会生效配置后会自动初始化微信JSSDK
*/
@@ -14,6 +30,31 @@ interface ScanConfigOptions {
* 微信JSSDK配置API地址调用接口会带上当前页面url作为参数
*/
apiUrl: string,
/**
* 微信JSSDK配置参数不配置则自动获取
*/
sdkConfig?: {
/**
* 是否开启调试模式
*/
debug?: boolean,
/**
* 微信公众平台应用ID
*/
appId: string,
/**
* 时间戳
*/
timestamp: number,
/**
* 随机字符串
*/
nonceStr: string,
/**
* 签名
*/
signature: string,
},
/**
* 微信JSSDK配置SDK地址默认为https://res.wx.qq.com/open/js/jweixin-1.6.0.js
*/

6
dist/index.html vendored
View File

@@ -100,7 +100,11 @@
output("call ready");
hide();
var url = "https://vet.iqudoo.com/api?action=api.biz.wechat.JSSDKConfig";
initSDK({ initWechatJssdk: { apiUrl: url } }, function () {
initSDK({
webCanvasEnabled: true,
webScanBeepEnabled: true,
initWechatJssdk: { apiUrl: url }
}, function () {
IScan.setStatusListener(function (res) {
output("status", IScan.getStatus());
});

2
dist/index.js vendored

File diff suppressed because one or more lines are too long