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

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
  }
1044
1043
 
1045
1044
  jdJumpToMemberPaidCenter({ paidMemberShopType = 1 }, logEventInfo) {
1046
1045
  const venderId = global.info.queryInfo.venderId;
1047
1046
  const shopId = global.info.queryInfo.shopId;
1048
1047
  this.jdJumpToWeb(
1049
1048
  `${this.jumpWebUrl.memberPaidCenter}?venderId=${venderId}&shopId=${shopId}&paidMemberShopType=${paidMemberShopType}`,
1050
1049
  logEventInfo,
1051
1050
  );
1052
1051
  }
1053
1052
 
1054
1053
  jdJumpToMemberPaidCard({ paidMemberShopType = 1 }, logEventInfo) {
1055
1054
  const venderId = global.info.queryInfo.venderId;
1056
1055
  const shopId = global.info.queryInfo.shopId;
1057
1056
  this.jdJumpToWeb(
1058
1057
  `${this.jumpWebUrl.memberPaidCard}?venderId=${venderId}&shopId=${shopId}&paidMemberShopType=${paidMemberShopType}`,
1059
1058
  logEventInfo,
1060
1059
  );
1061
1060
  }
1062
1061
 
1063
1062
  jdJumpTodMemberPaidBind({ paidMemberShopType = 1 }, logEventInfo) {
1064
1063
  const venderId = global.info.queryInfo.venderId;
1065
1064
  const shopId = global.info.queryInfo.shopId;
1066
1065
  this.jdJumpToWeb(
1067
1066
  `${this.jumpWebUrl.memberPaidBind}?venderId=${venderId}&shopId=${shopId}&paidMemberShopType=${paidMemberShopType}`,
1068
1067
  logEventInfo,
1069
1068
  );
1070
1069
  }
1070
+ import Taro from '@tarojs/taro';
1071
1071
  entrance: 'shop-page-tab',
1072
1072
  moduleId: 'shop-modular-floor',
1073
1073
 
1074
1074
  jdJumpToProduct(skuIds, logEventInfo, otherParams = {}) {
1075
1075
  skuIds = skuIds.toString().trim();
1076
1076
  const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds;
1077
1077
  const openAppParam = {
1078
1078
  category: 'jump',
1079
1079
  des: 'productDetail',
1080
1080
  skuId: getSkuId,
1081
1081
  logEventInfo,
1082
1082
  ...otherParams,
1083
1083
  };
1084
1084
  const adInfos = getAdInfoBySkuId(getSkuId);
1085
1085
  if (adInfos) {
1086
1086
  openAppParam.pdExtFlag = {
1087
1087
  adInfos,
1088
1088
  };
1089
1089
  }
1090
1090
  this.jdNavigateToNative(openAppParam);
1091
1091
  }
1092
1092
 
1093
1093
  jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo) {
1094
1094
  const getSkuId = skuInfo?.skuId;
1095
1095
  this.jdJumpToProduct(getSkuId, logEventInfo);
1096
1096
  }
1097
1097
 
1098
1098
  jdJumpToCartPage(logEventInfo) {
1099
1099
  this.jdNavigateToNative(
1100
1100
  Object.assign(
1101
1101
  {},
1102
1102
  {
1103
1103
  category: 'jump',
1104
1104
  des: 'cartB',
1105
1105
  logEventInfo,
1106
1106
  },
1107
1107
  ),
1108
1108
  );
1109
1109
  }
1110
1110
 
1111
1111
  jdJumpToShopCategory(shopInfo = {}) {
1112
1112
  console.log(
1113
1113
  '🚀 ~ file: jdJumpJdApp.ts:40 ~ JdJumpJdApp ~ jdJumpToShopCategory ~ shopInfo:',
1114
1114
  shopInfo,
1115
1115
  );
1116
1116
  console.log('[降级H5] jdJumpToShopCategory jdJumpJdApp');
1117
1117
  this.jdNavigateToNative(
1118
1118
  Object.assign(
1119
1119
  {},
1120
1120
  {
1121
1121
  category: 'jump',
1122
1122
  des: 'jshopMain',
1123
1123
  jumpBottomTab: 'category',
1124
1124
  },
1125
1125
  shopInfo,
1126
1126
  {
1127
1127
  shopId: String(shopInfo.shopId ?? ''),
1128
1128
  venderId: String(shopInfo.venderId ?? ''),
1129
1129
  },
1130
1130
  ),
1131
1131
  );
1132
1132
  }
1133
1133
 
1134
1134
  jdJumpToOrderInfoView(skuInfos, logEventInfo) {
1135
1135
  if (!skuInfos || !Array.isArray(skuInfos) || skuInfos.length <= 0) {
1136
1136
  console.log('skuInfos 参数错误,必须为非空数组');
1137
1137
  return null;
1138
1138
  }
1139
1139
  const isValid = skuInfos.every(
1140
1140
  (item) =>
1141
1141
  item &&
1142
1142
  typeof item === 'object' &&
1143
1143
  item !== null &&
1144
1144
  'skuId' in item &&
1145
1145
  'num' in item &&
1146
1146
  typeof item.skuId === 'string' &&
1147
1147
  typeof item.num === 'number',
1148
1148
  );
1149
1149
  if (!isValid) {
1150
1150
  console.log('skuInfos 格式错误:每个item必须是对象且包含 skuId(string) 和 num(number) 属性');
1151
1151
  return null;
1152
1152
  }
1153
1153
  const skuItems = skuInfos.map((sku) => {
1154
1154
  sku['itemType'] = 1;
1155
1155
  return sku;
1156
1156
  });
1157
1157
  const extFlag = {
1158
1158
  cartValue: '1',
1159
1159
  skuItems,
1160
1160
  };
1161
1161
  this.jdNavigateToNative({
1162
1162
  category: 'jump',
1163
1163
  des: 'orderInfoView',
1164
1164
  skuSource: 176,
1165
1165
  sourceType: 7,
1166
1166
  extFlag: JSON.stringify(extFlag),
1167
1167
  logEventInfo,
1168
1168
  });
1169
1169
  }
