refactor(robotaxi): 统一替换 Taro.showToast 为自定义 toast 组件3
Co-Authored-By: 甄雪君 <zhenxj@xiaopeng.com>
| | |
| | | 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' |
| | | }); |
| | |
| | | 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); |
| | |
| | | stopPolling(); |
| | | stopLoading(doorType); |
| | | // Taro.hideLoading(); |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: failToastText, |
| | | icon: 'none' |
| | | }); |
| | |
| | | setTrunkStatus(isOpen); |
| | | stopLoading(doorType); |
| | | // Taro.hideLoading(); |
| | | Taro.showToast({ |
| | | showToast({ |
| | | title: successToastText, |
| | | icon: 'none' |
| | | }); |
| | |
| | | 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' |
| | |
| | | stopLoading('ac'); |
| | | |
| | | if (!acSuccess) { |
| | | Taro.showToast({ title: AC_TOGGLE_FAIL_TEXT, icon: 'none' }); |
| | | showToast({ title: AC_TOGGLE_FAIL_TEXT, icon: 'none' }); |
| | | } else { |
| | | if (!tempSuccess) { |
| | | Taro.showToast({ title: AC_TEMP_FAIL_TEXT, icon: 'none' }); |
| | | showToast({ title: AC_TEMP_FAIL_TEXT, icon: 'none' }); |
| | | } |
| | | } |
| | | |
| | |
| | | // 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); |
| | |
| | | userActionSeqRef.current++; |
| | | const currentTemp = typeof tempStatus === 'number' ? tempStatus : DEFAULT_FIRST_TEMP; |
| | | saveAcStorage(targetOrderId, { acOpen: targetOpenState, temperature: currentTemp }); |
| | | Taro.showToast({ title: targetOpenState ? '已开启空调' : '已关闭空调', icon: 'none' }); |
| | | showToast({ title: targetOpenState ? '已开启空调' : '已关闭空调', icon: 'none' }); |
| | | 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' }); |
| | | showToast({ title: AC_TOGGLE_FAIL_TEXT, icon: 'none' }); |
| | | } finally { |
| | | stopLoading('ac'); |
| | | } |
| | |
| | | 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 ROUTE_SUMMARY_MARKER_ID = 999001; |
| | |
| | | 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' |
| | | }); |