@conecli/cone-render 0.10.1-shop-beta.36 → 0.10.1-shop-beta.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.
@@ -1 +1 @@
1
- import React from 'react';
2
1
  NETWORK_DATA_TYPE,
3
2
  M_SHOP_DOWNLOAD_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT,
4
3
  APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT,
5
4
  window.navigator.userAgent.includes('jdappPuppeteer') && window.loadPuppeteerPageLocalData;
6
5
  memberBaseInfo?: {
7
6
  shopId?: string;
8
7
  venderId?: string;
9
8
  channel?: string;
10
9
  venderType?: string;
11
10
  showDefaultModule?: boolean;
12
11
  customerLevel?: string;
13
12
  isUserForMember?: boolean;
14
13
  isLv0?: boolean;
15
14
  levelZeroMenuUrl?: string;
16
15
  totalRefresh?: functionType;
17
16
  callOpenCardPopPage?: functionType;
18
17
  };
19
18
  source?: string;
20
19
  containerFloorListData: ComponentInterFace.ContainerItemData[];
21
20
  extendInfoData?: object;
22
21
  className?: string;
23
22
  containerItemClass?: object;
24
23
  style?: object;
25
24
  hasGoodsFeeds?: boolean;
26
25
  builtInComponents?: object;
27
26
  loadingEndComponentFn?: functionType;
28
27
  sectionType?: string;
29
28
  updateShopFloorDataFn?: functionType;
30
29
  updateContainerFloorListDataFn?: functionType;
31
30
  refreshFloorListDataFn?: functionType;
32
31
  refreshFloorListDataBtnLabel?: string;
33
32
  customErrorIsvFloorModule?: React.ReactElement;
34
33
  componentExtend?: React.ReactElement;
35
34
  luxuryFixedIndex?: number;
36
35
  isContainerListHasMarginBottom?: boolean;
37
36
  switchConfig?: {
38
37
  [key: string]: any;
39
38
  };
40
39
  const { windowHeight, screenHeight } = taroJdBaseInfo.info.sysInfo;
41
40
  const {
42
41
  source,
43
42
  className,
44
43
  style,
45
44
  memberBaseInfo,
46
45
  containerItemClass = null,
47
46
  containerFloorListData,
48
47
  extendInfoData,
49
48
  builtInComponents,
50
49
  loadingEndComponentFn,
51
50
  sectionType,
52
51
  updateShopFloorDataFn,
53
52
  updateContainerFloorListDataFn,
54
53
  refreshFloorListDataFn,
55
54
  refreshFloorListDataBtnLabel,
56
55
  customErrorIsvFloorModule,
57
56
  luxuryFixedIndex = -1,
58
57
  isContainerListHasMarginBottom,
59
58
  switchConfig,
60
59
  } = props;
61
60
  const emptyFloorListHidden = switchConfig?.emptyFloorListHidden || false;
62
61
  const isSageShop = taroJdBaseInfo.info?.pageInfo?.isSageShop;
63
62
  const isHasMarginBottom = isContainerListHasMarginBottom ?? !isSageShop;
64
63
 
65
64
  const hasLiveForSageShop =
66
65
  isSageShop && taroJdBaseInfo.info?.pageInfo?.isJdShowNativeImmersivePlayer;
67
66
 