1170
1170
 
1171
1171
  jdJumpToTryDetail(tryId) {
1172
1172
  this.jdNavigateToNative({
1173
1173
  category: 'jump',
1174
1174
  des: 'jdreactcommon',
1175
1175
  appname: 'JDReactNewProduct',
1176
1176
  modulename: 'JDReactNewProduct',
1177
1177
  param: {
1178
1178
  activityId: tryId,
1179
1179
  isNative: true,
1180
1180
  nativePage: 'jdtry_detail',
1181
1181
  transparentenable: true,
1182
1182
  },
1183
1183
  });
1184
1184
  }
1185
1185
 
1186
1186
  jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
1187
1187
  console.log('[降级H5] jdJumpToShopHome jdJumpJdApp');
1188
1188
  const currentShopInfo = {
1189
1189
  shopId: global.info.queryInfo.shopId,
1190
1190
  venderId: global.info.queryInfo.venderId,
1191
1191
  };
1192
1192
  const restParams =
1193
1193
  (shopInfo?.shopId && shopInfo.shopId !== currentShopInfo.shopId) ||
1194
1194
  (shopInfo?.venderId && shopInfo.venderId !== currentShopInfo.venderId)
1195
1195
  ? {}
1196
1196
  : currentShopInfo;
1197
1197
  const getInfo = Object.assign({}, restParams, shopInfo);
1198
1198
  const getShopParams = this.getShopIdsInfo(getInfo);
1199
1199
  this.jdJumpToShopBase(getShopParams);
1200
1200
  }
1201
1201
 
1202
1202
  jdJumpToShopHomeInner(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
1203
1203
  const getParam = Object.assign(
1204
1204
  {},
1205
1205
  {
1206
1206
  jumpTab: HOME_TOP_TAB_TYPE_APP.HOME,
1207
1207
  operation: 'jumpTabInner',
1208
1208
  },
1209
1209
  shopInfo,
1210
1210
  );
1211
1211
  this.jdJumpToShopBase(getParam);
1212
1212
  }
1213
1213
 
1214
1214
  jdJumpToUnifieddetail(sourceInfo) {
1215
1215
  this.jdNavigateToNative(
1216
1216
  Object.assign(
1217
1217
  {},
1218
1218
  {
1219
1219
  category: 'jump',
1220
1220
  des: 'unifieddetail',
1221
1221
  },
1222
1222
  sourceInfo,
1223
1223
  ),
1224
1224
  );
1225
1225
  }
1226
1226
 
1227
1227
  jdJumpToVideoImmersion(sourceInfo) {
1228
1228
  this.jdNavigateToNative(
1229
1229
  Object.assign(
1230
1230
  {},
1231
1231
  {
1232
1232
  category: 'jump',
1233
1233
  des: 'VideoImmersion',
1234
1234
  },
1235
1235
  sourceInfo,
1236
1236
  ),
1237
1237
  );
1238
1238
  }
1239
1239
 
1240
1240
  jdJumpToShopMember(shopInfo) {
1241
1241
  this.jdNavigateToNative(
1242
1242
  Object.assign(
1243
1243
  {},
1244
1244
  {
1245
1245
  category: 'jump',
1246
1246
  des: 'jshopMember',
1247
1247
  followAward: '-1',
1248
1248
  },
1249
1249
  shopInfo,
1250
1250
  ),
1251
1251
  );
1252
1252
  }
1253
1253
 
1254
1254
  jdJumpToMemberTab(shopInfo?) {
1255
1255
  this.jdNavigateToNative(
1256
1256
  Object.assign(
1257
1257
  {},
1258
1258
  {
1259
1259
  category: 'jump',
1260
1260
  des: 'jshopMain',
1261
1261
  shopId: global.info.queryInfo.shopId,
1262
1262
  venderId: global.info.queryInfo.venderId,
1263
1263
  operation: 'jumpBottomTabMember',
1264
1264
  sourceInfo: APP_SOURCE_INFO,
1265
1265
  },
1266
1266
  shopInfo,
1267
1267
  ),
1268
1268
  );
1269
1269
  }
1270
1270
 
1271
1271
  jdJumpToDongDongChatGroup(groupId, source = 'jdmini') {
1272
1272
  this.jdNavigateToNative({
1273
1273
  category: 'jump',
1274
1274
  des: 'dongdong_group_chat',
1275
1275
  source: source,
1276
1276
  groupId: `${groupId}`,
1277
1277
  });
1278
1278
  }
1279
1279
 
1280
1280
  jdJumpToDongDongChat(paramInfo: any = {}) {
1281
1281
  const { venderId, ...otherParams } = paramInfo;
1282
1282
  this.jdNavigateToNative(
1283
1283
  Object.assign(
1284
1284
  {},
1285
1285
  {
1286
1286
  category: 'jump',
1287
1287
  des: 'jd_dongdong_chat',
1288
1288
  venderId: `${venderId ? venderId : global.info.queryInfo?.venderId}`,
1289
1289
  entry: 'm_shop',
1290
1290
  },
1291
1291
  otherParams,
1292
1292
  ),
1293
1293
  );
1294
1294
  }
1295
1295
 
1296
1296
  jdJumpToShopActivity(shopInfo) {
1297
1297
  const getParams = Object.assign(
1298
1298
  {},
1299
1299
  {
1300
1300
  category: 'jump',
1301
1301
  des: 'jshopActivity',
1302
1302
  shopId: global.info.queryInfo.shopId,
1303
1303
  venderId: global.info.queryInfo.venderId,
1304
1304
  },
1305
1305
  shopInfo,
1306
1306
  );
1307
1307
  getParams['projectId'] && (getParams['projectId'] = `${getParams['projectId']}`);
1308
1308
  this.jdNavigateToNative(getParams);
1309
1309
  }
1310
1310
 
