feat(robotaxi/begin-route): 新增到达目的地和行程完成页的页面浏览埋点
新增两个页面浏览埋点事件常量,并补充两处上报逻辑:
1. 到达目的地后上报到达目的地页浏览埋点
2. 启动行程支付时上报行程完成页浏览埋点
| | |
| | | /** 到达上车点后取消成功埋点事件。 */ |
| | | export const PICKUP_ARRIVED_CANCEL_TRIP_BUTTON_EVENT_ID = 'RT_xcx_Click_PickupArrived_CancelTrip_Button'; |
| | | |
| | | /** 到达目的地页面浏览埋点事件。 */ |
| | | export const ARRIVED_DROPOFF_PAGE_VIEW_EVENT_ID = 'RT_xcx_PageView_ArrivedDropoff'; |
| | | |
| | | /** 行程中完成行程埋点事件。 */ |
| | | export const TRIP_IN_PROGRESS_COMPLETE_TRIP_BUTTON_EVENT_ID = 'RT_xcx_Click_TripInProgress_CompleteTrip_Button'; |
| | | |
| | | /** 行程完成页面浏览埋点事件。 */ |
| | | export const TRIP_COMPLETED_PAGE_VIEW_EVENT_ID = 'RT_xcx_PageView_TripCompleted'; |
| | | |
| | | /** 行程中结束行程后进入支付前埋点事件。 */ |
| | | export const TRIP_IN_PROGRESS_PAY_START_BUTTON_EVENT_ID = 'RT_xcx_Click_TripInProgress_payStart_Button'; |
| | |
| | | import { getOrderDistance } from '../../../api/select-map-site'; |
| | | import { getOrderId } from '../../../utils/order'; |
| | | import { createTripInProgressCompleteTripReportPayload } from '../constants/confirm-ride-report'; |
| | | import { TRIP_IN_PROGRESS_PAY_START_BUTTON_EVENT_ID } from '../constants/report-events'; |
| | | import { TRIP_COMPLETED_PAGE_VIEW_EVENT_ID, TRIP_IN_PROGRESS_PAY_START_BUTTON_EVENT_ID } from '../constants/report-events'; |
| | | import { SocketOrderStatus, TripStatus } from '../constants/trip-status'; |
| | | import { OrderActionsDeps } from './use-order-actions.shared'; |
| | | |
| | |
| | | return; |
| | | } |
| | | try { |
| | | reportEvent( |
| | | TRIP_IN_PROGRESS_PAY_START_BUTTON_EVENT_ID, |
| | | createTripInProgressCompleteTripReportPayload({ |
| | | startSite: deps.startSite, |
| | | endSite: deps.endSite, |
| | | vehicleInfo: deps.vehicleInfo, |
| | | vehicleLocation: deps.vehicleLocation, |
| | | fareEstimate: deps.fareEstimate, |
| | | routeDurationSeconds: deps.routeDuration, |
| | | routeDistanceMeters: deps.orderRouteMetrics?.distanceMeters, |
| | | orderDetail |
| | | }) |
| | | ); |
| | | const payload = createTripInProgressCompleteTripReportPayload({ |
| | | startSite: deps.startSite, |
| | | endSite: deps.endSite, |
| | | vehicleInfo: deps.vehicleInfo, |
| | | vehicleLocation: deps.vehicleLocation, |
| | | fareEstimate: deps.fareEstimate, |
| | | routeDurationSeconds: deps.routeDuration, |
| | | routeDistanceMeters: deps.orderRouteMetrics?.distanceMeters, |
| | | orderDetail |
| | | }); |
| | | reportEvent(TRIP_IN_PROGRESS_PAY_START_BUTTON_EVENT_ID, payload); |
| | | reportEvent(TRIP_COMPLETED_PAGE_VIEW_EVENT_ID, payload, 'pageView'); |
| | | } catch (error) { |
| | | } |
| | | }; |
| | |
| | | import { clearOrderTripStorage, reportEvent } from '../../../../../utils/Robotaxi-public-method'; |
| | | import { getOrderId } from '../../../../utils/order'; |
| | | import { TripStatus, toTripStatus } from '../../constants/trip-status'; |
| | | import { TRIP_IN_PROGRESS_COMPLETE_TRIP_BUTTON_EVENT_ID } from '../../constants/report-events'; |
| | | import { ARRIVED_DROPOFF_PAGE_VIEW_EVENT_ID, TRIP_IN_PROGRESS_COMPLETE_TRIP_BUTTON_EVENT_ID } from '../../constants/report-events'; |
| | | import { createTripInProgressCompleteTripReportPayload } from '../../constants/confirm-ride-report'; |
| | | import { clearPassedRouteCache } from '../passed-route-cache'; |
| | | import { PENDING_CANCEL_CONTEXT_TTL_MS, type PendingCancelContext } from '../use-order-actions.shared'; |
| | |
| | | deps.arrivedDestinationReportedOrderIdRef.current = effectiveOrderId; |
| | | getOrderDetail(effectiveOrderId) |
| | | .then((orderDetail: any) => { |
| | | reportEvent( |
| | | TRIP_IN_PROGRESS_COMPLETE_TRIP_BUTTON_EVENT_ID, |
| | | createTripInProgressCompleteTripReportPayload({ |
| | | startSite: deps.startSite, |
| | | endSite: deps.endSite, |
| | | vehicleInfo: deps.vehicleInfo, |
| | | vehicleLocation: deps.vehicleLocation, |
| | | fareEstimate: deps.fareEstimate, |
| | | routeDurationSeconds: deps.routeDuration, |
| | | routeDistanceMeters: deps.orderRouteMetrics?.distanceMeters, |
| | | orderDetail |
| | | }) |
| | | ); |
| | | const payload = createTripInProgressCompleteTripReportPayload({ |
| | | startSite: deps.startSite, |
| | | endSite: deps.endSite, |
| | | vehicleInfo: deps.vehicleInfo, |
| | | vehicleLocation: deps.vehicleLocation, |
| | | fareEstimate: deps.fareEstimate, |
| | | routeDurationSeconds: deps.routeDuration, |
| | | routeDistanceMeters: deps.orderRouteMetrics?.distanceMeters, |
| | | orderDetail |
| | | }); |
| | | reportEvent(TRIP_IN_PROGRESS_COMPLETE_TRIP_BUTTON_EVENT_ID, payload); |
| | | reportEvent(ARRIVED_DROPOFF_PAGE_VIEW_EVENT_ID, payload, 'pageView'); |
| | | }) |
| | | .catch(() => { |
| | | deps.arrivedDestinationReportedOrderIdRef.current = ''; |