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>
|
);
|
}
|