86 lines
2.7 KiB
Plaintext
86 lines
2.7 KiB
Plaintext
<page-layout id="page-layout" title="一起去兜风">
|
||
<view class="screen walk-screen">
|
||
<view class="map-box">
|
||
<map
|
||
id="walk-map"
|
||
latitude="{{latitude}}"
|
||
longitude="{{longitude}}"
|
||
scale="16"
|
||
show-location="{{walk!=null}}"
|
||
polyline="{{polyline}}"
|
||
style="width: 100%; height: 100%"
|
||
/>
|
||
<view class="map-tag">
|
||
{{walk?walk.status==='active'?'记录中':'已暂停':'等待出发'}}
|
||
</view>
|
||
</view>
|
||
<view class="card session">
|
||
<view class="eyebrow">{{walk?'快乐进行时':'出门走走吧'}}</view>
|
||
<view class="session-title">
|
||
{{walk?'跟它们一起探索':'选择今天同行的狗狗'}}
|
||
</view>
|
||
<view class="stats">
|
||
<view>
|
||
<strong>{{duration}}</strong>
|
||
<text>时长</text>
|
||
</view>
|
||
<view>
|
||
<strong>{{distance}}</strong>
|
||
<text>公里</text>
|
||
</view>
|
||
<view>
|
||
<strong>{{points.length}}</strong>
|
||
<text>足迹</text>
|
||
</view>
|
||
</view>
|
||
<view class="picker-title">同行伙伴 · 可多选</view>
|
||
<pet-picker
|
||
pets="{{pets}}"
|
||
selected="{{walk?walk.pet_ids:selected}}"
|
||
disabled="{{walk!==null}}"
|
||
bind:change="pick"
|
||
/>
|
||
<view wx:if="{{!pets.length}}" class="empty">
|
||
到「宠物」添加同行的狗狗,再一起出发吧
|
||
</view>
|
||
<button
|
||
wx:if="{{!walk||walk.status==='finished'}}"
|
||
class="primary main-button"
|
||
bindtap="start"
|
||
disabled="{{busy}}"
|
||
>
|
||
开始遛狗 →
|
||
</button>
|
||
<view wx:else class="actions">
|
||
<button
|
||
class="secondary"
|
||
data-kind="{{walk.status==='active'?'pause':'resume'}}"
|
||
bindtap="action"
|
||
disabled="{{busy}}"
|
||
>
|
||
{{walk.status==='active'?'暂停':'继续'}}
|
||
</button>
|
||
<button class="primary" data-kind="finish" bindtap="action" disabled="{{busy}}">
|
||
结束遛狗
|
||
</button>
|
||
</view>
|
||
<view wx:if="{{walk&&walk.status!=='finished'}}" class="share-row">
|
||
<view>
|
||
<strong>分享实时位置</strong>
|
||
<text>打开后可分享给朋友,结束遛狗会自动关闭</text>
|
||
</view>
|
||
<switch color="#278465" checked="{{share}}" bindchange="shareChange" />
|
||
</view>
|
||
<button wx:if="{{share}}" class="share-button" open-type="share">
|
||
发给朋友看位置 ↗
|
||
</button>
|
||
<view wx:if="{{locationError}}" class="location-error" bindtap="point">{{locationError}} · 点击重试</view>
|
||
</view>
|
||
<button class="records-button" bindtap="records">查看最近的脚印 ›</button>
|
||
<view class="privacy">
|
||
只有你主动打开分享时,朋友才能查看位置。保持小程序打开,位置才会持续更新。
|
||
</view>
|
||
</view>
|
||
</page-layout>
|
||
<tab-bar current="/pages/walk/walk" />
|