欧美三级国产三级日韩三级_亚洲熟妇丰满大屁股熟妇_欧美亚洲成人一区二区三区_国产精品久久久久久模特

微信小程序入門案例——指南針 - 新聞資訊 - 云南小程序開發(fā)|云南軟件開發(fā)|云南網(wǎng)站建設-昆明葵宇信息科技有限公司

159-8711-8523

云南網(wǎng)建設/小程序開發(fā)/軟件開發(fā)

知識

不管是網(wǎng)站,軟件還是小程序,都要直接或間接能為您產(chǎn)生價值,我們在追求其視覺表現(xiàn)的同時,更側重于功能的便捷,營銷的便利,運營的高效,讓網(wǎng)站成為營銷工具,讓軟件能切實提升企業(yè)內(nèi)部管理水平和效率。優(yōu)秀的程序為后期升級提供便捷的支持!

您當前位置>首頁 » 新聞資訊 » 小程序相關 >

微信小程序入門案例——指南針

發(fā)表時間:2020-10-13

發(fā)布人:葵宇科技

瀏覽次數(shù):78

微信小程序入門案例——指南針

涉及技術:獲取地理位置、監(jiān)聽指南針角度

目錄結構:

pages\index\index.js

Page({

  /**
   * 頁面的初始數(shù)據(jù)
   */
  data: {
    rotate:0,
    degree:'未知',
    direction:'',
    lat:0,
    lon:0,
    alt:0
  },

  /**
   * 生命周期函數(shù)--監(jiān)聽頁面加載
   */
 ><view class="container">
  <image src="/images/1.jpg" mode="widthFix" style="transform:rotate({{rotate}}deg);"></image>
  <view class="status">
    <text class="bigTxt">{{degree}}°{{direction}}</text>
    <text class="smallTxt">北緯{{lat}}東經(jīng){{lon}}</text>
    <text class="smallTxt">海拔{{alt}}米</text>
  </view>
</view>

pages\index\index.wxss

.container{
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  color: #A46248;
}
image{
  width: 80%;
}
.status{
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bigTxt{
  font-size: 30pt;
  margin: 15rpx;
}
.smallTxt{
  font-size: 20pt;
  margin: 15rpx;
}

app.js

App({

  /**
   * 當小程序初始化完成時,會觸發(fā)>