@conecli/cone-render 0.10.1-shop-beta.42 → 0.10.1-shop-beta.44

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 Taro from '@tarojs/taro';
2
1
  entrance: 'shop-page-tab',
3
2
  moduleId: 'shop-modular-floor',
4
3
 
5
4
  jdJumpToProduct(skuIds, logEventInfo, otherParams = {}) {
6
5
  skuIds = skuIds.toString().trim();
7
6
  const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds;
8
7
  const openAppParam = {
9
8
  category: 'jump',
10
9
  des: 'productDetail',
11
10
  skuId: getSkuId,
12
11
  logEventInfo,
13
12
  ...otherParams,
14
13
  };
15
14
  const adInfos = getAdInfoBySkuId(getSkuId);
16
15
  if (adInfos) {
17
16
  openAppParam.pdExtFlag = {
18
17
  adInfos,
19
18
  };
20
19
  }
21
20
  this.jdNavigateToNative(openAppParam);
22
21
  }
23
22
 
24
23
  jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo, otherParams = {}) {
25
24
  const getSkuId = skuInfo?.skuId;
26
25
  this.jdJumpToProduct(getSkuId, logEventInfo, otherParams);
27
26
  }
28
27
 
29
28
  jdJumpToCartPage(logEventInfo) {
30
29
  this.jdNavigateToNative(
31
30
  Object.assign(
32
31
  {},
33
32
  {
34
33
  category: 'jump',
35
34
  des: 'cartB',
36
35
  logEventInfo,
37
36
  },
38
37
  ),
39
38
  );
40
39
  }
41
40
 
42
41
  jdJumpToShopCategory(shopInfo = {}) {
43
42
  console.log(
44
43
  '🚀 ~ file: jdJumpJdApp.ts:40 ~ JdJumpJdApp ~ jdJumpToShopCategory ~ shopInfo:',
45
44
  shopInfo,
46
45
  );
47
46
  console.log('[降级H5] jdJumpToShopCategory jdJumpJdApp');
48
47
  this.jdNavigateToNative(
49
48
  Object.assign(
50
49
  {},
51
50
  {
52
51
  category: 'jump',
53
52
  des: 'jshopMain',
54
53
  jumpBottomTab: 'category',
55
54
  },
56
55
  shopInfo,
57
56
  {
58
57
  shopId: String(shopInfo.shopId ?? ''),
59
58
  venderId: String(shopInfo.venderId ?? ''),
60
59
  },
61
60
  ),
62
61
  );
63
62
  }
64
63
 
65
64
  jdJumpToOrderInfoView(skuInfos, logEventInfo) {
66
65
  if (!skuInfos || !Array.isArray(skuInfos) || skuInfos.length <= 0) {
67
66
  console.log('skuInfos 参数错误,必须为非空数组');
68
67
  return null;
69
68
  }
70
69
  const isValid = skuInfos.every(
71
70
  (item) =>
72
71
  item &&
73
72
  typeof item === 'object' &&
74
73
  item !== null &&
75
74
  'skuId' in item &&
76
75
  'num' in item &&
77
76
  typeof item.skuId === 'string' &&
78
77
  typeof item.num === 'number',
79
78
  );
80
79
  if (!isValid) {
81
80
  console.log('skuInfos 格式错误:每个item必须是对象且包含 skuId(string) 和 num(number) 属性');
82
81
  return null;
83
82
  }
84
83
  const skuItems = skuInfos.map((sku) => {
85
84
  sku['itemType'] = 1;
86
85
  return sku;
87
86
  });
88
87
  const extFlag = {
89
88
  cartValue: '1',
90
89
  skuItems,
91
90
  };
92
91
  this.jdNavigateToNative({
93
92
  category: 'jump',
94
93
  des: 'orderInfoView',
95
94
  skuSource: 176,
96
95
  sourceType: 7,
97
96
  extFlag: JSON.stringify(extFlag),
98
97
  logEventInfo,
99
98
  });
100
99
  }
101
100
 
102
101
  jdJumpToTryDetail(tryId) {
103
102
  this.jdNavigateToNative({
104
103
  category: 'jump',
105
104
  des: 'jdreactcommon',
106
105
  appname: 'JDReactNewProduct',
107
106
  modulename: 'JDReactNewProduct',
108
107
  param: {
109
108
  activityId: tryId,
110
109
  isNative: true,
111
110
  nativePage: 'jdtry_detail',
112
111
  transparentenable: true,
113
112
  },
114
113
  });
115
114
  }
116
115
 
117
116
  jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
118
117
  console.log('[降级H5] jdJumpToShopHome jdJumpJdApp');
119
118
  const currentShopInfo = {
120
119
  shopId: global.info.queryInfo.shopId,
121
120
  venderId: global.info.queryInfo.venderId,
122
121
  };
123
122
  const restParams =
124
123
  (shopInfo?.shopId && shopInfo.shopId !== currentShopInfo.shopId) ||
125
124
  (shopInfo?.venderId && shopInfo.venderId !== currentShopInfo.venderId)
126
125
  ? {}
127
126
  : currentShopInfo;
128
127
  const getInfo = Object.assign({}, restParams, shopInfo);
129
128
  const getShopParams = this.getShopIdsInfo(getInfo);
130
129
  this.jdJumpToShopBase(getShopParams);
131
130
  }
132
131
 
133
132
  jdJumpToShopHomeInner(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
134
133
  const getParam = Object.assign(
135
134
  {},
136
135
  {
137
136
  jumpTab: HOME_TOP_TAB_TYPE_APP.HOME,
138
137
  operation: 'jumpTabInner',
139
138
  },
140
139
  shopInfo,
141
140
  );
142
141
  this.jdJumpToShopBase(getParam);
143
142
  }
144
143
 
145
144
  jdJumpToUnifieddetail(sourceInfo) {
146
145
  this.jdNavigateToNative(
147
146
  Object.assign(
148
147
  {},
149
148
  {
150
149
  category: 'jump',
151
150
  des: 'unifieddetail',
152
151
  },
153
152
  sourceInfo,
154
153
  ),
155
154
  );
156
155
  }
157
156
 
158
157
  jdJumpToVideoImmersion(sourceInfo) {
159
158
  this.jdNavigateToNative(
160
159
  Object.assign(
161
160
  {},
162
161
  {
163
162
  category: 'jump',
164
163
  des: 'VideoImmersion',
165
164
  },
166
165
  sourceInfo,
167
166
  ),
168
167
  );
169
168
  }
170
169
 
171
170
  jdJumpToShopMember(shopInfo) {
172
171
  this.jdNavigateToNative(
173
172
  Object.assign(
174
173
  {},
175
174
  {
176
175
  category: 'jump',
177
176
  des: 'jshopMember',
178
177
  followAward: '-1',
179
178
  },
180
179
  shopInfo,
181
180
  ),
182
181
  );
183
182
  }
184
183
 
185
184
  jdJumpToMemberTab(shopInfo?) {
186
185
  this.jdNavigateToNative(
187
186
  Object.assign(
188
187
  {},
189
188
  {
190
189
  category: 'jump',
191
190
  des: 'jshopMain',
192
191
  shopId: global.info.queryInfo.shopId,
193
192
  venderId: global.info.queryInfo.venderId,
194
193
  operation: 'jumpBottomTabMember',
195
194
  sourceInfo: APP_SOURCE_INFO,
196
195
  },
197
196
  shopInfo,
198
197
  ),
199
198
  );
200
199
  }
201
200
 
202
201
  jdJumpToDongDongChatGroup(groupId, source = 'jdmini') {
203
202
  this.jdNavigateToNative({
204
203
  category: 'jump',
205
204
  des: 'dongdong_group_chat',
206
205
  source: source,
207
206
  groupId: `${groupId}`,
208
207
  });
209
208
  }
210
209
 
211
210
  jdJumpToDongDongChat(paramInfo: any = {}) {
212
211
  const { venderId, ...otherParams } = paramInfo;
213
212
  this.jdNavigateToNative(
214
213
  Object.assign(
215
214
  {},
216
215
  {
217
216
  category: 'jump',
218
217
  des: 'jd_dongdong_chat',
219
218
  venderId: `${venderId ? venderId : global.info.queryInfo?.venderId}`,
220
219
  entry: 'm_shop',
221
220
  },
222
221
  otherParams,
223
222
  ),
224
223
  );
225
224
  }
226
225
 
227
226
  jdJumpToShopActivity(shopInfo) {
228
227
  const getParams = Object.assign(
229
228
  {},
230
229
  {
231
230
  category: 'jump',
232
231
  des: 'jshopActivity',
233
232
  shopId: global.info.queryInfo.shopId,
234
233
  venderId: global.info.queryInfo.venderId,
235
234
  },
236
235
  shopInfo,
237
236
  );
238
237
  getParams['projectId'] && (getParams['projectId'] = `${getParams['projectId']}`);
239
238
  this.jdNavigateToNative(getParams);
240
239
  }
241
240
 
242
241
  jdJumpToShopActivityPage(shopInfo) {
243
242
  this.jdNavigateToNative(
244
243
  Object.assign(
245
244
  {},
246
245
  {
247
246
  category: 'jump',
248
247
  des: 'jshopActivityPage',
249
248
  shopId: global.info.queryInfo.shopId,
250
249
  title: global.info.queryInfo?.shopName,
251
250
  },
252
251
  shopInfo,
253
252
  ),
254
253
  );
255
254
  }
256
255
 
257
256
  jdJumpToShopDetail(shopInfo) {
258
257
  this.jdNavigateToNative(
259
258
  Object.assign(
260
259
  {},
261
260
  {
262
261
  category: 'jump',
263
262
  des: 'jshopDetail',
264
263
  shopId: global.info.queryInfo.shopId,
265
264
  venderId: global.info.queryInfo.venderId,
266
265
  sourceInfo: APP_SOURCE_INFO,
267
266
  },
268
267
  shopInfo,
269
268
  ),
270
269
  );
271
270
  }
272
271
 
273
272
  jdJumpToShopMemberCard(shopInfo) {
274
273
  const { url, logEventInfo } = shopInfo;
275
274
  if (this.isOpenJdAppUrl(url)) {
276
275
  const getOpenAppParams = this.jdOpenAppParams(url);
277
276
  console.log('jd web 获取自定义openApp链接解析后的参数结果', getOpenAppParams);
278
277
  if (getOpenAppParams) {
279
278
  this.jdNavigateToNative(Object.assign({}, getOpenAppParams, { logEventInfo }));
280
279
  }
281
280
  } else {
282
281
  super.jdJumpToWeb(url, {
283
282
  ...logEventInfo,
284
283
  });
285
284
  }
286
285
  }
287
286
 
288
287
  jdJumpToTotalPromotion(shopInfo) {
289
288
  const { url, logEventInfo } = shopInfo;
290
289
  if (this.isOpenJdAppUrl(url)) {
291
290
  const getOpenAppParams = this.jdOpenAppParams(url);
292
291
  console.log('jd web 获取自定义openApp链接解析后的参数结果', getOpenAppParams);
293
292
  if (getOpenAppParams) {
294
293
  this.jdNavigateToNative(Object.assign({}, getOpenAppParams, { logEventInfo }));
295
294
  }
296
295
  } else {
297
296
  super.jdJumpToWeb(url, {
298
297
  ...logEventInfo,
299
298
  });
300
299
  }
301
300
  }
