Merge branch 'feature/xj-730-fragrance-hv' into 'feature_v2.4.0_ui'
feat: 样式交互调整 (甄雪君)
See merge request robotaxi1/xp-robotaxi-miniprogram!195
| | |
| | | return request({ |
| | | url: _ROBOTAXI_HOST + '/vehicleConvoy/api/v1/mini-program/order/ac/set-temperature', |
| | | method: 'POST', |
| | | payload |
| | | payload, |
| | | showToast: false |
| | | }, true); |
| | | } |
| | | |
| | |
| | | return request({ |
| | | url: _ROBOTAXI_HOST + '/vehicleConvoy/api/v1/mini-program/order/airConditionerUnlock', |
| | | method: 'POST', |
| | | payload |
| | | payload, |
| | | showToast: false |
| | | }, true); |
| | | } |
| | | |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../components/toast'; |
| | | import { useCallback, useMemo, useState } from 'react'; |
| | | |
| | | /** |
| | |
| | | const chooseAndUpload = useCallback(async () => { |
| | | const remainCount = Math.max(0, options.maxCount - images.length); |
| | | if (remainCount <= 0) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: `最多可上传${options.maxCount}张图片`, |
| | | icon: 'none' |
| | | }); |
| | |
| | | import { TripStatus } from '../../../../constants/trip-status'; |
| | | import { showToast } from '../../../../components/toast'; |
| | | import useMinimumSpinLoading from './use-minimum-spin-loading'; |
| | | import TrunkConfirmPopup from './trunk-confirm-popup'; |
| | | |
| | | const LOCK_CLOSE_ICON_URL = 'https://s.xiaopeng.com/xp-fe/robot-taxi/imgs/v2/lock-close-20260726.png'; |
| | | const LOCK_OPEN_ICON_URL = 'https://s.xiaopeng.com/xp-fe/robot-taxi/imgs/v2/lock-open-20260726.png'; |
| | |
| | | }: Props) { |
| | | const [trunkStatus, setTrunkStatus] = useState(orderTrunkStatus); // 后备箱开关状态 |
| | | const [lockStatus, setLockStatus] = useState(false); // 车门开关状态 |
| | | const [trunkConfirmVisible, setTrunkConfirmVisible] = useState(false); // 后备箱开启二次确认弹窗 |
| | | const trunkPollTimerRef = useRef<any>(null); // 后备箱状态轮询定时器 |
| | | const overRoutePopupDebounceTimerRef = useRef<any>(null); // 结束行程弹窗防抖定时器 |
| | | const OVER_ROUTE_POPUP_DEBOUNCE_MS = 1000; // 结束行程弹窗点击防抖时长 |
| | |
| | | return; |
| | | } |
| | | if (doorType === 'door' && lockStatus) { |
| | | Taro.showToast({ title: '车门已解锁,请开门上车', icon: 'none' }); |
| | | showToast({ title: '车门已解锁,请开门上车', icon: 'none' }); |
| | | return; |
| | | } |
| | | |
| | | const locationPayload = await getUnlockLocationPayload(); |
| | | if (!locationPayload) { |
| | | Taro.showToast({ title: '获取定位失败,请打开定位开关', icon: 'none' }); |
| | | showToast({ title: '获取定位失败,请打开定位开关', icon: 'none' }); |
| | | return; |
| | | } |
| | | startLoading(doorType); |
| | |
| | | : !!res?.data; |
| | | if (!unlockSucceeded) { |
| | | // Taro.hideLoading(); |
| | | stopLoading(doorType); |
| | | showToast({ title: res?.msg || '解锁失败,请重试或联系客服', icon: 'fail' }); |
| | | const failMsg = res?.msg || '解锁失败,请重试或联系客服'; |
| | | stopLoading(doorType, () => { |
| | | showToast({ title: failMsg, icon: 'fail' }); |
| | | }); |
| | | return; |
| | | } |
| | | |
| | |
| | | trunkPollTimerRef.current = setTimeout(doPoll, pollInterval); |
| | | } else { |
| | | stopPolling(); |
| | | stopLoading(doorType); |
| | | // Taro.hideLoading(); |
| | | Taro.showToast({ |
| | | title: failToastText, |
| | | icon: 'none' |
| | | stopLoading(doorType, () => { |
| | | showToast({ |
| | | title: failToastText, |
| | | icon: 'none' |
| | | }); |
| | | }); |
| | | } |
| | | }; |
| | |
| | | stopPolling(); |
| | | const isOpen = !isCloseAction; |
| | | setTrunkStatus(isOpen); |
| | | stopLoading(doorType); |
| | | // Taro.hideLoading(); |
| | | Taro.showToast({ |
| | | title: successToastText, |
| | | icon: 'none' |
| | | }); |
| | | onSuccess?.(); |
| | | // Taro.hideLoading(); |
| | | stopLoading(doorType, () => { |
| | | showToast({ |
| | | title: successToastText, |
| | | icon: 'none' |
| | | }); |
| | | }); |
| | | } else { |
| | | handlePollFail('state_mismatch', value); |
| | | } |
| | |
| | | if (doorType === 'door') { |
| | | // Taro.hideLoading(); |
| | | syncDoorUnlockButtonUI(); |
| | | stopLoading(doorType); |
| | | showToast({ title: '车门已解锁', icon: 'success' }); |
| | | onSuccess?.(); |
| | | stopLoading(doorType, () => { |
| | | showToast({ title: '车门已解锁', icon: 'success' }); |
| | | }); |
| | | } |
| | | }).catch(() => { |
| | | // Taro.hideLoading(); |
| | | stopLoading(doorType); |
| | | showToast({ title: '解锁失败,请重试或联系客服', icon: 'fail' }); |
| | | stopLoading(doorType, () => { |
| | | showToast({ title: '解锁失败,请重试或联系客服', icon: 'fail' }); |
| | | }); |
| | | }); |
| | | }; |
| | | |
| | | // 点击后备箱:当前为关闭态(将执行开启)时弹二次确认,开启态(将执行关闭)直接执行 |
| | | const handleTrunkCardClick = () => { |
| | | if (loadingControlType) { |
| | | return; |
| | | } |
| | | if (!trunkStatus) { |
| | | setTrunkConfirmVisible(true); |
| | | return; |
| | | } |
| | | handleUnlock('trunk', () => setTrunkStatus(!trunkStatus)); |
| | | }; |
| | | |
| | | // 二次确认弹窗:确认开启 |
| | | const handleTrunkConfirm = () => { |
| | | setTrunkConfirmVisible(false); |
| | | handleUnlock('trunk', () => setTrunkStatus(!trunkStatus)); |
| | | }; |
| | | |
| | | // 二次确认弹窗:取消 |
| | | const handleTrunkCancel = () => { |
| | | setTrunkConfirmVisible(false); |
| | | }; |
| | | |
| | | /** 渲染带 loading 效果的控制按钮图标。 */ |
| | |
| | | |
| | | if (tripStatus === TripStatus.VehicleArrivedPickup) { |
| | | return ( |
| | | <> |
| | | <View className="car-card-arrive"> |
| | | <View className={`car-card-arrive-item ${trunkStatus && 'close-btn-item'} ${loadingControlType ? 'trip-action-bar-item-disabled' : ''}`.trim()} onClick={() => handleUnlock('trunk', () => setTrunkStatus(!trunkStatus))}> |
| | | <View className={`car-card-arrive-item ${trunkStatus && 'close-btn-item'} ${loadingControlType ? 'trip-action-bar-item-disabled' : ''}`.trim()} onClick={handleTrunkCardClick}> |
| | | <View className="car-card-arrive-item-text">后备箱</View> |
| | | <View className="car-card-arrive-item-status">{trunkStatus ? '点击关闭' : '点击打开'}</View> |
| | | {renderControlIcon('trunk', trunkStatus ? TRUNK_OPEN_ICON_URL : TRUNK_CLOSE_ICON_URL, 'car-card-arrive-item-img')} |
| | |
| | | {renderControlIcon('door', lockStatus ? LOCK_OPEN_ICON_URL : LOCK_CLOSE_ICON_URL, 'car-card-arrive-item-img')} |
| | | </View> |
| | | </View> |
| | | <TrunkConfirmPopup show={trunkConfirmVisible} onCancel={handleTrunkCancel} onConfirm={handleTrunkConfirm} /> |
| | | </> |
| | | ); |
| | | } |
| | | |
| | | if (tripStatus === TripStatus.ArrivedDestination) { |
| | | // !! 6.30修改,车端会给我们传信号,说已到达目的地,小程序就会从前往目的地这个页面流转到行程结束待支付;意思是相当于这个不会展示 |
| | | return ( |
| | | <> |
| | | <View className="car-card-reach"> |
| | | <View className="car-card-reach-text">点击按钮开车门</View> |
| | | <Image className='car-card-reach-img' src='https://s.xiaopeng.com/xp-fe/robot-taxi/imgs/door-anim.webp' /> |
| | | <View className="car-card-reach-btn"> |
| | | <View className={`car-card-reach-btn-item ${trunkStatus && 'close-btn-item'} ${loadingControlType ? 'trip-action-bar-item-disabled' : ''}`.trim()} onClick={() => handleUnlock('trunk', () => setTrunkStatus(!trunkStatus))}> |
| | | <View className={`car-card-reach-btn-item ${trunkStatus && 'close-btn-item'} ${loadingControlType ? 'trip-action-bar-item-disabled' : ''}`.trim()} onClick={handleTrunkCardClick}> |
| | | {renderControlIcon('trunk', trunkStatus ? TRUNK_OPEN_ICON_URL : TRUNK_CLOSE_ICON_URL, 'car-card-reach-btn-item-img')} |
| | | <View className="car-card-reach-btn-item-text">后备箱</View> |
| | | </View> |
| | |
| | | </View> |
| | | </View> |
| | | </View> |
| | | <TrunkConfirmPopup show={trunkConfirmVisible} onCancel={handleTrunkCancel} onConfirm={handleTrunkConfirm} /> |
| | | </> |
| | | ); |
| | | } |
| | | |
| | |
| | | import Taro from "@tarojs/taro"; |
| | | import { showToast } from '../../../../components/toast'; |
| | | import { View, Image, Text } from "@tarojs/components"; |
| | | import { useState, useEffect, useRef } from "react"; |
| | | import { submitOrderComment } from '../../../../api/begin-route'; |
| | |
| | | } |
| | | const targetOrderId = getOrderId(orderId); |
| | | if (!targetOrderId) { |
| | | Taro.showToast({ title: '订单信息缺失,无法提交评价', icon: 'none' }); |
| | | showToast({ title: '订单信息缺失,无法提交评价', icon: 'none' }); |
| | | return; |
| | | } |
| | | submitOrderComment({ |
| | |
| | | orderId: targetOrderId |
| | | }).then(() => { |
| | | setIsEvaluated(true); |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: ['收到您的评价,我们将努力提升体验', '感谢您的反馈,欢迎下次乘坐'][index - 2], |
| | | icon: 'none' |
| | | }); |
| | | }).catch(() => { |
| | | Taro.showToast({ title: '评价提交失败,请稍后重试', icon: 'none' }); |
| | | showToast({ title: '评价提交失败,请稍后重试', icon: 'none' }); |
| | | }); |
| | | }; |
| | | |
| | |
| | | showToast({ title: nextSwitchOn ? FRAGRANCE_OPEN_SUCCESS_TEXT : CLOSE_SUCCESS_TEXT, icon: 'success' }); |
| | | closePanel(); |
| | | } catch (error) { |
| | | Taro.showToast({ title: APPLY_FAIL_TEXT, icon: 'none' }); |
| | | showToast({ title: APPLY_FAIL_TEXT, icon: 'none' }); |
| | | } finally { |
| | | setApplying(false); |
| | | setApplyingChannelId(''); |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../../../components/toast'; |
| | | import { View, Image } from '@tarojs/components'; |
| | | import { useEffect, useRef, useState } from 'react'; |
| | | import { querySeatHv, setSeatHv } from '../../../../../api/seat-hv'; |
| | |
| | | : item |
| | | ))); |
| | | } catch (error) { |
| | | Taro.showToast({ title: APPLY_FAIL_TEXT, icon: 'none' }); |
| | | showToast({ title: APPLY_FAIL_TEXT, icon: 'none' }); |
| | | } finally { |
| | | setApplyingKey(''); |
| | | } |
| | |
| | | import Taro from "@tarojs/taro"; |
| | | import { showToast } from '../../../../components/toast'; |
| | | import { View, Image, Text, ScrollView } from "@tarojs/components"; |
| | | import { useState, useEffect, useRef } from "react"; |
| | | // TODO(仅用于测试): 上线前将此处改回从 '../../../../api/begin-route' 导入 './test-case/ac-mock' |
| | |
| | | } |
| | | } catch {} |
| | | |
| | | stopLoading('ac'); |
| | | |
| | | if (!acSuccess) { |
| | | Taro.showToast({ title: AC_TOGGLE_FAIL_TEXT, icon: 'none' }); |
| | | } else { |
| | | if (!tempSuccess) { |
| | | Taro.showToast({ title: AC_TEMP_FAIL_TEXT, icon: 'none' }); |
| | | stopLoading('ac', () => { |
| | | if (!acSuccess) { |
| | | showToast({ title: AC_TOGGLE_FAIL_TEXT, icon: 'none' }); |
| | | } else if (!tempSuccess) { |
| | | showToast({ title: AC_TEMP_FAIL_TEXT, icon: 'none' }); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | saveAcStorage(targetOrderId, { acOpen: true, temperature: DEFAULT_FIRST_TEMP }); |
| | | }; |
| | |
| | | // Taro.showToast({ title: '设置成功', icon: 'none' }); |
| | | } else { |
| | | setTempStatus(lastConfirmedTempRef.current ?? null); |
| | | Taro.showToast({ title: AC_TEMP_FAIL_TEXT, icon: 'none' }); |
| | | showToast({ title: AC_TEMP_FAIL_TEXT, icon: 'none' }); |
| | | } |
| | | }).catch(() => { |
| | | setTempStatus(lastConfirmedTempRef.current ?? null); |
| | | Taro.showToast({ title: AC_TEMP_FAIL_TEXT, icon: 'none' }); |
| | | showToast({ title: AC_TEMP_FAIL_TEXT, icon: 'none' }); |
| | | }); |
| | | }, TEMP_UPDATE_DEBOUNCE_MS); |
| | | }; |
| | |
| | | } |
| | | const next = prev + delta; |
| | | if (delta < 0 && next < TEMP_MIN) { |
| | | Taro.showToast({ title: '当前已是空调最低温度', icon: 'none' }); |
| | | showToast({ title: '当前已是空调最低温度', icon: 'none' }); |
| | | return prev; |
| | | } |
| | | if (delta > 0 && next > TEMP_MAX) { |
| | | Taro.showToast({ title: '当前已是空调最高温度', icon: 'none' }); |
| | | showToast({ title: '当前已是空调最高温度', icon: 'none' }); |
| | | return prev; |
| | | } |
| | | scheduleTemperatureUpdate(next); |
| | |
| | | return; |
| | | } |
| | | if (isAtMinTemperature) { |
| | | Taro.showToast({ title: AC_TEMP_MIN_TIP_TEXT, icon: 'none' }); |
| | | showToast({ title: AC_TEMP_MIN_TIP_TEXT, icon: 'none' }); |
| | | return; |
| | | } |
| | | handleTempChange(-0.5); |
| | |
| | | return; |
| | | } |
| | | if (isAtMaxTemperature) { |
| | | Taro.showToast({ title: AC_TEMP_MAX_TIP_TEXT, icon: 'none' }); |
| | | showToast({ title: AC_TEMP_MAX_TIP_TEXT, icon: 'none' }); |
| | | return; |
| | | } |
| | | handleTempChange(0.5); |
| | |
| | | const targetOpenState = !acSwitchOn; |
| | | setAcTogglingTarget(targetOpenState); |
| | | startLoading('ac'); |
| | | let toastText = ''; |
| | | try { |
| | | // 200就认为是指令下发成功了 |
| | | await airConditionerUnlock({ |
| | |
| | | userActionSeqRef.current++; |
| | | const currentTemp = typeof tempStatus === 'number' ? tempStatus : DEFAULT_FIRST_TEMP; |
| | | saveAcStorage(targetOrderId, { acOpen: targetOpenState, temperature: currentTemp }); |
| | | Taro.showToast({ title: targetOpenState ? '已开启空调' : '已关闭空调', icon: 'none' }); |
| | | toastText = targetOpenState ? '已开启空调' : '已关闭空调'; |
| | | if (targetOpenState && typeof tempStatus !== 'number') { |
| | | setTempStatus(DEFAULT_FIRST_TEMP); |
| | | lastConfirmedTempRef.current = DEFAULT_FIRST_TEMP; |
| | | } |
| | | } catch (error) { |
| | | Taro.showToast({ title: AC_TOGGLE_FAIL_TEXT, icon: 'none' }); |
| | | toastText = AC_TOGGLE_FAIL_TEXT; |
| | | } finally { |
| | | stopLoading('ac'); |
| | | // 等 loading 动画真正结束后再弹 toast,避免异常提示已弹出但 loading 仍在转 |
| | | stopLoading('ac', () => { |
| | | if (toastText) { |
| | | showToast({ title: toastText, icon: 'none' }); |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | | |
| New file |
| | |
| | | .trunk-confirm-popup { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | z-index: 99999; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | |
| | | .trunk-confirm-mask { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: rgba(0, 0, 0, 0.8); |
| | | } |
| | | |
| | | .trunk-confirm-content { |
| | | position: relative; |
| | | width: 600rpx; |
| | | box-sizing: border-box; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | padding: 72rpx 40rpx 48rpx 40rpx; |
| | | gap: 64rpx; |
| | | border-radius: 48rpx; |
| | | background: #FFFFFF; |
| | | text-align: center; |
| | | } |
| | | |
| | | .trunk-confirm-title { |
| | | font-family: PingFang SC; |
| | | font-size: 36rpx; |
| | | font-weight: 500; |
| | | line-height: 52rpx; |
| | | color: rgba(0, 0, 0, 0.9); |
| | | } |
| | | |
| | | .trunk-confirm-btns { |
| | | display: flex; |
| | | flex-direction: row; |
| | | align-items: center; |
| | | width: 100%; |
| | | gap: 20rpx; |
| | | } |
| | | |
| | | .trunk-confirm-btn { |
| | | flex: 1; |
| | | height: 110rpx; |
| | | box-sizing: border-box; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border-radius: 110rpx; |
| | | font-family: PingFang SC; |
| | | font-size: 36rpx; |
| | | font-weight: 500; |
| | | line-height: 52rpx; |
| | | } |
| | | |
| | | .trunk-confirm-btn-cancel { |
| | | background: #FFFFFF; |
| | | border: 4rpx solid #141E27; |
| | | color: #141E27; |
| | | } |
| | | |
| | | .trunk-confirm-btn-primary { |
| | | background: #141E27; |
| | | color: #FFFFFF; |
| | | } |
| | | } |
| New file |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { View } from '@tarojs/components'; |
| | | import { useEffect, useRef, useState } from 'react'; |
| | | import './index.less'; |
| | | |
| | | type Props = { |
| | | /** 是否展示弹窗 */ |
| | | show?: boolean; |
| | | /** 点击「取消」回调 */ |
| | | onCancel?: () => void; |
| | | /** 点击「确认」回调 */ |
| | | onConfirm?: () => void; |
| | | }; |
| | | |
| | | const ANIMATION_DURATION_MS = 300; // 弹窗开合动画时长 |
| | | |
| | | /** |
| | | * 后备箱开启二次确认弹窗(居中,取消/确认双按钮)。 |
| | | * 容器/遮罩/标题沿用项目居中弹窗规范(over-popup),新增横向双按钮 + 实心主按钮。 |
| | | */ |
| | | export default function TrunkConfirmPopup({ show = false, onCancel, onConfirm }: Props) { |
| | | const [visible, setVisible] = useState(false); // 关闭动画保活标记 |
| | | const [animationData, setAnimationData] = useState<any>(); |
| | | const closeTimerRef = useRef<any>(null); |
| | | |
| | | // 控制弹窗开合:打开时立即渲染并入场,关闭时保留退场动画 |
| | | useEffect(() => { |
| | | if (closeTimerRef.current) { |
| | | clearTimeout(closeTimerRef.current); |
| | | closeTimerRef.current = null; |
| | | } |
| | | |
| | | if (show) { |
| | | setVisible(true); |
| | | const animation = Taro.createAnimation({ duration: ANIMATION_DURATION_MS, timingFunction: 'ease-out' }); |
| | | animation.opacity(1).scale(1).step(); |
| | | setAnimationData(animation.export()); |
| | | return; |
| | | } |
| | | |
| | | if (!visible) { |
| | | return; |
| | | } |
| | | |
| | | const animation = Taro.createAnimation({ duration: ANIMATION_DURATION_MS, timingFunction: 'ease-in' }); |
| | | animation.opacity(0).scale(0.8).step(); |
| | | setAnimationData(animation.export()); |
| | | closeTimerRef.current = setTimeout(() => { |
| | | setVisible(false); |
| | | closeTimerRef.current = null; |
| | | }, ANIMATION_DURATION_MS); |
| | | }, [show, visible]); |
| | | |
| | | // 卸载时清理定时器 |
| | | useEffect(() => { |
| | | return () => { |
| | | if (closeTimerRef.current) { |
| | | clearTimeout(closeTimerRef.current); |
| | | } |
| | | }; |
| | | }, []); |
| | | |
| | | if (!visible) { |
| | | return null; |
| | | } |
| | | |
| | | return ( |
| | | <View className='trunk-confirm-popup' catchMove> |
| | | <View className='trunk-confirm-mask'></View> |
| | | <View className='trunk-confirm-content' animation={animationData}> |
| | | <View className='trunk-confirm-title'> |
| | | <View>请确认后备箱周边安全</View> |
| | | <View>确认开启吗?</View> |
| | | </View> |
| | | <View className='trunk-confirm-btns'> |
| | | <View className='trunk-confirm-btn trunk-confirm-btn-cancel' onClick={onCancel}>取消</View> |
| | | <View className='trunk-confirm-btn trunk-confirm-btn-primary' onClick={onConfirm}>确认</View> |
| | | </View> |
| | | </View> |
| | | </View> |
| | | ); |
| | | } |
| | |
| | | export default function useMinimumSpinLoading<T extends string>() { |
| | | /** 当前处于 loading 展示中的控件标识。 */ |
| | | const [visibleLoadingKey, setVisibleLoadingKey] = useState<T | null>(null); |
| | | /** visibleLoadingKey 的同步镜像,供 stopLoading 内即时读取,避免闭包拿到旧值。 */ |
| | | const visibleLoadingKeyRef = useRef<T | null>(null); |
| | | /** 当前 loading 开始时间戳。 */ |
| | | const loadingStartedAtRef = useRef(0); |
| | | /** 延迟关闭 loading 的定时器。 */ |
| | | const loadingFinishTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null); |
| | | |
| | | /** |
| | | * 同步更新 state 与 ref,保证两者一致。 |
| | | */ |
| | | const setKey = useCallback((key: T | null) => { |
| | | visibleLoadingKeyRef.current = key; |
| | | setVisibleLoadingKey(key); |
| | | }, []); |
| | | |
| | | /** |
| | | * 清理延迟关闭定时器。 |
| | |
| | | const startLoading = useCallback((key: T) => { |
| | | clearLoadingFinishTimer(); |
| | | loadingStartedAtRef.current = Date.now(); |
| | | setVisibleLoadingKey(key); |
| | | }, [clearLoadingFinishTimer]); |
| | | setKey(key); |
| | | }, [clearLoadingFinishTimer, setKey]); |
| | | |
| | | /** |
| | | * 结束 loading 动画;若未满一圈则延迟到一圈完成后再关闭。 |
| | | * @param onStopped loading 真正关闭(含最短时长补足)后触发,用于把 toast 等提示对齐到动画结束,避免 loading 仍在转就弹出提示。 |
| | | */ |
| | | const stopLoading = useCallback((key?: T | null) => { |
| | | setVisibleLoadingKey((currentKey) => { |
| | | if (!currentKey) { |
| | | return currentKey; |
| | | } |
| | | if (key && currentKey !== key) { |
| | | return currentKey; |
| | | } |
| | | const elapsed = Date.now() - loadingStartedAtRef.current; |
| | | const remaining = Math.max(0, MINIMUM_SPIN_DURATION_MS - elapsed); |
| | | clearLoadingFinishTimer(); |
| | | if (remaining === 0) { |
| | | return null; |
| | | } |
| | | loadingFinishTimerRef.current = setTimeout(() => { |
| | | setVisibleLoadingKey((latestKey) => (latestKey === currentKey ? null : latestKey)); |
| | | loadingFinishTimerRef.current = null; |
| | | }, remaining); |
| | | return currentKey; |
| | | }); |
| | | }, [clearLoadingFinishTimer]); |
| | | const stopLoading = useCallback((key?: T | null, onStopped?: () => void) => { |
| | | const currentKey = visibleLoadingKeyRef.current; |
| | | // 无 loading 或指定 key 不匹配:不关闭,但仍执行回调作为兜底,保证提示不丢失。 |
| | | if (!currentKey || (key && currentKey !== key)) { |
| | | onStopped?.(); |
| | | return; |
| | | } |
| | | const elapsed = Date.now() - loadingStartedAtRef.current; |
| | | const remaining = Math.max(0, MINIMUM_SPIN_DURATION_MS - elapsed); |
| | | clearLoadingFinishTimer(); |
| | | if (remaining === 0) { |
| | | setKey(null); |
| | | onStopped?.(); |
| | | return; |
| | | } |
| | | loadingFinishTimerRef.current = setTimeout(() => { |
| | | setKey(null); |
| | | loadingFinishTimerRef.current = null; |
| | | onStopped?.(); |
| | | }, remaining); |
| | | }, [clearLoadingFinishTimer, setKey]); |
| | | |
| | | return { |
| | | visibleLoadingKey, |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { View, Text, Image, Textarea } from '@tarojs/components'; |
| | | import { useEffect, useRef, useState } from 'react'; |
| | | import './css-folder/evaluate-popup.less' |
| | |
| | | return; |
| | | } |
| | | if (shouldRequireFeedbackType && selectedTypeIds.length === 0) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '请选择问题类型', |
| | | icon: 'none' |
| | | }); |
| | |
| | | } |
| | | const targetOrderId = getOrderId(orderId); |
| | | if (!targetOrderId) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '订单信息缺失,无法提交评价', |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | if (!shouldHideFeedbackTextarea && !feedbackContent.trim()) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '请输入问题描述', |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | if (uploading) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '图片上传中,请稍后提交', |
| | | icon: 'none' |
| | | }); |
| | |
| | | submitter(payload).then((res: any) => { |
| | | const isFailure = res?.success === false || (typeof res?.code === 'number' && res.code !== 0); |
| | | if (isFailure) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '评价提交失败,请稍后重试', |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | const successTitle = submitMode === 'complaint' ? '投诉已提交' : '评价已提交'; |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: successTitle, |
| | | icon: 'none' |
| | | }); |
| | | onConfirm?.(); |
| | | }).catch(() => { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '评价提交失败,请稍后重试', |
| | | icon: 'none' |
| | | }); |
| | |
| | | import { View, Text, Image } from "@tarojs/components"; |
| | | import Taro from "@tarojs/taro"; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { useEffect, useState, useRef } from "react"; |
| | | import { getUpdateAddressNum } from "../../../api/begin-route"; |
| | | import "./css-folder/modify-destination-review.less"; |
| | |
| | | * 置灰态点击确认按钮时给出明确提示。 |
| | | */ |
| | | const handleDisabledConfirmToast = () => { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: MODIFY_DESTINATION_DISABLED_TOAST, |
| | | icon: "none" |
| | | }); |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { View, Image } from '@tarojs/components'; |
| | | import { useEffect, useState } from 'react'; |
| | | import './css-folder/over-route.less' |
| | |
| | | setAnimationData(animation.export()); |
| | | }).catch(() => { |
| | | if (!active) return; |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '获取结束时间失败,请稍后重试', |
| | | icon: 'none' |
| | | }); |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; |
| | | import { TripStatus } from '../../../constants/trip-status'; |
| | | import { waitForOrderSuccessSubscribePopup } from '../../../../utils/subscribe'; |
| | |
| | | recentAuthorizedAtRef.current = 0; |
| | | stopOpenSettingPollingRef.current(); |
| | | setStatus('system_off'); |
| | | Taro.showToast({ title: '请先开启系统蓝牙', icon: 'none' }); |
| | | showToast({ title: '请先开启系统蓝牙', icon: 'none' }); |
| | | return; |
| | | } |
| | | |
| | | Taro.showToast({ title: '蓝牙初始化失败,请稍后重试', icon: 'none' }); |
| | | showToast({ title: '蓝牙初始化失败,请稍后重试', icon: 'none' }); |
| | | setTimeout(() => { |
| | | refreshBluetoothStateRef.current(); |
| | | }, BLUETOOTH_AUTH_SYNC_DELAY_MS); |
| | |
| | | error, |
| | | systemInfo: systemInfoSnapshot |
| | | }); |
| | | Taro.showToast({ title: '请手动开启系统蓝牙', icon: 'none' }); |
| | | showToast({ title: '请手动开启系统蓝牙', icon: 'none' }); |
| | | } finally { |
| | | logBluetoothAccess('系统蓝牙设置流程结束,准备刷新状态', { |
| | | systemInfo: systemInfoSnapshot |
| | |
| | | openSettingError, |
| | | ...permissionSnapshot |
| | | }); |
| | | Taro.showToast({ title: getBluetoothPermissionDeniedMessage(permissionSnapshot), icon: 'none' }); |
| | | showToast({ title: getBluetoothPermissionDeniedMessage(permissionSnapshot), icon: 'none' }); |
| | | return; |
| | | } |
| | | const latestAuthState = await getMiniappBluetoothAuthState(); |
| | |
| | | ...latestSnapshot |
| | | }); |
| | | if (latestAuthState !== 'authorized') { |
| | | Taro.showToast({ title: getBluetoothPermissionDeniedMessage(latestSnapshot), icon: 'none' }); |
| | | showToast({ title: getBluetoothPermissionDeniedMessage(latestSnapshot), icon: 'none' }); |
| | | return; |
| | | } |
| | | await finishBluetoothAuthorization(); |
| | |
| | | openSettingError, |
| | | ...permissionSnapshot |
| | | }); |
| | | Taro.showToast({ title: getBluetoothPermissionDeniedMessage(permissionSnapshot), icon: 'none' }); |
| | | showToast({ title: getBluetoothPermissionDeniedMessage(permissionSnapshot), icon: 'none' }); |
| | | return; |
| | | } |
| | | const latestAuthState = await getMiniappBluetoothAuthState(); |
| | |
| | | ...latestSnapshot |
| | | }); |
| | | if (latestAuthState !== 'authorized') { |
| | | Taro.showToast({ title: getBluetoothPermissionDeniedMessage(latestSnapshot), icon: 'none' }); |
| | | showToast({ title: getBluetoothPermissionDeniedMessage(latestSnapshot), icon: 'none' }); |
| | | return; |
| | | } |
| | | await finishBluetoothAuthorization(); |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { useCallback, useEffect, useRef, useState } from 'react'; |
| | | import RtAuthBluetoothManager from '../../../utils/car-control/RtAuthBluetoothManager'; |
| | | import { getBluetoothUnlockToken } from '../../../api/car-control'; |
| | |
| | | const ensureManagerRef = useRef<() => any>(() => null); // 蓝牙管理器初始化函数引用 |
| | | const closeConnectionRef = useRef<() => void>(() => {}); // 断开连接动作引用 |
| | | const showUnlockToast = (title: string) => { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title, |
| | | icon: 'none' |
| | | }); |
| | |
| | | import { useCallback, useEffect, useRef } from 'react'; |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | |
| | | type Deps = { |
| | | /** 支付分页面返回后的回调。 */ |
| | |
| | | */ |
| | | const openCreditPayScoreUse = useCallback((packageValue: string) => { |
| | | if (!packageValue) { |
| | | Taro.showToast({ title: '支付参数缺失,请稍后重试', icon: 'none' }); |
| | | showToast({ title: '支付参数缺失,请稍后重试', icon: 'none' }); |
| | | return false; |
| | | } |
| | | |
| | | // @ts-ignore |
| | | if (!wx.openBusinessView) { |
| | | Taro.showToast({ title: '请升级微信版本后重试', icon: 'none' }); |
| | | showToast({ title: '请升级微信版本后重试', icon: 'none' }); |
| | | return false; |
| | | } |
| | | |
| | |
| | | }, |
| | | fail: () => { |
| | | clearAppShowListener(); |
| | | Taro.showToast({ title: '拉起支付分订单失败', icon: 'none' }); |
| | | showToast({ title: '拉起支付分订单失败', icon: 'none' }); |
| | | } |
| | | }); |
| | | |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { useEffect, useMemo, useState } from 'react'; |
| | | import { orderChange } from '../../../api/begin-route'; |
| | | import { TripStatus } from '../../../constants/trip-status'; |
| | |
| | | exitModifyDestinationReview({ shouldRestorePreviousEndSite: false }); |
| | | |
| | | Taro.hideLoading(); |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '行程已更新', |
| | | icon: 'none' |
| | | }); |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { useCallback, useEffect, useRef, useState } from 'react'; |
| | | import { TripStatus } from '../../../constants/trip-status'; |
| | | import { getOrderId } from '../../../utils/order'; |
| | |
| | | syncOrderRouteMetrics: false |
| | | }, |
| | | ); |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '报价已更新,请再次确认修改', |
| | | icon: 'none' |
| | | }); |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { clearOrderTripStorage, reportEvent } from '../../../../utils/Robotaxi-public-method'; |
| | | import { cancelOrder } from '../../../api/begin-route'; |
| | | import { getOrderId } from '../../../utils/order'; |
| | |
| | | if (shouldReportPickupArrivedCancelTrip) { |
| | | reportPickupArrivedCancelTripEvent(); |
| | | } |
| | | Taro.showToast({ title: '行程已取消', icon: 'success' }); |
| | | showToast({ title: '行程已取消', icon: 'success' }); |
| | | clearActiveOrderRuntime(); |
| | | deps.setTripStatus(TripStatus.CancelOnlyPickup); |
| | | deps.setCancelType(4); |
| | | } catch (error) { |
| | | Taro.showToast({ title: '取消订单失败,请重试', icon: 'none' }); |
| | | showToast({ title: '取消订单失败,请重试', icon: 'none' }); |
| | | } |
| | | }; |
| | | |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { useCallback, useState } from 'react'; |
| | | import { getOrderDistance } from '../../../api/select-map-site'; |
| | | import { getDistance } from '../../../../utils/Robotaxi-public-method'; |
| | |
| | | } |
| | | const openCityId = await resolveOpenCityId(); |
| | | if (openCityId) return openCityId; |
| | | Taro.showToast({ title: '未能获取所在城市信息,请重试', icon: 'none' }); |
| | | showToast({ title: '未能获取所在城市信息,请重试', icon: 'none' }); |
| | | deps.onCheckFailed(); |
| | | return null; |
| | | }; |
| | |
| | | import { useCallback } from 'react'; |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { queryOrderPaymentResultFromOrderId } from '../../../api/begin-route'; |
| | | import { RobotaxiOrderStatus } from '../../../api/types/begin-route'; |
| | | |
| | |
| | | */ |
| | | const queryPaymentResult = useCallback(async () => { |
| | | if (!deps.orderId) { |
| | | Taro.showToast({ title: '订单信息缺失,无法确认支付结果', icon: 'none' }); |
| | | showToast({ title: '订单信息缺失,无法确认支付结果', icon: 'none' }); |
| | | return; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (nextStatus === RobotaxiOrderStatus.Cancelled) { |
| | | Taro.showToast({ title: '订单已取消', icon: 'none' }); |
| | | showToast({ title: '订单已取消', icon: 'none' }); |
| | | return; |
| | | } |
| | | |
| | | Taro.showToast({ title: '订单状态异常,请稍后查看', icon: 'none' }); |
| | | showToast({ title: '订单状态异常,请稍后查看', icon: 'none' }); |
| | | } catch (error) { |
| | | Taro.showToast({ title: '支付结果查询失败,请稍后重试', icon: 'none' }); |
| | | showToast({ title: '支付结果查询失败,请稍后重试', icon: 'none' }); |
| | | } finally { |
| | | Taro.hideLoading(); |
| | | } |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { useRef } from 'react'; |
| | | import { reportEvent } from '../../../../utils/Robotaxi-public-method'; |
| | | import { |
| | |
| | | deps.setShowOverRoutePopup(false); |
| | | const targetOrderId = getTargetOrderId(); |
| | | if (!targetOrderId) { |
| | | Taro.showToast({ title: '订单信息缺失,无法结束行程', icon: 'none' }); |
| | | showToast({ title: '订单信息缺失,无法结束行程', icon: 'none' }); |
| | | return; |
| | | } |
| | | |
| | |
| | | const orderDetail = await syncPostEndOrderTripStatus(targetOrderId); |
| | | reportTripPayStartEvent(orderDetail); |
| | | if (endOrderResult) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '当前选择优惠券不满足,已自动切换为满足条件优惠券', |
| | | icon: 'none', |
| | | duration: 3000 |
| | | }); |
| | | } |
| | | } catch (error) { |
| | | Taro.showToast({ title: '结束行程失败,请重试', icon: 'none' }); |
| | | showToast({ title: '结束行程失败,请重试', icon: 'none' }); |
| | | } |
| | | }; |
| | | |
| | |
| | | } |
| | | const targetOrderId = getTargetOrderId(); |
| | | if (!targetOrderId) { |
| | | Taro.showToast({ title: '订单信息缺失,无法支付', icon: 'none' }); |
| | | showToast({ title: '订单信息缺失,无法支付', icon: 'none' }); |
| | | return; |
| | | } |
| | | paySubmittingRef.current = true; |
| | |
| | | // Taro.showToast({ title: '暂不支持当前支付方式', icon: 'none' }); |
| | | |
| | | } catch (error) { |
| | | Taro.showToast({ title: '支付失败,请重试', icon: 'none' }); |
| | | showToast({ title: '支付失败,请重试', icon: 'none' }); |
| | | } finally { |
| | | Taro.hideLoading(); |
| | | paySubmittingRef.current = false; |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { useCallback, useRef } from 'react'; |
| | | import { formatDateTime, debounce, reportEvent } from '../../../../utils/Robotaxi-public-method'; |
| | | import { createCreditPayOrder, saveOrder, routeStaleCheck } from '../../../api/begin-route'; |
| | |
| | | */ |
| | | const refreshRouteAndStopSubmitting = (startSite: any, message: string) => { |
| | | reportEvent(CONFIRM_RIDE_EXPIRE_BUTTON_EVENT_ID, createConfirmRideEventPayload('expire')); |
| | | Taro.showToast({ title: message, icon: 'none' }); |
| | | showToast({ title: message, icon: 'none' }); |
| | | deps.routeRequestRouteAndFare( |
| | | Number(startSite?.latitude), |
| | | Number(startSite?.longitude), |
| | |
| | | |
| | | if (typeof response === 'string') { |
| | | reportPayResultEvent(resolvePayResultStatus(response)); |
| | | Taro.showToast({ title: response, icon: 'none', mask: true }); |
| | | showToast({ title: response, icon: 'none', mask: true }); |
| | | setTimeout(() => { |
| | | Taro.reLaunch({ url: HOME_PAGE_URL }); |
| | | Taro.removeStorageSync('selectedCouponId'); |
| | |
| | | |
| | | if (!resolvedOrderId) { |
| | | reportPayResultEvent(resolvePayResultStatus(response?.msg || response?.data || response)); |
| | | Taro.showToast({ title: '下单失败,请重试', icon: 'none' }); |
| | | showToast({ title: '下单失败,请重试', icon: 'none' }); |
| | | return null; |
| | | } |
| | | |
| | |
| | | stopCallSubmitting(); |
| | | return false; |
| | | } catch (error) { |
| | | Taro.showToast({ title: '协议校验失败,请重试', icon: 'none' }); |
| | | showToast({ title: '协议校验失败,请重试', icon: 'none' }); |
| | | stopCallSubmitting(); |
| | | return false; |
| | | } |
| | |
| | | return true; |
| | | } |
| | | if (!deps.endSite.name) { |
| | | Taro.showToast({ title: '请选择站点', icon: 'none' }); |
| | | showToast({ title: '请选择站点', icon: 'none' }); |
| | | } |
| | | stopCallSubmitting(); |
| | | return false; |
| | |
| | | ) { |
| | | return startSite; |
| | | } |
| | | Taro.showToast({ title: '请先选择起终点', icon: 'none' }); |
| | | showToast({ title: '请先选择起终点', icon: 'none' }); |
| | | stopCallSubmitting(); |
| | | return null; |
| | | }; |
| | |
| | | refreshRouteAndStopSubmitting(startSite, ROUTE_STALE_NOTICE_TEXT); |
| | | return false; |
| | | } catch (error) { |
| | | Taro.showToast({ title: '路线校验失败,请重试', icon: 'none' }); |
| | | showToast({ title: '路线校验失败,请重试', icon: 'none' }); |
| | | stopCallSubmitting(); |
| | | return false; |
| | | } |
| | |
| | | |
| | | const selectedRoute = getSelectedRoute(); |
| | | if (!selectedRoute) { |
| | | Taro.showToast({ title: '路线信息缺失,请重试', icon: 'none' }); |
| | | showToast({ title: '路线信息缺失,请重试', icon: 'none' }); |
| | | stopCallSubmitting(); |
| | | return; |
| | | } |
| | |
| | | if (submitMode === 'credit_pay_submit') { |
| | | const creditPayPackageValue = String(submitResult.creditPayPackageValue || '').trim(); |
| | | if (!creditPayPackageValue) { |
| | | Taro.showToast({ title: '支付参数缺失,请稍后重试', icon: 'none' }); |
| | | showToast({ title: '支付参数缺失,请稍后重试', icon: 'none' }); |
| | | return; |
| | | } |
| | | // 复用现有支付分确认页拉起与回跳查询链路。 |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { clearOrderTripStorage, safeMakePhoneCall } from '../../../../utils/Robotaxi-public-method'; |
| | | import { TripStatus } from '../../../constants/trip-status'; |
| | | import { |
| | |
| | | */ |
| | | const guardPrivacyThenNavigate = (url: string) => { |
| | | if (Taro.getStorageSync('has_show_privicy_Robotaxi') !== 'true') { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '请先同意协议', |
| | | icon: 'none' |
| | | }); |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import wsManager from '../../../../utils/websocket'; |
| | | import { mapOrderStatusToTripStatus, clearOrderTripStorage } from '../../../../utils/Robotaxi-public-method'; |
| | | import { getOrderActive, } from '../../../api/home'; |
| | |
| | | const isModifyDestinationReturn = String(fromModifyDestination || '') === '1'; |
| | | const shouldShowPendingSameSiteToast = isModifyDestinationReturn && !!Taro.getStorageSync(MODIFY_DESTINATION_PENDING_SAME_SITE_TOAST_KEY); |
| | | if (skipPageFlag && hasActiveTripOrderInStorage() && !isModifyDestinationReturn && !isModifyDestinationSessionActive) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: getActiveTripOrderToastTitle(Taro.getStorageSync('tripStatus')), |
| | | icon: 'none', |
| | | }); |
| | | } |
| | | if (shouldShowPendingSameSiteToast) { |
| | | Taro.removeStorageSync(MODIFY_DESTINATION_PENDING_SAME_SITE_TOAST_KEY); |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: MODIFY_DESTINATION_SAME_SITE_TOAST, |
| | | icon: 'none' |
| | | }); |
| | |
| | | } from '../../constants/confirm-ride-report'; |
| | | import { withRobotaxiWhitelist } from '../../../utils/whitelist'; |
| | | import { withToast } from '../../components/toast/with-toast'; |
| | | import { showToast } from '../../components/toast'; |
| | | import type { PickupExceptionInfo } from './pickup-exception'; |
| | | |
| | | const MODIFY_DESTINATION_PICKUP_STATUS_GUARD_MS = 5000; |
| | |
| | | const handleOpenPickupRouteChange = useCallback(async () => { |
| | | const routeContext = resolvePickupRouteChangeRequestContext(); |
| | | if (!routeContext) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '当前无法切换路线', |
| | | icon: 'none' |
| | | }); |
| | |
| | | const pathFingerprint = selectedRoute?.pathFingerprint ?? selectedRoute?.route?.pathFingerprint; |
| | | |
| | | if (!orderId || !snapshotId || !pathFingerprint) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '路线信息不完整,请刷新后重试', |
| | | icon: 'none' |
| | | }); |
| | |
| | | routeRequestOrderRoute(orderId, tripStatus); |
| | | Taro.hideLoading(); |
| | | setTimeout(() => { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '切换成功,将按新路线行驶', |
| | | icon: 'none' |
| | | }); |
| | |
| | | */ |
| | | const handleSignedCreditPayment = useCallback((value: SignedOrderPaymentValue) => { |
| | | if (Number(value?.payType) !== RobotaxiSignedPayType.WechatCredit) { |
| | | Taro.showToast({ title: '暂不支持当前支付方式', icon: 'none' }); |
| | | showToast({ title: '暂不支持当前支付方式', icon: 'none' }); |
| | | return; |
| | | } |
| | | |
| | |
| | | if (!modifyDestinationDisabledToastText) { |
| | | return; |
| | | } |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: modifyDestinationDisabledToastText, |
| | | icon: 'none' |
| | | }); |
| | |
| | | CouponDetail |
| | | } from "../../../robotaxi/api/coupon"; |
| | | import { withRobotaxiWhitelist } from "../../../utils/whitelist"; |
| | | import { showToast } from "../../components/toast"; |
| | | import { withToast } from "../../components/toast/with-toast"; |
| | | |
| | | function CouponPage() { |
| | | const [couponStatus] = useState([ |
| | |
| | | setVisible(true); |
| | | } catch (error) { |
| | | Taro.hideLoading(); |
| | | Taro.showToast({ title: "获取详情失败", icon: "none" }); |
| | | showToast({ title: "获取详情失败", icon: "none" }); |
| | | } |
| | | }; |
| | | |
| | |
| | | e.stopPropagation(); |
| | | try { |
| | | await receiveCoupon({ couponId: item.couponId }); |
| | | Taro.showToast({ title: "领取成功", icon: "success" }); |
| | | showToast({ title: "领取成功", icon: "success" }); |
| | | // 领取成功后刷新列表 |
| | | getList(1, activeStatus, true); |
| | | setPageNum(1); |
| | | } catch (error) { |
| | | Taro.showToast({ title: "领取失败", icon: "none" }); |
| | | showToast({ title: "领取失败", icon: "none" }); |
| | | } |
| | | }; |
| | | |
| | |
| | | ); |
| | | } |
| | | |
| | | export default withRobotaxiWhitelist(CouponPage); |
| | | export default withRobotaxiWhitelist(withToast(CouponPage)); |
| | |
| | | } from '../../../utils/Robotaxi-public-method'; |
| | | import EvaluatePopup from '../begin-route/components/evaluate-popup'; |
| | | import { withRobotaxiWhitelist } from '../../../utils/whitelist'; |
| | | import { showToast } from '../../components/toast'; |
| | | import { withToast } from '../../components/toast/with-toast'; |
| | | import './index.less'; |
| | | |
| | | function OrderPage() { |
| | |
| | | setFareData(res); |
| | | } catch (error) { |
| | | console.error('获取费用明细失败', error); |
| | | Taro.showToast({ title: '获取费用明细失败', icon: 'none' }); |
| | | showToast({ title: '获取费用明细失败', icon: 'none' }); |
| | | } |
| | | }; |
| | | |
| | |
| | | ) |
| | | } |
| | | |
| | | export default withRobotaxiWhitelist(OrderPage); |
| | | export default withRobotaxiWhitelist(withToast(OrderPage)); |
| | |
| | | formatTripDurationFromSeconds |
| | | } from '../../../utils/Robotaxi-public-method'; |
| | | import { withRobotaxiWhitelist } from '../../../utils/whitelist'; |
| | | import { showToast } from '../../components/toast'; |
| | | import { withToast } from '../../components/toast/with-toast'; |
| | | |
| | | /** 城市缓存 key */ |
| | | const SELECTED_CITY_STORAGE_KEY = 'selectedCity'; |
| | |
| | | const cityID = getSelectedCityId(); |
| | | |
| | | if (!cityID) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: RESELECT_CITY_TOAST_TEXT, |
| | | icon: 'none' |
| | | }); |
| | |
| | | ) |
| | | } |
| | | |
| | | export default withRobotaxiWhitelist(OrderPage); |
| | | export default withRobotaxiWhitelist(withToast(OrderPage)); |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import Toast, { showToast } from '../../components/toast'; |
| | | import { View, Image, ScrollView } from '@tarojs/components'; |
| | | import { useEffect, useState } from 'react'; |
| | | import './index.less'; |
| | |
| | | |
| | | await collectPoint(payload); |
| | | setList(prev => prev.filter(f => (f.id || f.pointId || f.stationId) !== (item.id || item.pointId || item.stationId))); |
| | | Taro.showToast({ title: '已取消收藏', icon: 'none' }); |
| | | showToast({ title: '已取消收藏', icon: 'none' }); |
| | | } catch (e) { |
| | | console.log('取消收藏失败', e); |
| | | Taro.showToast({ title: '取消收藏失败', icon: 'none' }); |
| | | showToast({ title: '取消收藏失败', icon: 'none' }); |
| | | } |
| | | }; |
| | | |
| | |
| | | )} |
| | | </View> |
| | | </ScrollView> |
| | | <Toast /> |
| | | </View> |
| | | ); |
| | | } |
| | |
| | | import { formatTripDistance, formatTripDurationFromSeconds, safeParse } from '../../../../utils/Robotaxi-public-method'; |
| | | import { getOrderId } from '../../../utils/order'; |
| | | import { withRobotaxiWhitelist } from '../../../../utils/whitelist'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { withToast } from '../../../components/toast/with-toast'; |
| | | |
| | | function OrderDetailPage() { |
| | | const router = useRouter(); |
| | |
| | | setActiveIndex(res.orderRating); |
| | | } catch (error) { |
| | | console.error('获取订单详情失败', error); |
| | | Taro.showToast({ title: '获取详情失败', icon: 'none' }); |
| | | showToast({ title: '获取详情失败', icon: 'none' }); |
| | | } |
| | | }; |
| | | |
| | |
| | | const submitSimpleEvaluate = (index: number) => { |
| | | const targetOrderId = getOrderId(orderId); |
| | | if (!targetOrderId) { |
| | | Taro.showToast({ title: '订单信息缺失,无法提交评价', icon: 'none' }); |
| | | showToast({ title: '订单信息缺失,无法提交评价', icon: 'none' }); |
| | | return; |
| | | } |
| | | const successToastMap: Record<number, string> = { |
| | |
| | | submitOrderComment({ orderRating: index, orderId: targetOrderId }) |
| | | .then(() => { |
| | | setActiveIndex(index); |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: successToastMap[index] || '评价提交成功', |
| | | icon: 'none' |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | Taro.showToast({ title: '评价提交失败,请稍后重试', icon: 'none' }); |
| | | showToast({ title: '评价提交失败,请稍后重试', icon: 'none' }); |
| | | }); |
| | | } |
| | | |
| | |
| | | ) |
| | | } |
| | | |
| | | export default withRobotaxiWhitelist(OrderDetailPage); |
| | | export default withRobotaxiWhitelist(withToast(OrderDetailPage)); |
| | |
| | | const XP_INVOICE_APP_ID = "xp_invoice"; |
| | | |
| | | import { withRobotaxiWhitelist } from "../../../utils/whitelist"; |
| | | import { showToast } from "../../components/toast"; |
| | | import { withToast } from "../../components/toast/with-toast"; |
| | | |
| | | function OrderPage() { |
| | | const router = useRouter(); |
| | |
| | | // 根据当前订单编号跳转到发票开具页面。 |
| | | const toInvoicePage = (orderNo?: string) => { |
| | | if (!orderNo) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: "订单编号缺失", |
| | | icon: "none" |
| | | }); |
| | |
| | | ); |
| | | } |
| | | |
| | | export default withRobotaxiWhitelist(OrderPage); |
| | | export default withRobotaxiWhitelist(withToast(OrderPage)); |
| | |
| | | import './index.less' |
| | | import { getLoginAgreementContentInfo, getPrivacyContent } from '../../api/home'; |
| | | import { withRobotaxiWhitelist } from '../../../utils/whitelist'; |
| | | import { showToast } from '../../components/toast'; |
| | | import { withToast } from '../../components/toast/with-toast'; |
| | | |
| | | type AgreementItem = { |
| | | id: number | string; |
| | |
| | | console.log('normalizeContent(target.content ||', normalizeContent(target.content || '')); |
| | | return; |
| | | } |
| | | Taro.showToast({ title: '协议内容获取失败', icon: 'none' }); |
| | | showToast({ title: '协议内容获取失败', icon: 'none' }); |
| | | }).catch(() => { |
| | | Taro.showToast({ title: '协议内容获取失败', icon: 'none' }); |
| | | showToast({ title: '协议内容获取失败', icon: 'none' }); |
| | | }); |
| | | }, []); |
| | | |
| | |
| | | ) |
| | | } |
| | | |
| | | export default withRobotaxiWhitelist(PassengerNotice); |
| | | export default withRobotaxiWhitelist(withToast(PassengerNotice)); |
| | |
| | | import { useCallback, useState } from 'react'; |
| | | import { getPayPwd, RobotaxiPaySettingStatus, setPayPwd } from '../../api/payment'; |
| | | import { withRobotaxiWhitelist } from '../../../utils/whitelist'; |
| | | import { showToast } from '../../components/toast'; |
| | | import { withToast } from '../../components/toast/with-toast'; |
| | | |
| | | import './index.less'; |
| | | |
| | |
| | | try { |
| | | setIsOperating(true); |
| | | await setPayPwd(RobotaxiPaySettingStatus.Disable); |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '微信免密支付已关闭', |
| | | icon: 'none' |
| | | }); |
| | |
| | | navigateBackToList(); |
| | | }, 300); |
| | | } catch (error) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '关闭失败', |
| | | icon: 'none' |
| | | }); |
| | |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '查询支付设置失败', |
| | | icon: 'none' |
| | | }); |
| | |
| | | ); |
| | | } |
| | | |
| | | export default withRobotaxiWhitelist(PaymentSettingDetail); |
| | | export default withRobotaxiWhitelist(withToast(PaymentSettingDetail)); |
| | |
| | | import { useCallback, useEffect, useRef, useState } from 'react'; |
| | | import { getPayPwd, RobotaxiPaySettingStatus, setPayPwd } from '../../api/payment'; |
| | | import { withRobotaxiWhitelist } from '../../../utils/whitelist'; |
| | | import { showToast } from '../../components/toast'; |
| | | import { withToast } from '../../components/toast/with-toast'; |
| | | |
| | | import './index.less'; |
| | | |
| | |
| | | return nextStatus; |
| | | } catch (error) { |
| | | if (showErrorToast) { |
| | | Taro.showToast({ title: '查询支付设置失败', icon: 'none' }); |
| | | showToast({ title: '查询支付设置失败', icon: 'none' }); |
| | | } |
| | | throw error; |
| | | } |
| | |
| | | |
| | | try { |
| | | const nextStatus = await refreshPayStatus(false); |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: nextStatus ? '开通成功' : '开通未完成', |
| | | icon: nextStatus ? 'success' : 'none' |
| | | }); |
| | | } catch (error) { |
| | | Taro.showToast({ title: '查询签约结果失败', icon: 'none' }); |
| | | showToast({ title: '查询签约结果失败', icon: 'none' }); |
| | | } finally { |
| | | setIsOperating(false); |
| | | } |
| | |
| | | const openCreditPaySign = useCallback((signStr: string) => { |
| | | const weappGlobal = (globalThis as any).wx; |
| | | if (typeof weappGlobal?.openBusinessView !== 'function') { |
| | | Taro.showToast({ title: '请升级微信版本后重试', icon: 'none' }); |
| | | showToast({ title: '请升级微信版本后重试', icon: 'none' }); |
| | | return false; |
| | | } |
| | | |
| | |
| | | waitingCreditPayReturnRef.current = false; |
| | | clearCreditPayReturnListener(); |
| | | setIsOperating(false); |
| | | Taro.showToast({ title: '拉起支付分签约失败', icon: 'none' }); |
| | | showToast({ title: '拉起支付分签约失败', icon: 'none' }); |
| | | } |
| | | }); |
| | | return true; |
| | |
| | | |
| | | if (nextOperateStatus === RobotaxiPaySettingStatus.Disable) { |
| | | const nextStatus = await refreshPayStatus(false); |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: nextStatus ? '关闭未完成' : '已关闭', |
| | | icon: nextStatus ? 'none' : 'success' |
| | | }); |
| | |
| | | |
| | | const signStr = String(response?.signStr || ''); |
| | | if (!signStr) { |
| | | Taro.showToast({ title: '获取签约信息失败', icon: 'none' }); |
| | | showToast({ title: '获取签约信息失败', icon: 'none' }); |
| | | return; |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | } catch (error) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: isPayEnabled ? '关闭失败' : '开通失败', |
| | | icon: 'none' |
| | | }); |
| | |
| | | ); |
| | | } |
| | | |
| | | export default withRobotaxiWhitelist(PaymentSetting); |
| | | export default withRobotaxiWhitelist(withToast(PaymentSetting)); |
| | |
| | | ]; |
| | | |
| | | import { withRobotaxiWhitelist } from '../../../utils/whitelist'; |
| | | import { showToast } from '../../components/toast'; |
| | | import { withToast } from '../../components/toast/with-toast'; |
| | | |
| | | function PersonalCenter() { |
| | | const nickname = useSelector((state: any) => state.user?.userInfo?.nickName) || "小鹏艺术家"; |
| | |
| | | return; |
| | | } |
| | | |
| | | Taro.showToast({ title: "功能建设中", icon: "none" }); |
| | | showToast({ title: "功能建设中", icon: "none" }); |
| | | }; |
| | | |
| | | return ( |
| | |
| | | ); |
| | | } |
| | | |
| | | export default withRobotaxiWhitelist(PersonalCenter); |
| | | export default withRobotaxiWhitelist(withToast(PersonalCenter)); |
| | |
| | | import { View, Text } from '@tarojs/components'; |
| | | import { getPricingRules } from '../../api/pricing'; |
| | | import { withRobotaxiWhitelist } from '../../../utils/whitelist'; |
| | | import { showToast } from '../../components/toast'; |
| | | import { withToast } from '../../components/toast/with-toast'; |
| | | import './index.less'; |
| | | |
| | | type AnyRecord = Record<string, any>; |
| | |
| | | setMockJson(res || {}); |
| | | } catch (error) { |
| | | setMockJson({}); |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '获取定价规则失败', |
| | | icon: 'none' |
| | | }); |
| | | }); |
| | | } finally { |
| | | setLoading(false); |
| | | } |
| | |
| | | ); |
| | | } |
| | | |
| | | export default withRobotaxiWhitelist(PricingRulesPage); |
| | | export default withRobotaxiWhitelist(withToast(PricingRulesPage)); |
| | | |
| | |
| | | import './index.less'; |
| | | import { getOpenCity, getCityList } from '../../api/select-city'; |
| | | import { withRobotaxiWhitelist } from '../../../utils/whitelist'; |
| | | import { showToast } from '../../components/toast'; |
| | | import { withToast } from '../../components/toast/with-toast'; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | const handleSelectCity = (city, isOpen) => { |
| | | if (!isOpen) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '该城市暂未开通服务', |
| | | icon: 'none' |
| | | }); |
| | |
| | | ) |
| | | } |
| | | |
| | | export default withRobotaxiWhitelist(SelectCityPage); |
| | | export default withRobotaxiWhitelist(withToast(SelectCityPage)); |
| | |
| | | import Taro, { useDidShow } from "@tarojs/taro"; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { useEffect, useMemo } from 'react'; |
| | | import { |
| | | buildStationMetaMap, |
| | |
| | | const handleViewOperatingArea = () => { |
| | | const points = extractPointsFromPolygons(selectablePolygons); |
| | | if (points.length === 0) { |
| | | Taro.showToast({ title: '暂无可选运营区域', icon: 'none' }); |
| | | showToast({ title: '暂无可选运营区域', icon: 'none' }); |
| | | return; |
| | | } |
| | | const mapCtx = Taro.createMapContext('select-site-map'); |
| | |
| | | */ |
| | | const confirmSite = async () => { |
| | | if (!state.selectedSite.name) { |
| | | Taro.showToast({ title: '请选择站点', icon: 'none' }); |
| | | showToast({ title: '请选择站点', icon: 'none' }); |
| | | return; |
| | | } |
| | | if (state.rangeStatus === SELECT_SITE_RANGE_STATUS.crossOperatingArea) { |
| | | Taro.showToast({ title: '请在同一运营区内选择', icon: 'none' }); |
| | | showToast({ title: '请在同一运营区内选择', icon: 'none' }); |
| | | return; |
| | | } |
| | | if (state.pageType === 'start') { |
| | | const distanceConfig = await ensureDistanceConfigReady(); |
| | | const endSiteCache = Taro.getStorageSync('endSite'); |
| | | if (endSiteCache?.electronicAreaId && state.selectedSite?.electronicAreaId && endSiteCache.electronicAreaId !== state.selectedSite.electronicAreaId) { |
| | | Taro.showToast({ title: '请在同一运营区内选择', icon: 'none' }); |
| | | showToast({ title: '请在同一运营区内选择', icon: 'none' }); |
| | | return; |
| | | } |
| | | if (!isWithinPickupMaxDistance({ |
| | |
| | | const distanceConfig = await ensureDistanceConfigReady(); |
| | | const startSiteCache = Taro.getStorageSync('startSite'); |
| | | if (startSiteCache?.electronicAreaId && state.selectedSite?.electronicAreaId && startSiteCache.electronicAreaId !== state.selectedSite.electronicAreaId) { |
| | | Taro.showToast({ title: '请在同一运营区内选择', icon: 'none' }); |
| | | showToast({ title: '请在同一运营区内选择', icon: 'none' }); |
| | | return; |
| | | } |
| | | if (!isWithinStartEndMinDistance({ |
| | |
| | | Taro.setStorageSync('endSite', nextSite); |
| | | } |
| | | } |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: type === 2 ? '已取消收藏' : '收藏成功', |
| | | icon: 'none' |
| | | }); |
| | |
| | | PIN_PICKUP_LOCATION_PAGE_VIEW_EVENT_ID |
| | | } from '../../constants/report-events'; |
| | | import { withRobotaxiWhitelist } from '../../../utils/whitelist'; |
| | | import { withToast } from '../../components/toast/with-toast'; |
| | | |
| | | /** |
| | | * 地图选点页入口:负责 hook 编排与视图组装。 |
| | |
| | | ); |
| | | } |
| | | |
| | | export default withRobotaxiWhitelist(SelectMapSite); |
| | | export default withRobotaxiWhitelist(withToast(SelectMapSite)); |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { useEffect, useRef } from 'react'; |
| | | import type { MutableRefObject } from 'react'; |
| | | import { getDistance, mapOrderStatusToTripStatus } from '../../../../utils/Robotaxi-public-method'; |
| | |
| | | return; |
| | | } |
| | | if (!deps.orderId) { |
| | | Taro.showToast({ title: '分享订单不存在', icon: 'none' }); |
| | | showToast({ title: '分享订单不存在', icon: 'none' }); |
| | | return; |
| | | } |
| | | |
| | |
| | | console.error('获取分享行程失败', error); |
| | | if (!errorToastShownRef.current) { |
| | | errorToastShownRef.current = true; |
| | | Taro.showToast({ title: '获取分享行程失败', icon: 'none' }); |
| | | showToast({ title: '获取分享行程失败', icon: 'none' }); |
| | | } |
| | | }; |
| | | |
| | |
| | | pollCount += 1; |
| | | if (pollCount >= MAX_SHARE_TRIP_POLL_COUNT) { |
| | | stopPolling(); |
| | | Taro.showToast({ title: '分享行程数据可能不是最新,请手动刷新', icon: 'none' }); |
| | | showToast({ title: '分享行程数据可能不是最新,请手动刷新', icon: 'none' }); |
| | | return; |
| | | } |
| | | void fetchShareTripData(); |
| | |
| | | import { checkOtp } from '../../../utils/tools'; |
| | | import { safeMakePhoneCall } from '../../../utils/Robotaxi-public-method'; |
| | | import { withRobotaxiWhitelist } from '../../../utils/whitelist'; |
| | | import { withToast } from '../../components/toast/with-toast'; |
| | | |
| | | const ROUTE_SUMMARY_MARKER_ID = 999001; |
| | | |
| | |
| | | ); |
| | | } |
| | | |
| | | export default withRobotaxiWhitelist(ShareTrip); |
| | | export default withRobotaxiWhitelist(withToast(ShareTrip)); |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../../components/toast'; |
| | | import { View, Text, Image, ScrollView } from '@tarojs/components'; |
| | | import { useEffect, useState } from 'react'; |
| | | import './index.less'; |
| | |
| | | |
| | | await collectPoint(payload); |
| | | setList(prev => prev.filter(f => (f.id || f.pointId || f.stationId) !== (item.id || item.pointId || item.stationId))); |
| | | Taro.showToast({ title: '已取消收藏', icon: 'none' }); |
| | | showToast({ title: '已取消收藏', icon: 'none' }); |
| | | } catch (e) { |
| | | console.log('取消收藏失败', e); |
| | | Taro.showToast({ title: '取消收藏失败', icon: 'none' }); |
| | | showToast({ title: '取消收藏失败', icon: 'none' }); |
| | | } |
| | | }; |
| | | |
| | |
| | | if (itemType === 2) { |
| | | const children = Array.isArray(item?.children) ? item.children : []; |
| | | if (children.length === 0) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '此场站无有效站点', |
| | | icon: 'none', |
| | | }); |
| | |
| | | import Taro from '@tarojs/taro'; |
| | | import { showToast } from '../../../components/toast'; |
| | | import { View, Image } from '@tarojs/components'; |
| | | import { useState, useEffect } from 'react'; |
| | | import { collectPoint, getCollectPoints } from '../../../api/site-search'; |
| | |
| | | } |
| | | const firstSite = stationChildren[0]; |
| | | if (!firstSite) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '此场站无有效站点', |
| | | icon: 'none' |
| | | }); |
| | |
| | | }); |
| | | |
| | | if (Number(res?.total) >= MAX_COLLECT_COUNT) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: `最多收藏${MAX_COLLECT_COUNT}个站点`, |
| | | icon: 'none' |
| | | }); |
| | |
| | | await collectPoint(payload); |
| | | |
| | | setIsCollected(!isCollected); |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: isCollected ? '已取消收藏' : '收藏成功', |
| | | icon: 'none' |
| | | }); |
| | |
| | | } from '../../constants/confirm-ride-report'; |
| | | import { hasActiveTripOrderInStorage } from '../../utils/order'; |
| | | import { withRobotaxiWhitelist } from '../../../utils/whitelist'; |
| | | import { showToast } from '../../components/toast'; |
| | | import { withToast } from '../../components/toast/with-toast'; |
| | | import { TripStatus } from '../../constants/trip-status'; |
| | | |
| | | function SiteSearchPage() { |
| | |
| | | const resolvedDistanceConfig = await ensureDistanceConfigReady(); |
| | | const startSiteCache = Taro.getStorageSync('startSite'); |
| | | if (startSiteCache?.electronicAreaId && item?.electronicAreaId && startSiteCache.electronicAreaId !== item.electronicAreaId) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '起终点需在同一运营区域', |
| | | icon: 'none', |
| | | }) |
| | |
| | | sourceType = UNKNOWN_CONFIRM_RIDE_SOURCE_TYPE |
| | | ) => { |
| | | if (item?.operationStatus === 2) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '当前站点暂未开放', |
| | | icon: 'none', |
| | | }) |
| | | return |
| | | } |
| | | if (!isNonOperational) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '当前站点暂未开放', |
| | | icon: 'none', |
| | | }) |
| | |
| | | const resolvedDistanceConfig = await ensureDistanceConfigReady(); |
| | | const endSiteCache = Taro.getStorageSync('endSite'); |
| | | if (endSiteCache?.electronicAreaId && item?.electronicAreaId && endSiteCache.electronicAreaId !== item.electronicAreaId) { |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: '起终点需在同一运营区域', |
| | | icon: 'none', |
| | | }) |
| | |
| | | ) |
| | | } |
| | | |
| | | export default withRobotaxiWhitelist(SiteSearchPage); |
| | | export default withRobotaxiWhitelist(withToast(SiteSearchPage)); |