weapp-qrcode 在github搜索weapp-qrcode 在dist文件夹下下载weapp.qrcode.min.js文件 创建小程序片段 接着将weapp.qrcode.min.js文件拷贝到小程序目录下面 然后打开小程序的png.js文件,在顶部导入weapp.qrcode.min.js文件 先在 wxml 文件中,创建绘制的 canvas,并定义好 width, height, canvasId 。 然后在png.js文件中调用qrcode方法生成二维码,text属性就说二维码的内容,如下图所示 然后运行小程序就出来啦 weapp.qrcode 配置 参考网址 在github搜索weapp-qrcode 这个就是所需要的工具 在dist文件夹下下载weapp.qrcode.min.js文件 创建小程序片段 接着将weapp.qrcode.min.js文件拷贝到小程序目录下面 然后打开小程序的png.js文件,在顶部导入weapp.qrcode.min.js文件