小程序接口

微信小程序比起WEB来虽然能力上受到一些限制,但也具备WEB没用的原生能力,下面罗列一些常用的原生接口,具体查看小程序官方文档

wx.getDeviceInfo(); log($r)

wx.getSystemInfoSync(); log($r)wx.getSystemInfo({ success: func("log($arg[0])") })

wx.showActionSheet({ itemList: ["A", "B", "C"], success: func("log($arg[0].tapIndex)") })

wx.downloadFile({ url: "https://a.zccdn.cn/l/6344dce1f18cdeb21c08615f.pdf", success: func("wx.openDocument({ filePath: $arg[0].tempFilePath })") })

wx.showNavigationBarLoading()wx.hideNavigationBarLoading()

wx.startPullDownRefresh()wx.stopPullDownRefresh()

wx.scanCode({ success: func("log($arg[0])") })

wx.sendSms({ phoneNumber: $c.me.phone, content: "xxxxxxxx" })

wx.vibrateShort({ type: "heavy" })

wx.vibrateLong()

Make in ZC APP Platform