1311
1311
  jdJumpToShopActivityPage(shopInfo) {
1312
1312
  this.jdNavigateToNative(
1313
1313
  Object.assign(
1314
1314
  {},
1315
1315
  {
1316
1316
  category: 'jump',
1317
1317
  des: 'jshopActivityPage',
1318
1318
  shopId: global.info.queryInfo.shopId,
1319
1319
  title: global.info.queryInfo?.shopName,
1320
1320
  },
1321
1321
  shopInfo,
1322
1322
  ),
1323
1323
  );
1324
1324
  }
1325
1325
 
1326
1326
  jdJumpToShopDetail(shopInfo) {
1327
1327
  this.jdNavigateToNative(
1328
1328
  Object.assign(
1329
1329
  {},
1330
1330
  {
1331
1331
  category: 'jump',
1332
1332
  des: 'jshopDetail',
1333
1333
  shopId: global.info.queryInfo.shopId,
1334
1334
  venderId: global.info.queryInfo.venderId,
1335
1335
  sourceInfo: APP_SOURCE_INFO,
1336
1336
  },
1337
1337
  shopInfo,
1338
1338
  ),
1339
1339
  );
1340
1340
  }
1341
1341
 
1342
1342
  jdJumpToShopMemberCard(shopInfo) {
1343
1343
  const { url, logEventInfo } = shopInfo;
1344
1344
  if (this.isOpenJdAppUrl(url)) {
1345
1345
  const getOpenAppParams = this.jdOpenAppParams(url);
1346
1346
  console.log('jd web 获取自定义openApp链接解析后的参数结果', getOpenAppParams);
1347
1347
  if (getOpenAppParams) {
1348
1348
  this.jdNavigateToNative(Object.assign({}, getOpenAppParams, { logEventInfo }));
1349
1349
  }
1350
1350
  } else {
1351
1351
  super.jdJumpToWeb(url, {
1352
1352
  ...logEventInfo,
1353
1353
  });
1354
1354
  }
1355
1355
  }
1356
1356
 
1357
1357
  jdJumpToTotalPromotion(shopInfo) {
1358
1358
  const { url, logEventInfo } = shopInfo;
1359
1359
  if (this.isOpenJdAppUrl(url)) {
1360
1360
  const getOpenAppParams = this.jdOpenAppParams(url);
1361
1361
  console.log('jd web 获取自定义openApp链接解析后的参数结果', getOpenAppParams);
1362
1362
  if (getOpenAppParams) {
1363
1363
  this.jdNavigateToNative(Object.assign({}, getOpenAppParams, { logEventInfo }));
1364
1364
  }
1365
1365
  } else {
1366
1366
  super.jdJumpToWeb(url, {
1367
1367
  ...logEventInfo,
1368
1368
  });
1369
1369
  }
1370
1370
  }
1371
1371
 
1372
1372
  jdJumpToShopSearch(pageInfo = {}) {
1373
1373
  const getInfo = Object.assign(
1374
1374
  {},
1375
1375
  {
1376
1376
  shopId: global.info.queryInfo.shopId,
1377
1377
  venderId: global.info.queryInfo.venderId,
1378
1378
  sourceInfo: APP_SOURCE_INFO,
1379
1379
  },
1380
1380
  pageInfo,
1381
1381
  );
1382
1382
  const { keyword = '', categoryId = '', ...otherPageInfo }: any = getInfo;
1383
1383
  const searchInfo = {};
1384
1384
  if (categoryId !== '') {
1385
1385
  searchInfo['categoryId'] = typeof categoryId === 'string' ? categoryId?.trim() : categoryId;
1386
1386
  searchInfo['searchType'] = '5';
1387
1387
  } else if (keyword !== '') {
1388
1388
  searchInfo['keyWord'] = keyword;
1389
1389
  searchInfo['searchType'] = '4';
1390
1390
  }
1391
1391
  const openAppParam = {
1392
1392
  category: 'jump',
1393
1393
  des: 'jshopProductList',
1394
1394
  pageId: '1',
1395
1395
  ...searchInfo,
1396
1396
  };
1397
1397
  const jumpExtMap = getEnterShopExtInfo();
1398
1398
  if (jumpExtMap) {
1399
1399
  openAppParam.jumpExtMap = jumpExtMap;
1400
1400
  }
1401
1401
  this.jdNavigateToNative(Object.assign({}, openAppParam, otherPageInfo));
1402
1402
  }
1403
1403
 
1404
1404
  jdJumpToOrderList(logEventInfo = {}) {
1405
1405
  this.jdNavigateToNative(
1406
1406
  Object.assign(
1407
1407
  {},
1408
1408
  {
1409
1409
  category: 'jump',
1410
1410
  des: 'orderlist',
1411
1411
  from: 'dphycc',
1412
1412
  },
1413
1413
  logEventInfo,
1414
1414
  ),
1415
1415
  );
1416
1416
  }
1417
1417
 
1418
1418
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
1419
1419
  this.jdNavigateToNative(
1420
1420
  Object.assign(
1421
1421
  {},
1422
1422
  {
1423
1423
  category: 'jump',
1424
1424
  des: 'productList',
1425
1425
  from: 'couponBatch',
1426
1426
  couponId: `${couponId}`,
1427
1427
  logEventInfo,
1428
1428
  },
1429
1429
  ),
1430
1430
  );
1431
1431
  }
1432
1432
 
1433
1433
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}, shopInfo = {}) {
1434
1434
  console.log('jdJumpJdApp - jdJumpToTabAllProduct');
1435
1435
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
1436
1436
  if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
1437
1437
  this.jdNavigateToNative(
1438
1438
  Object.assign(
1439
1439
  {},
1440
1440
  {
1441
1441
  category: 'jump',
1442
1442
  des: 'jshopMain',
1443
1443
  jumpTab: 'allProduct',
1444
1444
  },
1445
1445
  shopInfo,
1446
1446
  shopId !== 'undefined'
1447
1447
  ? {
1448
1448
  shopId,
1449
1449
  }
1450
1450
  : {},
1451
1451
  venderId !== 'undefined'
1452
1452
  ? {
1453
1453
  venderId,
1454
1454
  }
1455
1455
  : {},
1456
1456
  {
1457
1457
  logEventInfo,
1458
1458
  },
1459
1459
  ),
1460
1460
  );
1461
1461
  }
1462
1462
 
1463
1463
  jdJumpToTabAllProductInner(shopId, venderId, logEventInfo = {}, shopInfo = {}) {
1464
1464
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
1465
1465
  if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
1466
1466
  this.jdNavigateToNative(
1467
1467
  Object.assign(
1468
1468
  {},
1469
1469
  {
1470
1470
  category: 'jump',
1471
1471
  des: 'jshopMain',
1472
1472
  jumpTab: 'allProduct',
1473
1473
  operation: 'jumpTabInner',
1474
1474
  },
1475
1475
  shopInfo,
1476
1476
  shopId !== 'undefined'
1477
1477
  ? {
1478
1478
  shopId,
1479
1479
  }
1480
1480
  : {},
1481
1481
  venderId !== 'undefined'
1482
1482
  ? {
1483
1483
  venderId,
1484
1484
  }
1485
1485
  : {},
1486
1486
  {
1487
1487
  logEventInfo,
1488
1488
  },
1489
1489
  ),
1490
1490
  );
1491
1491
  }
1492
1492
 
1493
1493
  jdJumpToShopBase(shopInfo) {
1494
1494
  console.log('[降级H5] jdJumpToShopBase jdJumpJdApp');
1495
1495
  const currentShopInfo = {
1496
1496
  shopId: global.info.queryInfo.shopId,
1497
1497
  venderId: global.info.queryInfo.venderId,
1498
1498
  };
1499
1499
  const restParams =
1500
1500
  (shopInfo?.shopId && shopInfo.shopId !== currentShopInfo.shopId) ||
1501
1501
  (shopInfo?.venderId && shopInfo.venderId !== currentShopInfo.venderId)
1502
1502
  ? {}
1503
1503
  : currentShopInfo;
1504
1504
  const getParam = Object.assign(
1505
1505
  {},
1506
1506
  {
1507
1507
  category: 'jump',
1508
1508
  des: 'jshopMain',
1509
1509
  jumpTab: HOME_TOP_TAB_TYPE_APP.HOME,
1510
1510
  ...restParams,
1511
1511
  sourceInfo: APP_SOURCE_INFO,
1512
1512
  },
1513
1513
  shopInfo,
1514
1514
  );
1515
1515
  this.jdNavigateToNative(getParam);
1516
1516
  }
1517
1517
 
1518
1518
  jdJumpToTabNew(shopInfo = {}) {
1519
1519
  const getParam = Object.assign(
1520
1520
  {},
1521
1521
  {
1522
1522
  jumpTab: HOME_TOP_TAB_TYPE_APP.NEW,
1523
1523
  },
1524
1524
  shopInfo,
1525
1525
  );
1526
1526
  this.jdJumpToShopBase(getParam);
1527
1527
  }
1528
1528
 
1529
1529
  jdJumpToTabNewInner(shopInfo = {}) {
1530
1530
  const getParam = Object.assign(
1531
1531
  {},
1532
1532
  {
1533
1533
  jumpTab: HOME_TOP_TAB_TYPE_APP.NEW,
1534
1534
  operation: 'jumpTabInner',
1535
1535
  },
1536
1536
  shopInfo,
1537
1537
  );
1538
1538
  this.jdJumpToShopBase(getParam);
1539
1539
  }
1540
1540
  jdJumpToTabRank(shopInfo = {}) {
1541
1541
  const getParam = Object.assign(
1542
1542
  {},
1543
1543
  {
1544
1544
  jumpTab: HOME_TOP_TAB_TYPE_APP.RANK,
1545
1545
  },
1546
1546
  shopInfo,
1547
1547
  );
1548
1548
  this.jdJumpToShopBase(getParam);
1549
1549
  }
1550
1550
  jdJumpToTabRankInner(shopInfo = {}) {
1551
1551
  const getParam = Object.assign(
1552
1552
  {},
1553
1553
  {
1554
1554
  jumpTab: HOME_TOP_TAB_TYPE_APP.RANK,
1555
1555
  operation: 'jumpTabInner',
1556
1556
  },
1557
1557
  shopInfo,
1558
1558
  );
1559
1559
  this.jdJumpToShopBase(getParam);
1560
1560
  }
1561
1561
  jdJumpToTabBuyerShow(shopInfo = {}) {
1562
1562
  const getParam = Object.assign(
1563
1563
  {},
1564
1564
  {
1565
1565
  jumpTab: HOME_TOP_TAB_TYPE_APP.BUYERSHOW,
1566
1566
  },
1567
1567
  shopInfo,
1568
1568
  );
1569
1569
  this.jdJumpToShopBase(getParam);
1570
1570
  }
1571
1571
  jdJumpToTabBuyerShowInner(shopInfo = {}) {
1572
1572
  const getParam = Object.assign(
1573
1573
  {},
1574
1574
  {
1575
1575
  jumpTab: HOME_TOP_TAB_TYPE_APP.BUYERSHOW,
1576
1576
  operation: 'jumpTabInner',
1577
1577
  },
1578
1578
  shopInfo,
1579
1579
  );
1580
1580
  this.jdJumpToShopBase(getParam);
1581
1581
  }
1582
1582
  jdJumpToTabActivity(shopInfo = {}) {
1583
1583
  const getParam = Object.assign(
1584
1584
  {},
1585
1585
  {
1586
1586
  jumpTab: HOME_TOP_TAB_TYPE_APP.ACTIVITY,
1587
1587
  },
1588
1588
  shopInfo,
1589
1589
  );
1590
1590
  this.jdJumpToShopBase(getParam);
1591
1591
  }
1592
1592
  jdJumpToTabActivityInner(shopInfo = {}) {
1593
1593
  const getParam = Object.assign(
1594
1594
  {},
1595
1595
  {
1596
1596
  jumpTab: HOME_TOP_TAB_TYPE_APP.ACTIVITY,
1597
1597
  operation: 'jumpTabInner',
1598
1598
  },
1599
1599
  shopInfo,
1600
1600
  );
1601
1601
  this.jdJumpToShopBase(getParam);
1602
1602
  }