68
67
  const renderFloorItem = (
69
68
  item,
70
69
  floorItem,
71
70
  floorIndex,
72
71
  containerLayoutLeftRightMargin,
73
72
  lazyLoadState = false,
74
73
  index,
75
74
  borderStyle,
76
75
  ) => {
77
76
  return (
78
77
  <View
79
78
  className={classNames(shopContainerListStyle['d-floor-item'])}
80
79
  data-floor-uid={floorItem?.uid}
81
80
  data-floor-type={floorItem?.floorExtInfo?.moduleFlag || ''}
82
81
  data-lazy-load={lazyLoadState}
83
82
  key={floorItem.uid}
84
83
  id={`J_floor_${floorItem.uid}`}
85
84
  style={borderStyle}
86
85
  >
87
86
  {isChartH5 && (
88
87
  <View
89
88
  className={shopContainerListStyle['d-floor-chart-item']}
90
89
  id={`J_chart_floor_${floorItem?.uid}`}
91
90
  data-floor-uid={floorItem?.uid}
92
91
  data-floor-type={floorItem?.floorExtInfo?.moduleFlag || ''}
93
92
  />
94
93
  )}
95
94
  <FloorListItem
96
95
  memberBaseInfo={memberBaseInfo}
97
96
  source={source}
98
97
  floorIndex={floorIndex}
99
98
  floorData={floorItem}
100
99
  containerIndex={index}
101
100
  layoutLeftRightMargin={containerLayoutLeftRightMargin}
102
101
  containerBorderRadius={borderStyle}
103
102
  updateShopFloorDataFn={updateShopFloorDataFn}
104
103
  loadingEndComponentFn={loadingEndComponentFn}
105
104
  extendInfoData={
106
105
  passExtendInfoModuleWhiteList.includes(floorItem?.floorExtInfo?.moduleFlag)
107
106
  ? extendInfoData
108
107
  : undefined
109
108
  }
110
109
  key={floorItem.uid}
111
110
  builtInComponents={builtInComponents}
112
111
  updateContainerFloorListDataFn={updateContainerFloorListDataFn}
113
112
  customErrorIsvFloorModule={customErrorIsvFloorModule}
114
113
  />
115
114
  {index === luxuryFixedIndex ? props.children : null}
116
115
  {floorItem?.inspectResult === '1' && (
117
116
  <View className={shopContainerListStyle['d-floor-inspect-mask']} />
118
117
  )}
119
118
  </View>
120
119
  );
121
120
  };
122
121
 
123
122
  const getFloorSetHeight = (item) => {
124
123
  const getHeight = item?.floorExtInfo?.floorHeight
125
124
  ? Number(item?.floorExtInfo?.floorHeight)
126
125
  : 200;
127
126
  return getHeight > 0 ? getHeight : 200;
128
127
  };
129
128
  const containerFloorListDataLen = containerFloorListData.length;
130
129
 
131
130
  const getNoDataContainerHeight = () => {
132
131
  const getWindowHeight = windowHeight > 10 ? windowHeight : screenHeight;
133
132
  const changeHeight = hasLiveForSageShop
134
133
  ? getWindowHeight
135
134
  : getWindowHeight -
136
135
  (isJdApp
137
136
  ? APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT
138
137
  : M_SHOP_DOWNLOAD_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT);
139
138
  return {
140
139
  height: `${changeHeight}px`,
141
140
  };
142
141
  };
