@conecli/cone-render 0.9.1-shop2.16 → 0.9.1-shop2.18

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.
Files changed (38) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/environmentType.ts +1 -1
  4. package/dist/common/index.h5.ts +1 -1
  5. package/dist/common/index.jd.ts +1 -1
  6. package/dist/common/index.ts +1 -1
  7. package/dist/common/index.weapp.ts +1 -1
  8. package/dist/components/decorate/DecorateFloorModule/index.module.scss +11 -0
  9. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  10. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  11. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  12. package/dist/components/floorItem.tsx +1 -1
  13. package/dist/interface/common.ts +1 -1
  14. package/dist/interface/component.ts +1 -1
  15. package/dist/interface/jumpEventReport.ts +1 -1
  16. package/dist/interface/service.ts +1 -1
  17. package/dist/jumpEventReport/base.ts +1 -1
  18. package/dist/jumpEventReport/const.ts +1 -1
  19. package/dist/jumpEventReport/index.jd.ts +1 -1
  20. package/dist/jumpEventReport/index.weapp.ts +1 -1
  21. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  22. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  23. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  24. package/dist/jumpEventReport/web.base.ts +1 -1
  25. package/dist/jumpEventReport/web.jd.ts +1 -1
  26. package/dist/jumpEventReport/web.tjm.ts +1 -1
  27. package/dist/modules/ContainerFloorList/index.h5.module.scss +1 -1
  28. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  29. package/dist/open/api/device.ts +1 -1
  30. package/dist/sass/base.scss +45 -0
  31. package/dist/service/requestServer.ts +1 -1
  32. package/dist/utils/connectNativeJsBridge.ts +1 -1
  33. package/dist/utils/h5Utils.ts +1 -1
  34. package/dist/utils/index.h5.ts +1 -1
  35. package/dist/utils/index.ts +1 -1
  36. package/dist/utils/index.weapp.ts +1 -1
  37. package/dist/utils/utils.ts +1 -1
  38. package/package.json +1 -1
@@ -1 +1 @@
1
- import { JdJumpJdApp } from './jdJumpJdApp'
2
1
  reportClick,
3
2
  reportPV,
4
3
  reportToCart,
5
4
  routerInfo: {
6
5
  params: {},
7
6
  },
8
7
  nativeEvent: null,
9
8
  jumpConfig: {
10
9
  venderId: null,
11
10
  shopId: null,
12
11
  sourceValue: '',
13
12
  sourceType: 'App-H5',
14
13
  activityType: 'shopx',
15
14
  moduleId: 'none',
16
15
  entrance: 'none',
17
16
  },
18
17
  logPageParamStr: '',
19
18
  public logPageId: string
20
19
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
21
20
  constructor(opt = {}) {
22
21
  super(opt)
23
22
  this.getConfig(opt)
24
23
  }
25
24
  getConfig(opt = {}) {
26
25
  return Object.assign(this, {}, defaultConfig, opt)
27
26
  }
28
27
  updateInfo(
29
28
  routerInfo,
30
29
  logPname = LogPnameInfo.HOME,
31
30
  pageId = LogPageIdInfo.APP,
32
31
  ) {
33
32
  this.logPageId = pageId
34
33
  this.routerInfo = routerInfo
35
34
  this.jumpConfig = Object.assign({}, this.jumpConfig, routerInfo.params)
36
35
  this.logPname = logPname
37
36
  }
38
37
  reportInfoPv(
39
38
  pageId = LogPageIdInfo.APP,
40
39
  opt: {
41
40
  pageParam?: any
42
41
  } = {},
43
42
  ) {
44
43
  const { pageParam } = opt
45
44
  this.logPageParamStr = pageParam
46
45
  ? pageParam
47
46
  : this.creatParamToLogStr(this.jumpConfig)
48
47
  .replace(/moduleId/, 'JumpmoduleID')
49
48
  .replace(/entrance/, 'Jumpentrance')
50
49
  reportPV({
51
50
  pageId,
52
51
  pageParam: this.logPageParamStr,
53
52
  ...opt,
54
53
  })
55
54
  }
56
55
 
57
56
  jdJumpToDongDongChatGroup(groupId, source = '4') {
58
57
  this.jdNavigateToNative({
59
58
  category: 'jump',
60
59
  des: 'dongdong_group_chat',
61
60
  source: source,
62
61
  groupId: `${groupId}`,
63
62
  })
64
63
  }
