feat: 更新埋点配置并添加用户行为追踪
- 更新生产环境埋点平台ID和数据源ID
- 在多个关键用户操作节点添加事件上报,包括协议同意、地址搜索、订单提交等
- 将"系统优惠"统一更名为"限时优惠"
- 修复评价弹窗图片删除按钮样式问题
- 优化路线初始化逻辑,确保地图正确渲染
| | |
| | | }; |
| | | |
| | | const GIO_CONFIG = { |
| | | accountId: '"xxxxxxx"', // 埋点平台id |
| | | accountId: '"84eafaa69d23412f"', // 埋点平台id |
| | | dataSourceId: { |
| | | weapp: '"xxxxxxx"', // 埋点数据源id |
| | | weapp: '"b9aa24dc0aab9edb"', // 埋点数据源id |
| | | }, |
| | | host: '"https://collect.xiaopeng.com"', |
| | | } |
| | |
| | | import uncheck from '../../../../../robotaxi/assets/uncheck.png' |
| | | import { privicyShowManager } from './utils' |
| | | import { submitAgreement } from '../../../../../robotaxi/api/home' |
| | | import { reportEvent } from '../../../../../utils/Robotaxi-public-method' |
| | | |
| | | type Props = { |
| | | show?: boolean; |
| | |
| | | }, [isAgree]); |
| | | |
| | | const handleClose = () => { |
| | | reportEvent('RT_xcx_protocol_click', { |
| | | status_code: 0 |
| | | }) |
| | | privicyShowManager.setHasShow(false) |
| | | onClose?.(); |
| | | }; |
| | |
| | | return |
| | | }; |
| | | submitAgreement({ type: [1, 2, 3, 4] }).then((res: any) => { |
| | | reportEvent('RT_xcx_protocol_click', { |
| | | status_code: 1 |
| | | }) |
| | | privicyShowManager.setHasShow(true) |
| | | onAgree?.(); |
| | | }).catch(() => { |
| | |
| | | getCityLocation, |
| | | getCityInfoWithId, |
| | | getLocationByIP, |
| | | mapOrderStatusToTripStatus |
| | | mapOrderStatusToTripStatus, |
| | | reportEvent, |
| | | } from '../../../utils/Robotaxi-public-method'; |
| | | import { jumpTo } from '../../../utils/jump'; |
| | | import { _ROBOTAXI_WS_HOST, CDN } from '../../../constants/api'; |
| | |
| | | Taro.setStorageSync('startSite', currentSite); |
| | | Taro.navigateTo({ |
| | | url: '/robotaxi/pages/select-map-site/index?pageType=' + type, |
| | | success: () => { |
| | | reportEvent('RT_xcx_protocol_click', { |
| | | element_type: 'start' |
| | | }) |
| | | } |
| | | }) |
| | | return |
| | | } |
| | |
| | | Taro.setStorageSync('startSite', currentSite); |
| | | } |
| | | Taro.navigateTo({ |
| | | url: `/robotaxi/pages/site-search/index?pageType=${type}&electronicAreaId=${electronicAreaId}&longitude=${currentSite.longitude}&latitude=${currentSite.latitude}` |
| | | url: `/robotaxi/pages/site-search/index?pageType=${type}&electronicAreaId=${electronicAreaId}&longitude=${currentSite.longitude}&latitude=${currentSite.latitude}`, |
| | | success: () => { |
| | | reportEvent('RT_xcx_protocol_click', { |
| | | element_type: type == 'start' ? 'start' : 'dest', |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | getTypeLabel, |
| | | formatMoney, |
| | | formatTripDistance, |
| | | formatTripDurationFromSeconds |
| | | formatTripDurationFromSeconds, |
| | | reportEvent |
| | | } from '../../../../utils/Robotaxi-public-method'; |
| | | import { |
| | | getWaitTime, |
| | |
| | | queryFareBreakdown(targetOrderId).then((res: any) => { |
| | | const data = res?.data ?? res?.result ?? res; |
| | | setFareBreakdown(data); |
| | | }).catch(() => { }); |
| | | }).catch(() => { |
| | | reportEvent('RT_xcx_dest_arrive_fail', {}) |
| | | }); |
| | | }; |
| | | |
| | | // 根据行程状态初始化等待/限停/倒计时/温度信息,并管理对应定时器 |
| | |
| | | width: 208px; |
| | | height: 208px; |
| | | border-radius: 16px; |
| | | overflow: hidden; |
| | | // overflow: hidden; |
| | | background: rgba(0, 0, 0, 0.03); |
| | | } |
| | | |
| | |
| | | |
| | | &-delete { |
| | | position: absolute; |
| | | top: 8px; |
| | | right: 8px; |
| | | box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2); |
| | | top: -10px; |
| | | right: -10px; |
| | | z-index: 2; |
| | | |
| | | .delete-icon { |
| | |
| | | import wsManager from '../../../utils/websocket'; |
| | | import { |
| | | getWalkingRoute, |
| | | formatDurationToClock, |
| | | formatDateTime, |
| | | clearOrderTripStorage, |
| | | preloadImageToTemp, |
| | |
| | | convertAdcodeToCityCode, |
| | | getCityInfoWithId, |
| | | getDistance, |
| | | shouldUpdateRoute, |
| | | mapOrderStatusToTripStatus |
| | | mapOrderStatusToTripStatus, |
| | | reportEvent |
| | | } from '../../../utils/Robotaxi-public-method'; |
| | | import { |
| | | saveOrder, |
| | |
| | | orderRouteInitializedRef.current = true; |
| | | currentFullRouteRef.current = [...points]; |
| | | lastErasedIndexRef.current = 0; |
| | | applyRoutePoints(points); |
| | | Taro.nextTick(() => { |
| | | applyRoutePoints(points); |
| | | }); |
| | | } |
| | | if (firstPoint && typeof firstPoint.latitude === 'number' && typeof firstPoint.longitude === 'number') { |
| | | updateVehicleLocationThrottled(firstPoint.latitude, firstPoint.longitude, true); |
| | |
| | | |
| | | const waitingTime = Number(fareEstimate?.waitingTime || 0); |
| | | const estimatedTime = formatDateTime(new Date(Date.now() + waitingTime * 60 * 1000)); |
| | | const cachedCouponId = Taro.getStorageSync('selectedCouponId'); |
| | | const cachedCouponId = Taro.getStorageSync('selectedCouponId') || ''; |
| | | const payload: any = { |
| | | endPointId: endSite.id, |
| | | openCityId: openCityId, |
| | |
| | | } |
| | | try { |
| | | const res = await saveOrder(payload); |
| | | let status_code = res.orderId ? 1 : 0; |
| | | reportEvent('RT_xcx_order_submit', { |
| | | total_amount: fareEstimate.originalFare, |
| | | payable_amount: fareEstimate.finalFare, |
| | | coupon_id: cachedCouponId, |
| | | status_code: status_code, |
| | | }) |
| | | if (typeof res == 'string') { |
| | | Taro.showToast({ |
| | | title: res, |
| | |
| | | }) |
| | | setTimeout(() => { |
| | | Taro.reLaunch({ |
| | | url: '/robotaxi/pages/begin-route/index', |
| | | url: '/pages/home/index', |
| | | }) |
| | | }, 1500); |
| | | return |
| | |
| | | { |
| | | (fareData.orderMoney && !fareData.couponMoney) && |
| | | <View className='flex-between-card mt-16'> |
| | | <View className='price-label'>系统优惠</View> |
| | | <View className='price-label'>限时优惠</View> |
| | | <View className='price-value color-red'>-{formatMoney(fareData.orderMoney)}元</View> |
| | | </View> |
| | | } |
| | | { |
| | | (fareData.orderMoney && fareData.couponMoney && fareData.orderMoney - fareData.couponMoney > 0) ? |
| | | <View className='flex-between-card mt-16'> |
| | | <View className='price-label'>系统优惠</View> |
| | | <View className='price-label'>限时优惠</View> |
| | | <View className='price-value color-red'>-{formatMoney(fareData.orderMoney - fareData.couponMoney)}元</View> |
| | | </View> |
| | | : '' |
| | |
| | | { |
| | | (pricingCard.systemDiscount && pricingCard.systemDiscount > 0) && |
| | | <View className='flex-between-card'> |
| | | <View className='price-label'>系统优惠</View> |
| | | <View className='price-label'>限时优惠</View> |
| | | <View className='price-value color-red'>-{pricingCard.systemDiscountStr}元</View> |
| | | </View> |
| | | } |
| | |
| | | import { getOrderDistance } from '../../api/select-map-site'; |
| | | import { AMAP_KEY, _UID } from '../../../constants/api'; |
| | | import amapFile from '../../../libs/amap-wx.130.js'; |
| | | import { checkOtp, getStorage } from '../../../utils/tools'; |
| | | import { checkOtp } from '../../../utils/tools'; |
| | | import TipPopup from '../select-map-site/components/tip-popup'; |
| | | import { getNearestSite } from '../../api/home'; |
| | | |
| | |
| | | return; |
| | | } |
| | | } catch { } |
| | | // 埋点 |
| | | getStorage(_UID).then((uid) => { |
| | | const $app: any = Taro.getApp().$app; |
| | | $app.xpReportSend({ |
| | | eventId: 'RT_mp_user_address_searched', |
| | | para: { |
| | | eventId: 'RT_mp_user_address_searched', |
| | | user_id: uid || '-1', |
| | | search_type: pageType === 'start' ? 'pickup ' : 'dropoff ', |
| | | geo_lat: item.latitude, |
| | | geo_lng: item.longitude, |
| | | odd_grid_id: item.electronicAreaId, |
| | | timestamp: Date.now(), |
| | | }, |
| | | }); |
| | | }); |
| | | Taro.setStorageSync('startSite', item); |
| | | Taro.navigateBack() |
| | | } else if (pageType == 'end') { |
| | |
| | | } |
| | | } |
| | | } catch { } |
| | | // 埋点 |
| | | getStorage(_UID).then((uid) => { |
| | | const $app: any = Taro.getApp().$app; |
| | | $app.xpReportSend({ |
| | | eventId: 'RT_mp_user_address_searched', |
| | | para: { |
| | | eventId: 'RT_mp_user_address_searched', |
| | | user_id: uid || '-1', |
| | | search_type: pageType === 'start' ? 'pickup ' : 'dropoff ', |
| | | }, |
| | | }); |
| | | }); |
| | | Taro.setStorageSync('endSite', item) |
| | | Taro.reLaunch({ |
| | | url: Taro.getStorageSync('orderId') ? '/robotaxi/pages/begin-route/index?skipPageFlag=1' : '/robotaxi/pages/begin-route/index', |
| | |
| | | import amapFile from '../libs/amap-wx.130.js'; |
| | | import { AMAP_KEY, _ROBOTAXI_HOST } from '../constants/api'; |
| | | import { AMAP_KEY, _ROBOTAXI_HOST, _UID } from '../constants/api'; |
| | | import Taro from '@tarojs/taro'; |
| | | import request from './request'; |
| | | import { getFenceCheck, getNearestSite } from '../robotaxi/api/home'; |
| | | import { getOpenCity } from '../robotaxi/api/select-city'; |
| | | import { getStorage, getOrCreateLocalId } from './tools'; |
| | | |
| | | |
| | | // 辅助函数:计算两点之间的距离(单位:米) |
| | | export const getDistance = (lat1: number, lng1: number, lat2: number, lng2: number) => { |
| | |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | // 埋点 |
| | | export const reportEvent = async (eventId: string, para: any) => { |
| | | let appVersion = ''; |
| | | const $app: any = Taro.getApp().$app; |
| | | const { openId } = await $app.getIdData() || {}; |
| | | try { |
| | | const accountInfo = Taro.getAccountInfoSync(); |
| | | appVersion = accountInfo?.miniProgram?.version || accountInfo?.miniProgram?.envVersion || ''; |
| | | } catch (e) { |
| | | console.warn('获取小程序版本号失败:', e); |
| | | } |
| | | |
| | | getStorage(_UID).then((uid) => { |
| | | $app.xpReportSend({ |
| | | eventId, |
| | | para: { |
| | | ...para, |
| | | user_id: uid || '-1', |
| | | masked_device_id: openId, |
| | | event_time: Date.now(), |
| | | city: Taro.getStorageSync('selectedCity').name, |
| | | orderId: Taro.getStorageSync('orderId') || '', |
| | | os: Taro.getSystemInfoSync().system, |
| | | app_ver: appVersion, |
| | | }, |
| | | }); |
| | | }); |
| | | } |