ordering-ui-react-native 0.12.33 → 0.12.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +6 -5
- package/themes/business/src/components/OrderDetails/Business.tsx +2 -4
- package/themes/business/src/components/OrderDetails/Delivery.tsx +231 -202
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +344 -334
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +83 -69
- package/themes/business/src/components/OrdersOption/index.tsx +122 -77
- package/themes/business/src/components/PreviousOrders/index.tsx +124 -73
- package/themes/business/src/components/PreviousOrders/styles.tsx +7 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +26 -25
- package/themes/business/src/components/shared/OIcon.tsx +2 -0
- package/themes/business/src/types/index.tsx +5 -0
- package/themes/single-business/src/components/BusinessBasicInformation/index.tsx +1 -1
- package/themes/single-business/src/components/BusinessProductsListing/index.tsx +9 -8
- package/themes/single-business/src/components/BusinessesListing/index.tsx +307 -296
- package/themes/single-business/src/components/BusinessesListing/styles.tsx +41 -14
- package/themes/single-business/src/components/HelpAccountAndPayment/index.tsx +7 -6
- package/themes/single-business/src/components/HelpGuide/index.tsx +7 -6
- package/themes/single-business/src/components/HelpOrder/index.tsx +7 -6
- package/themes/single-business/src/components/LanguageSelector/index.tsx +87 -70
- package/themes/single-business/src/components/LoginForm/index.tsx +2 -2
- package/themes/single-business/src/components/OrderDetails/index.tsx +21 -21
- package/themes/single-business/src/components/ProductForm/index.tsx +682 -656
- package/themes/single-business/src/components/ProductForm/styles.tsx +1 -1
- package/themes/single-business/src/components/UserProfile/index.tsx +2 -2
- package/themes/single-business/src/components/shared/OIconButton.tsx +2 -2
- package/themes/single-business/src/components/shared/OInput.tsx +1 -0
- package/themes/single-business/src/components/shared/OLink.tsx +80 -0
- package/themes/single-business/src/components/shared/index.tsx +2 -0
- package/themes/single-business/src/types/index.tsx +3 -0
|
@@ -4,13 +4,13 @@ import { Platform, StyleSheet, View } from 'react-native';
|
|
|
4
4
|
|
|
5
5
|
import { OButton, OText, OLink, OModal } from '../shared'
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
OrderContent,
|
|
8
|
+
OrderBusiness,
|
|
9
|
+
OrderCustomer,
|
|
10
|
+
OrderProducts,
|
|
11
|
+
Table,
|
|
12
|
+
OrderBill,
|
|
13
|
+
Total,
|
|
14
14
|
} from './styles';
|
|
15
15
|
|
|
16
16
|
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
@@ -18,289 +18,293 @@ import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
|
18
18
|
import { verifyDecimals } from '../../utils';
|
|
19
19
|
|
|
20
20
|
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
useLanguage,
|
|
22
|
+
useUtils,
|
|
23
|
+
useConfig,
|
|
24
24
|
} from 'ordering-components/native';
|
|
25
25
|
import { useTheme } from 'styled-components/native';
|
|
26
26
|
import { ReviewCustomer } from '../ReviewCustomer'
|
|
27
27
|
|
|
28
28
|
interface OrderContent {
|
|
29
|
-
|
|
29
|
+
order: any,
|
|
30
|
+
logisticOrderStatus?: Array<number>
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
export const OrderContentComponent = (props: OrderContent) => {
|
|
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
|
-
borderRadius: 8,
|
|
63
|
-
}
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
const handleSuccessReviewed = () => {
|
|
67
|
-
setOpenReviewModal(false)
|
|
68
|
-
setIsCustomerReviewed(true)
|
|
34
|
+
const [, t] = useLanguage();
|
|
35
|
+
const theme = useTheme()
|
|
36
|
+
|
|
37
|
+
const { order, logisticOrderStatus } = props;
|
|
38
|
+
const [{ parsePrice, parseNumber }] = useUtils();
|
|
39
|
+
const [{ configs }] = useConfig();
|
|
40
|
+
const [openReviewModal, setOpenReviewModal] = useState(false)
|
|
41
|
+
const [isCustomerReviewed, setIsCustomerReviewed] = useState(false)
|
|
42
|
+
|
|
43
|
+
const pastOrderStatuses = [1, 2, 5, 6, 10, 11, 12, 16, 17]
|
|
44
|
+
|
|
45
|
+
const styles = StyleSheet.create({
|
|
46
|
+
linkWithIcons: {
|
|
47
|
+
flexDirection: 'row',
|
|
48
|
+
alignItems: 'center',
|
|
49
|
+
justifyContent: 'space-between',
|
|
50
|
+
marginBottom: 5,
|
|
51
|
+
flex: 1,
|
|
52
|
+
},
|
|
53
|
+
textBold: {
|
|
54
|
+
fontWeight: '600',
|
|
55
|
+
},
|
|
56
|
+
textLink: {
|
|
57
|
+
color: '#365CC7'
|
|
58
|
+
},
|
|
59
|
+
btnReview: {
|
|
60
|
+
borderWidth: 0,
|
|
61
|
+
backgroundColor: theme.colors.primary,
|
|
62
|
+
borderRadius: 8,
|
|
69
63
|
}
|
|
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
|
-
</View>
|
|
101
|
-
)}
|
|
102
|
-
|
|
103
|
-
{!!order?.business?.phone && (
|
|
104
|
-
<View style={styles.linkWithIcons}>
|
|
105
|
-
<OLink
|
|
106
|
-
PressStyle={styles.linkWithIcons}
|
|
107
|
-
url={`tel:${order?.business?.phone}`}
|
|
108
|
-
shorcut={order?.business?.phone}
|
|
109
|
-
TextStyle={styles.textLink}
|
|
110
|
-
/>
|
|
111
|
-
</View>
|
|
112
|
-
)}
|
|
113
|
-
|
|
114
|
-
{!!order?.business?.address && (
|
|
115
|
-
<View style={styles.linkWithIcons}>
|
|
116
|
-
<OLink
|
|
117
|
-
PressStyle={styles.linkWithIcons}
|
|
118
|
-
url={Platform.select({
|
|
119
|
-
ios: `maps:0,0?q=${order?.business?.address}`,
|
|
120
|
-
android: `geo:0,0?q=${order?.business?.address}`,
|
|
121
|
-
})}
|
|
122
|
-
shorcut={order?.business?.address}
|
|
123
|
-
TextStyle={styles.textLink}
|
|
124
|
-
/>
|
|
125
|
-
</View>
|
|
126
|
-
)}
|
|
127
|
-
|
|
128
|
-
{!!order?.business?.address_notes && (
|
|
129
|
-
<View style={styles.linkWithIcons}>
|
|
130
|
-
<OLink
|
|
131
|
-
PressStyle={styles.linkWithIcons}
|
|
132
|
-
url={Platform.select({
|
|
133
|
-
ios: `maps:0,0?q=${order?.business?.address_notes}`,
|
|
134
|
-
android: `geo:0,0?q=${order?.business?.address_notes}`,
|
|
135
|
-
})}
|
|
136
|
-
shorcut={order?.business?.address_notes}
|
|
137
|
-
TextStyle={styles.textLink}
|
|
138
|
-
/>
|
|
139
|
-
</View>
|
|
140
|
-
)}
|
|
141
|
-
</OrderBusiness>
|
|
142
|
-
|
|
143
|
-
<OrderCustomer>
|
|
144
|
-
<OText style={{ marginBottom: 5 }} size={16} weight="600">
|
|
145
|
-
{t('CUSTOMER_DETAILS', 'Customer details')}
|
|
146
|
-
</OText>
|
|
147
|
-
|
|
148
|
-
<View style={{ flexDirection: 'row' }}>
|
|
149
|
-
<OText numberOfLines={2} mBottom={4}>
|
|
150
|
-
<OText
|
|
151
|
-
numberOfLines={1}
|
|
152
|
-
mBottom={4}
|
|
153
|
-
ellipsizeMode="tail"
|
|
154
|
-
space>
|
|
155
|
-
{order?.customer?.name}
|
|
156
|
-
</OText>
|
|
157
|
-
|
|
158
|
-
<OText
|
|
159
|
-
numberOfLines={1}
|
|
160
|
-
mBottom={4}
|
|
161
|
-
ellipsizeMode="tail"
|
|
162
|
-
space>
|
|
163
|
-
{order?.customer?.middle_name}
|
|
164
|
-
</OText>
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
const handleSuccessReviewed = () => {
|
|
67
|
+
setOpenReviewModal(false)
|
|
68
|
+
setIsCustomerReviewed(true)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<OrderContent>
|
|
73
|
+
<OrderBusiness>
|
|
74
|
+
<OText style={{ marginBottom: 5 }} size={16} weight="600">
|
|
75
|
+
{t('BUSINESS_DETAILS', 'Business details')}
|
|
76
|
+
</OText>
|
|
77
|
+
|
|
78
|
+
<OText numberOfLines={1} mBottom={4} ellipsizeMode="tail">
|
|
79
|
+
{order?.business?.name}
|
|
80
|
+
</OText>
|
|
81
|
+
{(!order?.isLogistic || !logisticOrderStatus?.includes(order?.status)) && (
|
|
82
|
+
<>
|
|
83
|
+
{!!order?.business?.email && (
|
|
84
|
+
<View style={styles.linkWithIcons}>
|
|
85
|
+
<OLink
|
|
86
|
+
PressStyle={styles.linkWithIcons}
|
|
87
|
+
url={`mailto:${order?.business?.email}`}
|
|
88
|
+
shorcut={order?.business?.email}
|
|
89
|
+
TextStyle={styles.textLink}
|
|
90
|
+
/>
|
|
91
|
+
</View>
|
|
92
|
+
)}
|
|
165
93
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
94
|
+
{!!order?.business?.cellphone && (
|
|
95
|
+
<View style={styles.linkWithIcons}>
|
|
96
|
+
<OLink
|
|
97
|
+
PressStyle={styles.linkWithIcons}
|
|
98
|
+
url={`tel:${order?.business?.cellphone}`}
|
|
99
|
+
shorcut={`${order?.business?.cellphone}`}
|
|
100
|
+
TextStyle={styles.textLink}
|
|
101
|
+
/>
|
|
102
|
+
</View>
|
|
103
|
+
)}
|
|
173
104
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
105
|
+
{!!order?.business?.phone && (
|
|
106
|
+
<View style={styles.linkWithIcons}>
|
|
107
|
+
<OLink
|
|
108
|
+
PressStyle={styles.linkWithIcons}
|
|
109
|
+
url={`tel:${order?.business?.phone}`}
|
|
110
|
+
shorcut={order?.business?.phone}
|
|
111
|
+
TextStyle={styles.textLink}
|
|
112
|
+
/>
|
|
113
|
+
</View>
|
|
114
|
+
)}
|
|
115
|
+
</>
|
|
116
|
+
)}
|
|
117
|
+
|
|
118
|
+
{!!order?.business?.address && (
|
|
119
|
+
<View style={styles.linkWithIcons}>
|
|
120
|
+
<OLink
|
|
121
|
+
PressStyle={styles.linkWithIcons}
|
|
122
|
+
url={Platform.select({
|
|
123
|
+
ios: `maps:0,0?q=${order?.business?.address}`,
|
|
124
|
+
android: `geo:0,0?q=${order?.business?.address}`,
|
|
125
|
+
})}
|
|
126
|
+
shorcut={order?.business?.address}
|
|
127
|
+
TextStyle={styles.textLink}
|
|
128
|
+
/>
|
|
129
|
+
</View>
|
|
130
|
+
)}
|
|
131
|
+
|
|
132
|
+
{!!order?.business?.address_notes && (
|
|
133
|
+
<View style={styles.linkWithIcons}>
|
|
134
|
+
<OLink
|
|
135
|
+
PressStyle={styles.linkWithIcons}
|
|
136
|
+
url={Platform.select({
|
|
137
|
+
ios: `maps:0,0?q=${order?.business?.address_notes}`,
|
|
138
|
+
android: `geo:0,0?q=${order?.business?.address_notes}`,
|
|
139
|
+
})}
|
|
140
|
+
shorcut={order?.business?.address_notes}
|
|
141
|
+
TextStyle={styles.textLink}
|
|
142
|
+
/>
|
|
182
143
|
</View>
|
|
144
|
+
)}
|
|
145
|
+
</OrderBusiness>
|
|
146
|
+
|
|
147
|
+
<OrderCustomer>
|
|
148
|
+
<OText style={{ marginBottom: 5 }} size={16} weight="600">
|
|
149
|
+
{t('CUSTOMER_DETAILS', 'Customer details')}
|
|
150
|
+
</OText>
|
|
151
|
+
|
|
152
|
+
<View style={{ flexDirection: 'row' }}>
|
|
153
|
+
<OText numberOfLines={2} mBottom={4}>
|
|
154
|
+
<OText
|
|
155
|
+
numberOfLines={1}
|
|
156
|
+
mBottom={4}
|
|
157
|
+
ellipsizeMode="tail"
|
|
158
|
+
space>
|
|
159
|
+
{order?.customer?.name}
|
|
160
|
+
</OText>
|
|
183
161
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
TextStyle={styles.textLink}
|
|
191
|
-
|
|
192
|
-
/>
|
|
193
|
-
</View>
|
|
194
|
-
)}
|
|
195
|
-
|
|
196
|
-
{!!order?.customer?.cellphone && (
|
|
197
|
-
<View style={styles.linkWithIcons}>
|
|
198
|
-
<OLink
|
|
199
|
-
PressStyle={styles.linkWithIcons}
|
|
200
|
-
url={`tel:${order?.customer?.cellphone}`}
|
|
201
|
-
shorcut={order?.customer?.cellphone}
|
|
202
|
-
TextStyle={styles.textLink}
|
|
203
|
-
/>
|
|
204
|
-
</View>
|
|
205
|
-
)}
|
|
206
|
-
|
|
207
|
-
{!!order?.customer?.phone && (
|
|
208
|
-
<View style={styles.linkWithIcons}>
|
|
209
|
-
<OLink
|
|
210
|
-
PressStyle={styles.linkWithIcons}
|
|
211
|
-
url={`tel:${order?.customer?.phone}`}
|
|
212
|
-
shorcut={order?.customer?.phone}
|
|
213
|
-
TextStyle={styles.textLink}
|
|
214
|
-
/>
|
|
215
|
-
</View>
|
|
216
|
-
)}
|
|
217
|
-
|
|
218
|
-
{!!order?.customer?.address && (
|
|
219
|
-
<View style={styles.linkWithIcons}>
|
|
220
|
-
<OLink
|
|
221
|
-
PressStyle={styles.linkWithIcons}
|
|
222
|
-
url={Platform.select({
|
|
223
|
-
ios: `maps:0,0?q=${order?.customer?.address}`,
|
|
224
|
-
android: `geo:0,0?q=${order?.customer?.address}`,
|
|
225
|
-
})}
|
|
226
|
-
shorcut={order?.customer?.address}
|
|
227
|
-
TextStyle={styles.textLink}
|
|
228
|
-
/>
|
|
229
|
-
</View>
|
|
230
|
-
)}
|
|
231
|
-
|
|
232
|
-
{!!order?.customer?.internal_number && (
|
|
233
|
-
<OText numberOfLines={1} mBottom={4} ellipsizeMode="tail">
|
|
234
|
-
{order?.customer?.internal_number}
|
|
162
|
+
<OText
|
|
163
|
+
numberOfLines={1}
|
|
164
|
+
mBottom={4}
|
|
165
|
+
ellipsizeMode="tail"
|
|
166
|
+
space>
|
|
167
|
+
{order?.customer?.middle_name}
|
|
235
168
|
</OText>
|
|
236
|
-
)}
|
|
237
169
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
{
|
|
170
|
+
<OText
|
|
171
|
+
numberOfLines={1}
|
|
172
|
+
mBottom={4}
|
|
173
|
+
ellipsizeMode="tail"
|
|
174
|
+
space>
|
|
175
|
+
{order?.customer?.lastname}
|
|
241
176
|
</OText>
|
|
242
|
-
)}
|
|
243
177
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
{
|
|
178
|
+
<OText
|
|
179
|
+
numberOfLines={1}
|
|
180
|
+
mBottom={4}
|
|
181
|
+
ellipsizeMode="tail"
|
|
182
|
+
space>
|
|
183
|
+
{order?.customer?.second_lastname}
|
|
247
184
|
</OText>
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
185
|
+
</OText>
|
|
186
|
+
</View>
|
|
187
|
+
|
|
188
|
+
{!!order?.customer?.email && (
|
|
189
|
+
<View style={styles.linkWithIcons}>
|
|
190
|
+
<OLink
|
|
191
|
+
PressStyle={styles.linkWithIcons}
|
|
192
|
+
url={`mailto:${order?.customer?.email}`}
|
|
193
|
+
shorcut={order?.customer?.email}
|
|
194
|
+
TextStyle={styles.textLink}
|
|
195
|
+
|
|
196
|
+
/>
|
|
197
|
+
</View>
|
|
198
|
+
)}
|
|
199
|
+
|
|
200
|
+
{!!order?.customer?.cellphone && (
|
|
201
|
+
<View style={styles.linkWithIcons}>
|
|
202
|
+
<OLink
|
|
203
|
+
PressStyle={styles.linkWithIcons}
|
|
204
|
+
url={`tel:${order?.customer?.cellphone}`}
|
|
205
|
+
shorcut={order?.customer?.cellphone}
|
|
206
|
+
TextStyle={styles.textLink}
|
|
207
|
+
/>
|
|
208
|
+
</View>
|
|
209
|
+
)}
|
|
210
|
+
|
|
211
|
+
{!!order?.customer?.phone && (
|
|
212
|
+
<View style={styles.linkWithIcons}>
|
|
213
|
+
<OLink
|
|
214
|
+
PressStyle={styles.linkWithIcons}
|
|
215
|
+
url={`tel:${order?.customer?.phone}`}
|
|
216
|
+
shorcut={order?.customer?.phone}
|
|
217
|
+
TextStyle={styles.textLink}
|
|
218
|
+
/>
|
|
219
|
+
</View>
|
|
220
|
+
)}
|
|
221
|
+
|
|
222
|
+
{!!order?.customer?.address && (
|
|
223
|
+
<View style={styles.linkWithIcons}>
|
|
224
|
+
<OLink
|
|
225
|
+
PressStyle={styles.linkWithIcons}
|
|
226
|
+
url={Platform.select({
|
|
227
|
+
ios: `maps:0,0?q=${order?.customer?.address}`,
|
|
228
|
+
android: `geo:0,0?q=${order?.customer?.address}`,
|
|
229
|
+
})}
|
|
230
|
+
shorcut={order?.customer?.address}
|
|
231
|
+
TextStyle={styles.textLink}
|
|
257
232
|
/>
|
|
258
|
-
|
|
259
|
-
|
|
233
|
+
</View>
|
|
234
|
+
)}
|
|
260
235
|
|
|
261
|
-
|
|
262
|
-
<OText
|
|
263
|
-
{
|
|
236
|
+
{!!order?.customer?.internal_number && (
|
|
237
|
+
<OText numberOfLines={1} mBottom={4} ellipsizeMode="tail">
|
|
238
|
+
{order?.customer?.internal_number}
|
|
264
239
|
</OText>
|
|
240
|
+
)}
|
|
265
241
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
/>
|
|
272
|
-
))}
|
|
273
|
-
</OrderProducts>
|
|
242
|
+
{!!order?.customer?.address_notes && (
|
|
243
|
+
<OText numberOfLines={1} mBottom={4} ellipsizeMode="tail">
|
|
244
|
+
{order?.customer?.address_notes}
|
|
245
|
+
</OText>
|
|
246
|
+
)}
|
|
274
247
|
|
|
275
|
-
|
|
248
|
+
{!!order?.customer?.zipcode && (
|
|
249
|
+
<OText numberOfLines={1} mBottom={4} ellipsizeMode="tail">
|
|
250
|
+
{order?.customer?.zipcode}
|
|
251
|
+
</OText>
|
|
252
|
+
)}
|
|
253
|
+
{!order?.user_review && pastOrderStatuses.includes(order?.status) && !isCustomerReviewed && (
|
|
254
|
+
<OButton
|
|
255
|
+
style={styles.btnReview}
|
|
256
|
+
textStyle={{ color: theme.colors.white }}
|
|
257
|
+
text={t('REVIEW_CUSTOMER', 'Review customer')}
|
|
258
|
+
imgRightSrc={false}
|
|
259
|
+
onClick={() => setOpenReviewModal(true)}
|
|
260
|
+
/>
|
|
261
|
+
)}
|
|
262
|
+
</OrderCustomer>
|
|
263
|
+
|
|
264
|
+
<OrderProducts>
|
|
265
|
+
<OText style={{ marginBottom: 5 }} size={16} weight="600">
|
|
266
|
+
{t('ORDER_DETAILS', 'Order Details')}
|
|
267
|
+
</OText>
|
|
268
|
+
|
|
269
|
+
{order?.products?.length > 0 &&
|
|
270
|
+
order?.products.map((product: any, i: number) => (
|
|
271
|
+
<ProductItemAccordion
|
|
272
|
+
key={product?.id || i}
|
|
273
|
+
product={product}
|
|
274
|
+
/>
|
|
275
|
+
))}
|
|
276
|
+
</OrderProducts>
|
|
277
|
+
|
|
278
|
+
<OrderBill>
|
|
279
|
+
<Table>
|
|
280
|
+
<OText mBottom={4}>{t('SUBTOTAL', 'Subtotal')}</OText>
|
|
281
|
+
<OText mBottom={4}>
|
|
282
|
+
{parsePrice(
|
|
283
|
+
order.tax_type === 1
|
|
284
|
+
? order?.summary?.subtotal + order?.summary?.tax ?? 0
|
|
285
|
+
: order?.summary?.subtotal ?? 0,
|
|
286
|
+
)}
|
|
287
|
+
</OText>
|
|
288
|
+
</Table>
|
|
289
|
+
|
|
290
|
+
{order?.tax_type !== 1 && (
|
|
276
291
|
<Table>
|
|
277
|
-
<OText mBottom={4}>{t('SUBTOTAL', 'Subtotal')}</OText>
|
|
278
292
|
<OText mBottom={4}>
|
|
279
|
-
{
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
)}
|
|
293
|
+
{t('TAX', 'Tax')}
|
|
294
|
+
{`(${verifyDecimals(
|
|
295
|
+
order?.summary?.tax_rate,
|
|
296
|
+
parseNumber,
|
|
297
|
+
)}%)`}
|
|
284
298
|
</OText>
|
|
285
|
-
</Table>
|
|
286
299
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
order?.summary?.tax_rate,
|
|
293
|
-
parseNumber,
|
|
294
|
-
)}%)`}
|
|
295
|
-
</OText>
|
|
296
|
-
|
|
297
|
-
<OText mBottom={4}>
|
|
298
|
-
{parsePrice(order?.summary?.tax ?? 0)}
|
|
299
|
-
</OText>
|
|
300
|
-
</Table>
|
|
301
|
-
)}
|
|
300
|
+
<OText mBottom={4}>
|
|
301
|
+
{parsePrice(order?.summary?.tax ?? 0)}
|
|
302
|
+
</OText>
|
|
303
|
+
</Table >
|
|
304
|
+
)}
|
|
302
305
|
|
|
303
|
-
|
|
306
|
+
{
|
|
307
|
+
order?.summary?.discount > 0 && (
|
|
304
308
|
<Table>
|
|
305
309
|
{order?.offer_type === 1 ? (
|
|
306
310
|
<OText mBottom={4}>
|
|
@@ -321,36 +325,40 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
321
325
|
- {parsePrice(order?.summary?.discount)}
|
|
322
326
|
</OText>
|
|
323
327
|
</Table>
|
|
324
|
-
)
|
|
328
|
+
)
|
|
329
|
+
}
|
|
325
330
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
331
|
+
{
|
|
332
|
+
order?.summary?.subtotal_with_discount > 0 &&
|
|
333
|
+
order?.summary?.discount > 0 &&
|
|
334
|
+
order?.summary?.total >= 0 && (
|
|
335
|
+
<Table>
|
|
336
|
+
<OText mBottom={4}>
|
|
337
|
+
{t(
|
|
338
|
+
'SUBTOTAL_WITH_DISCOUNT',
|
|
339
|
+
'Subtotal with discount',
|
|
340
|
+
)}
|
|
341
|
+
</OText>
|
|
342
|
+
{order?.tax_type === 1 ? (
|
|
330
343
|
<OText mBottom={4}>
|
|
331
|
-
{
|
|
332
|
-
|
|
333
|
-
|
|
344
|
+
{parsePrice(
|
|
345
|
+
order?.summary?.subtotal_with_discount +
|
|
346
|
+
order?.summary?.tax ?? 0,
|
|
334
347
|
)}
|
|
335
348
|
</OText>
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
order?.summary?.subtotal_with_discount ?? 0,
|
|
347
|
-
)}
|
|
348
|
-
</OText>
|
|
349
|
-
)}
|
|
350
|
-
</Table>
|
|
351
|
-
)}
|
|
349
|
+
) : (
|
|
350
|
+
<OText mBottom={4}>
|
|
351
|
+
{parsePrice(
|
|
352
|
+
order?.summary?.subtotal_with_discount ?? 0,
|
|
353
|
+
)}
|
|
354
|
+
</OText>
|
|
355
|
+
)}
|
|
356
|
+
</Table>
|
|
357
|
+
)
|
|
358
|
+
}
|
|
352
359
|
|
|
353
|
-
|
|
360
|
+
{
|
|
361
|
+
order?.summary?.delivery_price > 0 && (
|
|
354
362
|
<Table>
|
|
355
363
|
<OText mBottom={4}>
|
|
356
364
|
{t('DELIVERY_FEE', 'Delivery Fee')}
|
|
@@ -360,26 +368,28 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
360
368
|
{parsePrice(order?.summary?.delivery_price)}
|
|
361
369
|
</OText>
|
|
362
370
|
</Table>
|
|
363
|
-
)
|
|
371
|
+
)
|
|
372
|
+
}
|
|
364
373
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
<Table>
|
|
375
|
+
<OText mBottom={4}>
|
|
376
|
+
{t('DRIVER_TIP', 'Driver tip')}{' '}
|
|
377
|
+
{order?.summary?.driver_tip > 0 &&
|
|
378
|
+
parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
379
|
+
!parseInt(configs?.driver_tip_use_custom?.value, 10) &&
|
|
380
|
+
`(${verifyDecimals(
|
|
381
|
+
order?.summary?.driver_tip,
|
|
382
|
+
parseNumber,
|
|
383
|
+
)}%)`}
|
|
384
|
+
</OText>
|
|
376
385
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
386
|
+
<OText mBottom={4}>
|
|
387
|
+
{parsePrice(order?.summary?.driver_tip ?? 0)}
|
|
388
|
+
</OText>
|
|
389
|
+
</Table>
|
|
381
390
|
|
|
382
|
-
|
|
391
|
+
{
|
|
392
|
+
order?.summary?.service_fee > 0 && (
|
|
383
393
|
<Table>
|
|
384
394
|
<OText mBottom={4}>
|
|
385
395
|
{t('SERVICE_FEE', 'Service Fee')}{' '}
|
|
@@ -393,36 +403,36 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
393
403
|
{parsePrice(order?.summary?.service_fee)}
|
|
394
404
|
</OText>
|
|
395
405
|
</Table>
|
|
396
|
-
)
|
|
406
|
+
)
|
|
407
|
+
}
|
|
397
408
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
409
|
+
<Total>
|
|
410
|
+
<Table>
|
|
411
|
+
<OText mBottom={4} style={styles.textBold}>
|
|
412
|
+
{t('TOTAL', 'Total')}
|
|
413
|
+
</OText>
|
|
403
414
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
)
|
|
415
|
+
<OText
|
|
416
|
+
mBottom={4}
|
|
417
|
+
style={styles.textBold}
|
|
418
|
+
color={theme.colors.primary}>
|
|
419
|
+
{parsePrice(order?.summary?.total ?? 0)}
|
|
420
|
+
</OText>
|
|
421
|
+
</Table>
|
|
422
|
+
</Total>
|
|
423
|
+
</OrderBill >
|
|
424
|
+
<OModal
|
|
425
|
+
open={openReviewModal}
|
|
426
|
+
onClose={() => setOpenReviewModal(false)}
|
|
427
|
+
entireModal
|
|
428
|
+
customClose
|
|
429
|
+
>
|
|
430
|
+
<ReviewCustomer
|
|
431
|
+
order={order}
|
|
432
|
+
closeModal={() => setOpenReviewModal(false)}
|
|
433
|
+
onClose={() => handleSuccessReviewed()}
|
|
434
|
+
/>
|
|
435
|
+
</OModal>
|
|
436
|
+
</OrderContent>
|
|
437
|
+
)
|
|
428
438
|
}
|