1603
1603
  jdJumpToTabSecKill(shopInfo = {}) {
1604
1604
  const getParam = Object.assign(
1605
1605
  {},
1606
1606
  {
1607
1607
  jumpTab: HOME_TOP_TAB_TYPE_APP.SECKILL,
1608
1608
  },
1609
1609
  shopInfo,
1610
1610
  );
1611
1611
  this.jdJumpToShopBase(getParam);
1612
1612
  }
1613
1613
  jdJumpToTabSecKillInner(shopInfo = {}) {
1614
1614
  const getParam = Object.assign(
1615
1615
  {},
1616
1616
  {
1617
1617
  jumpTab: HOME_TOP_TAB_TYPE_APP.SECKILL,
1618
1618
  operation: 'jumpTabInner',
1619
1619
  },
1620
1620
  shopInfo,
1621
1621
  );
1622
1622
  this.jdJumpToShopBase(getParam);
1623
1623
  }
1624
1624
  jdJumpToTabLive(shopInfo = {}) {
1625
1625
  const getParam = Object.assign(
1626
1626
  {},
1627
1627
  {
1628
1628
  jumpTab: HOME_TOP_TAB_TYPE_APP.LIVE,
1629
1629
  },
1630
1630
  shopInfo,
1631
1631
  );
1632
1632
  this.jdJumpToShopBase(getParam);
1633
1633
  }
1634
1634
  jdJumpToTabLiveInner(shopInfo = {}) {
1635
1635
  const getParam = Object.assign(
1636
1636
  {},
1637
1637
  {
1638
1638
  jumpTab: HOME_TOP_TAB_TYPE_APP.LIVE,
1639
1639
  operation: 'jumpTabInner',
1640
1640
  },
1641
1641
  shopInfo,
1642
1642
  );
1643
1643
  this.jdJumpToShopBase(getParam);
1644
1644
  }
1645
1645
 
1646
1646
  jdJumpToBottomTabBase(type, shopInfo = {}) {
1647
1647
  this.jdNavigateToNative(
1648
1648
  Object.assign(
1649
1649
  {},
1650
1650
  {
1651
1651
  category: 'jump',
1652
1652
  des: 'jshopMain',
1653
1653
  shopId: global.info.queryInfo.shopId,
1654
1654
  venderId: global.info.queryInfo.venderId,
1655
1655
  jumpBottomTab: type,
1656
1656
  sourceInfo: APP_SOURCE_INFO,
1657
1657
  },
1658
1658
  shopInfo,
1659
1659
  ),
1660
1660
  );
1661
1661
  }
1662
1662
 
1663
1663
  jdJumpToBottomTabProduct(shopInfo = {}) {
1664
1664
  this.jdJumpToBottomTabBase(BOTTOM_TAB_TYPE_APP.PRODUCT, shopInfo);
1665
1665
  }
1666
1666
 
1667
1667
  jdJumpToBottomTabCategory(shopInfo = {}) {
1668
1668
  this.jdJumpToBottomTabBase(BOTTOM_TAB_TYPE_APP.CATEGORY, shopInfo);
1669
1669
  }
1670
1670
 
1671
1671
  jdJumpToBottomTabFind(shopInfo = {}) {
1672
1672
  this.jdJumpToBottomTabBase(BOTTOM_TAB_TYPE_APP.FIND, shopInfo);
1673
1673
  }
1674
1674
 
1675
1675
  jdJumpToBottomTabBrandMember(shopInfo = {}) {
1676
1676
  this.jdJumpToBottomTabBase(BOTTOM_TAB_TYPE_APP.BRANDMEMBER, shopInfo);
1677
1677
  }
1678
1678
 
1679
1679
  jdJumpToBottomTabBrandMemberInner(shopInfo = {}) {
1680
1680
  this.jdJumpToMemberTab(shopInfo);
1681
1681
  }
1682
1682
 
1683
1683
  jdJumpToWeb(
1684
1684
  url,
1685
1685
  logEventInfo,
1686
1686
  successBack?: functionType | undefined,
1687
1687
  failBack?: functionType | undefined,
1688
1688
  ) {
1689
1689
  const changeUrl = /^\/\//.test(url) ? `https:${url}` : url;
1690
1690
  this.jdNavigateToNative(
1691
1691
  {
1692
1692
  category: 'jump',
1693
1693
  des: 'm',
1694
1694
  url: isJdAndHarmonyDevice ? changeUrl : encodeURIComponent(changeUrl),
1695
1695
  logEventInfo,
1696
1696
  },
1697
1697
  OpenAppHost,
1698
1698
  successBack,
1699
1699
  failBack,
1700
1700
  );
1701
1701
  }
1702
1702
 
1703
1703
  jdJumpToLive(clickUrlOrObj, logEventInfo) {
1704
1704
  if (isJdAppForNotMain) {
1705
1705
  super.jdJumpToLive(clickUrlOrObj, logEventInfo);
1706
1706
  } else {
1707
1707
  if (typeof clickUrlOrObj === 'object') {
1708
1708
  this.jdNavigateToNative({
1709
1709
  category: 'jump',
1710
1710
  des: 'LivePlayerRoom',
1711
1711
  liveOrigin: '1',
1712
1712
  needLogin: '0',
1713
1713
  isNeedVideo: true,
1714
1714
  logEventInfo,
1715
1715
  ...clickUrlOrObj,
1716
1716
  });
1717
1717
  } else {
1718
1718
  const getShopLiveParams = this.jdOpenAppParams(clickUrlOrObj);
1719
1719
  console.log('getShopLiveParams=====', getShopLiveParams);
1720
1720
  if (typeof getShopLiveParams === 'object') {
1721
1721
  this.jdNavigateToNative({
1722
1722
  ...getShopLiveParams,
1723
1723
  logEventInfo,
1724
1724
  });
1725
1725
  }
1726
1726
  }
1727
1727
  }
1728
1728
  }
