vue+koa实现简单的图书小程序(2)

记录一下实现我们图书的扫码功能:

https://developers.weixin.qq.com/miniprogram/dev/api/scancode.html
要多读文档

scanBook () {
wx.scanCode({
success: (res) => {
if (res.result) {
this.addBook(res.result)
}
}
})
}
就可以完成调用手机摄像头扫码的功能 到这里为止 我们如果用手机预览还是不会连接到我们本机的服务器 不会有任何的反映 因为我们还没有上线和部署 具体到本机就是启动一个获取本地图片的功能


原文地址:https://www.cnblogs.com/zhangxin123/p/9355175.html