@conecli/cone-render 0.10.1-shop3.96 → 0.10.1-shop3.98

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