董国庆
2026-02-04 2541fe7e9c4ad5bdee31d794c53aaccd673b342a
Merge branch 'dev' of http://120.76.84.145:10101/gitblit/r/H5/xp-robotaxi-miniprogram into dev
2个文件已添加
2个文件已修改
120 ■■■■■ 已修改文件
src/pages/robotaxi/components/customer-service/index.less 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/robotaxi/components/customer-service/index.tsx 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/robotaxi/components/privacy-popup/index.tsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/robotaxi/home/index.tsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/robotaxi/components/customer-service/index.less
New file
@@ -0,0 +1,44 @@
.customer-service {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  .customer-service-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
  }
  .customer-service-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    background: rgba(0, 0, 0, 0.03);
    font-size: 32px;
    font-weight: normal;
    text-align: center;
    letter-spacing: normal;
    background-color: #f7f7f7;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    .phone-number {
      padding: 54px 0;
      background: #ffffff;
    }
    .cancel {
      margin-top: 20px;
      padding: 54px 0;
      background: #ffffff;
    }
  }
}
src/pages/robotaxi/components/customer-service/index.tsx
New file
@@ -0,0 +1,55 @@
import Taro from '@tarojs/taro';
import { View } from '@tarojs/components';
import { useEffect, useState } from 'react';
import './index.less';
type Props = {
  show?: boolean;
  onClose?: () => void;
}
export default function PrivacyPopup({ show = false, onClose }: Props) {
  const [visible, setVisible] = useState(false);
  const [animationData, setAnimationData] = useState<any>();
  useEffect(() => {
    if (show && !visible) {
      setVisible(true);
      const animation = Taro.createAnimation({
        duration: 300,
        timingFunction: 'ease-out'
      });
      animation.translateY(0).step();
      setAnimationData(animation.export());
    } else if (!show && visible) {
      const animation = Taro.createAnimation({
        duration: 300,
        timingFunction: 'ease-in'
      });
      animation.translateY(500).step();
      setAnimationData(animation.export());
      setTimeout(() => {
        setVisible(false);
      }, 300);
    }
  }, [show]);
  const callPhone = () => {
    Taro.makePhoneCall({
      phoneNumber: '400-800-66889',
    })
  }
  if (!visible) return null;
  return (
    <View className='customer-service' >
      <View className='customer-service-mask'></View>
      <View className='customer-service-content' animation={animationData}>
        <View onClick={callPhone} className='phone-number'>400-800-66889</View>
        <View className='cancel' onClick={onClose}>取消</View>
      </View>
    </View>
  )
}
src/pages/robotaxi/components/privacy-popup/index.tsx
@@ -50,7 +50,7 @@
  }, [isAgree]);
  const handleClose = () => {
    privicyShowManager.setHasShow(true)
    privicyShowManager.setHasShow(false)
    onClose?.();
  };
src/pages/robotaxi/home/index.tsx
@@ -3,6 +3,7 @@
import { View, Map, Text, Image } from '@tarojs/components';
import './index.less';
import PrivacyPopup from '../components/privacy-popup';
import CustomerServicePopup from '../components/customer-service';
import { AMAP_KEY } from '../../../constants/api';
import selectCityIcon from '../../../robotaxi/assets/select-city.png'
import contactService from '../../../robotaxi/assets/contact-service.png'
@@ -17,6 +18,7 @@
export default function Home() {
  const [showPrivacy, setShowPrivacy] = useState(false);
  const [showCustomerService, setShowCustomerService] = useState(false);
  const [longitude, setLongitude] = useState<number | null>(null);
  const [latitude, setLatitude] = useState<number | null>(null);
  const [showToolTip, setShowToolTip] = useState(true);
@@ -124,6 +126,14 @@
    }
  }
  const handleCloseCustomerService = () => {
    setShowCustomerService(false);
  };
  const openService = () => {
    setShowCustomerService(true);
  }
  return (
    <View className="home-container">
      <Map
@@ -131,7 +141,7 @@
        longitude={longitude ?? 113.32452}
        latitude={latitude ?? 23.099994}
        scale={14}
        showLocation
        showLocation={!!longitude}
        onRegionChange={handleRegionChange}
        style={{ width: '100%', flex: 1 }}
      >
@@ -142,7 +152,7 @@
        </View>
        {/* 地图浮层入口 */}
        <View className="map-entry">
          <Image className="map-entry-icon" src={contactService} />
          <Image onClick={openService} className="map-entry-icon" src={contactService} />
          <View className="split-line"></View>
          <Image className="map-entry-icon" src={coupon} />
          <View className="split-line"></View>
@@ -218,6 +228,11 @@
        onClose={handleClosePrivacy}
        onAgree={handleAgreePrivacy}
      />
      {/* 客服弹窗 */}
      <CustomerServicePopup
        show={showCustomerService}
        onClose={handleCloseCustomerService}
      />
    </View>
  )
}