65
64
 
66
65
  jdJumpToWeb(
67
66
  url,
68
67
  logEventInfo,
69
68
  successBack?: Function | undefined,
70
69
  failBack?: Function | undefined,
71
70
  ) {
72
71
  console.log('jd web',this.isOpenJdAppUrl(url),url)
73
72
  if (this.isOpenJdAppUrl(url)) {
74
73
  const getOpenAppParams = this.jdOpenAppParams(url)
75
74
  console.log(
76
75
  'jd web 获取自定义openApp链接解析后的参数结果',
77
76
  getOpenAppParams,
78
77
  )
79
78
  if (getOpenAppParams) {
80
79
  this.jdNavigateToNative(
81
80
  Object.assign({}, getOpenAppParams, {
82
81
  logEventInfo,
83
82
  }),
84
83
  )
85
84
  }
86
85
  } else {
87
86
  super.jdJumpToWeb(
88
87
  url,
89
88
  {
90
89
  ...logEventInfo,
91
90
  },
92
91
  successBack,
93
92
  failBack,
94
93
  )
95
94
  }
96
95
  }
97
96
 
98
97
  jdJumpToWebInner(url, logEventInfo) {
99
98
  this.jdJumpToWeb(url, logEventInfo)
100
99
  }
101
100
 
102
101
  jdJumpConfigUrl(detail, logEventInfo = {}) {
103
102
  const { configDataType, configDataValue } = detail
104
103
  switch (configDataType) {
105
104
  case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
106
105
  this.jdJumpToShopCategory({
107
106
  ...configDataValue,
108
107
  logEventInfo,
109
108
  })
110
109
  break
111
110
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
112
111
  if(logEventInfo?.jsonParam?.logBaseInfo?.mInfo){
113
112
  logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds
114
113
  }
115
114
  this.jdJumpToProduct(configDataValue.skuIds, logEventInfo)
116
115
  break
117
116
  case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
118
117
  this.jdJumpToWeb(
119
118
  `${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
120
119
  {},
121
120
  )
122
121
  break
123
122
  case LinkConfigType.CONFIG_TYPE_CATEGORY:
124
123
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
125
124
  const getShopSearchParams = this.jdOpenAppParams(
126
125
  configDataValue.clickUrl,
127
126
  )
128
127
  console.log(
129
128
  'jd web 获取店铺分类链接解析后的参数结果',
130
129
  getShopSearchParams,
131
130
  )
132
131
  getShopSearchParams &&
133
132
  this.jdJumpToShopSearch(
134
133
  Object.assign({}, getShopSearchParams, {
135
134
  logEventInfo,
136
135
  }),
137
136
  )
138
137
  } else {
139
138
  this.jdJumpToShopSearch(
140
139
  configDataValue['cid']
141
140
  ? Object.assign(
142
141
  {},
143
142
  {
144
143
  shopId: global.info.queryInfo.shopId,
145
144
  categoryId: configDataValue.cid,
146
145
  searchType: '5',
147
146
  logEventInfo,
148
147
  },
149
148
  )
150
149
  : {
151
150
  shopId: global.info.queryInfo.shopId,
152
151
  logEventInfo,
153
152
  },
154
153
  )
155
154
  }
156
155
  break
157
156
  case LinkConfigType.CONFIG_TYPE_MEMBER:
158
157
  if(isAppHomeForMarketPage){
159
158
  this.jdJumpToBottomTabBrandMember({
160
159
  logEventInfo
161
160
  })
162
161
  }else {
163
162
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
164
163
  const getShopMemberParams = this.jdOpenAppParams(
165
164
  configDataValue.clickUrl,
166
165
  )
167
166
  getShopMemberParams &&
168
167
  this.jdJumpToShopMember(
169
168
  Object.assign({}, getShopMemberParams, {
170
169
  logEventInfo,
171
170
  }),
172
171
  )
173
172
  } else {
174
173
  this.jdJumpToShopMember({
175
174
  shopId: global.info.queryInfo.shopId,
176
175
  venderId: configDataValue.shopDetail,
177
176
  logEventInfo,
178
177
  })
179
178
  }
180
179
  }
181
180
  break
182
181
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
183
182
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
184
183
  const getShopActivityParams = this.jdOpenAppParams(
185
184
  configDataValue.clickUrl,
186
185
  )
187
186
  getShopActivityParams &&
188
187
  this.jdJumpToShopActivity(
189
188
  Object.assign({}, getShopActivityParams, {
190
189
  logEventInfo,
191
190
  }),
192
191
  )
193
192
  } else if (configDataValue['projectId']) {
194
193
  this.jdJumpToShopActivity({
195
194
  projectId: configDataValue['projectId'],
196
195
  configDataValue,
197
196
  logEventInfo,
198
197
  })
199
198
  }
200
199
  break
201
200
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
202
201
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
203
202
  const _url = configDataValue.linkUrl
204
203
  if (
205
204
  _url.indexOf('to=') === -1 &&
206
205
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
207
206
  ) {
208
207
  const _shopId = _url.match(/\d+/g)[0]
209
208
  this.jdJumpToShopHome({
210
209
  shopId: `${_shopId}`,
211
210
  logEventInfo,
212
211
  })
213
212
  } else if (this.isOpenJdAppUrl(_url)) {
214
213
  const getOpenAppParams = this.jdOpenAppParams(_url)
215
214
  console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams)
216
215
  if (getOpenAppParams) {
217
216
  let _changeOpenAppParams = getOpenAppParams
218
217
  if(isAppHomeForMarketPage){
219
218
  const { operation, ...otherOpenAppParams } = getOpenAppParams
220
219
  if(operation && operation === 'jumpTabInner'){
221
220
  _changeOpenAppParams = otherOpenAppParams
222
221
  }
223
222
  }
224
223
  this.jdNavigateToNative(
225
224
  Object.assign({}, _changeOpenAppParams, {
226
225
  logEventInfo,
227
226
  }),
228
227
  )
229
228
  }
230
229
  } else {
231
230
  this.jdJumpToWeb(_url, logEventInfo)
232
231
  }
233
232
  break
234
233
  }
235
234
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
236
235
  this.jdJumpToShopDetail({
237
236
  venderId: global.info.queryInfo.venderId,
238
237
  shopId: global.info.queryInfo.shopId,
239
238
  logEventInfo,
240
239
  })
241
240
  break
242
241
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
243
242
  this.jdJumpToShopHome({
244
243
  ...configDataValue,
245
244
  logEventInfo,
246
245
  })
247
246
  break
248
247
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
249
248
  break
250
249
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
251
250
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
252
251
  const getShoppingGuideParams = this.jdOpenAppParams(
253
252
  configDataValue.clickUrl,
254
253
  )
255
254
  getShoppingGuideParams &&
256
255
  this.jdJumpToShopActivity(
257
256
  Object.assign({}, getShoppingGuideParams, {
258
257
  logEventInfo,
259
258
  }),
260
259
  )
261
260
  }
262
261
  break
263
262
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
264
263
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '')
265
264
  const search = linkUrl.match(/\?.+/)
266
265
  if (search) {
267
266
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
268
267
  parseQueryUrlString(linkUrl)
269
268
  try {
270
269
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param)
271
270
  } catch (e) {
272
271
  console.warn('解析小程序 param 错误:', miniQueryData.param)
273
272
  }
274
273
  this.jdJumpToMiniProgram(miniQueryData)
275
274
  } else {
276
275
  console.warn('小程序地址错误:', linkUrl)
277
276
  }
278
277
  break
279
278
  }
280
279
  default:
281
280
  }
282
281
  }
283
282
 
284
283
  jdNavigateToNative(
285
284
  params: {},
286
285
  url = 'openapp.jdmobile://virtual',
287
286
  successBack?: Function | null,
288
287
  failBack?: Function | null,
289
288
  ) {
290
289
  console.log('[降级H5] jdNavigateToNative web.jd:', params)
291
290
  const getResParams: JumpEventReportInterFace.JdMiniJumpParams =
292
291
  Object.assign(
293
292
  {},
294
293
  {
295
294
  sourceValue: 'sourceValue_jshopModuleWeb',
296
295
  sourceType: 'sourceType_jshopModuleWeb',
297
296
  param: {},
298
297
  },
299
298
  params,
300
299
  )
301
300
  const { logEventInfo, ...otherParams } = getResParams
302
301
  console.log(
303
302
  'jd web 获取open协议参数 jdNavigateToNative params: ',
304
303
  getResParams,
305
304
  )
306
305
  console.log('logEventInfo params: ', logEventInfo)
307
306
  global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
308
307
  this.clickEventLog(logEventInfo || getResParams)
309
308
  .then(() => {
310
309
  if (typeof successBack == 'function') {
311
310
  successBack(getResParams)
312
311
  } else {
313
312
  try {
314
313
  const paramsStr = JSON.stringify(otherParams)
315
314
  console.log('跳转web jd open协议', `${url}?params=${paramsStr}`)
316
315
  window.location.href = `${url}?params=${paramsStr}`
317
316
  } catch (e) {
318
317
  console.log('跳转异常', e)
319
318
  }
320
319
  }
321
320
  })
322
321
  .catch(() => {
323
322
  typeof failBack == 'function' && failBack(getResParams)
324
323
  })
325
324
  }
326
325
 
327
326
  clickEventLog(
328
327
  opts: JumpEventReportInterFace.OptEventLogParams = {},
329
328
  reportKey = 'click',
330
329
  ) {
331
330
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
332
331
  if (eventId && jsonParam) {
333
332
  const { etModelInfo, logBaseInfo } = jsonParam
334
333
  let getJsonParam = {}
335
334
  if (etModelInfo && logBaseInfo) {
336
335
  getJsonParam = logBaseInfo
337
336
  } else {
338
337
  if (Array.isArray(jsonParam)){
339
338
  getJsonParam = jsonParam
340
339
  } else {
341
340
  getJsonParam = Object.assign(
342
341
  {},
343
342
  {
344
343
  shopid: global.info.queryInfo?.shopId,
345
344
  },
346
345
  jsonParam,
347
346
  )
348
347
  }
349
348
  }
350
349
  if(reportKey === 'exposure' && /^TerminatorNew/.test(eventId) && !Array.isArray(getJsonParam)){
351
350
  getJsonParam = [getJsonParam]
352
351
  }
353
352
  const webLogParams = {
354
353
  eid: eventId,
355
354
  elevel: eventLevel,
356
355
  jsonParam: JSON.stringify(getJsonParam),
357
356
  etModel: JSON.stringify(etModelInfo || {}),
358
357
  pageId: this.logPageId,
359
358
  pageParam: this.logPageParamStr,
360
359
  ...otherParams,
361
360
  }
362
361
  return /click|exposure/.test(reportKey)
363
362
  ? reportClick(webLogParams)
364
363
  : reportToCart(opts,webLogParams)
365
364
  } else {
366
365
  console.log('暂无埋点参数eventId和eventParam')
367
366
  return Promise.resolve(false)
368
367
  }
369
368
  }
370
369
 
371
370
  exposureEventLog(opts) {
372
371
  return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
373
372
  ? this.clickEventLog(
374
373
  {
375
374
  ...opts,
376
375
  exposureState: true,
377
376
  },
378
377
  'exposure',
379
378
  )
380
379
  : Promise.resolve(false)
381
380
  }
381
+ import { JdJumpJdApp } from './jdJumpJdApp'
382
382
  reportClick,
383
383
  reportPV,
384
384
  reportToCart,
385
385
  routerInfo: {
386
386
  params: {},
387
387
  },
388
388
  nativeEvent: null,
389
389
  jumpConfig: {
390
390
  venderId: null,
391
391
  shopId: null,
392
392
  sourceValue: '',
393
393
  sourceType: 'App-H5',
394
394
  activityType: 'shopx',
395
395
  moduleId: 'none',
396
396
  entrance: 'none',
397
397
  },
398
398
  logPageParamStr: '',
399
399
  public logPageId: string
400
400
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
401
401
  constructor(opt = {}) {
402
402
  super(opt)
403
403
  this.getConfig(opt)
404
404
  }
405
405
  getConfig(opt = {}) {
406
406
  return Object.assign(this, {}, defaultConfig, opt)
407
407
  }
408
408
  updateInfo(
409
409
  routerInfo,
410
410
  logPname = LogPnameInfo.HOME,
411
411
  pageId = LogPageIdInfo.APP,
412
412
  ) {
413
413
  this.logPageId = pageId
414
414
  this.routerInfo = routerInfo
415
415
  this.jumpConfig = Object.assign({}, this.jumpConfig, routerInfo.params)
416
416
  this.logPname = logPname
417
417
  }
418
418
  reportInfoPv(
419
419
  pageId = LogPageIdInfo.APP,
420
420
  opt: {
421
421
  pageParam?: any
422
422
  } = {},
423
423
  ) {
424
424
  const { pageParam } = opt
425
425
  this.logPageParamStr = pageParam
426
426
  ? pageParam
427
427
  : this.creatParamToLogStr(this.jumpConfig)
428
428
  .replace(/moduleId/, 'JumpmoduleID')
429
429
  .replace(/entrance/, 'Jumpentrance')
430
430
  reportPV({
431
431
  pageId,
432
432
  pageParam: this.logPageParamStr,
433
433
  ...opt,
434
434
  })
435
435
  }
436
436
 
437
437
  jdJumpToDongDongChatGroup(groupId, source = '4') {
438
438
  this.jdNavigateToNative({
439
439
  category: 'jump',
440
440
  des: 'dongdong_group_chat',
441
441
  source: source,
442
442
  groupId: `${groupId}`,
443
443
  })
444
444
  }
445
445
 
446
446
  jdJumpToWeb(
447
447
  url,
448
448
  logEventInfo,
449
449
  successBack?: Function | undefined,
450
450
  failBack?: Function | undefined,
451
451
  ) {
452
452
  console.log('jd web',this.isOpenJdAppUrl(url),url)
453
453
  if (this.isOpenJdAppUrl(url)) {
454
454
  const getOpenAppParams = this.jdOpenAppParams(url)
455
455
  console.log(
456
456
  'jd web 获取自定义openApp链接解析后的参数结果',
457
457
  getOpenAppParams,
458
458
  )
459
459
  if (getOpenAppParams) {
460
460
  this.jdNavigateToNative(
461
461
  Object.assign({}, getOpenAppParams, {
462
462
  logEventInfo,
463
463
  }),
464
464
  )
465
465
  }
466
466
  } else {
467
467
  const getLastUrl = !/jwebprog=0/.test(url) ? `${url}${url.indexOf("?") !== -1 ? '&jwebprog=0' : '?jwebprog=0'}` : url
468
468
  super.jdJumpToWeb(
469
469
  getLastUrl,
470
470
  {
471
471
  ...logEventInfo,
472
472
  },
473
473
  successBack,
474
474
  failBack,
475
475
  )
476
476
  }
477
477
  }
478
478
 
479
479
  jdJumpToWebInner(url, logEventInfo) {
480
480
  this.jdJumpToWeb(url, logEventInfo)
481
481
  }
482
482
 
483
483
  jdJumpConfigUrl(detail, logEventInfo = {}) {
484
484
  const { configDataType, configDataValue } = detail
485
485
  switch (configDataType) {
486
486
  case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
487
487
  this.jdJumpToShopCategory({
488
488
  ...configDataValue,
489
489
  logEventInfo,
490
490
  })
491
491
  break
492
492
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
493
493
  if(logEventInfo?.jsonParam?.logBaseInfo?.mInfo){
494
494
  logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds
495
495
  }
496
496
  this.jdJumpToProduct(configDataValue.skuIds, logEventInfo)
497
497
  break
498
498
  case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
499
499
  this.jdJumpToWeb(
500
500
  `${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
501
501
  {},
502
502
  )
503
503
  break
504
504
  case LinkConfigType.CONFIG_TYPE_CATEGORY:
505
505
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
506
506
  const getShopSearchParams = this.jdOpenAppParams(
507
507
  configDataValue.clickUrl,
508
508
  )
509
509
  console.log(
510
510
  'jd web 获取店铺分类链接解析后的参数结果',
511
511
  getShopSearchParams,
512
512
  )
513
513
  getShopSearchParams &&
514
514
  this.jdJumpToShopSearch(
515
515
  Object.assign({}, getShopSearchParams, {
516
516
  logEventInfo,
517
517
  }),
518
518
  )
519
519
  } else {
520
520
  this.jdJumpToShopSearch(
521
521
  configDataValue['cid']
522
522
  ? Object.assign(
523
523
  {},
524
524
  {
525
525
  shopId: global.info.queryInfo.shopId,
526
526
  categoryId: configDataValue.cid,
527
527
  searchType: '5',
528
528
  logEventInfo,
529
529
  },
530
530
  )
531
531
  : {
532
532
  shopId: global.info.queryInfo.shopId,
533
533
  logEventInfo,
534
534
  },
535
535
  )
536
536
  }
537
537
  break
538
538
  case LinkConfigType.CONFIG_TYPE_MEMBER:
539
539
  if(isAppHomeForMarketPage){
540
540
  this.jdJumpToBottomTabBrandMember({
541
541
  logEventInfo
542
542
  })
543
543
  }else {
544
544
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
545
545
  const getShopMemberParams = this.jdOpenAppParams(
546
546
  configDataValue.clickUrl,
547
547
  )
548
548
  getShopMemberParams &&
549
549
  this.jdJumpToShopMember(
550
550
  Object.assign({}, getShopMemberParams, {
551
551
  logEventInfo,
552
552
  }),
553
553
  )
554
554
  } else {
555
555
  this.jdJumpToShopMember({
556
556
  shopId: global.info.queryInfo.shopId,
557
557
  venderId: configDataValue.shopDetail,
558
558
  logEventInfo,
559
559
  })
560
560
  }
561
561
  }
562
562
  break
563
563
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
564
564
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
565
565
  const getShopActivityParams = this.jdOpenAppParams(
566
566
  configDataValue.clickUrl,
567
567
  )
568
568
  getShopActivityParams &&
569
569
  this.jdJumpToShopActivity(
570
570
  Object.assign({}, getShopActivityParams, {
571
571
  logEventInfo,
572
572
  }),
573
573
  )
574
574
  } else if (configDataValue['projectId']) {
575
575
  this.jdJumpToShopActivity({
576
576
  projectId: configDataValue['projectId'],
577
577
  configDataValue,
578
578
  logEventInfo,
579
579
  })
580
580
  }