1729
1729
 
1730
1730
  jdJumpToUgcContent(urlObj, logEventInfo = {}) {
1731
1731
  if (isJdAppForNotMain) {
1732
1732
  super.jdJumpToUgcContent(urlObj, logEventInfo);
1733
1733
  } else {
1734
1734
  if (typeof urlObj === 'object') {
1735
1735
  this.jdNavigateToNative({
1736
1736
  category: 'jump',
1737
1737
  des: 'shareOrderUgcContent',
1738
1738
  channel: 'shopshangxin',
1739
1739
  cmtType: '10',
1740
1740
  isNeedVideo: true,
1741
1741
  ...urlObj,
1742
1742
  logEventInfo,
1743
1743
  });
1744
1744
  } else {
1745
1745
  const getShopUgcParams = this.jdOpenAppParams(urlObj);
1746
1746
  if (getShopUgcParams) {
1747
1747
  getShopUgcParams['logEventInfo'] = logEventInfo;
1748
1748
  console.log('getShopUgcParams=====', getShopUgcParams);
1749
1749
  getShopUgcParams && this.jdNavigateToNative(getShopUgcParams as string);
1750
1750
  }
1751
1751
  }
1752
1752
  }
1753
1753
  }
1754
1754
 
1755
1755
  jdJumpToSeckillNewBrand(brandId) {
1756
1756
  this.jdNavigateToNative({
1757
1757
  category: 'jump',
1758
1758
  des: 'seckillnewbrand',
1759
1759
  brandId: `${brandId}`,
1760
1760
  });
1761
1761
  }
1762
1762
 
1763
1763
  jdJumpToJshopDynamicDetail(info) {
1764
1764
  this.jdNavigateToNative({
1765
1765
  category: 'jump',
1766
1766
  des: 'jshopDynamicDetail',
1767
1767
  shopId: global.info.queryInfo.shopId,
1768
1768
  venderId: global.info.queryInfo.venderId,
1769
1769
  ...info,
1770
1770
  });
1771
1771
  }
1772
1772
 
1773
1773
  jdJumpToRankList(rankingId, rankType, logEventInfo) {
1774
1774
  if (isJdAppForNotMain) {
1775
1775
  super.jdJumpToRankList(rankingId, rankType, logEventInfo);
1776
1776
  } else {
1777
1777
  this.jdNavigateToNative(
1778
1778
  Object.assign(
1779
1779
  {},
1780
1780
  {
1781
1781
  category: 'jump',
1782
1782
  des: 'jdreactcommon',
1783
1783
  modulename: 'JDReactRankingList',
1784
1784
  appname: 'JDReactRankingList',
1785
1785
  transparentenable: true,
1786
1786
  ishidden: true,
1787
1787
  param: {
1788
1788
  contentId: '' + rankingId,
1789
1789
  fromSkuId: '',
1790
1790
  detailPageType: '5',
1791
1791
  rankType: rankType || 10 + '',
1792
1792
  },
1793
1793
  logEventInfo,
1794
1794
  },
1795
1795
  ),
1796
1796
  );
1797
1797
  }
1798
1798
  }
1799
1799
 
1800
1800
  jdJumpToFlashSaleTab(logEventInfo) {
1801
1801
  this.jdNavigateToNative(
1802
1802
  Object.assign(
1803
1803
  {},
1804
1804
  {
1805
1805
  category: 'jump',
1806
1806
  des: 'jshopMain',
1807
1807
  jumpTab: 'flashPurchase',
1808
1808
  shopId: global.info.queryInfo.shopId,
1809
1809
  venderId: global.info.queryInfo.venderId,
1810
1810
  sourceType: 'JDReactShopActivityTAB',
1811
1811
  sourceValue: '2',
1812
1812
  operation: 'jumpTabInner',
1813
1813
  logEventInfo,
1814
1814
  },
1815
1815
  ),
1816
1816
  );
1817
1817
  }
1818
1818
 
1819
1819
 
1820
1820
  jdJumpToShopMemberInfo(logEventInfo) {
1821
1821
  this.jdNavigateToNative(
1822
1822
  Object.assign(
1823
1823
  {},
1824
1824
  {
1825
1825
  category: 'jump',
1826
1826
  des: 'jdreactcommon',
1827
1827
  modulename: 'JDReactShopMember',
1828
1828
  appname: 'JDReactShopMember',
1829
1829
  ishidden: true,
1830
1830
  param: {
1831
1831
  page: 'memberInfo',
1832
1832
  shopId: global.info.queryInfo.shopId,
1833
1833
  venderId: global.info.queryInfo.venderId,
1834
1834
  },
1835
1835
  logEventInfo,
1836
1836
  },
1837
1837
  ),
1838
1838
  );
1839
1839
  }
1840
1840
 
1841
1841
  jdJumpToShopMemberBenefit(logEventInfo) {
1842
1842
  const venderId = global.info.queryInfo.venderId;
1843
1843
  const shopId = global.info.queryInfo.shopId;
1844
1844
  this.jdJumpToWeb(
1845
1845
  `${this.jumpWebUrl.memberBenefit}?venderId=${venderId}&shopId=${shopId}`,
1846
1846
  logEventInfo,
1847
1847
  );
1848
1848
  }
1849
1849
 
1850
1850
  jdJumpToShopMemberPointExchange(venderType, levelZeroMenuUrl, logEventInfo) {
1851
1851
  this.jdNavigateToNative(
1852
1852
  Object.assign(
1853
1853
  {},
1854
1854
  {
1855
1855
  category: 'jump',
1856
1856
  des: 'jdreactcommon',
1857
1857
  modulename: 'JDReactShopMember',
1858
1858
  appname: 'JDReactShopMember',
1859
1859
  ishidden: true,
1860
1860
  param: {
1861
1861
  page: 'pointsExchangePage',
1862
1862
  shopId: global.info.queryInfo.shopId,
1863
1863
  venderId: global.info.queryInfo.venderId,
1864
1864
  levelZeroMenuUrl,
1865
1865
  },
1866
1866
  logEventInfo,
1867
1867
  },
1868
1868
  ),
1869
1869
  );
1870
1870
  }
