卢春龙
2026-04-24 aa8038c44dc8e2eda1e801b8f44f54d00fd649e3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
import { View, Map, Image } from '@tarojs/components';
import CustomerServicePopup from '../../../components/customer-service';
import ReleaseRoute from './release-route';
import ReleaseBeBeing from './release-be-being';
import CancelPopup from './cancel-popup';
import CallingCar from './calling-car';
import AnnouncementsPopup from './announcements-popup';
import OverRoute from './over-route';
import PassengerNotice from './passenger-notice';
import EvaluatePopup from './evaluate-popup';
import TipPopup from '../../select-map-site/components/tip-popup';
import PrivacyPopup from '../../../../pages/robotaxi/home/components/privacy-popup';
 
type Props = {
  mapLongitude: number;
  mapLatitude: number;
  mapScale: number;
  markers: any[];
  polyline: any[];
  showLocation: boolean;
  handleCalloutTap: (e: any) => void;
  handleRegionChange: (e: any) => void;
  renderMapOverlays: () => JSX.Element;
  toBack: () => void;
  backIcon: string;
  onServiceEntry: () => void;
  onCouponEntry: () => void;
  onOrderEntry: () => void;
  contactService: string;
  coupon: string;
  suggest: string;
  shouldShowOrigin: boolean;
  originBoxHidden: boolean;
  originOpacity: number;
  toOrigin: () => void;
  originIcon: string;
  renderTripCard: () => JSX.Element | null;
  showCustomerService: boolean;
  handleCloseCustomerService: () => void;
  showCancelPopup: boolean;
  cancelType: number;
  cancelPopupWaitMinutes: number | null;
  startSite: any;
  endSite: any;
  fareEstimate: any;
  tripStatus: number;
  routeDuration: number | null;
  handleCloseCancelPopup: () => void;
  handleConfirmCancel: () => void;
  showAnnouncementsPopup: boolean;
  handleCloseAnnouncementsPopup: () => void;
  showOverRoutePopup: boolean;
  handleCloseOverRoutePopup: () => void;
  handleConfirmOverRoute: () => void;
  showTipPopup: boolean;
  handleCloseTipPopup: () => void;
  tipType: string;
  showPrivacyPopup: boolean;
  handleClosePrivacyPopup: () => void;
  showPassengerNotice: boolean;
  handleClosePassengerNotice: () => void;
  changeCheckedEnter: (checked: boolean) => void;
  showEvaluatePopup: boolean;
  orderId: string;
  handleCloseEvaluatePopup: () => void;
  handleConfirmEvaluate: (content: string) => void;
};
 
export default function BeginRouteView(props: Props) {
  const {
    mapLongitude,
    mapLatitude,
    mapScale,
    markers,
    polyline,
    showLocation,
    handleCalloutTap,
    handleRegionChange,
    renderMapOverlays,
    toBack,
    backIcon,
    onServiceEntry,
    onCouponEntry,
    onOrderEntry,
    contactService,
    coupon,
    suggest,
    shouldShowOrigin,
    originBoxHidden,
    originOpacity,
    toOrigin,
    originIcon,
    renderTripCard,
    showCustomerService,
    handleCloseCustomerService,
    showCancelPopup,
    cancelType,
    cancelPopupWaitMinutes,
    startSite,
    endSite,
    fareEstimate,
    tripStatus,
    routeDuration,
    handleCloseCancelPopup,
    handleConfirmCancel,
    showAnnouncementsPopup,
    handleCloseAnnouncementsPopup,
    showOverRoutePopup,
    handleCloseOverRoutePopup,
    handleConfirmOverRoute,
    showTipPopup,
    handleCloseTipPopup,
    tipType,
    showPrivacyPopup,
    handleClosePrivacyPopup,
    showPassengerNotice,
    handleClosePassengerNotice,
    changeCheckedEnter,
    showEvaluatePopup,
    orderId,
    handleCloseEvaluatePopup,
    handleConfirmEvaluate
  } = props;
 
  // 统一渲染地图与业务弹窗容器
  return (
    <View className='home-container'>
      <Map
        id='map'
        longitude={mapLongitude}
        latitude={mapLatitude}
        scale={mapScale}
        markers={markers}
        polyline={polyline}
        showLocation={showLocation}
        onCalloutTap={handleCalloutTap}
        onRegionChange={handleRegionChange}
        style={{ width: '100%', height: '87vh' }}
      >
        {renderMapOverlays()}
        <View onClick={toBack} className='select-city'>
          <Image className='select-city-icon' src={backIcon} />
        </View>
        <View className='map-entry'>
          <Image onClick={onServiceEntry} className='map-entry-icon' src={contactService} />
          <View className='split-line'></View>
          <Image onClick={onCouponEntry} className='map-entry-icon' src={coupon} />
          <View className='split-line'></View>
          <Image onClick={onOrderEntry} className='map-entry-icon' src={suggest} />
        </View>
        <View className='container'>
          <View className='container-inner'>
            {shouldShowOrigin && (
              <View className='origin-box' style={{ opacity: originBoxHidden ? 0 : originOpacity, transition: 'opacity 0.2s ease-out', pointerEvents: originBoxHidden ? 'none' : 'auto' }}>
                <Image onClick={toOrigin} className='origin-icon' src={originIcon} />
              </View>
            )}
            <View catchMove onClick={(e) => e.stopPropagation()}>
              {renderTripCard()}
            </View>
          </View>
        </View>
      </Map>
      <CustomerServicePopup
        show={showCustomerService}
        onClose={handleCloseCustomerService}
      />
      <CancelPopup
        show={showCancelPopup}
        cancelType={cancelType}
        startSite={startSite}
        endSite={endSite}
        waitMinutes={cancelPopupWaitMinutes ?? fareEstimate?.waitingTime}
        tripStatus={tripStatus}
        routeDurationSeconds={routeDuration}
        discountAmount={fareEstimate?.discountAmount}
        onClose={handleCloseCancelPopup}
        onConfirm={handleConfirmCancel}
      />
      <AnnouncementsPopup
        show={showAnnouncementsPopup}
        onClose={handleCloseAnnouncementsPopup}
      />
      <OverRoute
        show={showOverRoutePopup}
        onClose={handleCloseOverRoutePopup}
        onConfirm={handleConfirmOverRoute}
      />
      <TipPopup
        show={showTipPopup}
        onClose={handleCloseTipPopup}
        tipType={tipType}
      />
      <PrivacyPopup
        show={showPrivacyPopup}
        onClose={handleClosePrivacyPopup}
        onAgree={handleClosePrivacyPopup}
      />
      {!showCancelPopup && (
        <PassengerNotice
          show={showPassengerNotice}
          onClose={handleClosePassengerNotice}
          onCheckedChange={changeCheckedEnter}
        />
      )}
      <EvaluatePopup
        show={showEvaluatePopup}
        orderId={orderId}
        orderRating={1}
        onClose={handleCloseEvaluatePopup}
        onConfirm={handleConfirmEvaluate}
      />
    </View>
  );
}