微信小程序---设备信息

1.学习大纲:

2.获取系统信息:

 wx.getSystemInfo({
     success: function(res) {
       // success
       console.log(res)
     }
   })
  }

3.获取系统信息同步接口:

wx.getSystemInfoSync()

 

4.监听重力感应数据,频率:5次/秒:

wx.onAccelerometerChange(CALLBACK)

 

5.监听罗盘数据,频率:5次/秒:

wx.onCompassChange(CALLBACK)

 

6.拨打电话:

 //事件处理函数
  bindViewTap: function() {
    wx.makePhoneCall({
      phoneNumber: '15300086553',
      success: function(res) {
        // success
      }
    })
  },

 

 

 

原文地址:https://www.cnblogs.com/pengsi/p/6443569.html