302
301
 
303
302
  jdJumpToShopSearch(pageInfo = {}) {
304
303
  const getInfo = Object.assign(
305
304
  {},
306
305
  {
307
306
  shopId: global.info.queryInfo.shopId,
308
307
  venderId: global.info.queryInfo.venderId,
309
308
  sourceInfo: APP_SOURCE_INFO,
310
309
  },
311
310
  pageInfo,
312
311
  );
313
312
  const { keyword = '', categoryId = '', ...otherPageInfo }: any = getInfo;
314
313
  const searchInfo = {};
315
314
  if (categoryId !== '') {
316
315
  searchInfo['categoryId'] = typeof categoryId === 'string' ? categoryId?.trim() : categoryId;
317
316
  searchInfo['searchType'] = '5';
318
317
  } else if (keyword !== '') {
319
318
  searchInfo['keyWord'] = keyword;
320
319
  searchInfo['searchType'] = '4';
321
320
  }
322
321
  const openAppParam = {
323
322
  category: 'jump',
324
323
  des: 'jshopProductList',
325
324
  pageId: '1',
326
325
  ...searchInfo,
327
326
  };
328
327
  const jumpExtMap = getEnterShopExtInfo();
329
328
  if (jumpExtMap) {
330
329
  openAppParam.jumpExtMap = jumpExtMap;
331
330
  }
332
331
  this.jdNavigateToNative(Object.assign({}, openAppParam, otherPageInfo));
333
332
  }
334
333
 
335
334
  jdJumpToOrderList(type = "all",logEventInfo = {}) {
336
335
  const iosOrderType = {
337
336
  all: 1,
338
337
  waitPay: 2,
339
338
  waitReceipt: 3,
340
339
  waitServe: 9,
341
340
  waitComment: 12,
342
341
  cancel: 5,
343
342
  finish: 4,
344
343
  }
345
344
  const androidOrderType = {
346
345
  all: "all",
347
346
  waitPay: "daifukuan",
348
347
  waitReceipt: "daishouhuo",
349
348
  waitServe: "waitForUse",
350
349
  waitComment: "wait4EvaluateNew",
351
350
  cancel: "yiquxiao",
352
351
  }
353
352
  const getParams = Object.assign(
354
353
  {},
355
354
  {
356
355
  category: 'jump',
357
356
  des: 'orderlist',
358
357
  from: 'dphycc',
359
358
  },
360
359
  )
361
360
  if(isJdAndIosDevice){
362
361
  getParams.listType = iosOrderType[type] || iosOrderType.all;
363
362
  }else {
364
363
  if(type !== androidOrderType.all && androidOrderType[type]){
365
364
  getParams.functionId = androidOrderType[type];
366
365
  }
367
366
  }
368
367
  this.jdNavigateToNative(
369
368
  Object.assign(
370
369
  {},
371
370
  getParams,
372
371
  logEventInfo,
373
372
  ),
374
373
  );
375
374
  }
376
375
 
377
376
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
378
377
  this.jdNavigateToNative(
379
378
  Object.assign(
380
379
  {},
381
380
  {
382
381
  category: 'jump',
383
382
  des: 'productList',
384
383
  from: 'couponBatch',
385
384
  couponId: `${couponId}`,
386
385
  logEventInfo,
387
386
  },
388
387
  ),
389
388
  );
390
389
  }
391
390
 
392
391
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}, shopInfo = {}) {
393
392
  console.log('jdJumpJdApp - jdJumpToTabAllProduct');
394
393
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
395
394
  if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
396
395
  this.jdNavigateToNative(
397
396
  Object.assign(
398
397
  {},
399
398
  {
400
399
  category: 'jump',
401
400
  des: 'jshopMain',
402
401
  jumpTab: 'allProduct',
403
402
  },
404
403
  shopInfo,
405
404
  shopId !== 'undefined'
406
405
  ? {
407
406
  shopId,
408
407
  }
409
408
  : {},
410
409
  venderId !== 'undefined'
411
410
  ? {
412
411
  venderId,
413
412
  }
414
413
  : {},
415
414
  {
416
415
  logEventInfo,
417
416
  },
418
417
  ),
419
418
  );
420
419
  }
421
420
 
422
421
  jdJumpToTabAllProductInner(shopId, venderId, logEventInfo = {}, shopInfo = {}) {
423
422
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
424
423
  if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
425
424
  this.jdNavigateToNative(
426
425
  Object.assign(
427
426
  {},
428
427
  {
429
428
  category: 'jump',
430
429
  des: 'jshopMain',
431
430
  jumpTab: 'allProduct',
432
431
  operation: 'jumpTabInner',
433
432
  },
434
433
  shopInfo,
435
434
  shopId !== 'undefined'
436
435
  ? {
437
436
  shopId,
438
437
  }
439
438
  : {},
440
439
  venderId !== 'undefined'
441
440
  ? {
442
441
  venderId,
443
442
  }
444
443
  : {},
445
444
  {
446
445
  logEventInfo,
447
446
  },
448
447
  ),
449
448
  );
450
449
  }
451
450
 
452
451
  jdJumpToShopBase(shopInfo) {
453
452
  console.log('[降级H5] jdJumpToShopBase jdJumpJdApp');
454
453
  const currentShopInfo = {
455
454
  shopId: global.info.queryInfo.shopId,
456
455
  venderId: global.info.queryInfo.venderId,
457
456
  };
458
457
  const restParams =
459
458
  (shopInfo?.shopId && shopInfo.shopId !== currentShopInfo.shopId) ||
460
459
  (shopInfo?.venderId && shopInfo.venderId !== currentShopInfo.venderId)
461
460
  ? {}
462
461
  : currentShopInfo;
463
462
  const getParam = Object.assign(
464
463
  {},
465
464
  {
466
465
  category: 'jump',
467
466
  des: 'jshopMain',
468
467
  jumpTab: HOME_TOP_TAB_TYPE_APP.HOME,
469
468
  ...restParams,
470
469
  sourceInfo: APP_SOURCE_INFO,
471
470
  },
472
471
  shopInfo,
473
472
  );
474
473
  this.jdNavigateToNative(getParam);
475
474
  }
476
475
 
477
476
  jdJumpToTabNew(shopInfo = {}) {
478
477
  const getParam = Object.assign(
479
478
  {},
480
479
  {
481
480
  jumpTab: HOME_TOP_TAB_TYPE_APP.NEW,
482
481
  },
483
482
  shopInfo,
484
483
  );
485
484
  this.jdJumpToShopBase(getParam);
486
485
  }
487
486
 
488
487
  jdJumpToTabNewInner(shopInfo = {}) {
489
488
  const getParam = Object.assign(
490
489
  {},
491
490
  {
492
491
  jumpTab: HOME_TOP_TAB_TYPE_APP.NEW,
493
492
  operation: 'jumpTabInner',
494
493
  },
495
494
  shopInfo,
496
495
  );
497
496
  this.jdJumpToShopBase(getParam);
498
497
  }
499
498
  jdJumpToTabRank(shopInfo = {}) {
500
499
  const getParam = Object.assign(
501
500
  {},
502
501
  {
503
502
  jumpTab: HOME_TOP_TAB_TYPE_APP.RANK,
504
503
  },
505
504
  shopInfo,
506
505
  );
507
506
  this.jdJumpToShopBase(getParam);
508
507
  }
509
508
  jdJumpToTabRankInner(shopInfo = {}) {
510
509
  const getParam = Object.assign(
511
510
  {},
512
511
  {
513
512
  jumpTab: HOME_TOP_TAB_TYPE_APP.RANK,
514
513
  operation: 'jumpTabInner',
515
514
  },
516
515
  shopInfo,
517
516
  );
518
517
  this.jdJumpToShopBase(getParam);
519
518
  }
520
519
  jdJumpToTabBuyerShow(shopInfo = {}) {
521
520
  const getParam = Object.assign(
522
521
  {},
523
522
  {
524
523
  jumpTab: HOME_TOP_TAB_TYPE_APP.BUYERSHOW,
525
524
  },
526
525
  shopInfo,
527
526
  );
528
527
  this.jdJumpToShopBase(getParam);
529
528
  }
530
529
  jdJumpToTabBuyerShowInner(shopInfo = {}) {
531
530
  const getParam = Object.assign(
532
531
  {},
533
532
  {
534
533
  jumpTab: HOME_TOP_TAB_TYPE_APP.BUYERSHOW,
535
534
  operation: 'jumpTabInner',
536
535
  },
537
536
  shopInfo,
538
537
  );
539
538
  this.jdJumpToShopBase(getParam);
540
539
  }
541
540
  jdJumpToTabActivity(shopInfo = {}) {
542
541
  const getParam = Object.assign(
543
542
  {},
544
543
  {
545
544
  jumpTab: HOME_TOP_TAB_TYPE_APP.ACTIVITY,
546
545
  },
547
546
  shopInfo,
548
547
  );
549
548
  this.jdJumpToShopBase(getParam);
550
549
  }
551
550
  jdJumpToTabActivityInner(shopInfo = {}) {
552
551
  const getParam = Object.assign(
553
552
  {},
554
553
  {
555
554
  jumpTab: HOME_TOP_TAB_TYPE_APP.ACTIVITY,
556
555
  operation: 'jumpTabInner',
557
556
  },
558
557
  shopInfo,
559
558
  );
560
559
  this.jdJumpToShopBase(getParam);
561
560
  }
562
561
  jdJumpToTabSecKill(shopInfo = {}) {
563
562
  const getParam = Object.assign(
564
563
  {},
565
564
  {
566
565
  jumpTab: HOME_TOP_TAB_TYPE_APP.SECKILL,
567
566
  },
568
567
  shopInfo,
569
568
  );
570
569
  this.jdJumpToShopBase(getParam);
571
570
  }
572
571
  jdJumpToTabSecKillInner(shopInfo = {}) {
573
572
  const getParam = Object.assign(
574
573
  {},
575
574
  {
576
575
  jumpTab: HOME_TOP_TAB_TYPE_APP.SECKILL,
577
576
  operation: 'jumpTabInner',
578
577
  },
579
578
  shopInfo,
580
579
  );
581
580
  this.jdJumpToShopBase(getParam);
582
581
  }
583
582
  jdJumpToTabLive(shopInfo = {}) {
584
583
  const getParam = Object.assign(
585
584
  {},
586
585
  {
587
586
  jumpTab: HOME_TOP_TAB_TYPE_APP.LIVE,
588
587
  },
589
588
  shopInfo,
590
589
  );
591
590
  this.jdJumpToShopBase(getParam);
592
591
  }
593
592
  jdJumpToTabLiveInner(shopInfo = {}) {
594
593
  const getParam = Object.assign(
595
594
  {},
596
595
  {
597
596
  jumpTab: HOME_TOP_TAB_TYPE_APP.LIVE,
598
597
  operation: 'jumpTabInner',
599
598
  },
600
599
  shopInfo,
601
600
  );
602
601
  this.jdJumpToShopBase(getParam);
603
602
  }
604
603
 
