|
@@ -127,8 +127,25 @@ const getDate = data => {
|
|
|
}
|
|
|
|
|
|
const getQRCodeUrl = (content, isShow = true) => {
|
|
|
+ console.log(content, isShow)
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- QRCode.toString(content, {
|
|
|
+ my.generateImageFromCode({
|
|
|
+ code: content,
|
|
|
+ format: 'QRCODE',
|
|
|
+ width: 100,
|
|
|
+ correctLevel: 'H',
|
|
|
+ codeColor: '#000',
|
|
|
+ backgroundColor: '#ffffff',
|
|
|
+ success: function (res) {
|
|
|
+ console.log('二维码临时路径:', res.image) // 这里是base64
|
|
|
+ resolve(res.image)
|
|
|
+ },
|
|
|
+ fail: function (err) {
|
|
|
+ console.log(err)
|
|
|
+ reject(err)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ /*QRCode.toString(content, {
|
|
|
type: 'png',
|
|
|
}, function (err, url) {
|
|
|
let str = (isShow ? 'data:image/svg+xml;base64,' : '') + Buffer(url).toString('base64');
|
|
@@ -136,7 +153,7 @@ const getQRCodeUrl = (content, isShow = true) => {
|
|
|
reject(err)
|
|
|
}
|
|
|
resolve(str)
|
|
|
- });
|
|
|
+ });*/
|
|
|
|
|
|
})
|
|
|
}
|