Created
March 18, 2018 13:12
-
-
Save macdylan/88885e4cc031525d046bb7baa9a5680b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drawQr: function(content) { | |
var that = this, | |
scale = 750/500, | |
w = this.sysinfo.windowWidth / scale; | |
qr.api.draw(content, "qrcode", w, w, function (ctx) { | |
setTimeout(function () { | |
wx.canvasToTempFilePath({ | |
canvasId: ctx.canvasId, | |
success: res => { | |
that.setData({ | |
qrSrc: res.tempFilePath, | |
}); | |
setTimeout(function() { | |
// that.qrShowing = false; | |
that.animation | |
.rotate(10).step() | |
.rotate(25).step() | |
.rotate(0).top("-550rpx").step({ duration: 250 }); | |
that.setData({qrAnimation: that.animation.export()}); | |
}, 1000); | |
} | |
}) | |
}, 500); | |
}); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment