@conecli/cone-render 0.10.1-shop3.85 → 0.10.1-shop3.86

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