@conecli/cone-render 0.10.1-shop3.76 → 0.10.1-shop3.79

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