605
604
  jdJumpToBottomTabBase(type, shopInfo = {}) {
606
605
  this.jdNavigateToNative(
607
606
  Object.assign(
608
607
  {},
609
608
  {
610
609
  category: 'jump',
611
610
  des: 'jshopMain',
612
611
  shopId: global.info.queryInfo.shopId,
613
612
  venderId: global.info.queryInfo.venderId,
614
613
  jumpBottomTab: type,
615
614
  sourceInfo: APP_SOURCE_INFO,
616
615
  },
617
616
  shopInfo,
618
617
  ),
619
618
  );
620
619
  }
621
620
 
622
621
  jdJumpToBottomTabProduct(shopInfo = {}) {
623
622
  this.jdJumpToBottomTabBase(BOTTOM_TAB_TYPE_APP.PRODUCT, shopInfo);
624
623
  }
625
624
 
626
625
  jdJumpToBottomTabCategory(shopInfo = {}) {
627
626
  this.jdJumpToBottomTabBase(BOTTOM_TAB_TYPE_APP.CATEGORY, shopInfo);
628
627
  }
629
628
 
630
629
  jdJumpToBottomTabFind(shopInfo = {}) {
631
630
  this.jdJumpToBottomTabBase(BOTTOM_TAB_TYPE_APP.FIND, shopInfo);
632
631
  }
633
632
 
634
633
  jdJumpToBottomTabBrandMember(shopInfo = {}) {
635
634
  this.jdJumpToBottomTabBase(BOTTOM_TAB_TYPE_APP.BRANDMEMBER, shopInfo);
636
635
  }
637
636
 
638
637
  jdJumpToBottomTabBrandMemberInner(shopInfo = {}) {
639
638
  this.jdJumpToMemberTab(shopInfo);
640
639
  }
641
640
 
642
641
  jdJumpToWeb(
643
642
  url,
644
643
  logEventInfo,
645
644
  successBack?: functionType | undefined,
646
645
  failBack?: functionType | undefined,
647
646
  ) {
648
647
  const changeUrl = /^\/\//.test(url) ? `https:${url}` : url;
649
648
  this.jdNavigateToNative(
650
649
  {
651
650
  category: 'jump',
652
651
  des: 'm',
653
652
  url: isJdAndHarmonyDevice ? changeUrl : encodeURIComponent(changeUrl),
654
653
  logEventInfo,
655
654
  },
656
655
  OpenAppHost,
657
656
  successBack,
658
657
  failBack,
659
658
  );
660
659
  }
661
660
 
662
661
  jdJumpToLive(clickUrlOrObj, logEventInfo) {
663
662
  if (isJdAppForNotMain) {
664
663
  super.jdJumpToLive(clickUrlOrObj, logEventInfo);
665
664
  } else {
666
665
  if (typeof clickUrlOrObj === 'object') {
667
666
  this.jdNavigateToNative({
668
667
  category: 'jump',
669
668
  des: 'LivePlayerRoom',
670
669
  liveOrigin: '1',
671
670
  needLogin: '0',
672
671
  isNeedVideo: true,
673
672
  logEventInfo,
674
673
  ...clickUrlOrObj,
675
674
  });
676
675
  } else {
677
676
  const getShopLiveParams = this.jdOpenAppParams(clickUrlOrObj);
678
677
  console.log('getShopLiveParams=====', getShopLiveParams);
679
678
  if (typeof getShopLiveParams === 'object') {
680
679
  this.jdNavigateToNative({
681
680
  ...getShopLiveParams,
682
681
  logEventInfo,
683
682
  });
684
683
  }
685
684
  }
686
685
  }
687
686
  }
688
687
 
689
688
  jdJumpToUgcContent(urlObj, logEventInfo = {}) {
690
689
  if (isJdAppForNotMain) {
691
690
  super.jdJumpToUgcContent(urlObj, logEventInfo);
692
691
  } else {
693
692
  if (typeof urlObj === 'object') {
694
693
  this.jdNavigateToNative({
695
694
  category: 'jump',
696
695
  des: 'shareOrderUgcContent',
697
696
  channel: 'shopshangxin',
698
697
  cmtType: '10',
699
698
  isNeedVideo: true,
700
699
  ...urlObj,
701
700
  logEventInfo,
702
701
  });
703
702
  } else {
704
703
  const getShopUgcParams = this.jdOpenAppParams(urlObj);
705
704
  if (getShopUgcParams) {
706
705
  getShopUgcParams['logEventInfo'] = logEventInfo;
707
706
  console.log('getShopUgcParams=====', getShopUgcParams);
708
707
  getShopUgcParams && this.jdNavigateToNative(getShopUgcParams as string);
709
708
  }
710
709
  }
711
710
  }
712
711
  }
713
712
 
714
713
  jdJumpToSeckillNewBrand(brandId) {
715
714
  this.jdNavigateToNative({
716
715
  category: 'jump',
717
716
  des: 'seckillnewbrand',
718
717
  brandId: `${brandId}`,
719
718
  });
720
719
  }
721
720
 
722
721
  jdJumpToJshopDynamicDetail(info) {
723
722
  this.jdNavigateToNative({
724
723
  category: 'jump',
725
724
  des: 'jshopDynamicDetail',
726
725
  shopId: global.info.queryInfo.shopId,
727
726
  venderId: global.info.queryInfo.venderId,
728
727
  ...info,
729
728
  });
730
729
  }
731
730
 
732
731
  jdJumpToRankList(rankingId, rankType, logEventInfo) {
733
732
  if (isJdAppForNotMain) {
734
733
  super.jdJumpToRankList(rankingId, rankType, logEventInfo);
735
734
  } else {
736
735
  this.jdNavigateToNative(
737
736
  Object.assign(
738
737
  {},
739
738
  {
740
739
  category: 'jump',
741
740
  des: 'jdreactcommon',
742
741
  modulename: 'JDReactRankingList',
743
742
  appname: 'JDReactRankingList',
744
743
  transparentenable: true,
745
744
  ishidden: true,
746
745
  param: {
747
746
  contentId: '' + rankingId,
748
747
  fromSkuId: '',
749
748
  detailPageType: '5',
750
749
  rankType: rankType || 10 + '',
751
750
  },
752
751
  logEventInfo,
753
752
  },
754
753
  ),
755
754
  );
756
755
  }
757
756
  }
758
757
 
759
758
  jdJumpToFlashSaleTab(logEventInfo) {
760
759
  this.jdNavigateToNative(
761
760
  Object.assign(
762
761
  {},
763
762
  {
764
763
  category: 'jump',
765
764
  des: 'jshopMain',
766
765
  jumpTab: 'flashPurchase',
767
766
  shopId: global.info.queryInfo.shopId,
768
767
  venderId: global.info.queryInfo.venderId,
769
768
  sourceType: 'JDReactShopActivityTAB',
770
769
  sourceValue: '2',
771
770
  operation: 'jumpTabInner',
772
771
  logEventInfo,
773
772
  },
774
773
  ),
775
774
  );
776
775
  }
777
776
 
778
777
 
779
778
  jdJumpToShopMemberInfo(logEventInfo) {
780
779
  this.jdNavigateToNative(
781
780
  Object.assign(
782
781
  {},
783
782
  {
784
783
  category: 'jump',
785
784
  des: 'jdreactcommon',
786
785
  modulename: 'JDReactShopMember',
787
786
  appname: 'JDReactShopMember',
788
787
  ishidden: true,
789
788
  param: {
790
789
  page: 'memberInfo',
791
790
  shopId: global.info.queryInfo.shopId,
792
791
  venderId: global.info.queryInfo.venderId,
793
792
  },
794
793
  logEventInfo,
795
794
  },
796
795
  ),
797
796
  );
798
797
  }
799
798
 
800
799
  jdJumpToShopMemberBenefit(logEventInfo) {
801
800
  const venderId = global.info.queryInfo.venderId;
802
801
  const shopId = global.info.queryInfo.shopId;
803
802
  this.jdJumpToWeb(
804
803
  `${this.jumpWebUrl.memberBenefit}?venderId=${venderId}&shopId=${shopId}`,
805
804
  logEventInfo,
806
805
  );
807
806
  }
808
807
 
809
808
  jdJumpToShopMemberPointExchange(venderType, levelZeroMenuUrl, logEventInfo) {
810
809
  this.jdNavigateToNative(
811
810
  Object.assign(
812
811
  {},
813
812
  {
814
813
  category: 'jump',
815
814
  des: 'jdreactcommon',
816
815
  modulename: 'JDReactShopMember',
817
816
  appname: 'JDReactShopMember',
818
817
  ishidden: true,
819
818
  param: {
820
819
  page: 'pointsExchangePage',
821
820
  shopId: global.info.queryInfo.shopId,
822
821
  venderId: global.info.queryInfo.venderId,
823
822
  levelZeroMenuUrl,
824
823
  },
825
824
  logEventInfo,
826
825
  },
827
826
  ),
828
827
  );
829
828
  }
830
829
 
831
830
  jdJumpToShopMemberBonusPurchase(customerLevel, logEventInfo) {
832
831
  this.jdNavigateToNative(
833
832
  Object.assign(
834
833
  {},
835
834
  {
836
835
  category: 'jump',
837
836
  des: 'jdreactcommon',
838
837
  modulename: 'JDReactShopMember',
839
838
  appname: 'JDReactShopMember',
840
839
  ishidden: true,
841
840
  param: {
842
841
  page: 'bonusPurchase',
843
842
  shopId: global.info.queryInfo.shopId,
844
843
  venderId: global.info.queryInfo.venderId,
845
844
  customerLevel,
846
845
  },
847
846
  logEventInfo,
848
847
  },
849
848
  ),
850
849
  );
851
850
  }
852
851
 
853
852
  jdJumpToMyRedEnvelope(logEventInfo) {
854
853
  this.jdNavigateToNative(
855
854
  Object.assign(
856
855
  {},
857
856
  {
858
857
  category: 'jump',
859
858
  des: 'jdreactcommon',
860
859
  modulename: 'JDReactMyRedEnvelope',
861
860
  appname: 'JDReactMyRedEnvelope',
862
861
  ishidden: true,
863
862
  fromName: 2,
864
863
  needLogin: true,
865
864
  logEventInfo,
866
865
  },
867
866
  ),
868
867
  );
869
868
  }
870
869
 
871
870
  jdJumpToMyCoupon(logEventInfo) {
872
871
  this.jdNavigateToNative(
873
872
  Object.assign(
874
873
  {},
875
874
  {
876
875
  category: 'jump',
877
876
  des: 'mycoupon',
878
877
  logEventInfo,
879
878
  },
880
879
  ),
881
880
  );
882
881
  }
883
882
 
884
883
 
885
884
  jdJumpToMiniProgram({ vapptype, appId, path, param }) {
886
885
  const pageName = param['pageType'] || 'home';
887
886
  const nowMiniPath = `pages/${pageName}/index`;
888
887
  if (appId === global.info.pageInfo.appId) {
889
888
  Taro.navigateTo({
890
889
  url: `/${nowMiniPath}?${objectToUrlEncode(param)}`,
891
890
  }).catch((err) => {
892
891
  console.warn('跳转小程序页面错误:', err);
893
892
  });
894
893
  } else {
895
894
  const params = {
896
895
  category: 'jump',
897
896
  des: 'jdmp',
898
897
  appId,
899
898
  vapptype,
900
899
  param,
901
900
  path: '',
902
901
  };
903
902
  if (path) {
904
903
  params.path = `${path}.html`;
905
904
  }
906
905
  this.jdNavigateToNative(params);
907
906
  }
908
907
  }
