Browse Source

feat: 左右偏向、toast

master
jiannibang 2 years ago
parent
commit
aa2fa52096
  1. 5
      pages/index/index.js
  2. 1
      pages/index/index.wxml
  3. 33
      pages/index/index.wxss
  4. BIN
      pages/index/leftyaw.png
  5. BIN
      pages/index/rightyaw.png

5
pages/index/index.js

@ -71,6 +71,7 @@ Page({
searchType: 0, searchType: 0,
point: null, point: null,
resolution: null, resolution: null,
showBannerToast: false,
}, },
async sendArriveMsg() { async sendArriveMsg() {
try { try {
@ -540,7 +541,11 @@ Page({
this.setData({ this.setData({
showTabs: true, showTabs: true,
tab: 0, tab: 0,
showBannerToast: true,
}); });
setTimeout(() => {
this.setData({ showBannerToast: false });
}, 5000);
}, 1000); }, 1000);
}, },
exit() { exit() {

1
pages/index/index.wxml

@ -78,6 +78,7 @@
</nav> </nav>
<image wx:if="{{state===states.inNav&&leftYaw===false&&rightYaw===true}}" class="leftyaw" src="./leftyaw.png"></image> <image wx:if="{{state===states.inNav&&leftYaw===false&&rightYaw===true}}" class="leftyaw" src="./leftyaw.png"></image>
<image wx:if="{{state===states.inNav&&leftYaw===true&&rightYaw===false}}" class="rightyaw" src="./rightyaw.png"></image> <image wx:if="{{state===states.inNav&&leftYaw===true&&rightYaw===false}}" class="rightyaw" src="./rightyaw.png"></image>
<view wx:if="{{state===states.inNav&&shop&&showBannerToast}}" class="toast">您导航的终点在{{shop.floorName}},请跟随箭头前行,导航中请注意避让行人</view>
<map2d hidden="{{!(showTabs&&tab===0)}}" floororder="{{floorOrder}}" loc="{{lastLoc}}" searchType="{{searchType}}" bindmap="handleMap" bindpoint="handlePoint"></map2d> <map2d hidden="{{!(showTabs&&tab===0)}}" floororder="{{floorOrder}}" loc="{{lastLoc}}" searchType="{{searchType}}" bindmap="handleMap" bindpoint="handlePoint"></map2d>
<destination wx:if="{{showTabs&&tab===2&&shop}}" shop="{{shop}}"></destination> <destination wx:if="{{showTabs&&tab===2&&shop}}" shop="{{shop}}"></destination>
<tabs wx:if="{{showTabs}}" floor="{{floorName}}" tab="{{tab}}" bindrelocate="handleRelocate" bindchange="handleTabChange" bindtomap="handleToMap" bindtomob='handleToMap'></tabs> <tabs wx:if="{{showTabs}}" floor="{{floorName}}" tab="{{tab}}" bindrelocate="handleRelocate" bindchange="handleTabChange" bindtomap="handleToMap" bindtomob='handleToMap'></tabs>

33
pages/index/index.wxss

@ -583,23 +583,23 @@
} }
.leftyaw { .leftyaw {
position: fixed; position: fixed;
width: 100px;
height: 36px;
width: 191px;
height: 58px;
top: 0; top: 0;
bottom: 0; bottom: 0;
z-index: 11; z-index: 11;
left: 8px;
left: 4px;
margin: auto; margin: auto;
animation: pointleft 0.5s infinite ease; animation: pointleft 0.5s infinite ease;
} }
.rightyaw { .rightyaw {
position: fixed; position: fixed;
width: 100px;
height: 36px;
width: 191px;
height: 58px;
top: 0; top: 0;
bottom: 0; bottom: 0;
z-index: 11; z-index: 11;
right: 8px;
right: 4px;
margin: auto; margin: auto;
animation: pointright 0.5s infinite ease; animation: pointright 0.5s infinite ease;
} }
@ -619,3 +619,24 @@
height: 54px; height: 54px;
pointer-events: none; pointer-events: none;
} }
.toast {
position: fixed;
width: 296px;
height: 62px;
top: 128px;
left: 0;
right: 0;
z-index: 17;
padding: 10px 14px;
margin: auto;
border-radius: 12px;
background: rgba(0, 0, 0, 0.7);
backdrop-filter: blur(6px);
color: #fff;
text-align: center;
font-family: "Noto IKEA Simplified Chinese";
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 21px;
}

BIN
pages/index/leftyaw.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 19 KiB

BIN
pages/index/rightyaw.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Loading…
Cancel
Save