581
581
  break
582
582
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
583
583
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
584
584
  const _url = configDataValue.linkUrl
585
585
  if (
586
586
  _url.indexOf('to=') === -1 &&
587
587
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
588
588
  ) {
589
589
  const _shopId = _url.match(/\d+/g)[0]
590
590
  this.jdJumpToShopHome({
591
591
  shopId: `${_shopId}`,
592
592
  logEventInfo,
593
593
  })
594
594
  } else if (this.isOpenJdAppUrl(_url)) {
595
595
  const getOpenAppParams = this.jdOpenAppParams(_url)
596
596
  console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams)
597
597
  if (getOpenAppParams) {
598
598
  let _changeOpenAppParams = getOpenAppParams
599
599
  if(isAppHomeForMarketPage){
600
600
  const { operation, ...otherOpenAppParams } = getOpenAppParams
601
601
  if(operation && operation === 'jumpTabInner'){
602
602
  _changeOpenAppParams = otherOpenAppParams
603
603
  }
604
604
  }
605
605
  this.jdNavigateToNative(
606
606
  Object.assign({}, _changeOpenAppParams, {
607
607
  logEventInfo,
608
608
  }),
609
609
  )
610
610
  }
611
611
  } else {
612
612
  this.jdJumpToWeb(_url, logEventInfo)
613
613
  }
