| | |
| | | }; |
| | | |
| | | // 返回当前位置 |
| | | const toOrigin = () => { |
| | | const toOrigin = async () => { |
| | | const ok = await ensureNetwork(); |
| | | if (!ok) return; |
| | | shouldIgnoreRegionChange.current = false; |
| | | isReturningToOrigin.current = true; |
| | | setMapScale(14); |
| | |
| | | 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, |
| | |
| | | }) |
| | | } |
| | | |
| | | 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: '请先开启定位权限', |
| | |
| | | }) |
| | | } |
| | | |
| | | 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', |
| | | }) |
| | |
| | | const toBeginRoute = () => { |
| | | } |
| | | |
| | | const toCoupon = () => { |
| | | const toCoupon = async () => { |
| | | const ok = await ensureNetwork(); |
| | | if (!ok) return; |
| | | if (isLogin) { |
| | | jumpTo({ url: '/pages/user/login?hideBack=1' }); |
| | | return |
| | |
| | | }) |
| | | } |
| | | |
| | | const toOrder = () => { |
| | | const toOrder = async () => { |
| | | const ok = await ensureNetwork(); |
| | | if (!ok) return; |
| | | if (isLogin) { |
| | | jumpTo({ url: '/pages/user/login?hideBack=1' }); |
| | | return |
| | |
| | | }) |
| | | } |
| | | |
| | | 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: '此城市暂未开通运营区域', |
| | |
| | | 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 ( |
| | |
| | | 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"> |
| | |
| | | <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> |