143
142
  return (
144
143
  <View
145
144
  id="J_shopContainerFloorList"
146
145
  className={classNames(
147
146
  className,
148
147
  shopContainerListStyle['d-shop-container-list'],
149
148
  isHasMarginBottom
150
149
  ? shopContainerListStyle['d-container-list-with-margin-bottom']
151
150
  : shopContainerListStyle['d-container-list-no-margin-bottom'],
152
151
  )}
153
152
  style={style}
154
153
  >
155
154
  {containerFloorListDataLen > 0 ? (
156
155
  <>
157
156
  {containerFloorListData.map((item, index) => {
158
157
  const containerLayoutLeftRightMargin = (item.marginLeft || 0) + (item.marginRight || 0);
159
158
  const getContainerId = `J_container_${item.containerId}`;
160
159
  const borderStyle = getBorderStyle(
161
160
  item,
162
161
  index,
163
162
  containerFloorListData,
164
163
  containerFloorListDataLen,
165
164
  );
166
165
  return (
167
166
  <React.Fragment key={item.containerId + index}>
168
167
  {item.addLuxuryStyle ? (
169
168
  <View className={shopContainerListStyle['d-luxury-header']} />
170
169
  ) : null}
171
170
  {item.addLuxuryBackupStyle ? (
172
171
  <View
173
172
  style={{
174
173
  height: taroJdBaseInfo?.info?.sysInfo?.jdNativeHeaderHeight + 'px',
175
174
  }}
176
175
  className={shopContainerListStyle['d-luxury-header-black']}
177
176
  />
178
177
  ) : null}
179
178
  {typeof item?.renderExtendComponent === 'function'
180
179
  ? item?.renderExtendComponent(item?.floorExtendData)
181
180
  : null}
182
181
  <View
183
182
  className={classNames(
184
183
  shopContainerListStyle['d-container-item'],
185
184
  containerItemClass,
186
185
  )}
187
186
  id={getContainerId}
188
187
  key={item.containerId}
189
188
  data-container-id={item?.containerId}
190
189
  data-container-type={item?.typeCode}
191
190
  data-container-index={index}
192
191
  style={{
193
192
  marginBottom: item.marginBottom ? `${item.marginBottom}px` : 0,
194
193
  marginTop: item.marginTop ? `${item.marginTop}px` : 0,
195
194
  marginLeft: item.marginLeft ? `${item.marginLeft}px` : 0,
196
195
  marginRight: item.marginRight ? `${item.marginRight}px` : 0,
197
196
  borderTopLeftRadius: borderStyle?.borderTopLeftRadius || `0px`,
198
197
  borderTopRightRadius: borderStyle?.borderTopRightRadiu || `0px`,
199
198
  borderBottomLeftRadius: borderStyle?.borderBottomLeftRadius || `0px`,
200
199
  borderBottomRightRadius: borderStyle?.borderBottomRightRadius || `0px`,
201
200
  '--container-layout-left-right-margin': `${containerLayoutLeftRightMargin}px`,
202
201
  }}
203
202
  >
204
203
  {typeof item?.insertContainerStartComponent === 'function'
205
204
  ? item?.insertContainerStartComponent(item)
206
205
  : null}
207
206
  {item.floors &&
208
207
  item.floors.length > 0 &&
209
208
  item.floors?.map((floorItem, floorIndex) => {
210
209
  return index > lazyLoadStartIndex ? (
211
210
  <LazyLayoutLoad
212
211
  key={item.containerId}
213
212
  sectionType={sectionType}
214
213
  containerId={getContainerId}
215
214
  height={getFloorSetHeight(floorItem)}
216
215
  floorData={floorItem}
217
216
  >
218
217
  {renderFloorItem(
219
218
  item,
220
219
  floorItem,
221
220
  floorIndex,
222
221
  containerLayoutLeftRightMargin,
223
222
  true,
224
223
  index,
225
224
  borderStyle,
226
225
  )}
227
226
  </LazyLayoutLoad>
228
227
  ) : (
229
228
  renderFloorItem(
230
229
  item,
231
230
  floorItem,
232
231
  floorIndex,
233
232
  containerLayoutLeftRightMargin,
234
233
  false,
235
234
  index,
236
235
  borderStyle,
237
236
  )
238
237
  );
239
238
  })}
240
239
  </View>
241
240
  </React.Fragment>
242
241
  );
243
242
  })}
244
243
  </>
245
244
  ) : !emptyFloorListHidden ? (
246
245
  <View
247
246
  className={classNames(shopContainerListStyle['d-container-list-no-data'], {
248
247
  [shopContainerListStyle['d-sage-shop-no-data']]: hasLiveForSageShop,
249
248
  })}
250
249
  style={getNoDataContainerHeight()}
251
250
  >
252
251
  <NetworkDataError
253
252
  netWorkShowType={NetWorkShowType.PART}
254
253
  netWorkDataType={NETWORK_DATA_TYPE.DATA_ERROR}
255
254
  backgroundColorWhite={hasLiveForSageShop}
256
255
  refreshCallBackFn={refreshFloorListDataFn ? refreshFloorListDataFn : null}
257
256
  btnLabel={refreshFloorListDataBtnLabel || ''}
258
257
  />
259
258
  </View>
260
259
  ) : null}
261
260
  </View>
262
261
  );
263
262
  updateShopDataFn: null,
263
+ import React from 'react';
264
264
  NETWORK_DATA_TYPE,
265
265
  M_SHOP_DOWNLOAD_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT,
266
266
  APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT,
267
267
  memberBaseInfo?: {
268
268
  shopId?: string;
269
269
  venderId?: string;
270
270
  channel?: string;
271
271
  venderType?: string;
272
272
  showDefaultModule?: boolean;
273
273
  customerLevel?: string;
274
274
  isUserForMember?: boolean;
275
275
  isLv0?: boolean;
276
276
  levelZeroMenuUrl?: string;
277
277
  totalRefresh?: functionType;
278
278
  callOpenCardPopPage?: functionType;
279
279
  };
280
280
  source?: string;
281
281
  containerFloorListData: ComponentInterFace.ContainerItemData[];
282
282
  extendInfoData?: object;
283
283
  className?: string;
284
284
  containerItemClass?: object;
285
285
  style?: object;
286
286
  hasGoodsFeeds?: boolean;
287
287
  builtInComponents?: object;
