fix(地图交互): 优化地图标记点击的跳转动画与样式
- 修改乘客须知组件样式,为内容区域添加右侧内边距
- 将地图标记点击的跳转方式从 `moveToLocation` 改为直接更新经纬度
- 添加指针跳动动画,在动画期间隐藏工具提示,600ms后显示
- 统一优化两个页面的跳转逻辑,提升用户体验
- 修正运营区域页面中的标点符号格式
| | |
| | | // 忽略因调用 moveToLocation 引起的 region change,避免重复吸附计算 |
| | | shouldIgnoreRegionChange.current = true; |
| | | |
| | | const mapCtx = Taro.createMapContext('map'); |
| | | mapCtx.moveToLocation({ |
| | | latitude: targetMarker.latitude, |
| | | longitude: targetMarker.longitude, |
| | | }); |
| | | // 先隐藏tooltip,并触发指针跳动动画 |
| | | setShowToolTip(false); |
| | | setBounce(true); |
| | | |
| | | // 直接更新经纬度实现跳转 |
| | | setLatitude(targetMarker.latitude); |
| | | setLongitude(targetMarker.longitude); |
| | | |
| | | setIsAdsorbed(true); |
| | | setCurrentSite(targetMarker); |
| | | setShowToolTip(true); |
| | | // 等待指针动画(600ms)结束后,再展示tooltip和吸附状态 |
| | | setTimeout(() => { |
| | | setBounce(false); |
| | | setIsAdsorbed(true); |
| | | setCurrentSite(targetMarker); |
| | | setShowToolTip(true); |
| | | }, 600); |
| | | } |
| | | }; |
| | | |
| | |
| | | position: relative; |
| | | margin-top: 34px; |
| | | height: 342px; |
| | | padding-right: 1em; |
| | | |
| | | .passenger-content-desc { |
| | | height: 100%; |
| | |
| | | color: #FFFFFF; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | <View className="content-desc"> |
| | | <View className="desc-item"> |
| | | <Text className="index">1.</Text> |
| | | <Text className="text">在运营时段可正常使用打车服务,非运营时段服务暂停</Text> |
| | | <Text className="text">在运营时段可正常使用打车服务,非运营时段服务暂停</Text> |
| | | </View> |
| | | <View className="desc-item"> |
| | | <Text className="index">2.</Text> |
| | | <Text className="text">各站点运营时间可能存在调整,实际运营情况请以页面实时展示为准</Text> |
| | | <Text className="text">各站点运营时间可能存在调整,实际运营情况请以页面实时展示为准</Text> |
| | | </View> |
| | | <View className="desc-item"> |
| | | <Text className="index">3.</Text> |
| | | <Text className="text">如有问题,请拨打客服热线xxxxxx</Text> |
| | | <Text className="text">如有问题,请拨打客服热线xxxxxx</Text> |
| | | </View> |
| | | </View> |
| | | </View> |
| | |
| | | |
| | | const targetMarker = markers.find(m => m.id === markerId); |
| | | if (targetMarker) { |
| | | const mapCtx = Taro.createMapContext('map'); |
| | | mapCtx.moveToLocation({ |
| | | latitude: targetMarker.latitude, |
| | | longitude: targetMarker.longitude, |
| | | }); |
| | | // 先隐藏tooltip,并触发指针跳动动画 |
| | | setShowToolTip(false); |
| | | setBounce(true); |
| | | |
| | | setSelectedSite(targetMarker); |
| | | setOutOfServiceRange(getOutOfServiceRange(isOperatingArea, targetMarker)); |
| | | // 直接更新经纬度实现跳转 |
| | | setLatitude(targetMarker.latitude); |
| | | setLongitude(targetMarker.longitude); |
| | | setShowToolTip(true); |
| | | |
| | | // 等待指针动画(600ms)结束后,再展示tooltip和吸附状态 |
| | | setTimeout(() => { |
| | | setBounce(false); |
| | | setSelectedSite(targetMarker); |
| | | setOutOfServiceRange(getOutOfServiceRange(isOperatingArea, targetMarker)); |
| | | setShowToolTip(true); |
| | | }, 600); |
| | | } |
| | | }; |
| | | |