909
908
 
910
909
  jdJumpToAppMiniProgram(
911
910
  path: string,
912
911
  param = {},
913
912
  successBack?: functionType,
914
913
  failBack?: functionType,
915
914
  ) {
916
915
  this.jdNavigateToNative(param, path, successBack, failBack);
917
916
  }
918
917
 
919
918
  jdNavigateToNative(
920
919
  params: object,
921
920
  url = OpenAppHost,
922
921
  successBack?: functionType | undefined,
923
922
  failBack?: functionType | undefined,
924
923
  ) {
925
924
  console.log('[降级H5] jdNavigateToNative jdJumJdApp:', params);
926
925
  const getResParams: JumpEventReportInterFace.JdMiniJumpParams = Object.assign(
927
926
  {},
928
927
  {
929
928
  sourceValue: 'sourceValue_jshopMini',
930
929
  sourceType: 'sourceType_jshopMini',
931
930
  param: {},
932
931
  },
933
932
  params,
934
933
  );
935
934
  const { logEventInfo, ...otherParams } = getResParams;
936
935
  console.log('jdNavigateToNative params: ', getResParams);
937
936
  console.log('logEventInfo params: ', logEventInfo);
938
937
  this.clickEventLog(logEventInfo || getResParams, getResParams.des);
939
938
  jd.navigateToNative({
940
939
  dataParam: {
941
940
  url: url,
942
941
  params: otherParams,
943
942
  },
944
943
  success(res) {
945
944
  typeof successBack === 'function' && successBack(res);
946
945
  console.log('navigateToNative.success', res);
947
946
  },
948
947
  fail(res) {
949
948
  typeof failBack === 'function' && failBack(res);
950
949
  console.log('navigateToNative.fail', res);
951
950
  },
952
951
  });
953
952
  }
954
953
 
955
954
  clickEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}, clickKey = 'click') {
956
955
  const { eventId, jsonParam, eventLevel = 3, skuId, ...otherParams } = opts;
957
956
  if (eventId && jsonParam) {
958
957
  const { etModelInfo, logBaseInfo } = jsonParam;
959
958
  let getJsonParam = {};
960
959
  if (etModelInfo && logBaseInfo) {
961
960
  getJsonParam = logBaseInfo;
962
961
  } else {
963
962
  if (Array.isArray(jsonParam)) {
964
963
  getJsonParam = jsonParam;
965
964
  } else {
966
965
  getJsonParam = Object.assign(
967
966
  {},
968
967
  {
969
968
  shopid: global.info.queryInfo?.shopId,
970
969
  },
971
970
  jsonParam,
972
971
  );
973
972
  }
974
973
  }
975
974
  if (
976
975
  clickKey === 'exposure' &&
977
976
  /^TerminatorNew/.test(eventId) &&
978
977
  !Array.isArray(getJsonParam)
979
978
  ) {
980
979
  getJsonParam = [getJsonParam];
981
980
  }
982
981
  const miniLogParams = {
983
982
  eid: eventId,
984
983
  elevel: eventLevel,
985
984
  eparam: JSON.stringify(getJsonParam),
986
985
  pageId: this.logPageId,
987
986
  pname: this.logPname,
988
987
  pparam: JSON.stringify(this.routerInfo.params),
989
988
  target: this.routerInfo.path,
990
989
  event: this.nativeEvent,
991
990
  ...otherParams,
992
991
  };
993
992
  if (clickKey === 'addToCart' && skuId) {
994
993
  miniLogParams['shoppingList'] = {
995
994
  [skuId]: 1,
996
995
  };
997
996
  }
998
997
  console.log('点击埋点参数对象', miniLogParams, clickKey);
999
998
  global.miniAppLogInstance && global.miniAppLogInstance[clickKey](miniLogParams);
1000
999
  } else {
1001
1000
  console.log('暂无埋点参数eventId和eventParam');
1002
1001
  }
1003
1002
  }
1004
1003
 
1005
1004
  exposureEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}) {
1006
1005
  return this.clickEventLog(opts, 'exposure');
1007
1006
  }
1008
1007
 
1009
1008
  jdJumpToSearch(shopId, suggestWord) {
1010
1009
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
1011
1010
  this.jdNavigateToNative({
1012
1011
  category: 'jump',
1013
1012
  des: 'jshopGuessWord',
1014
1013
  shopId: String(shopId),
1015
1014
  transparentEnable: true,
1016
1015
  suggestWord,
1017
1016
  sourceInfo: APP_SOURCE_INFO,
1018
1017
  });
1019
1018
  }
1020
1019
 
1021
1020
  jdJumpToMyMessageBox() {
1022
1021
  this.jdNavigateToNative({
1023
1022
  category: 'jump',
1024
1023
  des: 'myMessageBox',
1025
1024
  });
1026
1025
  }
1027
1026
 
1028
1027
  jdJumpToAppHome() {
1029
1028
  this.jdNavigateToNative({
1030
1029
  category: 'jump',
1031
1030
  des: 'HomePage',
1032
1031
  });
1033
1032
  }
1034
1033
 
1035
1034
  jdJumpToShopHomeDetail({ shopId, venderId }) {
1036
1035
  this.jdNavigateToNative({
1037
1036
  category: 'jump',
1038
1037
  des: 'jshopDetail',
1039
1038
  shopId: String(shopId),
1040
1039
  venderId: String(venderId),
1041
1040
  });
1042
1041
  }
1043
1042
 
1044
1043
  jdJumpToShopLottery(shopTotalInfo) {
1045
1044
  this.jdNavigateToNative(
1046
1045
  Object.assign(
1047
1046
  {},
1048
1047
  {
1049
1048
  category: 'jump',
1050
1049
  des: 'jshopSign',
1051
1050
  activityRuleType: '0',
1052
1051
  shopId: global.info.queryInfo.shopId,
1053
1052
  venderId: global.info.queryInfo.venderId,
1054
1053
  },
1055
1054
  shopTotalInfo,
1056
1055
  ),
1057
1056
  );
1058
1057
  }
1059
1058
 
1060
1059
  jdJumpToSageAuthorHome(shopTotalInfo) {
1061
1060
  this.jdNavigateToNative(
1062
1061
  Object.assign(
1063
1062
  {},
1064
1063
  {
1065
1064
  category: 'jump',
1066
1065
  des: 'faxian_author',
1067
1066
  channel: 'shopHomePage',
1068
1067
  selectTab: '0',
1069
1068
  },
1070
1069
  shopTotalInfo,
1071
1070
  ),
1072
1071
  );
1073
1072
  }
1074
1073
 
1075
1074
  jdJumpToMemberPaidCenter({ paidMemberShopType = 1 }, logEventInfo) {
1076
1075
  const venderId = global.info.queryInfo.venderId;
1077
1076
  const shopId = global.info.queryInfo.shopId;
1078
1077
  this.jdJumpToWeb(
1079
1078
  `${this.jumpWebUrl.memberPaidCenter}?venderId=${venderId}&shopId=${shopId}&paidMemberShopType=${paidMemberShopType}`,
1080
1079
  logEventInfo,
1081
1080
  );
1082
1081
  }
1083
1082
 
1084
1083
  jdJumpToMemberPaidCard({ paidMemberShopType = 1 }, logEventInfo) {
1085
1084
  const venderId = global.info.queryInfo.venderId;
1086
1085
  const shopId = global.info.queryInfo.shopId;
1087
1086
  this.jdJumpToWeb(
1088
1087
  `${this.jumpWebUrl.memberPaidCard}?venderId=${venderId}&shopId=${shopId}&paidMemberShopType=${paidMemberShopType}`,
1089
1088
  logEventInfo,
1090
1089
  );
1091
1090
  }
1092
1091
 
1093
1092
  jdJumpTodMemberPaidBind({ paidMemberShopType = 1 }, logEventInfo) {
1094
1093
  const venderId = global.info.queryInfo.venderId;
1095
1094
  const shopId = global.info.queryInfo.shopId;
1096
1095
  this.jdJumpToWeb(
1097
1096
  `${this.jumpWebUrl.memberPaidBind}?venderId=${venderId}&shopId=${shopId}&paidMemberShopType=${paidMemberShopType}`,
1098
1097
  logEventInfo,
1099
1098
  );
1100
1099
  }
1100
+ import Taro from '@tarojs/taro';
1101
1101
  entrance: 'shop-page-tab',
1102
1102
  moduleId: 'shop-modular-floor',
1103
1103
 
1104
1104
  jdJumpToProduct(skuIds, logEventInfo, otherParams = {}) {
1105
1105
  skuIds = skuIds.toString().trim();
1106
1106
  const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds;
1107
1107
  const openAppParam = {
1108
1108
  category: 'jump',
1109
1109
  des: 'productDetail',
1110
1110
  skuId: getSkuId,
1111
1111
  logEventInfo,
1112
1112
  ...otherParams,
1113
1113
  };
1114
1114
  const adInfos = getAdInfoBySkuId(getSkuId);
1115
1115
  if (adInfos) {
1116
1116
  openAppParam.pdExtFlag = {
1117
1117
  adInfos,
1118
1118
  };
1119
1119
  }
1120
1120
  this.jdNavigateToNative(openAppParam);
1121
1121
  }
1122
1122
 
1123
1123
  jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo, otherParams = {}) {
1124
1124
  const getSkuId = skuInfo?.skuId;
1125
1125
  this.jdJumpToProduct(getSkuId, logEventInfo, otherParams);
1126
1126
  }
1127
1127
 
1128
1128
  jdJumpToCartPage(logEventInfo) {
1129
1129
  this.jdNavigateToNative(
1130
1130
  Object.assign(
1131
1131
  {},
1132
1132
  {
1133
1133
  category: 'jump',
1134
1134
  des: 'cartB',
1135
1135
  logEventInfo,
1136
1136
  },
1137
1137
  ),
1138
1138
  );
1139
1139
  }
1140
1140
 
1141
1141
  jdJumpToShopCategory(shopInfo = {}) {
1142
1142
  console.log(
1143
1143
  '🚀 ~ file: jdJumpJdApp.ts:40 ~ JdJumpJdApp ~ jdJumpToShopCategory ~ shopInfo:',
1144
1144
  shopInfo,
1145
1145
  );
1146
1146
  console.log('[降级H5] jdJumpToShopCategory jdJumpJdApp');
1147
1147
  this.jdNavigateToNative(
1148
1148
  Object.assign(
1149
1149
  {},
1150
1150
  {
1151
1151
  category: 'jump',
1152
1152
  des: 'jshopMain',
1153
1153
  jumpBottomTab: 'category',
1154
1154
  },
1155
1155
  shopInfo,
1156
1156
  {
1157
1157
  shopId: String(shopInfo.shopId ?? ''),
1158
1158
  venderId: String(shopInfo.venderId ?? ''),
1159
1159
  },
1160
1160
  ),
1161
1161
  );
1162
1162
  }
1163
1163
 
