zjk
2026-03-06 5fecade82826a1689236afdb7d8ea47ce84f5871
Merge branch 'dev' into develop
1个文件已修改
70 ■■■■■ 已修改文件
src/pages/robotaxi/home/index.tsx 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/robotaxi/home/index.tsx
@@ -546,7 +546,9 @@
  };
  // 返回当前位置
  const toOrigin = () => {
  const toOrigin = async () => {
    const ok = await ensureNetwork();
    if (!ok) return;
    shouldIgnoreRegionChange.current = false;
    isReturningToOrigin.current = true;
    setMapScale(14);
@@ -760,7 +762,29 @@
    setShowCustomerService(false);
  };
  const openService = () => {
  const ensureNetwork = async () => {
    try {
      const res = await Taro.getNetworkType();
      if (res?.networkType === 'none') {
        Taro.showToast({
          title: '网络未链接',
          icon: 'none'
        });
        return false;
      }
      return true;
    } catch (e) {
      Taro.showToast({
        title: '网络未链接',
        icon: 'none'
      });
      return false;
    }
  };
  const openService = async () => {
    const ok = await ensureNetwork();
    if (!ok) return;
    const phoneNumber = Taro.getStorageSync('customerServicePhone');
    Taro.makePhoneCall({
      phoneNumber,
@@ -778,7 +802,9 @@
    })
  }
  const toSeleteSitePage = (type: string, isToMapStart: boolean) => {
  const toSeleteSitePage = async (type: string, isToMapStart: boolean) => {
    const ok = await ensureNetwork();
    if (!ok) return;
    if (isLocationAuthDenied) {
      Taro.showToast({
        title: '请先开启定位权限',
@@ -813,13 +839,17 @@
    })
  }
  const toSeleteCityPage = () => {
  const toSeleteCityPage = async () => {
    const ok = await ensureNetwork();
    if (!ok) return;
    Taro.navigateTo({
      url: '/robotaxi/pages/select-city/index',
    })
  }
  const toOrderDetail = () => {
  const toOrderDetail = async () => {
    const ok = await ensureNetwork();
    if (!ok) return;
    Taro.navigateTo({
      url: '/robotaxi/pages/begin-route/index',
    })
@@ -828,7 +858,9 @@
  const toBeginRoute = () => {
  }
  const toCoupon = () => {
  const toCoupon = async () => {
    const ok = await ensureNetwork();
    if (!ok) return;
    if (isLogin) {
      jumpTo({ url: '/pages/user/login?hideBack=1' });
      return
@@ -842,7 +874,9 @@
    })
  }
  const toOrder = () => {
  const toOrder = async () => {
    const ok = await ensureNetwork();
    if (!ok) return;
    if (isLogin) {
      jumpTo({ url: '/pages/user/login?hideBack=1' });
      return
@@ -856,12 +890,16 @@
    })
  }
  const handleBannerClick = (item: any) => {
  const handleBannerClick = async (item: any) => {
    const ok = await ensureNetwork();
    if (!ok) return;
    handleBannerJump(item);
  }
  // 查看运营区域
  const handleViewOperatingArea = async () => {
    const ok = await ensureNetwork();
    if (!ok) return;
    if (!selectedCity?.code) {
      Taro.showToast({
        title: '此城市暂未开通运营区域',
@@ -922,10 +960,18 @@
    return !(showPrivacyBox || showLocationBox || showMaintainBox || showOperatingBox);
  }
  const toAgreementPage = () => {
  const toAgreementPage = async () => {
    const ok = await ensureNetwork();
    if (!ok) return;
    Taro.navigateTo({
      url: '/robotaxi/pages/agreement-page/index',
    })
  }
  const toLogin = async () => {
    const ok = await ensureNetwork();
    if (!ok) return;
    jumpTo({ url: '/pages/user/login?hideBack=1' });
  }
  return (
@@ -939,7 +985,7 @@
        polygons={polygons}
        showLocation={!!longitude}
        onRegionChange={handleRegionChange}
        style={{ width: '100%', height: '80vh', flex: 'none' }}
        style={{ width: '100%', height: '85vh', flex: 'none' }}
      >
        {/* 选择城市 */}
        <View onClick={toSeleteCityPage} className="select-city">
@@ -1117,9 +1163,7 @@
        <View className={`login-bar ${isLogin ? '' : 'hide'}`}>
          <View className='text'>立即登录,即可体验Robotaxi行程服务</View>
          <View className='more'
            onClick={() => {
              jumpTo({ url: '/pages/user/login?hideBack=1' });
            }}
            onClick={toLogin}
          >
            <Button className='more-btn'>立即登录</Button>
            <Image src={`${CDN}/common/arrow-white-new.png`} className='more-icon'></Image>