@conecli/cone-render 0.10.1-beta.4 → 0.10.1-beta.5

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