Skip to content

Instantly share code, notes, and snippets.

@macdylan
Created March 18, 2018 13:12
Show Gist options
  • Save macdylan/88885e4cc031525d046bb7baa9a5680b to your computer and use it in GitHub Desktop.
Save macdylan/88885e4cc031525d046bb7baa9a5680b to your computer and use it in GitHub Desktop.
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