Skip to content

Commit

Permalink
增加相册读取二维码
Browse files Browse the repository at this point in the history
  • Loading branch information
Fndroid committed Apr 15, 2018
1 parent 550aa74 commit 25d6679
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ss2surge.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,28 @@ function showResult(result) {
}

$ui.menu({
items: ['剪贴板读取链接', '扫描二维码'],
items: ['剪贴板读取链接', '扫描二维码', '相册选取二维码'],
handler: function(title, idx) {
if (idx == 0) {
let result = decodeScheme($clipboard.text)
showResult(result)
} else {
} else if (idx == 1) {
$qrcode.scan({
handler(string) {
let result = decodeScheme(string)
showResult(result)
}
})
}else {
$photo.pick({
format: "image",
handler: function(resp) {
var image = resp.image
let result = decodeScheme($qrcode.decode(image))
showResult(result)

}
})
}
}
})

0 comments on commit 25d6679

Please sign in to comment.