614
614
  break
615
615
  }
616
616
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
617
617
  this.jdJumpToShopDetail({
618
618
  venderId: global.info.queryInfo.venderId,
619
619
  shopId: global.info.queryInfo.shopId,
620
620
  logEventInfo,
621
621
  })
622
622
  break
623
623
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
624
624
  this.jdJumpToShopHome({
625
625
  ...configDataValue,
626
626
  logEventInfo,
627
627
  })
628
628
  break
629
629
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
630
630
  break
631
631
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
632
632
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
633
633
  const getShoppingGuideParams = this.jdOpenAppParams(
634
634
  configDataValue.clickUrl,
635
635
  )
636
636
  getShoppingGuideParams &&
637
637
  this.jdJumpToShopActivity(
638
638
  Object.assign({}, getShoppingGuideParams, {
639
639
  logEventInfo,
640
640
  }),
641
641
  )
642
642
  }
643
643
  break
644
644
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
645
645
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '')
646
646
  const search = linkUrl.match(/\?.+/)
647
647
  if (search) {
648
648
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
649
649
  parseQueryUrlString(linkUrl)
650
650
  try {
651
651
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param)
652
652
  } catch (e) {
653
653
  console.warn('解析小程序 param 错误:', miniQueryData.param)
654
654
  }
