get-location.wxml 1.0 KB

1234567891011121314151617181920212223242526272829
  1. <import src="../../../common/head.wxml" />
  2. <import src="../../../common/foot.wxml" />
  3. <view class="container page" data-weui-theme="{{theme}}">
  4. <template is="head" data="{{title: 'getLocation'}}"/>
  5. <view class="page-body">
  6. <view class="page-section">
  7. <view class="page-body-info">
  8. <text class="page-body-text-small">当前位置经纬度</text>
  9. <block wx:if="{{hasLocation === false}}">
  10. <text class="page-body-text">未获取</text>
  11. </block>
  12. <block wx:if="{{hasLocation === true}}">
  13. <view class="page-body-text-location">
  14. <text>E: {{location.longitude[0]}}°{{location.longitude[1]}}′</text>
  15. <text>N: {{location.latitude[0]}}°{{location.latitude[1]}}′</text>
  16. </view>
  17. </block>
  18. </view>
  19. <view class="btn-area">
  20. <button type="primary" bindtap="getLocation">获取位置</button>
  21. <button bindtap="clear">清空</button>
  22. </view>
  23. </view>
  24. </view>
  25. <template is="foot" />
  26. </view>