288
288
  loadingEndComponentFn?: functionType;
289
289
  sectionType?: string;
290
290
  updateShopFloorDataFn?: functionType;
291
291
  updateContainerFloorListDataFn?: functionType;
292
292
  refreshFloorListDataFn?: functionType;
293
293
  refreshFloorListDataBtnLabel?: string;
294
294
  customErrorIsvFloorModule?: React.ReactElement;
295
295
  componentExtend?: React.ReactElement;
296
296
  luxuryFixedIndex?: number;
297
297
  isContainerListHasMarginBottom?: boolean;
298
298
  switchConfig?: {
299
299
  [key: string]: any;
300
300
  };
301
301
  const { windowHeight, screenHeight } = taroJdBaseInfo.info.sysInfo;
302
302
  const {
303
303
  source,
304
304
  className,
305
305
  style,
306
306
  memberBaseInfo,
307
307
  containerItemClass = null,
308
308
  containerFloorListData,
309
309
  extendInfoData,
310
310
  builtInComponents,
311
311
  loadingEndComponentFn,
312
312
  sectionType,
313
313
  updateShopFloorDataFn,
314
314
  updateContainerFloorListDataFn,
315
315
  refreshFloorListDataFn,
316
316
  refreshFloorListDataBtnLabel,
317
317
  customErrorIsvFloorModule,
318
318
  luxuryFixedIndex = -1,
319
319
  isContainerListHasMarginBottom,
320
320
  switchConfig,
321
321
  } = props;
322
322
  const emptyFloorListHidden = switchConfig?.emptyFloorListHidden || false;
323
323
  const isSageShop = taroJdBaseInfo.info?.pageInfo?.isSageShop;
324
324
  const isHasMarginBottom = isContainerListHasMarginBottom ?? !isSageShop;
325
325
 
326
326
  const hasLiveForSageShop =
327
327
  isSageShop && taroJdBaseInfo.info?.pageInfo?.isJdShowNativeImmersivePlayer;
328
328
 
329
329
  const renderFloorItem = (
330
330
  item,
331
331
  floorItem,
332
332
  floorIndex,
333
333
  containerLayoutLeftRightMargin,
334
334
  lazyLoadState = false,
335
335
  index,
336
336
  borderStyle,
337
337
  ) => {
338
338
  return (
339
339
  <View
340
340
  className={classNames(shopContainerListStyle['d-floor-item'])}
341
341
  data-floor-uid={floorItem?.uid}
342
342
  data-floor-type={floorItem?.floorExtInfo?.moduleFlag || ''}
343
343
  data-lazy-load={lazyLoadState}
344
344
  key={floorItem.uid}
345
345
  id={`J_floor_${floorItem.uid}`}
346
346
  style={borderStyle}
347
347
  >
348
348
  {isChartH5 && (
349
349
  <View
350
350
  className={shopContainerListStyle['d-floor-chart-item']}
351
351
  id={`J_chart_floor_${floorItem?.uid}`}
352
352
  data-floor-uid={floorItem?.uid}
353
353
  data-floor-type={floorItem?.floorExtInfo?.moduleFlag || ''}
354
354
  />
355
355
  )}
356
356
  <FloorListItem
357
357
  memberBaseInfo={memberBaseInfo}
358
358
  source={source}
359
359
  floorIndex={floorIndex}
360
360
  floorData={floorItem}
361
361
  containerIndex={index}
362
362
  layoutLeftRightMargin={containerLayoutLeftRightMargin}
363
363
  containerBorderRadius={borderStyle}
364
364
  updateShopFloorDataFn={updateShopFloorDataFn}
365
365
  loadingEndComponentFn={loadingEndComponentFn}
366
366
  extendInfoData={
367
367
  passExtendInfoModuleWhiteList.includes(floorItem?.floorExtInfo?.moduleFlag)
368
368
  ? extendInfoData
369
369
  : undefined
370
370
  }
371
371
  key={floorItem.uid}
372
372
  builtInComponents={builtInComponents}
373
373
  updateContainerFloorListDataFn={updateContainerFloorListDataFn}
374
374
  customErrorIsvFloorModule={customErrorIsvFloorModule}
375
375
  />
376
376
  {index === luxuryFixedIndex ? props.children : null}
377
377
  {floorItem?.inspectResult === '1' && (
378
378
  <View className={shopContainerListStyle['d-floor-inspect-mask']} />
379
379
  )}
380
380
  </View>
381
381
  );
382
382
  };