1871
1871
 
1872
1872
  jdJumpToShopMemberBonusPurchase(customerLevel, logEventInfo) {
1873
1873
  this.jdNavigateToNative(
1874
1874
  Object.assign(
1875
1875
  {},
1876
1876
  {
1877
1877
  category: 'jump',
1878
1878
  des: 'jdreactcommon',
1879
1879
  modulename: 'JDReactShopMember',
1880
1880
  appname: 'JDReactShopMember',
1881
1881
  ishidden: true,
1882
1882
  param: {
1883
1883
  page: 'bonusPurchase',
1884
1884
  shopId: global.info.queryInfo.shopId,
1885
1885
  venderId: global.info.queryInfo.venderId,
1886
1886
  customerLevel,
1887
1887
  },
1888
1888
  logEventInfo,
1889
1889
  },
1890
1890
  ),
1891
1891
  );
1892
1892
  }
1893
1893
 
1894
1894
  jdJumpToMyRedEnvelope(logEventInfo) {
1895
1895
  this.jdNavigateToNative(
1896
1896
  Object.assign(
1897
1897
  {},
1898
1898
  {
1899
1899
  category: 'jump',
1900
1900
  des: 'jdreactcommon',
1901
1901
  modulename: 'JDReactMyRedEnvelope',
1902
1902
  appname: 'JDReactMyRedEnvelope',
1903
1903
  ishidden: true,
1904
1904
  fromName: 2,
1905
1905
  needLogin: true,
1906
1906
  logEventInfo,
1907
1907
  },
1908
1908
  ),
1909
1909
  );
1910
1910
  }
1911
1911
 
1912
1912
  jdJumpToMyCoupon(logEventInfo) {
1913
1913
  this.jdNavigateToNative(
1914
1914
  Object.assign(
1915
1915
  {},
1916
1916
  {
1917
1917
  category: 'jump',
1918
1918
  des: 'mycoupon',
1919
1919
  logEventInfo,
1920
1920
  },
1921
1921
  ),
1922
1922
  );
1923
1923
  }
1924
1924
 
1925
1925
 
1926
1926
  jdJumpToMiniProgram({ vapptype, appId, path, param }) {
1927
1927
  const pageName = param['pageType'] || 'home';
1928
1928
  const nowMiniPath = `pages/${pageName}/index`;
1929
1929
  if (appId === global.info.pageInfo.appId) {
1930
1930
  Taro.navigateTo({
1931
1931
  url: `/${nowMiniPath}?${objectToUrlEncode(param)}`,
1932
1932
  }).catch((err) => {
1933
1933
  console.warn('跳转小程序页面错误:', err);
1934
1934
  });
1935
1935
  } else {
1936
1936
  const params = {
1937
1937
  category: 'jump',
1938
1938
  des: 'jdmp',
1939
1939
  appId,
1940
1940
  vapptype,
1941
1941
  param,
1942
1942
  path: '',
1943
1943
  };
1944
1944
  if (path) {
1945
1945
  params.path = `${path}.html`;
1946
1946
  }
1947
1947
  this.jdNavigateToNative(params);
1948
1948
  }
1949
1949
  }
1950
1950
 
1951
1951
  jdJumpToAppMiniProgram(
1952
1952
  path: string,
1953
1953
  param = {},
1954
1954
  successBack?: functionType,
1955
1955
  failBack?: functionType,
1956
1956
  ) {
1957
1957
  this.jdNavigateToNative(param, path, successBack, failBack);
1958
1958
  }
1959
1959
 
1960
1960
  jdNavigateToNative(
1961
1961
  params: object,
1962
1962
  url = OpenAppHost,
1963
1963
  successBack?: functionType | undefined,
1964
1964
  failBack?: functionType | undefined,
1965
1965
  ) {
1966
1966
  console.log('[降级H5] jdNavigateToNative jdJumJdApp:', params);
1967
1967
  const getResParams: JumpEventReportInterFace.JdMiniJumpParams = Object.assign(
1968
1968
  {},
1969
1969
  {
1970
1970
  sourceValue: 'sourceValue_jshopMini',
1971
1971
  sourceType: 'sourceType_jshopMini',
1972
1972
  param: {},
1973
1973
  },
1974
1974
  params,
1975
1975
  );
1976
1976
  const { logEventInfo, ...otherParams } = getResParams;
1977
1977
  console.log('jdNavigateToNative params: ', getResParams);
1978
1978
  console.log('logEventInfo params: ', logEventInfo);
1979
1979
  this.clickEventLog(logEventInfo || getResParams, getResParams.des);
1980
1980
  jd.navigateToNative({
1981
1981
  dataParam: {
1982
1982
  url: url,
1983
1983
  params: otherParams,
1984
1984
  },
1985
1985
  success(res) {
1986
1986
  typeof successBack === 'function' && successBack(res);
1987
1987
  console.log('navigateToNative.success', res);
1988
1988
  },
1989
1989
  fail(res) {
1990
1990
  typeof failBack === 'function' && failBack(res);
1991
1991
  console.log('navigateToNative.fail', res);
1992
1992
  },
1993
1993
  });
1994
1994
  }
1995
1995
 
