page.js文件是写当前 page.wxml 页面的 JS 脚本文件:
示例:
//获取应用实例 const app = getApp() Page({ data: { navComOneOnOff: true, navComTwoOnOff: false, navComThrOnOff: false, }, scanclick:function(){ wx.scanCode({ success: (res) => { console.log(res) }, fail: (res) => { console.log(res) }, complete: (res) => { console.log(res) } }) } })