383
383
 
384
384
  const getFloorSetHeight = (item) => {
385
385
  const getHeight = item?.floorExtInfo?.floorHeight
386
386
  ? Number(item?.floorExtInfo?.floorHeight)
387
387
  : 200;
388
388
  return getHeight > 0 ? getHeight : 200;
389
389
  };
390
390
  const containerFloorListDataLen = containerFloorListData.length;
391
391
 
392
392
  const getNoDataContainerHeight = () => {
393
393
  const getWindowHeight = windowHeight > 10 ? windowHeight : screenHeight;
394
394
  const changeHeight = hasLiveForSageShop
395
395
  ? getWindowHeight
396
396
  : getWindowHeight -
397
397
  (isJdApp
398
398
  ? APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT
399
399
  : M_SHOP_DOWNLOAD_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT);
400
400
  return {
401
401
  height: `${changeHeight}px`,
402
402
  };
403
403
  };
404
404
  return (
405
405
  <View
406
406
  id="J_shopContainerFloorList"
407
407
  className={classNames(
408
408
  className,
409
409
  shopContainerListStyle['d-shop-container-list'],
410
410
  isHasMarginBottom
411
411
  ? shopContainerListStyle['d-container-list-with-margin-bottom']
412
412
  : shopContainerListStyle['d-container-list-no-margin-bottom'],
413
413
  )}
414
414
  style={style}
415
415
  >
416
416
  {containerFloorListDataLen > 0 ? (
417
417
  <>
418
418
  {containerFloorListData.map((item, index) => {
419
419
  const containerLayoutLeftRightMargin = (item.marginLeft || 0) + (item.marginRight || 0);
420
420
  const getContainerId = `J_container_${item.containerId}`;
421
421
  const borderStyle = getBorderStyle(
422
422
  item,
423
423
  index,
424
424
  containerFloorListData,
425
425
  containerFloorListDataLen,
426
426
  );
427
427
  return (
428
428
  <React.Fragment key={item.containerId + index}>
429
429
  {item.addLuxuryStyle ? (
430
430
  <View className={shopContainerListStyle['d-luxury-header']} />
431
431
  ) : null}
432
432
  {item.addLuxuryBackupStyle ? (
433
433
  <View
434
434
  style={{
435
435
  height: taroJdBaseInfo?.info?.sysInfo?.jdNativeHeaderHeight + 'px',
436
436
  }}
437
437
  className={shopContainerListStyle['d-luxury-header-black']}
438
438
  />
439
439
  ) : null}
440
440
  {typeof item?.renderExtendComponent === 'function'
441
441
  ? item?.renderExtendComponent(item?.floorExtendData)
442
442
  : null}
443
443
  <View
444
444
  className={classNames(
445
445
  shopContainerListStyle['d-container-item'],
446
446
  containerItemClass,
447
447
  )}
448
448
  id={getContainerId}
449
449
  key={item.containerId}
450
450
  data-container-id={item?.containerId}
451
451
  data-container-type={item?.typeCode}
452
452
  data-container-index={index}
453
453
  style={{
454
454
  marginBottom: item.marginBottom ? `${item.marginBottom}px` : 0,
455
455
  marginTop: item.marginTop ? `${item.marginTop}px` : 0,
456
456
  marginLeft: item.marginLeft ? `${item.marginLeft}px` : 0,
457
457
  marginRight: item.marginRight ? `${item.marginRight}px` : 0,
458
458
  borderTopLeftRadius: borderStyle?.borderTopLeftRadius || `0px`,
459
459
  borderTopRightRadius: borderStyle?.borderTopRightRadiu || `0px`,
460
460
  borderBottomLeftRadius: borderStyle?.borderBottomLeftRadius || `0px`,
461
461
  borderBottomRightRadius: borderStyle?.borderBottomRightRadius || `0px`,
462
462
  '--container-layout-left-right-margin': `${containerLayoutLeftRightMargin}px`,
463
463
  }}
464
464
  >
465
465
  {typeof item?.insertContainerStartComponent === 'function'
466
466
  ? item?.insertContainerStartComponent(item)
467
467
  : null}
468
468
  {item.floors &&
469
469
  item.floors.length > 0 &&
470
470
  item.floors?.map((floorItem, floorIndex) => {
471
471
  return index > lazyLoadStartIndex ? (
472
472
  <LazyLayoutLoad
473
473
  key={item.containerId}
474
474
  sectionType={sectionType}
475
475
  containerId={getContainerId}
476
476
  height={getFloorSetHeight(floorItem)}
477
477
  floorData={floorItem}
478
478
  >
479
479
  {renderFloorItem(
480
480
  item,
481
481
  floorItem,
482
482
  floorIndex,
483
483
  containerLayoutLeftRightMargin,
484
484
  true,
485
485
  index,
486
486
  borderStyle,
487
487
  )}
488
488
  </LazyLayoutLoad>
489
489
  ) : (
490
490
  renderFloorItem(
491
491
  item,
492
492
  floorItem,
493
493
  floorIndex,
494
494
  containerLayoutLeftRightMargin,
495
495
  false,
496
496
  index,
497
497
  borderStyle,
498
498
  )
499
499
  );
500
500
  })}
501
501
  </View>
502
502
  </React.Fragment>
503
503
  );
504
504
  })}
505
505
  </>
506
506
  ) : !emptyFloorListHidden ? (
507
507
  <View
508
508
  className={classNames(shopContainerListStyle['d-container-list-no-data'], {
509
509
  [shopContainerListStyle['d-sage-shop-no-data']]: hasLiveForSageShop,
510
510
  })}
511
511
  style={getNoDataContainerHeight()}
512
512
  >
513
513
  <NetworkDataError
514
514
  netWorkShowType={NetWorkShowType.PART}
515
515
  netWorkDataType={NETWORK_DATA_TYPE.DATA_ERROR}
516
516
  backgroundColorWhite={hasLiveForSageShop}
517
517
  refreshCallBackFn={refreshFloorListDataFn ? refreshFloorListDataFn : null}
518
518
  btnLabel={refreshFloorListDataBtnLabel || ''}
519
519
  />
520
520
  </View>
521
521
  ) : null}
522
522
  </View>
523
523
  );
