hejianhao
2026-04-24 2e0dc0b0932bbba389b075f6e4dfd48eb6dc4ad9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { View } from '@tarojs/components';
 
type Props = {
  /** 是否游客态 */
  isGuest: boolean;
  /** 是否拒绝定位 */
  isLocationAuthDenied: boolean;
  /** 是否在运营区 */
  isOperatingArea: boolean;
  /** 是否维护中 */
  isMaintain: boolean;
  /** 维护动效 */
  maintainBounce: boolean;
  /** 维护恢复时间文案 */
  hotfixEndText: string;
  /** 展示隐私弹窗 */
  onShowPrivacy: () => void;
  /** 去系统设置 */
  onOpenSetting: () => void;
  /** 查看运营区域 */
  onViewOperatingArea: () => void;
  /** 初始化锚点底部偏移 */
  anchorBottom?: number;
};
 
/**
 * 地图顶部提示层。
 */
export default function MapOverlayTips(props: Props) {
  const anchorStyle = typeof props.anchorBottom === 'number'
    ? { top: 'auto', bottom: `${props.anchorBottom}px` }
    : undefined;
  return (
    <View className="content-box-top" style={anchorStyle}>
      <View className="position-box">
        {
          props.isGuest && <View className="visitor-stste ml-32">
            <View className="visitor-stste-tip">同意隐私协议体验更多约车体验</View>
            <View onClick={props.onShowPrivacy} className="visitor-stste-go">去同意</View>
          </View>
        }
        {
          props.isLocationAuthDenied && <View className="visitor-stste ml-32 mt-20">
            <View className="visitor-stste-tip">未开启位置权限,开启后即可发布行程</View>
            <View onClick={props.onOpenSetting} className="visitor-stste-go">去开启</View>
          </View>
        }
        {
          props.isMaintain && <View className={`is-maintain ml-32 ${props.maintainBounce ? 'maintain-bounce' : ''}`}>系统维护中,预计{props.hotfixEndText || '-:-'}恢复服务</View>
        }
        {
          !props.isOperatingArea && <View onClick={props.onViewOperatingArea} className="is-operating-area mt-20">查看运营区域</View>
        }
      </View>
    </View>
  );
}