欧美日韩国产一区,亚洲一区视频,色综合久久久久,私密按摩师舌头伸进去了,99re6这里只有精品,夜夜性日日交xxx性hd

羅盤API

本文編輯: Flyinthesky Flyinthesky瀏覽 4891 版權(quán)所有,嚴(yán)禁轉(zhuǎn)載

接口說(shuō)明:

一個(gè)類似于指南針的接口,導(dǎo)航類APP應(yīng)用接口。

接口 說(shuō)明
wx.onCompassChange(CALLBACK) 監(jiān)聽(tīng)羅盤數(shù)據(jù),頻率:5次/秒

接口用法:

【圖片】

【代碼】

wxml

<view class="container">
  <template is="header" data="{{title: 'onCompassChange'}}"/>

  <view class="page-body">
    <view class="page-body-wrapper">
      <text class="page-body-text">旋轉(zhuǎn)手機(jī)即可獲取方位信息</text>
      <view class="direction">
        <text class="direction-value">{{direction}}</text>
        <text class="direction-degree">o</text>
      </view>
    </view>
  </view>

  <template is="footer" />
</view>

js

Page({
  data: {
    direction: 0
  },
  onReady: function () {
    var that = this
    wx.onCompassChange(function (res) {
      that.setData({
        direction: parseInt(res.direction)
      })
    })
  }
})

wxss

.direction {
  margin-top: 100rpx;
  display: flex;
}
.direction-value {
  font-size: 200rpx;
}
.direction-degree {
  font-size: 40rpx;
}

主要方法:

wx.onCompassChange(CALLBACK)

【方法內(nèi)容描述】

參數(shù) 類型 描述
direction Number 面對(duì)的方向度數(shù)
wx.onCompassChange(function (res) {
  console.log(res.direction)
})
如有技術(shù)問(wèn)題或?qū)Ρ疚挠蟹答仯?qǐng)加入QQ群:
微信小程序?qū)崙?zhàn)5營(yíng): 微信小程序Club實(shí)戰(zhàn)5營(yíng)