655
655
  this.jdJumpToMiniProgram(miniQueryData)
656
656
  } else {
657
657
  console.warn('小程序地址错误:', linkUrl)
658
658
  }
659
659
  break
660
660
  }
661
661
  case LinkConfigType.CONFIG_TYPE_SHOP_SEARCH: {
662
662
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
663
663
  const getShopSearchParams = this.jdOpenAppParams(
664
664
  configDataValue.clickUrl,
665
665
  )
666
666
  console.log(
667
667
  'jd web 获取店铺结果落地页链接解析后的参数结果',
668
668
  getShopSearchParams,
669
669
  )
670
670
  getShopSearchParams &&
671
671
  this.jdJumpToShopSearch(
672
672
  Object.assign({}, getShopSearchParams, {
673
673
  logEventInfo,
674
674
  }),
675
675
  )
676
676
  } else {
677
677
  this.jdJumpToWeb(configDataValue.clickUrl, logEventInfo)
678
678
  }
679
679
  break
680
680
  }
681
681
  default:
682
682
  }
683
683
  }
684
684
 
685
685
  jdNavigateToNative(
686
686
  params: {},
687
687
  url = 'openapp.jdmobile://virtual',
688
688
  successBack?: Function | null,
689
689
  failBack?: Function | null,
690
690
  ) {
691
691
  console.log('[降级H5] jdNavigateToNative web.jd:', params)
692
692
  const getResParams: JumpEventReportInterFace.JdMiniJumpParams =
693
693
  Object.assign(
694
694
  {},
695
695
  {
696
696
  sourceValue: 'sourceValue_jshopModuleWeb',
697
697
  sourceType: 'sourceType_jshopModuleWeb',
698
698
  param: {},
699
699
  },
700
700
  params,
701
701
  )
702
702
  const { logEventInfo, ...otherParams } = getResParams
703
703
  console.log(
704
704
  'jd web 获取open协议参数 jdNavigateToNative params: ',
705
705
  getResParams,
706
706
  )
707
707
  console.log('logEventInfo params: ', logEventInfo)
708
708
  global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
709
709
  this.clickEventLog(logEventInfo || getResParams)
710
710
  .then(() => {
711
711
  if (typeof successBack == 'function') {
712
712
  successBack(getResParams)
713
713
  } else {
714
714
  try {
715
715
  const paramsStr = JSON.stringify(otherParams)
716
716
  console.log('跳转web jd open协议', `${url}?params=${paramsStr}`)
717
717
  window.location.href = `${url}?params=${paramsStr}`
718
718
  } catch (e) {
719
719
  console.log('跳转异常', e)
720
720
  }
721
721
  }
722
722
  })
723
723
  .catch(() => {
724
724
  typeof failBack == 'function' && failBack(getResParams)
725
725
  })
726
726
  }
