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

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

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