1996
1996
  clickEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}, clickKey = 'click') {
1997
1997
  const { eventId, jsonParam, eventLevel = 3, skuId, ...otherParams } = opts;
1998
1998
  if (eventId && jsonParam) {
1999
1999
  const { etModelInfo, logBaseInfo } = jsonParam;
2000
2000
  let getJsonParam = {};
2001
2001
  if (etModelInfo && logBaseInfo) {
2002
2002
  getJsonParam = logBaseInfo;
2003
2003
  } else {
2004
2004
  if (Array.isArray(jsonParam)) {
2005
2005
  getJsonParam = jsonParam;
2006
2006
  } else {
2007
2007
  getJsonParam = Object.assign(
2008
2008
  {},
2009
2009
  {
2010
2010
  shopid: global.info.queryInfo?.shopId,
2011
2011
  },
2012
2012
  jsonParam,
2013
2013
  );
2014
2014
  }
2015
2015
  }
2016
2016
  if (
2017
2017
  clickKey === 'exposure' &&
2018
2018
  /^TerminatorNew/.test(eventId) &&
2019
2019
  !Array.isArray(getJsonParam)
2020
2020
  ) {
2021
2021
  getJsonParam = [getJsonParam];
2022
2022
  }
2023
2023
  const miniLogParams = {
2024
2024
  eid: eventId,
2025
2025
  elevel: eventLevel,
2026
2026
  eparam: JSON.stringify(getJsonParam),
2027
2027
  pageId: this.logPageId,
2028
2028
  pname: this.logPname,
2029
2029
  pparam: JSON.stringify(this.routerInfo.params),
2030
2030
  target: this.routerInfo.path,
2031
2031
  event: this.nativeEvent,
2032
2032
  ...otherParams,
2033
2033
  };
2034
2034
  if (clickKey === 'addToCart' && skuId) {
2035
2035
  miniLogParams['shoppingList'] = {
2036
2036
  [skuId]: 1,
2037
2037
  };
2038
2038
  }
2039
2039
  console.log('点击埋点参数对象', miniLogParams, clickKey);
2040
2040
  global.miniAppLogInstance && global.miniAppLogInstance[clickKey](miniLogParams);
2041
2041
  } else {
2042
2042
  console.log('暂无埋点参数eventId和eventParam');
2043
2043
  }
2044
2044
  }
2045
2045
 
2046
2046
  exposureEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}) {
2047
2047
  return this.clickEventLog(opts, 'exposure');
2048
2048
  }
2049
2049
 
2050
2050
  jdJumpToSearch(shopId, suggestWord) {
2051
2051
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
2052
2052
  this.jdNavigateToNative({
2053
2053
  category: 'jump',
2054
2054
  des: 'jshopGuessWord',
2055
2055
  shopId: String(shopId),
2056
2056
  transparentEnable: true,
2057
2057
  suggestWord,
2058
2058
  sourceInfo: APP_SOURCE_INFO,
2059
2059
  });
2060
2060
  }
2061
2061
 
2062
2062
  jdJumpToMyMessageBox() {
2063
2063
  this.jdNavigateToNative({
2064
2064
  category: 'jump',
2065
2065
  des: 'myMessageBox',
2066
2066
  });
2067
2067
  }
2068
2068
 
2069
2069
  jdJumpToAppHome() {
2070
2070
  this.jdNavigateToNative({
2071
2071
  category: 'jump',
2072
2072
  des: 'HomePage',
2073
2073
  });
2074
2074
  }
2075
2075
 
2076
2076
  jdJumpToShopHomeDetail({ shopId, venderId }) {
2077
2077
  this.jdNavigateToNative({
2078
2078
  category: 'jump',
2079
2079
  des: 'jshopDetail',
2080
2080
  shopId: String(shopId),
2081
2081
  venderId: String(venderId),
2082
2082
  });
2083
2083
  }
2084
2084
 
2085
2085
  jdJumpToShopLottery(shopTotalInfo) {
2086
2086
  this.jdNavigateToNative(
2087
2087
  Object.assign(
2088
2088
  {},
2089
2089
  {
2090
2090
  category: 'jump',
2091
2091
  des: 'jshopSign',
2092
2092
  activityRuleType: '0',
2093
2093
  shopId: global.info.queryInfo.shopId,
2094
2094
  venderId: global.info.queryInfo.venderId,
2095
2095
  },
2096
2096
  shopTotalInfo,
2097
2097
  ),
2098
2098
  );
2099
2099
  }
2100
2100
 
2101
2101
  jdJumpToSageAuthorHome(shopTotalInfo) {
2102
2102
  this.jdNavigateToNative(
2103
2103
  Object.assign(
2104
2104
  {},
2105
2105
  {
2106
2106
  category: 'jump',
2107
2107
  des: 'faxian_author',
2108
2108
  channel: 'shopHomePage',
2109
2109
  selectTab: '0',
2110
2110
  },
2111
2111
  shopTotalInfo,
2112
2112
  ),
2113
2113
  );
2114
2114
  }
2115
2115
 
2116
2116
  jdJumpToMemberPaidCenter({ paidMemberShopType = 1 }, logEventInfo) {
2117
2117
  const venderId = global.info.queryInfo.venderId;
2118
2118
  const shopId = global.info.queryInfo.shopId;
2119
2119
  this.jdJumpToWeb(
2120
2120
  `${this.jumpWebUrl.memberPaidCenter}?venderId=${venderId}&shopId=${shopId}&paidMemberShopType=${paidMemberShopType}`,
2121
2121
  logEventInfo,
2122
2122
  );
2123
2123
  }
2124
2124
 
2125
2125
  jdJumpToMemberPaidCard({ paidMemberShopType = 1 }, logEventInfo) {
2126
2126
  const venderId = global.info.queryInfo.venderId;
2127
2127
  const shopId = global.info.queryInfo.shopId;
2128
2128
  this.jdJumpToWeb(
2129
2129
  `${this.jumpWebUrl.memberPaidCard}?venderId=${venderId}&shopId=${shopId}&paidMemberShopType=${paidMemberShopType}`,
2130
2130
  logEventInfo,
2131
2131
  );
2132
2132
  }
2133
2133
 
2134
2134
  jdJumpTodMemberPaidBind({ paidMemberShopType = 1 }, logEventInfo) {
2135
2135
  const venderId = global.info.queryInfo.venderId;
2136
2136
  const shopId = global.info.queryInfo.shopId;
2137
2137
  this.jdJumpToWeb(
2138
2138
  `${this.jumpWebUrl.memberPaidBind}?venderId=${venderId}&shopId=${shopId}&paidMemberShopType=${paidMemberShopType}`,
2139
2139
  logEventInfo,
2140
2140
  );
2141
2141
  }