Files
ttstd_family_care_miniapp/pages/map/index.wxml
T

49 lines
1.6 KiB
Plaintext

<view class="map-page">
<view class="info-card">
<view class="title-row">
<text class="title">设备位置</text>
<view class="badge {{located ? 'ok' : ''}}">
{{loading ? '获取中' : located ? '已定位' : '暂无定位'}}
</view>
</view>
<block wx:if="{{located}}">
<text class="meta">{{deviceSn}} · 更新于 {{lastTime}}</text>
<view class="address-row">
<text class="address">{{address}}</text>
<text class="copy" bindtap="onCopyAddress">复制</text>
</view>
<text wx:if="{{detail}}" class="detail">{{detail}}</text>
</block>
<text wx:elif="{{!loading}}" class="reason">{{reason}}</text>
<text wx:else class="reason">正在获取最新定位…</text>
</view>
<view class="map-box">
<!-- 详情页允许拖动缩放;首页预览仍需保持 map-mask 禁手势 -->
<map
wx:if="{{located}}"
class="map"
longitude="{{longitude}}"
latitude="{{latitude}}"
markers="{{markers}}"
scale="17"
show-location="{{false}}"
enable-scroll="{{true}}"
enable-zoom="{{true}}"
enable-rotate="{{false}}"
enable-overlooking="{{true}}"
bindmarkertap="onCalloutTap"
></map>
<view wx:else class="empty-map">
<text class="empty-icon">📍</text>
<text class="empty-text">{{loading ? '正在获取定位…' : (reason || '暂无有效定位')}}</text>
</view>
</view>
<view class="actions">
<view class="btn primary" bindtap="onOpenNavigation">打开地图导航</view>
<view class="btn" bindtap="onRefresh">刷新定位</view>
</view>
</view>