-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathon-compass-change.wxml
More file actions
26 lines (23 loc) · 954 Bytes
/
on-compass-change.wxml
File metadata and controls
26 lines (23 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<import src="/common/head.wxml" />
<import src="/common/foot.wxml" />
<view class="container page" data-weui-theme="{{theme}}">
<template is="head" data="{{title: 'onCompassChange'}}"/>
<view class="page-body">
<view class="page-section page-section_center">
<text class="page-body-text">旋转手机即可获取方位信息</text>
<view class="direction">
<view class="bg-compass-line"></view>
<image class="bg-compass" src="compass.png" style="transform: rotate({{direction}}deg)"></image>
<view class="direction-value">
<text>{{direction}}</text>
<text class="direction-degree">o</text>
</view>
</view>
<view class="controls">
<button bindtap="startCompass" disabled="{{enabled}}">开始监听</button>
<button bindtap="stopCompass" disabled="{{!enabled}}">停止监听</button>
</view>
</view>
</view>
<template is="foot" />
</view>