提交 b77f59cf 编写于 作者: 雪洛's avatar 雪洛

fix: 修复支付宝小程序scanCode设置scanType无效的Bug #1578

上级 b2970df4
......@@ -211,11 +211,11 @@ const protocols = { // 需要做转换的 API 列表
returnValue: {
apFilePath: 'tempFilePath'
}
},
getFileInfo: {
args: {
filePath: 'apFilePath'
}
},
getFileInfo: {
args: {
filePath: 'apFilePath'
}
},
chooseVideo: {
// 支付宝小程序文档中未找到(仅在getSetting处提及),但实际可用
......@@ -306,22 +306,19 @@ const protocols = { // 需要做转换的 API 列表
scanCode: {
name: 'scan',
args (fromArgs) {
if (fromArgs.scanType === 'qrCode') {
fromArgs.type = 'qr'
return {
onlyFromCamera: 'hideAlbum'
}
} else if (fromArgs.scanType === 'barCode') {
fromArgs.type = 'bar'
return {
onlyFromCamera: 'hideAlbum'
}
} else {
return {
scanType: false,
onlyFromCamera: 'hideAlbum'
if (fromArgs.scanType) {
switch (fromArgs.scanType[0]) {
case 'qrCode':
fromArgs.type = 'qr'
break
case 'barCode':
fromArgs.type = 'bar'
break
}
}
return {
onlyFromCamera: 'hideAlbum'
}
},
returnValue: {
code: 'result'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册