524
524
  updateShopDataFn: null,
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro';
2
1
  UUID,
3
2
  isJdApp,
4
3
  jdAppVersionStr,
5
4
  isIosDevice,
6
5
  isPc,
7
6
  isJdAndIosDevice,
8
7
  isJdAndAndroidDevice,
9
8
  isJdAndHarmonyDevice,
10
9
  isNewHarmonyShop,
11
10
  passSmartCouponInfoFunctionIdList,
12
11
  needFixClientValueToHarmonyFunctionIdList,
13
12
  clientVersion: isJdApp && jdAppVersionStr !== '' ? jdAppVersionStr : '11.0.0',
14
13
  client: isJdApp ? (isIosDevice ? 'apple' : 'android') : isPc ? 'pc' : 'wh5',
15
14
  screen: `${Math.ceil(window.screen?.width * devicePixelRatio)}*${Math.ceil(
16
15
  window.screen?.height * devicePixelRatio,
17
16
  )}`,
18
17
  area: '1_72_2799_0',
19
18
  uuid: UUID,
20
19
  const { area, realTimeArea } = areaInfo || {};
21
20
  area && area !== '' && (clientParams.area = area);
22
21
  realTimeArea && realTimeArea !== '' && (clientParams['realTimeArea'] = realTimeArea);
23
22
  console.warn(
24
23
  'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
25
24
  areaInfo,
26
25
  '更新后的接口底层信息',
27
26
  clientParams,
28
27
  );
29
28
  const smartCouponInfo = await getSmartCouponInfo();
30
29
  if (smartCouponInfo) {
31
30
  requestParams.smartCouponInfo = smartCouponInfo;
32
31
  }
33
32
  functionId: string,
34
33
  body = {},
35
34
  options = {},
36
35
  requestOptions = {},
37
36
  const useBodyParams = { ...body };
38
37
  if (passSmartCouponInfoFunctionIdList.includes(functionId)) {
39
38
  await handleSmartCouponInfo(useBodyParams);
40
39
  }
41
40
  const params = Object.assign(
42
41
  {},
43
42
  {
44
43
  t: Date.now(),
45
44
  functionId,
46
45
  appid: 'shop_m_jd_com',
47
46
  body: JSON.stringify(useBodyParams),
48
47
  },
49
48
  clientParams,
50
49
  options,
51
50
  {
52
51
  area: clientParams.area,
53
52
  client: !isJdApp && options?.client ? options?.client : clientParams.client,
54
53
  clientVersion:
55
54
  !isJdApp && options?.clientVersion ? options?.clientVersion : clientParams.clientVersion,
56
55
  },
57
56
  );