1164
1164
  jdJumpToOrderInfoView(skuInfos, logEventInfo) {
1165
1165
  if (!skuInfos || !Array.isArray(skuInfos) || skuInfos.length <= 0) {
1166
1166
  console.log('skuInfos 参数错误,必须为非空数组');
1167
1167
  return null;
1168
1168
  }
1169
1169
  const isValid = skuInfos.every(
1170
1170
  (item) =>
1171
1171
  item &&
1172
1172
  typeof item === 'object' &&
1173
1173
  item !== null &&
1174
1174
  'skuId' in item &&
1175
1175
  'num' in item &&
1176
1176
  typeof item.skuId === 'string' &&
1177
1177
  typeof item.num === 'number',
1178
1178
  );
1179
1179
  if (!isValid) {
1180
1180
  console.log('skuInfos 格式错误:每个item必须是对象且包含 skuId(string) 和 num(number) 属性');
1181
1181
  return null;
1182
1182
  }
1183
1183
  const skuItems = skuInfos.map((sku) => {
1184
1184
  sku['itemType'] = 1;
1185
1185
  return sku;
1186
1186
  });
1187
1187
  const extFlag = {
1188
1188
  cartValue: '1',
1189
1189
  skuItems,
1190
1190
  };
1191
1191
  this.jdNavigateToNative({
1192
1192
  category: 'jump',
1193
1193
  des: 'orderInfoView',
1194
1194
  skuSource: 176,
1195
1195
  sourceType: 7,
1196
1196
  extFlag: JSON.stringify(extFlag),
1197
1197
  logEventInfo,
1198
1198
  });
1199
1199
  }
1200
1200
 
1201
1201
  jdJumpToTryDetail(tryId) {
1202
1202
  this.jdNavigateToNative({
1203
1203
  category: 'jump',
1204
1204
  des: 'jdreactcommon',
1205
1205
  appname: 'JDReactNewProduct',
1206
1206
  modulename: 'JDReactNewProduct',
1207
1207
  param: {
1208
1208
  activityId: tryId,
1209
1209
  isNative: true,
1210
1210
  nativePage: 'jdtry_detail',
1211
1211
  transparentenable: true,
1212
1212
  },
1213
1213
  });
1214
1214
  }
1215
1215
 
1216
1216
  jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
1217
1217
  console.log('[降级H5] jdJumpToShopHome jdJumpJdApp');
1218
1218
  const currentShopInfo = {
1219
1219
  shopId: global.info.queryInfo.shopId,
1220
1220
  venderId: global.info.queryInfo.venderId,
1221
1221
  };
1222
1222
  const restParams =
1223
1223
  (shopInfo?.shopId && shopInfo.shopId !== currentShopInfo.shopId) ||
1224
1224
  (shopInfo?.venderId && shopInfo.venderId !== currentShopInfo.venderId)
1225
1225
  ? {}
1226
1226
  : currentShopInfo;
1227
1227
  const getInfo = Object.assign({}, restParams, shopInfo);
1228
1228
  const getShopParams = this.getShopIdsInfo(getInfo);
1229
1229
  this.jdJumpToShopBase(getShopParams);
1230
1230
  }
1231
1231
 
1232
1232
  jdJumpToShopHomeInner(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
1233
1233
  const getParam = Object.assign(
1234
1234
  {},
1235
1235
  {
1236
1236
  jumpTab: HOME_TOP_TAB_TYPE_APP.HOME,
1237
1237
  operation: 'jumpTabInner',
1238
1238
  },
1239
1239
  shopInfo,
1240
1240
  );
1241
1241
  this.jdJumpToShopBase(getParam);
1242
1242
  }
1243
1243
 
1244
1244
  jdJumpToUnifieddetail(sourceInfo) {
1245
1245
  this.jdNavigateToNative(
1246
1246
  Object.assign(
1247
1247
  {},
1248
1248
  {
1249
1249
  category: 'jump',
1250
1250
  des: 'unifieddetail',
1251
1251
  },
1252
1252
  sourceInfo,
1253
1253
  ),
1254
1254
  );
1255
1255
  }
1256
1256
 
1257
1257
  jdJumpToVideoImmersion(sourceInfo) {
1258
1258
  this.jdNavigateToNative(
1259
1259
  Object.assign(
1260
1260
  {},
1261
1261
  {
1262
1262
  category: 'jump',
1263
1263
  des: 'VideoImmersion',
1264
1264
  },
1265
1265
  sourceInfo,
1266
1266
  ),
1267
1267
  );
1268
1268
  }
1269
1269
 
1270
1270
  jdJumpToShopMember(shopInfo) {
1271
1271
  this.jdNavigateToNative(
1272
1272
  Object.assign(
1273
1273
  {},
1274
1274
  {
1275
1275
  category: 'jump',
1276
1276
  des: 'jshopMember',
1277
1277
  followAward: '-1',
1278
1278
  },
1279
1279
  shopInfo,
1280
1280
  ),
1281
1281
  );
1282
1282
  }
1283
1283
 
1284
1284
  jdJumpToMemberTab(shopInfo?) {
1285
1285
  this.jdNavigateToNative(
1286
1286
  Object.assign(
1287
1287
  {},
1288
1288
  {
1289
1289
  category: 'jump',
1290
1290
  des: 'jshopMain',
1291
1291
  shopId: global.info.queryInfo.shopId,
1292
1292
  venderId: global.info.queryInfo.venderId,
1293
1293
  operation: 'jumpBottomTabMember',
1294
1294
  sourceInfo: APP_SOURCE_INFO,
1295
1295
  },
1296
1296
  shopInfo,
1297
1297
  ),
1298
1298
  );
1299
1299
  }
1300
1300
 
1301
1301
  jdJumpToDongDongChatGroup(groupId, source = 'jdmini') {
1302
1302
  this.jdNavigateToNative({
1303
1303
  category: 'jump',
1304
1304
  des: 'dongdong_group_chat',
1305
1305
  source: source,
1306
1306
  groupId: `${groupId}`,
1307
1307
  });
1308
1308
  }
1309
1309
 
1310
1310
  jdJumpToDongDongChat(paramInfo: any = {}) {
1311
1311
  const { venderId, ...otherParams } = paramInfo;
1312
1312
  this.jdNavigateToNative(
1313
1313
  Object.assign(
1314
1314
  {},
1315
1315
  {
1316
1316
  category: 'jump',
1317
1317
  des: 'jd_dongdong_chat',
1318
1318
  venderId: `${venderId ? venderId : global.info.queryInfo?.venderId}`,
1319
1319
  entry: 'm_shop',
1320
1320
  },
1321
1321
  otherParams,
1322
1322
  ),
1323
1323
  );
1324
1324
  }
1325
1325
 
1326
1326
  jdJumpToShopActivity(shopInfo) {
1327
1327
  const getParams = Object.assign(
1328
1328
  {},
1329
1329
  {
1330
1330
  category: 'jump',
1331
1331
  des: 'jshopActivity',
1332
1332
  shopId: global.info.queryInfo.shopId,
1333
1333
  venderId: global.info.queryInfo.venderId,
1334
1334
  },
1335
1335
  shopInfo,
1336
1336
  );
1337
1337
  getParams['projectId'] && (getParams['projectId'] = `${getParams['projectId']}`);
1338
1338
  this.jdNavigateToNative(getParams);
1339
1339
  }
1340
1340
 
1341
1341
  jdJumpToShopActivityPage(shopInfo) {
1342
1342
  this.jdNavigateToNative(
1343
1343
  Object.assign(
1344
1344
  {},
1345
1345
  {
1346
1346
  category: 'jump',
1347
1347
  des: 'jshopActivityPage',
1348
1348
  shopId: global.info.queryInfo.shopId,
1349
1349
  title: global.info.queryInfo?.shopName,
1350
1350
  },
1351
1351
  shopInfo,
1352
1352
  ),
1353
1353
  );
1354
1354
  }
1355
1355
 
1356
1356
  jdJumpToShopDetail(shopInfo) {
1357
1357
  this.jdNavigateToNative(
1358
1358
  Object.assign(
1359
1359
  {},
1360
1360
  {
1361
1361
  category: 'jump',
1362
1362
  des: 'jshopDetail',
1363
1363
  shopId: global.info.queryInfo.shopId,
1364
1364
  venderId: global.info.queryInfo.venderId,
1365
1365
  sourceInfo: APP_SOURCE_INFO,
1366
1366
  },
1367
1367
  shopInfo,
1368
1368
  ),
1369
1369
  );
1370
1370
  }
1371
1371
 
1372
1372
  jdJumpToShopMemberCard(shopInfo) {
1373
1373
  const { url, logEventInfo } = shopInfo;
1374
1374
  if (this.isOpenJdAppUrl(url)) {
1375
1375
  const getOpenAppParams = this.jdOpenAppParams(url);
1376
1376
  console.log('jd web 获取自定义openApp链接解析后的参数结果', getOpenAppParams);
1377
1377
  if (getOpenAppParams) {
1378
1378
  this.jdNavigateToNative(Object.assign({}, getOpenAppParams, { logEventInfo }));
1379
1379
  }
1380
1380
  } else {
1381
1381
  super.jdJumpToWeb(url, {
1382
1382
  ...logEventInfo,
1383
1383
  });
1384
1384
  }
1385
1385
  }
1386
1386
 
1387
1387
  jdJumpToTotalPromotion(shopInfo) {
1388
1388
  const { url, logEventInfo } = shopInfo;
1389
1389
  if (this.isOpenJdAppUrl(url)) {
1390
1390
  const getOpenAppParams = this.jdOpenAppParams(url);
1391
1391
  console.log('jd web 获取自定义openApp链接解析后的参数结果', getOpenAppParams);
1392
1392
  if (getOpenAppParams) {
1393
1393
  this.jdNavigateToNative(Object.assign({}, getOpenAppParams, { logEventInfo }));
1394
1394
  }
1395
1395
  } else {
1396
1396
  super.jdJumpToWeb(url, {
1397
1397
  ...logEventInfo,
1398
1398
  });
1399
1399
  }
1400
1400
  }
1401
1401
 
1402
1402
  jdJumpToShopSearch(pageInfo = {}) {
1403
1403
  const getInfo = Object.assign(
1404
1404
  {},
1405
1405
  {
1406
1406
  shopId: global.info.queryInfo.shopId,
1407
1407
  venderId: global.info.queryInfo.venderId,
1408
1408
  sourceInfo: APP_SOURCE_INFO,
1409
1409
  },
1410
1410
  pageInfo,
1411
1411
  );
1412
1412
  const { keyword = '', categoryId = '', ...otherPageInfo }: any = getInfo;
1413
1413
  const searchInfo = {};
1414
1414
  if (categoryId !== '') {
1415
1415
  searchInfo['categoryId'] = typeof categoryId === 'string' ? categoryId?.trim() : categoryId;
1416
1416
  searchInfo['searchType'] = '5';
1417
1417
  } else if (keyword !== '') {
1418
1418
  searchInfo['keyWord'] = keyword;
1419
1419
  searchInfo['searchType'] = '4';
1420
1420
  }
1421
1421
  const openAppParam = {
1422
1422
  category: 'jump',
1423
1423
  des: 'jshopProductList',
1424
1424
  pageId: '1',
1425
1425
  ...searchInfo,
1426
1426
  };
1427
1427
  const jumpExtMap = getEnterShopExtInfo();
1428
1428
  if (jumpExtMap) {
1429
1429
  openAppParam.jumpExtMap = jumpExtMap;
1430
1430
  }
1431
1431
  this.jdNavigateToNative(Object.assign({}, openAppParam, otherPageInfo));
1432
1432
  }
