@conecli/cone-render 0.10.1-shop3.133 → 0.10.1-shop3.134

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