feat(begin-route): 为路线费用查询接口添加toast控制选项并在页面hook中禁用toast
新增QueryRouteAndFareRequestOptions类型以支持toast显示控制,在接口中接收options参数并传递给request工具,在use-page-restore hook中调用接口时传入showToast: false关闭提示
| | |
| | | QueryLedgerCreditOrderResultResponse |
| | | } from './types/begin-route'; |
| | | |
| | | type QueryRouteAndFareRequestOptions = { |
| | | showToast?: boolean; |
| | | }; |
| | | |
| | | // 导航-获取路线和费用 |
| | | export const queryRouteAndFare = async (payload: QueryRouteAndFarePayload): Promise<QueryRouteAndFareResponse> => { |
| | | export const queryRouteAndFare = async ( |
| | | payload: QueryRouteAndFarePayload, |
| | | options: QueryRouteAndFareRequestOptions = {} |
| | | ): Promise<QueryRouteAndFareResponse> => { |
| | | return request({ |
| | | url: _ROBOTAXI_HOST + '/itinerary/base/v1/mini-program/navigation/multi-route-and-fare', |
| | | method: 'POST', |
| | | payload |
| | | payload, |
| | | showToast: options.showToast |
| | | }, true); |
| | | } |
| | | |
| | |
| | | openCityId, |
| | | startPointId: restoredStartSite?.id || '', |
| | | orderId: restoredOrderId |
| | | }, { |
| | | showToast: false |
| | | }); |
| | | const responseRoutes = Array.isArray(response?.routes) |
| | | ? response.routes |