1433
1433
 
1434
1434
  jdJumpToOrderList(type = "all",logEventInfo = {}) {
1435
1435
  const iosOrderType = {
1436
1436
  all: 1,
1437
1437
  waitPay: 2,
1438
1438
  waitReceipt: 3,
1439
1439
  waitServe: 9,
1440
1440
  waitComment: 12,
1441
1441
  cancel: 5,
1442
1442
  finish: 4,
1443
1443
  }
1444
1444
  const androidOrderType = {
1445
1445
  all: "all",
1446
1446
  waitPay: "daifukuan",
1447
1447
  waitReceipt: "daishouhuo",
1448
1448
  waitServe: "waitForUse",
1449
1449
  waitComment: "wait4EvaluateNew",
1450
1450
  cancel: "yiquxiao",
1451
1451
  }
1452
1452
  const getParams = Object.assign(
1453
1453
  {},
1454
1454
  {
1455
1455
  category: 'jump',
1456
1456
  des: 'orderlist',
1457
1457
  from: 'dphycc',
1458
1458
  },
1459
1459
  )
1460
1460
  if(isJdAndIosDevice){
1461
1461
  getParams.listType = iosOrderType[type] || iosOrderType.all;
1462
1462
  }else {
1463
1463
  if(type !== androidOrderType.all && androidOrderType[type]){
1464
1464
  getParams.functionId = androidOrderType[type];
1465
1465
  }
1466
1466
  }
1467
1467
  this.jdNavigateToNative(
1468
1468
  Object.assign(
1469
1469
  {},
1470
1470
  getParams,
1471
1471
  logEventInfo,
1472
1472
  ),
1473
1473
  );
1474
1474
  }
1475
1475
 
1476
1476
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
1477
1477
  this.jdNavigateToNative(
1478
1478
  Object.assign(
1479
1479
  {},
1480
1480
  {
1481
1481
  category: 'jump',
1482
1482
  des: 'productList',
1483
1483
  from: 'couponBatch',
1484
1484
  couponId: `${couponId}`,
1485
1485
  logEventInfo,
1486
1486
  },
1487
1487
  ),
1488
1488
  );
1489
1489
  }
1490
1490
 
1491
1491
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}, shopInfo = {}) {
1492
1492
  console.log('jdJumpJdApp - jdJumpToTabAllProduct');
1493
1493
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
1494
1494
  if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
1495
1495
  this.jdNavigateToNative(
1496
1496
  Object.assign(
1497
1497
  {},
1498
1498
  {
1499
1499
  category: 'jump',
1500
1500
  des: 'jshopMain',
1501
1501
  jumpTab: 'allProduct',
1502
1502
  },
1503
1503
  shopInfo,
1504
1504
  shopId !== 'undefined'
1505
1505
  ? {
1506
1506
  shopId,
1507
1507
  }
1508
1508
  : {},
1509
1509
  venderId !== 'undefined'
1510
1510
  ? {
1511
1511
  venderId,
1512
1512
  }
1513
1513
  : {},
1514
1514
  {
1515
1515
  logEventInfo,
1516
1516
  },
1517
1517
  ),
1518
1518
  );
1519
1519
  }
1520
1520
 
1521
1521
  jdJumpToTabAllProductInner(shopId, venderId, logEventInfo = {}, shopInfo = {}) {
1522
1522
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
1523
1523
  if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
1524
1524
  this.jdNavigateToNative(
1525
1525
  Object.assign(
1526
1526
  {},
1527
1527
  {
1528
1528
  category: 'jump',
1529
1529
  des: 'jshopMain',
1530
1530
  jumpTab: 'allProduct',
1531
1531
  operation: 'jumpTabInner',
1532
1532
  },
1533
1533
  shopInfo,
1534
1534
  shopId !== 'undefined'
1535
1535
  ? {
1536
1536
  shopId,
1537
1537
  }
1538
1538
  : {},
1539
1539
  venderId !== 'undefined'
1540
1540
  ? {
1541
1541
  venderId,
1542
1542
  }
1543
1543
  : {},
1544
1544
  {
1545
1545
  logEventInfo,
1546
1546
  },
1547
1547
  ),
1548
1548
  );
1549
1549
  }
1550
1550
 
1551
1551
  jdJumpToShopBase(shopInfo) {
1552
1552
  console.log('[降级H5] jdJumpToShopBase jdJumpJdApp');
1553
1553
  const currentShopInfo = {
1554
1554
  shopId: global.info.queryInfo.shopId,
1555
1555
  venderId: global.info.queryInfo.venderId,
1556
1556
  };
1557
1557
  const restParams =
1558
1558
  (shopInfo?.shopId && shopInfo.shopId !== currentShopInfo.shopId) ||
1559
1559
  (shopInfo?.venderId && shopInfo.venderId !== currentShopInfo.venderId)
1560
1560
  ? {}
1561
1561
  : currentShopInfo;
1562
1562
  const getParam = Object.assign(
1563
1563
  {},
1564
1564
  {
1565
1565
  category: 'jump',
1566
1566
  des: 'jshopMain',
1567
1567
  jumpTab: HOME_TOP_TAB_TYPE_APP.HOME,
1568
1568
  ...restParams,
1569
1569
  sourceInfo: APP_SOURCE_INFO,
1570
1570
  },
1571
1571
  shopInfo,
1572
1572
  );
1573
1573
  this.jdNavigateToNative(getParam);
1574
1574
  }
1575
1575
 
1576
1576
  jdJumpToTabNew(shopInfo = {}) {
1577
1577
  const getParam = Object.assign(
1578
1578
  {},
1579
1579
  {
1580
1580
  jumpTab: HOME_TOP_TAB_TYPE_APP.NEW,
1581
1581
  },
1582
1582
  shopInfo,
1583
1583
  );
1584
1584
  this.jdJumpToShopBase(getParam);
1585
1585
  }
1586
1586
 
1587
1587
  jdJumpToTabNewInner(shopInfo = {}) {
1588
1588
  const getParam = Object.assign(
1589
1589
  {},
1590
1590
  {
1591
1591
  jumpTab: HOME_TOP_TAB_TYPE_APP.NEW,
1592
1592
  operation: 'jumpTabInner',
1593
1593
  },
1594
1594
  shopInfo,
1595
1595
  );
1596
1596
  this.jdJumpToShopBase(getParam);
1597
1597
  }
1598
1598
  jdJumpToTabRank(shopInfo = {}) {
1599
1599
  const getParam = Object.assign(
1600
1600
  {},
1601
1601
  {
1602
1602
  jumpTab: HOME_TOP_TAB_TYPE_APP.RANK,
1603
1603
  },
1604
1604
  shopInfo,
1605
1605
  );
1606
1606
  this.jdJumpToShopBase(getParam);
1607
1607
  }
1608
1608
  jdJumpToTabRankInner(shopInfo = {}) {
1609
1609
  const getParam = Object.assign(
1610
1610
  {},
1611
1611
  {
1612
1612
  jumpTab: HOME_TOP_TAB_TYPE_APP.RANK,
1613
1613
  operation: 'jumpTabInner',
1614
1614
  },
1615
1615
  shopInfo,
1616
1616
  );
1617
1617
  this.jdJumpToShopBase(getParam);
1618
1618
  }
1619
1619
  jdJumpToTabBuyerShow(shopInfo = {}) {
1620
1620
  const getParam = Object.assign(
1621
1621
  {},
1622
1622
  {
1623
1623
  jumpTab: HOME_TOP_TAB_TYPE_APP.BUYERSHOW,
1624
1624
  },
1625
1625
  shopInfo,
1626
1626
  );
1627
1627
  this.jdJumpToShopBase(getParam);
1628
1628
  }
1629
1629
  jdJumpToTabBuyerShowInner(shopInfo = {}) {
1630
1630
  const getParam = Object.assign(
1631
1631
  {},
1632
1632
  {
1633
1633
  jumpTab: HOME_TOP_TAB_TYPE_APP.BUYERSHOW,
1634
1634
  operation: 'jumpTabInner',
1635
1635
  },
1636
1636
  shopInfo,
1637
1637
  );
1638
1638
  this.jdJumpToShopBase(getParam);
1639
1639
  }
1640
1640
  jdJumpToTabActivity(shopInfo = {}) {
1641
1641
  const getParam = Object.assign(
1642
1642
  {},
1643
1643
  {
1644
1644
  jumpTab: HOME_TOP_TAB_TYPE_APP.ACTIVITY,
1645
1645
  },
1646
1646
  shopInfo,
1647
1647
  );
1648
1648
  this.jdJumpToShopBase(getParam);
1649
1649
  }
1650
1650
  jdJumpToTabActivityInner(shopInfo = {}) {
1651
1651
  const getParam = Object.assign(
1652
1652
  {},
1653
1653
  {
1654
1654
  jumpTab: HOME_TOP_TAB_TYPE_APP.ACTIVITY,
1655
1655
  operation: 'jumpTabInner',
1656
1656
  },
1657
1657
  shopInfo,
1658
1658
  );
1659
1659
  this.jdJumpToShopBase(getParam);
1660
1660
  }
1661
1661
  jdJumpToTabSecKill(shopInfo = {}) {
1662
1662
  const getParam = Object.assign(
1663
1663
  {},
1664
1664
  {
1665
1665
  jumpTab: HOME_TOP_TAB_TYPE_APP.SECKILL,
1666
1666
  },
1667
1667
  shopInfo,
1668
1668
  );
1669
1669
  this.jdJumpToShopBase(getParam);
1670
1670
  }
1671
1671
  jdJumpToTabSecKillInner(shopInfo = {}) {
1672
1672
  const getParam = Object.assign(
1673
1673
  {},
1674
1674
  {
1675
1675
  jumpTab: HOME_TOP_TAB_TYPE_APP.SECKILL,
1676
1676
  operation: 'jumpTabInner',
1677
1677
  },
1678
1678
  shopInfo,
1679
1679
  );
1680
1680
  this.jdJumpToShopBase(getParam);
1681
1681
  }
1682
1682
  jdJumpToTabLive(shopInfo = {}) {
1683
1683
  const getParam = Object.assign(
1684
1684
  {},
1685
1685
  {
1686
1686
  jumpTab: HOME_TOP_TAB_TYPE_APP.LIVE,
1687
1687
  },
1688
1688
  shopInfo,
1689
1689
  );
1690
1690
  this.jdJumpToShopBase(getParam);
1691
1691
  }
1692
1692
  jdJumpToTabLiveInner(shopInfo = {}) {
1693
1693
  const getParam = Object.assign(
1694
1694
  {},
1695
1695
  {
1696
1696
  jumpTab: HOME_TOP_TAB_TYPE_APP.LIVE,
1697
1697
  operation: 'jumpTabInner',
1698
1698
  },
1699
1699
  shopInfo,
1700
1700
  );
1701
1701
  this.jdJumpToShopBase(getParam);
1702
1702
  }
