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

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