58
57
  if (
59
58
  isJdAndHarmonyDevice &&
60
59
  (needFixClientValueToHarmonyFunctionIdList.includes(functionId) || isNewHarmonyShop)
61
60
  ) {
62
61
  params.client = 'harmony';
63
62
  } else {
64
63
  }
65
64
  console.warn(
66
65
  'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
67
66
  '底层默认的clientParams',
68
67
  clientParams,
69
68
  '下发的options',
70
69
  options,
71
70
  '最后params',
72
71
  params,
73
72
  );
74
73
  return http.post(api.apiFunc, params, requestOptions);
74
+ import Taro from '@tarojs/taro';
75
75
  UUID,
76
76
  isJdApp,
77
77
  jdAppVersionStr,
78
78
  isIosDevice,
79
79
  isPc,
80
80
  isJdAndIosDevice,
81
81
  isJdAndAndroidDevice,
82
82
  isJdAndHarmonyDevice,
83
83
  isNewHarmonyShop,
84
84
  passSmartCouponInfoFunctionIdList,
85
85
  needFixClientValueToHarmonyFunctionIdList,
86
86
  clientVersion: isJdApp && jdAppVersionStr !== '' ? jdAppVersionStr : '11.0.0',
87
87
  client: isJdApp ? (isIosDevice ? 'apple' : 'android') : isPc ? 'pc' : 'wh5',
88
88
  screen: `${Math.ceil(window.screen?.width * devicePixelRatio)}*${Math.ceil(
89
89
  window.screen?.height * devicePixelRatio,
90
90
  )}`,
91
91
  area: '1_72_2799_0',
92
92
  uuid: UUID,
93
93
  const { area, realTimeArea } = areaInfo || {};
94
94
  area && area !== '' && (clientParams.area = area);
95
95
  realTimeArea && realTimeArea !== '' && (clientParams['realTimeArea'] = realTimeArea);
96
96
  console.warn(
97
97
  'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
98
98
  areaInfo,
99
99
  '更新后的接口底层信息',
100
100
  clientParams,
101
101
  );
102
102
  if (isH5 && (isJdAndIosDevice || isJdAndAndroidDevice)) {
103
103
  const smartCouponInfo = await getSmartCouponInfo();
104
104
  if (smartCouponInfo) {
105
105
  requestParams.smartCouponInfo = smartCouponInfo;
106
106
  }
107
107
  } else {
108
108
  console.warn('🚗 ~~ handleSmartCouponInfo ~~ 不支持的环境!');
109
109
  }
110
110
  functionId: string,
111
111
  body = {},
112
112
  options = {},
113
113
  requestOptions = {},
114
114
  const useBodyParams = { ...body };
115
115
  if (passSmartCouponInfoFunctionIdList.includes(functionId)) {
116
116
  await handleSmartCouponInfo(useBodyParams);
117
117
  }
118
118
  const params = Object.assign(
119
119
  {},
120
120
  {
121
121
  t: Date.now(),
122
122
  functionId,
123
123
  appid: 'shop_m_jd_com',
124
124
  body: JSON.stringify(useBodyParams),
125
125
  },
126
126
  clientParams,
127
127
  options,
128
128
  {
129
129
  area: clientParams.area,
130
130
  client: !isJdApp && options?.client ? options?.client : clientParams.client,
131
131
  clientVersion:
132
132
  !isJdApp && options?.clientVersion ? options?.clientVersion : clientParams.clientVersion,
133
133
  },
134
134
  );
135
135
  if (
136
136
  isJdAndHarmonyDevice &&
137
137
  (needFixClientValueToHarmonyFunctionIdList.includes(functionId) || isNewHarmonyShop)
138
138
  ) {
139
139
  params.client = 'harmony';
140
140
  } else {
141
141
  }
142
142
  console.warn(
143
143
  'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
144
144
  '底层默认的clientParams',
145
145
  clientParams,
146
146
  '下发的options',
147
147
  options,
148
148
  '最后params',
149
149
  params,
150
150
  );
151
151
  return http.post(api.apiFunc, params, requestOptions);