| src/pages/not-on-whitelist/index.tsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/pages/robotaxi/home/components/privacy-popup/index.less | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/robotaxi/pages/begin-route/components/cancel-popup.tsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/robotaxi/pages/begin-route/components/css-folder/cancel-popup.less | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/robotaxi/pages/select-map-site/components/select-map-site-view.tsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/robotaxi/pages/site-search/index.tsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/utils/whitelist.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/pages/not-on-whitelist/index.tsx
@@ -1,28 +1,56 @@ import Taro, { useDidShow } from '@tarojs/taro'; import { Image, View } from '@tarojs/components'; import { useState } from 'react'; import { syncWhitelistBlockPageAccess } from '../../utils/whitelist'; import { checkOtp } from '../../utils/tools'; import { isWhiteList } from '../../robotaxi/api/home'; import { redirectToRobotaxiHomePage } from '../../utils/whitelist'; import { jumpTo } from '../../utils/jump'; import './index.less'; /** 白名单拦截图 CDN 地址。 */ // const NOT_ON_WHITELIST_IMAGE_URL = 'https://s.xiaopeng.com/xp-fe/robot-taxi/imgs/not-on-whitelist.png'; const NOT_ON_WHITELIST_IMAGE_URL = 'https://s.xiaopeng.com/xp-fe/robot-taxi/imgs/not-on-whitelist-v2.png'; const BACK_ICON = 'https://s.xiaopeng.com/xp-fe/robot-taxi/imgs/back-icon.png'; const LOGIN_PAGE_URL = '/pages/user/login'; /** * 非白名单拦截页。 * * 进入页面后顺序执行: * 1. 检查是否已登录,未登录 → 跳转登录页,登录后重新触发本页 useDidShow * 2. 已登录 → 查询白名单 * 3. 在白名单内 → 自动跳转 Robotaxi 首页 * 4. 不在白名单内(含接口异常)→ 展示拦截图 */ export default function NotOnWhitelist() { const [shouldRenderImage, setShouldRenderImage] = useState(false); // 白名单接口确认非白名单后才展示图片 const [shouldRenderImage, setShouldRenderImage] = useState(false); useDidShow(() => { useDidShow(async () => { if (typeof Taro.hideHomeButton === 'function') { Taro.hideHomeButton(); } setShouldRenderImage(false); void syncWhitelistBlockPageAccess().then((whitelistAccessResult) => { setShouldRenderImage(whitelistAccessResult === 'deny'); }); // 1. 检查登录态 const otp = await checkOtp(false); if (!otp) { jumpTo({ url: LOGIN_PAGE_URL }); return; } // 2. 查询白名单 try { const onWhitelist = await isWhiteList(); if (onWhitelist) { // 3. 在白名单内 → 回首页 await redirectToRobotaxiHomePage(); } else { // 4. 不在白名单内 → 展示拦截图 setShouldRenderImage(true); } } catch (error) { console.error('白名单校验失败', error); // 接口异常时按不在白名单处理 setShouldRenderImage(true); } }); const handleBack = () => { src/pages/robotaxi/home/components/privacy-popup/index.less
@@ -75,8 +75,9 @@ white-space: normal; } .all-name{ font-size: 28px; color:#000000; font-size: 28px; color:#000000; height: 66px; } } .mt-16{ src/robotaxi/pages/begin-route/components/cancel-popup.tsx
@@ -142,7 +142,7 @@ : <View className='cancel-btn-box'> <Image className='cancel-btn-cancel' onClick={onConfirm} src='https://s.xiaopeng.com/xp-fe/robot-taxi/imgs/submit-cancel-btn.png' /> <View className='cancel-btn-again' onClick={onClose}>再等等</View> <View className='cancel-btn-again wait-btn' onClick={onClose}>再等等</View> </View> } </View> src/robotaxi/pages/begin-route/components/css-folder/cancel-popup.less
@@ -122,7 +122,6 @@ } .cancel-btn-again { margin-left: 32px; flex: 1; line-height: 96px; text-align: center; @@ -133,6 +132,9 @@ letter-spacing: normal; color: #FFFFFF; } .wait-btn { margin-left: 32px; } } } } } src/robotaxi/pages/select-map-site/components/select-map-site-view.tsx
@@ -101,7 +101,7 @@ )} <View className="toolTip-txt"> <View className="toolTip-txt-content"> {deps.outOfServiceRange ? `请拖动至${deps.pageType == 'end' ? '下车' : '上车'}点` : deps.selectedSite.name} {deps.outOfServiceRange ? `请拖动至${deps.pageType == 'end' ? '目的地' : '上车点'}` : deps.selectedSite.name} </View> </View> </View> @@ -129,7 +129,7 @@ </View> )} {(deps.nearbySites.length > 0 && deps.pageType === 'end') && ( <View className="limit-tip">点击其他选项或紫色原点,可更改{deps.pageType === 'start' ? '上车' : '下车'}点</View> <View className="limit-tip">点击紫色原点或拖动大头针,可修改{deps.pageType === 'start' ? '上车点' : '目的地'}</View> )} </View> {deps.selectionMode === 'station' && ( src/robotaxi/pages/site-search/index.tsx
@@ -544,7 +544,7 @@ { recommendList.length > 0 && <View className='recommend-card'> <View className='card-header'>{searchValue ? '推荐站点' : '附近站点'}</View> <View className='card-header'>{searchValue ? '搜索站点' : '推荐站点'}</View> <View className='card-content list-content' id='recommend-card-content'> { renderSiteItems(visibleRecommend, (item, index = 0) => { src/utils/whitelist.ts
@@ -118,21 +118,9 @@ return; } await Taro.reLaunch({ await Taro.redirectTo({ url: ROBOTAXI_HOME_PAGE_URL, }); } /** * 白名单拦截页自恢复:白名单命中后自动返回首页。 */ export async function syncWhitelistBlockPageAccess() { const whitelistAccessResult = await checkWhitelistAccess({ ignoreRouteExempt: true }); // 白名单页不允许未登录用户停留,游客态或白名单恢复后都回首页。 if (whitelistAccessResult === 'guest' || whitelistAccessResult === 'pass') { await redirectToRobotaxiHomePage(); } return whitelistAccessResult; } /**