@conecli/cone-render 0.9.1-shop2.2 → 0.9.1-shop2.4

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 (62) hide show
  1. package/dist/common/const.ts +1 -1
  2. package/dist/common/index.h5.ts +1 -1
  3. package/dist/common/index.jd.ts +1 -1
  4. package/dist/common/index.ts +1 -1
  5. package/dist/common/index.weapp.ts +1 -1
  6. package/dist/common/jssdk.ts +1 -0
  7. package/dist/common/pageType.ts +1 -0
  8. package/dist/common/token/index.h5.ts +1 -1
  9. package/dist/common/token/token.jd.ts +1 -1
  10. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  11. package/dist/components/base/Exposure/index.h5.tsx +1 -1
  12. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  13. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  14. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  15. package/dist/components/base/InViewRender/index.tsx +1 -1
  16. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  17. package/dist/components/base/LazyLoadImage/const.ts +1 -1
  18. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  19. package/dist/components/base/MobileCommonHeader/index.module.scss +9 -0
  20. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  21. package/dist/components/base/NetworkDataError/const.ts +1 -1
  22. package/dist/components/base/NetworkDataError/index.module.scss +4 -0
  23. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  24. package/dist/components/base/Price/Double/index.tsx +1 -1
  25. package/dist/components/base/Price/index.tsx +1 -1
  26. package/dist/components/decorate/DecorateFloorModule/index.module.scss +21 -2
  27. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  28. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  29. package/dist/components/isv/Floor/index.tsx +1 -1
  30. package/dist/components/remoteFloorItem.tsx +1 -1
  31. package/dist/interface/common.ts +1 -1
  32. package/dist/interface/component.ts +1 -1
  33. package/dist/jumpEventReport/const.ts +1 -1
  34. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  35. package/dist/jumpEventReport/index.h5.ts +1 -1
  36. package/dist/jumpEventReport/index.weapp.ts +1 -1
  37. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  38. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  39. package/dist/jumpEventReport/web/report.ts +1 -1
  40. package/dist/jumpEventReport/web.base.ts +1 -1
  41. package/dist/jumpEventReport/web.jd.ts +1 -1
  42. package/dist/jumpEventReport/web.jdb.ts +1 -1
  43. package/dist/jumpEventReport/web.jdjch.ts +1 -1
  44. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  45. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  46. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  47. package/dist/open/api/environment.ts +1 -1
  48. package/dist/open/api/index.ts +1 -1
  49. package/dist/open/api/track.ts +1 -1
  50. package/dist/open/components/index.ts +1 -1
  51. package/dist/service/fetchGateway.ts +1 -1
  52. package/dist/service/http/const.ts +1 -1
  53. package/dist/service/requestServer.ts +1 -1
  54. package/dist/utils/connectNativeJsBridge.ts +1 -1
  55. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  56. package/dist/utils/h5Utils.ts +1 -1
  57. package/dist/utils/index.h5.ts +1 -1
  58. package/dist/utils/index.ts +1 -1
  59. package/dist/utils/index.weapp.ts +1 -1
  60. package/dist/utils/jm-common.js +1 -1
  61. package/dist/utils/utils.ts +1 -1
  62. 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
  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 webLogParams = {
321
320
  eid: eventId,
322
321
  elevel: eventLevel,
323
322
  jsonParam: JSON.stringify(logBaseInfo || jsonParam),
324
323
  etModel: JSON.stringify(etModelInfo || {}),
325
324
  pageId: this.logPageId,
326
325
  pageParam: this.logPageParamStr,
327
326
  ...otherParams,
328
327
  }
329
328
  return /click|exposure/.test(reportKey)
330
329
  ? reportClick(webLogParams)
331
330
  : reportToCart(opts,webLogParams)
332
331
  } else {
333
332
  console.log('暂无埋点参数eventId和eventParam')
334
333
  return Promise.resolve(false)
335
334
  }
336
335
  }
337
336
 
338
337
  exposureEventLog(opts) {
339
338
  return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
340
339
  ? this.clickEventLog(
341
340
  {
342
341
  ...opts,
343
342
  exposureState: true,
344
343
  },
345
344
  'exposure',
346
345
  )
347
346
  : Promise.resolve(false)
348
347
  }
348
+ import { JdJumpJdApp } from './jdJumpJdApp'
349
349
  reportClick,
350
350
  reportPV,
351
351
  reportToCart,
