@conecli/cone-render 0.8.39 → 0.8.40

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