Browse Source

剩余米数

test
jiannibang 2 years ago
parent
commit
bde7ef55d5
  1. 4
      pages/bluetooth/index.js
  2. 3
      pages/bluetooth/index.wxml
  3. 11
      pages/bluetooth/index.wxss

4
pages/bluetooth/index.js

@ -53,6 +53,7 @@ Page({
bluetoothOpened: false, bluetoothOpened: false,
mode: "bluetooth", mode: "bluetooth",
naviData: null, naviData: null,
distance2End: null,
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -231,7 +232,7 @@ Page({
this.setState(STATES.inNav); this.setState(STATES.inNav);
this.setData({ this.setData({
showTabs: true, showTabs: true,
tab: 1,
tab: 0,
}); });
}, 1000); }, 1000);
}, },
@ -405,6 +406,7 @@ Page({
"距离区间终点距离:", "距离区间终点距离:",
distance2End / 27 distance2End / 27
); );
this.setData({ distance2End: Math.ceil(distance2End / 27) });
if (distance / 27 > 10 && this.data.state === STATES.inNav) { if (distance / 27 > 10 && this.data.state === STATES.inNav) {
this.reroute(); this.reroute();
} }

3
pages/bluetooth/index.wxml

@ -12,4 +12,5 @@
</view> </view>
<map2d mode="{{mode}}" hidden="{{!showTabs}}" floororder="{{floorOrder}}" loc="{{loc}}" searchType="{{searchType}}" bindmap="handleMap" bindpoint="handlePoint" bindexit="handleNavExit" binddistance="handleDistance"></map2d> <map2d mode="{{mode}}" hidden="{{!showTabs}}" floororder="{{floorOrder}}" loc="{{loc}}" searchType="{{searchType}}" bindmap="handleMap" bindpoint="handlePoint" bindexit="handleNavExit" binddistance="handleDistance"></map2d>
<destination wx:if="{{showTabs&&tab===1&&shop}}" shop="{{shop}}" bindexit="handleNavExit"></destination> <destination wx:if="{{showTabs&&tab===1&&shop}}" shop="{{shop}}" bindexit="handleNavExit"></destination>
<btabs wx:if="{{showTabs}}" mode="{{mode}}" floor="{{floorName}}" tab="{{tab}}" bindrelocate="handleRelocate" bindchange="handleTabChange" bindtomap="handleToMap"></btabs>
<div class="nav" wx:if="{{showTabs&&tab===0}}">剩余{{distance2End}}米</div>
<btabs wx:if="{{showTabs}}" floor="{{floorName}}" tab="{{tab}}" bindrelocate="handleRelocate" bindchange="handleTabChange" bindtomap="handleToMap"></btabs>

11
pages/bluetooth/index.wxss

@ -404,3 +404,14 @@
height: 54px; height: 54px;
pointer-events: none; pointer-events: none;
} }
.nav {
position: fixed;
height: 110px;
left: 10px;
right: 10px;
bottom: 116px;
background: #ffffff;
z-index: 12 !important;
border-radius: 18px 18px 0 0;
}

Loading…
Cancel
Save