727
727
 
728
728
  clickEventLog(
729
729
  opts: JumpEventReportInterFace.OptEventLogParams = {},
730
730
  reportKey = 'click',
731
731
  ) {
732
732
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
733
733
  if (eventId && jsonParam) {
734
734
  const { etModelInfo, logBaseInfo } = jsonParam
735
735
  let getJsonParam = {}
736
736
  if (etModelInfo && logBaseInfo) {
737
737
  getJsonParam = logBaseInfo
738
738
  } else {
739
739
  if (Array.isArray(jsonParam)){
740
740
  getJsonParam = jsonParam
741
741
  } else {
742
742
  getJsonParam = Object.assign(
743
743
  {},
744
744
  {
745
745
  shopid: global.info.queryInfo?.shopId,
746
746
  },
747
747
  jsonParam,
748
748
  )
749
749
  }
750
750
  }
751
751
  if(reportKey === 'exposure' && /^TerminatorNew/.test(eventId) && !Array.isArray(getJsonParam)){
752
752
  getJsonParam = [getJsonParam]
753
753
  }
754
754
  const webLogParams = {
755
755
  eid: eventId,
756
756
  elevel: eventLevel,
757
757
  jsonParam: JSON.stringify(getJsonParam),
758
758
  etModel: JSON.stringify(etModelInfo || {}),
759
759
  pageId: this.logPageId,
760
760
  pageParam: this.logPageParamStr,
761
761
  ...otherParams,
762
762
  }
763
763
  return /click|exposure/.test(reportKey)
764
764
  ? reportClick(webLogParams)
765
765
  : reportToCart(opts,webLogParams)
766
766
  } else {
767
767
  console.log('暂无埋点参数eventId和eventParam')
768
768
  return Promise.resolve(false)
769
769
  }
770
770
  }
771
771
 
772
772
  exposureEventLog(opts) {
773
773
  return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
774
774
  ? this.clickEventLog(
775
775
  {
776
776
  ...opts,
777
777
  exposureState: true,
778
778
  },
779
779
  'exposure',
780
780
  )
781
781
  : Promise.resolve(false)
782
782
  }