1703
1703
 
1704
1704
  jdJumpToBottomTabBase(type, shopInfo = {}) {
1705
1705
  this.jdNavigateToNative(
1706
1706
  Object.assign(
1707
1707
  {},
1708
1708
  {
1709
1709
  category: 'jump',
1710
1710
  des: 'jshopMain',
1711
1711
  shopId: global.info.queryInfo.shopId,
1712
1712
  venderId: global.info.queryInfo.venderId,
1713
1713
  jumpBottomTab: type,
1714
1714
  sourceInfo: APP_SOURCE_INFO,
1715
1715
  },
1716
1716
  shopInfo,
1717
1717
  ),
1718
1718
  );
1719
1719
  }
1720
1720
 
1721
1721
  jdJumpToBottomTabProduct(shopInfo = {}) {
1722
1722
  this.jdJumpToBottomTabBase(BOTTOM_TAB_TYPE_APP.PRODUCT, shopInfo);
1723
1723
  }
1724
1724
 
1725
1725
  jdJumpToBottomTabCategory(shopInfo = {}) {
1726
1726
  this.jdJumpToBottomTabBase(BOTTOM_TAB_TYPE_APP.CATEGORY, shopInfo);
1727
1727
  }
1728
1728
 
1729
1729
  jdJumpToBottomTabFind(shopInfo = {}) {
1730
1730
  this.jdJumpToBottomTabBase(BOTTOM_TAB_TYPE_APP.FIND, shopInfo);
1731
1731
  }
1732
1732
 
1733
1733
  jdJumpToBottomTabBrandMember(shopInfo = {}) {
1734
1734
  this.jdJumpToBottomTabBase(BOTTOM_TAB_TYPE_APP.BRANDMEMBER, shopInfo);
1735
1735
  }
1736
1736
 
1737
1737
  jdJumpToBottomTabBrandMemberInner(shopInfo = {}) {
1738
1738
  this.jdJumpToMemberTab(shopInfo);
1739
1739
  }
1740
1740
 
1741
1741
  jdJumpToWeb(
1742
1742
  url,
1743
1743
  logEventInfo,
1744
1744
  successBack?: functionType | undefined,
1745
1745
  failBack?: functionType | undefined,
1746
1746
  ) {
1747
1747
  const changeUrl = /^\/\//.test(url) ? `https:${url}` : url;
1748
1748
  this.jdNavigateToNative(
1749
1749
  {
1750
1750
  category: 'jump',
1751
1751
  des: 'm',
1752
1752
  url: isJdAndHarmonyDevice ? changeUrl : encodeURIComponent(changeUrl),
1753
1753
  logEventInfo,
1754
1754
  },
1755
1755
  OpenAppHost,
1756
1756
  successBack,
1757
1757
  failBack,
1758
1758
  );
1759
1759
  }
1760
1760
 
1761
1761
  jdJumpToLive(clickUrlOrObj, logEventInfo) {
1762
1762
  if (isJdAppForNotMain) {
1763
1763
  super.jdJumpToLive(clickUrlOrObj, logEventInfo);
1764
1764
  } else {
1765
1765
  if (typeof clickUrlOrObj === 'object') {
1766
1766
  this.jdNavigateToNative({
1767
1767
  category: 'jump',
1768
1768
  des: 'LivePlayerRoom',
1769
1769
  liveOrigin: '1',
1770
1770
  needLogin: '0',
1771
1771
  isNeedVideo: true,
1772
1772
  logEventInfo,
1773
1773
  ...clickUrlOrObj,
1774
1774
  });
1775
1775
  } else {
1776
1776
  const getShopLiveParams = this.jdOpenAppParams(clickUrlOrObj);
1777
1777
  console.log('getShopLiveParams=====', getShopLiveParams);
1778
1778
  if (typeof getShopLiveParams === 'object') {
1779
1779
  this.jdNavigateToNative({
1780
1780
  ...getShopLiveParams,
1781
1781
  logEventInfo,
1782
1782
  });
1783
1783
  }
1784
1784
  }
1785
1785
  }
1786
1786
  }
1787
1787
 
1788
1788
  jdJumpToUgcContent(urlObj, logEventInfo = {}) {
1789
1789
  if (isJdAppForNotMain) {
1790
1790
  super.jdJumpToUgcContent(urlObj, logEventInfo);
1791
1791
  } else {
1792
1792
  if (typeof urlObj === 'object') {
1793
1793
  this.jdNavigateToNative({
1794
1794
  category: 'jump',
1795
1795
  des: 'shareOrderUgcContent',
1796
1796
  channel: 'shopshangxin',
1797
1797
  cmtType: '10',
1798
1798
  isNeedVideo: true,
1799
1799
  ...urlObj,
1800
1800
  logEventInfo,
1801
1801
  });
1802
1802
  } else {
1803
1803
  const getShopUgcParams = this.jdOpenAppParams(urlObj);
1804
1804
  if (getShopUgcParams) {
1805
1805
  getShopUgcParams['logEventInfo'] = logEventInfo;
1806
1806
  console.log('getShopUgcParams=====', getShopUgcParams);
1807
1807
  getShopUgcParams && this.jdNavigateToNative(getShopUgcParams as string);
1808
1808
  }
1809
1809
  }
1810
1810
  }
1811
1811
  }
1812
1812
 
1813
1813
  jdJumpToSeckillNewBrand(brandId) {
1814
1814
  this.jdNavigateToNative({
1815
1815
  category: 'jump',
1816
1816
  des: 'seckillnewbrand',
1817
1817
  brandId: `${brandId}`,
1818
1818
  });
1819
1819
  }
1820
1820
 
1821
1821
  jdJumpToJshopDynamicDetail(info) {
1822
1822
  this.jdNavigateToNative({
1823
1823
  category: 'jump',
1824
1824
  des: 'jshopDynamicDetail',
1825
1825
  shopId: global.info.queryInfo.shopId,
1826
1826
  venderId: global.info.queryInfo.venderId,
1827
1827
  ...info,
1828
1828
  });
1829
1829
  }
1830
1830
 
1831
1831
  jdJumpToRankList(rankingId, rankType, logEventInfo) {
1832
1832
  if (isJdAppForNotMain) {
1833
1833
  super.jdJumpToRankList(rankingId, rankType, logEventInfo);
1834
1834
  } else {
1835
1835
  this.jdNavigateToNative(
1836
1836
  Object.assign(
1837
1837
  {},
1838
1838
  {
1839
1839
  category: 'jump',
1840
1840
  des: 'jdreactcommon',
1841
1841
  modulename: 'JDReactRankingList',
1842
1842
  appname: 'JDReactRankingList',
1843
1843
  transparentenable: true,
1844
1844
  ishidden: true,
1845
1845
  param: {
1846
1846
  contentId: '' + rankingId,
1847
1847
  fromSkuId: '',
1848
1848
  detailPageType: '5',
1849
1849
  rankType: rankType || 10 + '',
1850
1850
  },
1851
1851
  logEventInfo,
1852
1852
  },
1853
1853
  ),
1854
1854
  );
1855
1855
  }
1856
1856
  }
1857
1857
 
1858
1858
  jdJumpToFlashSaleTab(logEventInfo) {
1859
1859
  this.jdNavigateToNative(
1860
1860
  Object.assign(
1861
1861
  {},
1862
1862
  {
1863
1863
  category: 'jump',
1864
1864
  des: 'jshopMain',
1865
1865
  jumpTab: 'flashPurchase',
1866
1866
  shopId: global.info.queryInfo.shopId,
1867
1867
  venderId: global.info.queryInfo.venderId,
1868
1868
  sourceType: 'JDReactShopActivityTAB',
1869
1869
  sourceValue: '2',
1870
1870
  operation: 'jumpTabInner',
1871
1871
  logEventInfo,
1872
1872
  },
1873
1873
  ),
1874
1874
  );
1875
1875
  }
1876
1876
 
1877
1877
 
1878
1878
  jdJumpToShopMemberInfo(logEventInfo) {
1879
1879
  this.jdNavigateToNative(
1880
1880
  Object.assign(
1881
1881
  {},
1882
1882
  {
1883
1883
  category: 'jump',
1884
1884
  des: 'jdreactcommon',
1885
1885
  modulename: 'JDReactShopMember',
1886
1886
  appname: 'JDReactShopMember',
1887
1887
  ishidden: true,
1888
1888
  param: {
1889
1889
  page: 'memberInfo',
1890
1890
  shopId: global.info.queryInfo.shopId,
1891
1891
  venderId: global.info.queryInfo.venderId,
1892
1892
  },
1893
1893
  logEventInfo,
1894
1894
  },
1895
1895
  ),
1896
1896
  );
1897
1897
  }
1898
1898
 
1899
1899
  jdJumpToShopMemberBenefit(logEventInfo) {
1900
1900
  const venderId = global.info.queryInfo.venderId;
1901
1901
  const shopId = global.info.queryInfo.shopId;
1902
1902
  this.jdJumpToWeb(
1903
1903
  `${this.jumpWebUrl.memberBenefit}?venderId=${venderId}&shopId=${shopId}`,
1904
1904
  logEventInfo,
1905
1905
  );
1906
1906
  }
1907
1907
 
1908
1908
  jdJumpToShopMemberPointExchange(venderType, levelZeroMenuUrl, logEventInfo) {
1909
1909
  this.jdNavigateToNative(
1910
1910
  Object.assign(
1911
1911
  {},
1912
1912
  {
1913
1913
  category: 'jump',
1914
1914
  des: 'jdreactcommon',
1915
1915
  modulename: 'JDReactShopMember',
1916
1916
  appname: 'JDReactShopMember',
1917
1917
  ishidden: true,
1918
1918
  param: {
1919
1919
  page: 'pointsExchangePage',
1920
1920
  shopId: global.info.queryInfo.shopId,
1921
1921
  venderId: global.info.queryInfo.venderId,
1922
1922
  levelZeroMenuUrl,
1923
1923
  },
1924
1924
  logEventInfo,
1925
1925
  },
1926
1926
  ),
1927
1927
  );
1928
1928
  }
1929
1929
 
1930
1930
  jdJumpToShopMemberBonusPurchase(customerLevel, logEventInfo) {
1931
1931
  this.jdNavigateToNative(
1932
1932
  Object.assign(
1933
1933
  {},
1934
1934
  {
1935
1935
  category: 'jump',
1936
1936
  des: 'jdreactcommon',
1937
1937
  modulename: 'JDReactShopMember',
1938
1938
  appname: 'JDReactShopMember',
1939
1939
  ishidden: true,
1940
1940
  param: {
1941
1941
  page: 'bonusPurchase',
1942
1942
  shopId: global.info.queryInfo.shopId,
1943
1943
  venderId: global.info.queryInfo.venderId,
1944
1944
  customerLevel,
1945
1945
  },
1946
1946
  logEventInfo,
1947
1947
  },
1948
1948
  ),
1949
1949
  );
1950
1950
  }
1951
1951
 