352
352
  routerInfo: {
353
353
  params: {},
354
354
  },
355
355
  nativeEvent: null,
356
356
  jumpConfig: {
357
357
  venderId: null,
358
358
  shopId: null,
359
359
  sourceValue: '',
360
360
  sourceType: 'App-H5',
361
361
  activityType: 'shopx',
362
362
  moduleId: 'none',
363
363
  entrance: 'none',
364
364
  },
365
365
  logPageParamStr: '',
366
366
  public logPageId: string
367
367
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
368
368
  constructor(opt = {}) {
369
369
  super(opt)
370
370
  this.getConfig(opt)
371
371
  }
372
372
  getConfig(opt = {}) {
373
373
  return Object.assign(this, {}, defaultConfig, opt)
374
374
  }
375
375
  updateInfo(
376
376
  routerInfo,
377
377
  logPname = LogPnameInfo.HOME,
378
378
  pageId = LogPageIdInfo.APP,
379
379
  ) {
380
380
  this.logPageId = pageId
381
381
  this.routerInfo = routerInfo
382
382
  this.jumpConfig = Object.assign({}, this.jumpConfig, routerInfo.params)
383
383
  this.logPname = logPname
384
384
  }
385
385
  reportInfoPv(
386
386
  pageId = LogPageIdInfo.APP,
387
387
  opt: {
388
388
  pageParam?: any
389
389
  } = {},
390
390
  ) {
391
391
  const { pageParam } = opt
392
392
  this.logPageParamStr = pageParam
393
393
  ? pageParam
394
394
  : this.creatParamToLogStr(this.jumpConfig)
395
395
  .replace(/moduleId/, 'JumpmoduleID')
396
396
  .replace(/entrance/, 'Jumpentrance')
397
397
  reportPV({
398
398
  pageId,
399
399
  pageParam: this.logPageParamStr,
400
400
  ...opt,
401
401
  })
402
402
  }
403
403
 
404
404
  jdJumpToDongDongChatGroup(groupId, source = '4') {
405
405
  this.jdNavigateToNative({
406
406
  category: 'jump',
407
407
  des: 'dongdong_group_chat',
408
408
  source: source,
409
409
  groupId: `${groupId}`,
410
410
  })
411
411
  }
412
412
 
413
413
  jdJumpToWeb(
414
414
  url,
415
415
  logEventInfo,
416
416
  successBack?: Function | undefined,
417
417
  failBack?: Function | undefined,
418
418
  ) {
419
419
  if (this.isOpenJdAppUrl(url)) {
420
420
  const getOpenAppParams = this.jdOpenAppParams(url)
421
421
  console.log(
422
422
  'jd web 获取自定义openApp链接解析后的参数结果',
423
423
  getOpenAppParams,
424
424
  )
425
425
  if (getOpenAppParams) {
426
426
  this.jdNavigateToNative(
427
427
  Object.assign({}, getOpenAppParams, {
428
428
  logEventInfo,
429
429
  }),
430
430
  )
431
431
  }
432
432
  } else {
433
433
  super.jdJumpToWeb(
434
434
  url,
435
435
  {
436
436
  ...logEventInfo,
437
437
  },
438
438
  successBack,
439
439
  failBack,
440
440
  )
441
441
  }
442
442
  }
443
443
 
444
444
  jdJumpToWebInner(url, logEventInfo) {
445
445
  this.jdJumpToWeb(url, logEventInfo)
446
446
  }
447
447
 
448
448
  jdJumpConfigUrl(detail, logEventInfo = {}) {
449
449
  const { configDataType, configDataValue } = detail
450
450
  switch (configDataType) {
451
451
  case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
452
452
  this.jdJumpToShopCategory({
453
453
  ...configDataValue,
454
454
  logEventInfo,
455
455
  })
456
456
  break
457
457
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
458
458
  if(logEventInfo?.jsonParam?.logBaseInfo?.mInfo){
459
459
  logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds
460
460
  }
461
461
  this.jdJumpToProduct(configDataValue.skuIds, logEventInfo)
462
462
  break
463
463
  case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
464
464
  this.jdJumpToWeb(
465
465
  `${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
466
466
  {},
467
467
  )
468
468
  break
469
469
  case LinkConfigType.CONFIG_TYPE_CATEGORY:
470
470
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
471
471
  const getShopSearchParams = this.jdOpenAppParams(
472
472
  configDataValue.clickUrl,
473
473
  )
474
474
  console.log(
475
475
  'jd web 获取店铺分类链接解析后的参数结果',
476
476
  getShopSearchParams,
477
477
  )
478
478
  getShopSearchParams &&
479
479
  this.jdJumpToShopSearch(
480
480
  Object.assign({}, getShopSearchParams, {
481
481
  logEventInfo,
482
482
  }),
483
483
  )
484
484
  } else {
485
485
  this.jdJumpToShopSearch(
486
486
  configDataValue['cid']
487
487
  ? Object.assign(
488
488
  {},
489
489
  {
490
490
  shopId: global.info.queryInfo.shopId,
491
491
  categoryId: configDataValue.cid,
492
492
  searchType: '5',
493
493
  logEventInfo,
494
494
  },
495
495
  )
496
496
  : {
497
497
  shopId: global.info.queryInfo.shopId,
498
498
  logEventInfo,
499
499
  },
500
500
  )
501
501
  }
502
502
  break
503
503
  case LinkConfigType.CONFIG_TYPE_MEMBER:
504
504
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
505
505
  const getShopMemberParams = this.jdOpenAppParams(
506
506
  configDataValue.clickUrl,
507
507
  )
508
508
  getShopMemberParams &&
509
509
  this.jdJumpToShopMember(
510
510
  Object.assign({}, getShopMemberParams, {
511
511
  logEventInfo,
512
512
  }),
513
513
  )
514
514
  } else {
515
515
  this.jdJumpToShopMember({
516
516
  shopId: global.info.queryInfo.shopId,
517
517
  venderId: configDataValue.shopDetail,
518
518
  logEventInfo,
519
519
  })
520
520
  }
521
521
  break
522
522
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
523
523
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
524
524
  const getShopActivityParams = this.jdOpenAppParams(
525
525
  configDataValue.clickUrl,
526
526
  )
527
527
  getShopActivityParams &&
528
528
  this.jdJumpToShopActivity(
529
529
  Object.assign({}, getShopActivityParams, {
530
530
  logEventInfo,
531
531
  }),
532
532
  )
533
533
  } else if (configDataValue['projectId']) {
534
534
  this.jdJumpToShopActivity({
535
535
  projectId: configDataValue['projectId'],
536
536
  configDataValue,
537
537
  logEventInfo,
538
538
  })
539
539
  }
540
540
  break
541
541
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
542
542
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
543
543
  const _url = configDataValue.linkUrl
544
544
  if (
545
545
  _url.indexOf('to=') === -1 &&
546
546
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
547
547
  ) {
548
548
  const _shopId = _url.match(/\d+/g)[0]
549
549
  this.jdJumpToShopHome({
550
550
  shopId: `${_shopId}`,
551
551
  logEventInfo,
552
552
  })
553
553
  } else if (this.isOpenJdAppUrl(_url)) {
554
554
  const getOpenAppParams = this.jdOpenAppParams(_url)
555
555
  console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams)
556
556
  if (getOpenAppParams) {
557
557
  this.jdNavigateToNative(
558
558
  Object.assign({}, getOpenAppParams, {
559
559
  logEventInfo,
560
560
  }),
561
561
  )
562
562
  }
563
563
  } else {
564
564
  this.jdJumpToWeb(_url, logEventInfo)
565
565
  }
566
566
  break
567
567
  }
568
568
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
569
569
  this.jdJumpToShopDetail({
570
570
  venderId: global.info.queryInfo.venderId,
571
571
  shopId: global.info.queryInfo.shopId,
572
572
  logEventInfo,
573
573
  })
574
574
  break
575
575
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
576
576
  this.jdJumpToShopHome({
577
577
  ...configDataValue,
578
578
  logEventInfo,
579
579
  })
580
580
  break
581
581
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
582
582
  break
583
583
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
584
584
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
585
585
  const getShoppingGuideParams = this.jdOpenAppParams(
586
586
  configDataValue.clickUrl,
587
587
  )
588
588
  getShoppingGuideParams &&
589
589
  this.jdJumpToShopActivity(
590
590
  Object.assign({}, getShoppingGuideParams, {
591
591
  logEventInfo,
592
592
  }),
593
593
  )
594
594
  }
595
595
  break
596
596
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
597
597
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '')
598
598
  const search = linkUrl.match(/\?.+/)
599
599
  if (search) {
600
600
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
601
601
  parseQueryUrlString(linkUrl)
602
602
  try {
603
603
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param)
604
604
  } catch (e) {
605
605
  console.warn('解析小程序 param 错误:', miniQueryData.param)
606
606
  }
607
607
  this.jdJumpToMiniProgram(miniQueryData)
608
608
  } else {
609
609
  console.warn('小程序地址错误:', linkUrl)
610
610
  }
611
611
  break
612
612
  }
613
613
  default:
614
614
  }
615
615
  }
616
616
 
617
617
  jdNavigateToNative(
618
618
  params: {},
619
619
  url = 'openapp.jdmobile://virtual',
620
620
  successBack?: Function | null,
621
621
  failBack?: Function | null,
622
622
  ) {
623
623
  console.log('[降级H5] jdNavigateToNative web.jd:', params)
624
624
  const getResParams: JumpEventReportInterFace.JdMiniJumpParams =
625
625
  Object.assign(
626
626
  {},
627
627
  {
628
628
  sourceValue: 'sourceValue_jshopModuleWeb',
629
629
  sourceType: 'sourceType_jshopModuleWeb',
630
630
  param: {},
631
631
  },
632
632
  params,
633
633
  )
634
634
  const { logEventInfo, ...otherParams } = getResParams
635
635
  console.log(
636
636
  'jd web 获取open协议参数 jdNavigateToNative params: ',
637
637
  getResParams,
638
638
  )
639
639
  console.log('logEventInfo params: ', logEventInfo)
640
640
  global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
641
641
  this.clickEventLog(logEventInfo || getResParams)
642
642
  .then(() => {
643
643
  if (typeof successBack == 'function') {
644
644
  successBack(getResParams)
645
645
  } else {
646
646
  try {
647
647
  const paramsStr = JSON.stringify(otherParams)
648
648
  console.log('跳转web jd open协议', `${url}?params=${paramsStr}`)
649
649
  window.location.href = `${url}?params=${paramsStr}`
650
650
  } catch (e) {
651
651
  console.log('跳转异常', e)
652
652
  }
653
653
  }
654
654
  })
655
655
  .catch(() => {
656
656
  typeof failBack == 'function' && failBack(getResParams)
657
657
  })
658
658
  }
659
659
 
660
660
  clickEventLog(
661
661
  opts: JumpEventReportInterFace.OptEventLogParams = {},
662
662
  reportKey = 'click',
663
663
  ) {
664
664
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
665
665
  if (eventId && jsonParam) {
666
666
  const { etModelInfo, logBaseInfo } = jsonParam
667
667
  let getJsonParam = {}
668
668
  if (etModelInfo && logBaseInfo) {
669
669
  getJsonParam = logBaseInfo
670
670
  } else {
671
671
  if (Array.isArray(jsonParam)){
672
672
  getJsonParam = jsonParam
673
673
  } else {
674
674
  getJsonParam = Object.assign(
675
675
  {},
676
676
  {
677
677
  shopid: global.info.queryInfo?.shopId,
678
678
  },
679
679
  jsonParam,
680
680
  )
681
681
  }
682
682
  }
683
683
  if(reportKey === 'exposure' && /^TerminatorNew/.test(eventId) && !Array.isArray(getJsonParam)){
684
684
  getJsonParam = [getJsonParam]
685
685
  }
686
686
  const webLogParams = {
687
687
  eid: eventId,
688
688
  elevel: eventLevel,
689
689
  jsonParam: JSON.stringify(getJsonParam),
690
690
  etModel: JSON.stringify(etModelInfo || {}),
691
691
  pageId: this.logPageId,
692
692
  pageParam: this.logPageParamStr,
693
693
  ...otherParams,
694
694
  }
695
695
  return /click|exposure/.test(reportKey)
696
696
  ? reportClick(webLogParams)
697
697
  : reportToCart(opts,webLogParams)
698
698
  } else {
699
699
  console.log('暂无埋点参数eventId和eventParam')
700
700
  return Promise.resolve(false)
701
701
  }
702
702
  }
703
703
 
704
704
  exposureEventLog(opts) {
705
705
  return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
706
706
  ? this.clickEventLog(
707
707
  {
708
708
  ...opts,
709
709
  exposureState: true,
710
710
  },
711
711
  'exposure',
712
712
  )
713
713
  : Promise.resolve(false)
714
714
  }