1952
1952
  jdJumpToMyRedEnvelope(logEventInfo) {
1953
1953
  this.jdNavigateToNative(
1954
1954
  Object.assign(
1955
1955
  {},
1956
1956
  {
1957
1957
  category: 'jump',
1958
1958
  des: 'jdreactcommon',
1959
1959
  modulename: 'JDReactMyRedEnvelope',
1960
1960
  appname: 'JDReactMyRedEnvelope',
1961
1961
  ishidden: true,
1962
1962
  fromName: 2,
1963
1963
  needLogin: true,
1964
1964
  logEventInfo,
1965
1965
  },
1966
1966
  ),
1967
1967
  );
1968
1968
  }
1969
1969
 
1970
1970
  jdJumpToMyCoupon(logEventInfo) {
1971
1971
  this.jdNavigateToNative(
1972
1972
  Object.assign(
1973
1973
  {},
1974
1974
  {
1975
1975
  category: 'jump',
1976
1976
  des: 'mycoupon',
1977
1977
  logEventInfo,
1978
1978
  },
1979
1979
  ),
1980
1980
  );
1981
1981
  }
1982
1982
 
1983
1983
 
1984
1984
  jdJumpToMiniProgram({ vapptype, appId, path, param }) {
1985
1985
  const pageName = param['pageType'] || 'home';
1986
1986
  const nowMiniPath = `pages/${pageName}/index`;
1987
1987
  if (appId === global.info.pageInfo.appId) {
1988
1988
  Taro.navigateTo({
1989
1989
  url: `/${nowMiniPath}?${objectToUrlEncode(param)}`,
1990
1990
  }).catch((err) => {
1991
1991
  console.warn('跳转小程序页面错误:', err);
1992
1992
  });
1993
1993
  } else {
1994
1994
  const params = {
1995
1995
  category: 'jump',
1996
1996
  des: 'jdmp',
1997
1997
  appId,
1998
1998
  vapptype,
1999
1999
  param,
2000
2000
  path: '',
2001
2001
  };
2002
2002
  if (path) {
2003
2003
  params.path = `${path}.html`;
2004
2004
  }
2005
2005
  this.jdNavigateToNative(params);
2006
2006
  }
2007
2007
  }
2008
2008
 
2009
2009
  jdJumpToAppMiniProgram(
2010
2010
  path: string,
2011
2011
  param = {},
2012
2012
  successBack?: functionType,
2013
2013
  failBack?: functionType,
2014
2014
  ) {
2015
2015
  this.jdNavigateToNative(param, path, successBack, failBack);
2016
2016
  }
2017
2017
 
2018
2018
  jdNavigateToNative(
2019
2019
  params: object,
2020
2020
  url = OpenAppHost,
2021
2021
  successBack?: functionType | undefined,
2022
2022
  failBack?: functionType | undefined,
2023
2023
  ) {
2024
2024
  console.log('[降级H5] jdNavigateToNative jdJumJdApp:', params);
2025
2025
  const getResParams: JumpEventReportInterFace.JdMiniJumpParams = Object.assign(
2026
2026
  {},
2027
2027
  {
2028
2028
  sourceValue: 'sourceValue_jshopMini',
2029
2029
  sourceType: 'sourceType_jshopMini',
2030
2030
  param: {},
2031
2031
  },
2032
2032
  params,
2033
2033
  );
2034
2034
  const { logEventInfo, ...otherParams } = getResParams;
2035
2035
  console.log('jdNavigateToNative params: ', getResParams);
2036
2036
  console.log('logEventInfo params: ', logEventInfo);
2037
2037
  this.clickEventLog(logEventInfo || getResParams, getResParams.des);
2038
2038
  jd.navigateToNative({
2039
2039
  dataParam: {
2040
2040
  url: url,
2041
2041
  params: otherParams,
2042
2042
  },
2043
2043
  success(res) {
2044
2044
  typeof successBack === 'function' && successBack(res);
2045
2045
  console.log('navigateToNative.success', res);
2046
2046
  },
2047
2047
  fail(res) {
2048
2048
  typeof failBack === 'function' && failBack(res);
2049
2049
  console.log('navigateToNative.fail', res);
2050
2050
  },
2051
2051
  });
2052
2052
  }
2053
2053
 
2054
2054
  clickEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}, clickKey = 'click') {
2055
2055
  const { eventId, jsonParam, eventLevel = 3, skuId, ...otherParams } = opts;
2056
2056
  if (eventId && jsonParam) {
2057
2057
  const { etModelInfo, logBaseInfo } = jsonParam;
2058
2058
  let getJsonParam = {};
2059
2059
  if (etModelInfo && logBaseInfo) {
2060
2060
  getJsonParam = logBaseInfo;
2061
2061
  } else {
2062
2062
  if (Array.isArray(jsonParam)) {
2063
2063
  getJsonParam = jsonParam;
2064
2064
  } else {
2065
2065
  getJsonParam = Object.assign(
2066
2066
  {},
2067
2067
  {
2068
2068
  shopid: global.info.queryInfo?.shopId,
2069
2069
  },
2070
2070
  jsonParam,
2071
2071
  );
2072
2072
  }
2073
2073
  }
2074
2074
  if (
2075
2075
  clickKey === 'exposure' &&
2076
2076
  /^TerminatorNew/.test(eventId) &&
2077
2077
  !Array.isArray(getJsonParam)
2078
2078
  ) {
2079
2079
  getJsonParam = [getJsonParam];
2080
2080
  }
2081
2081
  const miniLogParams = {
2082
2082
  eid: eventId,
2083
2083
  elevel: eventLevel,
2084
2084
  eparam: JSON.stringify(getJsonParam),
2085
2085
  pageId: this.logPageId,
2086
2086
  pname: this.logPname,
2087
2087
  pparam: JSON.stringify(this.routerInfo.params),
2088
2088
  target: this.routerInfo.path,
2089
2089
  event: this.nativeEvent,
2090
2090
  ...otherParams,
2091
2091
  };
2092
2092
  if (clickKey === 'addToCart' && skuId) {
2093
2093
  miniLogParams['shoppingList'] = {
2094
2094
  [skuId]: 1,
2095
2095
  };
2096
2096
  }
2097
2097
  console.log('点击埋点参数对象', miniLogParams, clickKey);
2098
2098
  global.miniAppLogInstance && global.miniAppLogInstance[clickKey](miniLogParams);
2099
2099
  } else {
2100
2100
  console.log('暂无埋点参数eventId和eventParam');
2101
2101
  }
2102
2102
  }
2103
2103
 
2104
2104
  exposureEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}) {
2105
2105
  return this.clickEventLog(opts, 'exposure');
2106
2106
  }
2107
2107
 
2108
2108
  jdJumpToSearch(shopId, suggestWord) {
2109
2109
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
2110
2110
  this.jdNavigateToNative({
2111
2111
  category: 'jump',
2112
2112
  des: 'jshopGuessWord',
2113
2113
  shopId: String(shopId),
2114
2114
  transparentEnable: true,
2115
2115
  suggestWord,
2116
2116
  sourceInfo: APP_SOURCE_INFO,
2117
2117
  });
2118
2118
  }
2119
2119
 
2120
2120
  jdJumpToMyMessageBox() {
2121
2121
  this.jdNavigateToNative({
2122
2122
  category: 'jump',
2123
2123
  des: 'myMessageBox',
2124
2124
  });
2125
2125
  }
2126
2126
 
2127
2127
  jdJumpToAppHome() {
2128
2128
  this.jdNavigateToNative({
2129
2129
  category: 'jump',
2130
2130
  des: 'HomePage',
2131
2131
  });
2132
2132
  }
2133
2133
 
2134
2134
  jdJumpToShopHomeDetail({ shopId, venderId }) {
2135
2135
  this.jdNavigateToNative({
2136
2136
  category: 'jump',
2137
2137
  des: 'jshopDetail',
2138
2138
  shopId: String(shopId),
2139
2139
  venderId: String(venderId),
2140
2140
  });
2141
2141
  }
2142
2142
 
2143
2143
  jdJumpToShopLottery(shopTotalInfo) {
2144
2144
  this.jdNavigateToNative(
2145
2145
  Object.assign(
2146
2146
  {},
2147
2147
  {
2148
2148
  category: 'jump',
2149
2149
  des: 'jshopSign',
2150
2150
  activityRuleType: '0',
2151
2151
  shopId: global.info.queryInfo.shopId,
2152
2152
  venderId: global.info.queryInfo.venderId,
2153
2153
  },
2154
2154
  shopTotalInfo,
2155
2155
  ),
2156
2156
  );
2157
2157
  }
2158
2158
 
2159
2159
  jdJumpToSageAuthorHome(shopTotalInfo) {
2160
2160
  this.jdNavigateToNative(
2161
2161
  Object.assign(
2162
2162
  {},
2163
2163
  {
2164
2164
  category: 'jump',
2165
2165
  des: 'faxian_author',
2166
2166
  channel: 'shopHomePage',
2167
2167
  selectTab: '0',
2168
2168
  },
2169
2169
  shopTotalInfo,
2170
2170
  ),
2171
2171
  );
2172
2172
  }
2173
2173
 
2174
2174
  jdJumpToMemberPaidCenter({ paidMemberShopType = 1 }, logEventInfo) {
2175
2175
  const venderId = global.info.queryInfo.venderId;
2176
2176
  const shopId = global.info.queryInfo.shopId;
2177
2177
  this.jdJumpToWeb(
2178
2178
  `${this.jumpWebUrl.memberPaidCenter}?venderId=${venderId}&shopId=${shopId}&paidMemberShopType=${paidMemberShopType}`,
2179
2179
  logEventInfo,
2180
2180
  );
2181
2181
  }
2182
2182
 
2183
2183
  jdJumpToMemberPaidCard({ paidMemberShopType = 1 }, logEventInfo) {
2184
2184
  const venderId = global.info.queryInfo.venderId;
2185
2185
  const shopId = global.info.queryInfo.shopId;
2186
2186
  this.jdJumpToWeb(
2187
2187
  `${this.jumpWebUrl.memberPaidCard}?venderId=${venderId}&shopId=${shopId}&paidMemberShopType=${paidMemberShopType}`,
2188
2188
  logEventInfo,
2189
2189
  );
2190
2190
  }
2191
2191
 
2192
2192
  jdJumpTodMemberPaidBind({ paidMemberShopType = 1 }, logEventInfo) {
2193
2193
  const venderId = global.info.queryInfo.venderId;
2194
2194
  const shopId = global.info.queryInfo.shopId;
2195
2195
  this.jdJumpToWeb(
2196
2196
  `${this.jumpWebUrl.memberPaidBind}?venderId=${venderId}&shopId=${shopId}&paidMemberShopType=${paidMemberShopType}`,
2197
2197
  logEventInfo,
2198
2198
  );
2199
2199
  }
2200
2200
 
2201
2201
  jdJumpBack(logEventInfo) {
2202
2202
  this.clickEventLog(logEventInfo);
2203
2203
  global.jmfeReayPromise().then(() => {
2204
2204
  window?.jmfe?.goBackRouter &&
2205
2205
  window?.jmfe?.goBackRouter().then(({ status }) => {
2206
2206
  if (status === '0' || status === '0000') {
2207
2207
  console.log('调用成功,即将关闭webview或返回历史记录前1页');
2208
2208
  } else {
2209
2209
  console.log('失败');
2210
2210
  }
2211
2211
  });
2212
2212
  });
2213
2213
  }