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

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
  let _getLastUrl = url
468
468
  if(/shop\.m\.jd\.com|pages\.jd\.com/.test(url)){
469
469
  _getLastUrl = !/jwebprog=0/.test(url) ? `${url}${url.indexOf("?") !== -1 ? '&jwebprog=0' : '?jwebprog=0'}` : url
470
470
  }
471
471
  super.jdJumpToWeb(
472
472
  _getLastUrl,
473
473
  {
474
474
  ...logEventInfo,
475
475
  },
476
476
  successBack,
477
477
  failBack,
478
478
  )
479
479
  }
480
480
  }
481
481
 
482
482
  jdJumpToWebInner(url, logEventInfo) {
483
483
  this.jdJumpToWeb(url, logEventInfo)
484
484
  }
485
485
 
486
486
  jdJumpConfigUrl(detail, logEventInfo = {}) {
487
487
  const { configDataType, configDataValue } = detail
488
488
  switch (configDataType) {
489
489
  case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
490
490
  this.jdJumpToShopCategory({
491
491
  ...configDataValue,
492
492
  logEventInfo,
493
493
  })
494
494
  break
495
495
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
496
496
  if(logEventInfo?.jsonParam?.logBaseInfo?.mInfo){
497
497
  logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds
498
498
  }
499
499
  this.jdJumpToProduct(configDataValue.skuIds, logEventInfo)
500
500
  break
501
501
  case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
502
502
  this.jdJumpToWeb(
503
503
  `${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
504
504
  {},
505
505
  )
506
506
  break
507
507
  case LinkConfigType.CONFIG_TYPE_CATEGORY:
508
508
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
509
509
  const getShopSearchParams = this.jdOpenAppParams(
510
510
  configDataValue.clickUrl,
511
511
  )
512
512
  console.log(
513
513
  'jd web 获取店铺分类链接解析后的参数结果',
514
514
  getShopSearchParams,
515
515
  )
516
516
  getShopSearchParams &&
517
517
  this.jdJumpToShopSearch(
518
518
  Object.assign({}, getShopSearchParams, {
519
519
  logEventInfo,
520
520
  }),
521
521
  )
522
522
  } else {
523
523
  this.jdJumpToShopSearch(
524
524
  configDataValue['cid']
525
525
  ? Object.assign(
526
526
  {},
527
527
  {
528
528
  shopId: global.info.queryInfo.shopId,
529
529
  categoryId: configDataValue.cid,
530
530
  searchType: '5',
531
531
  logEventInfo,
532
532
  },
533
533
  )
534
534
  : {
535
535
  shopId: global.info.queryInfo.shopId,
536
536
  logEventInfo,
537
537
  },
538
538
  )
539
539
  }
540
540
  break
541
541
  case LinkConfigType.CONFIG_TYPE_MEMBER:
542
542
  if(isAppHomeForMarketPage){
543
543
  this.jdJumpToBottomTabBrandMember({
544
544
  logEventInfo
545
545
  })
546
546
  }else {
547
547
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
548
548
  const getShopMemberParams = this.jdOpenAppParams(
549
549
  configDataValue.clickUrl,
550
550
  )
551
551
  getShopMemberParams &&
552
552
  this.jdJumpToShopMember(
553
553
  Object.assign({}, getShopMemberParams, {
554
554
  logEventInfo,
555
555
  }),
556
556
  )
557
557
  } else {
558
558
  this.jdJumpToShopMember({
559
559
  shopId: global.info.queryInfo.shopId,
560
560
  venderId: configDataValue.shopDetail,
561
561
  logEventInfo,
562
562
  })
563
563
  }
564
564
  }
565
565
  break
566
566
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
567
567
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
568
568
  const getShopActivityParams = this.jdOpenAppParams(
569
569
  configDataValue.clickUrl,
570
570
  )
571
571
  getShopActivityParams &&
572
572
  this.jdJumpToShopActivity(
573
573
  Object.assign({}, getShopActivityParams, {
574
574
  logEventInfo,
575
575
  }),
576
576
  )
577
577
  } else if (configDataValue['projectId']) {
578
578
  this.jdJumpToShopActivity({
579
579
  projectId: configDataValue['projectId'],
580
580
  configDataValue,
581
581
  logEventInfo,
582
582
  })
583
583
  }
584
584
  break
585
585
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
586
586
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
587
587
  const _url = configDataValue.linkUrl
588
588
  if (
589
589
  _url.indexOf('to=') === -1 &&
590
590
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
591
591
  ) {
592
592
  const _shopId = _url.match(/\d+/g)[0]
593
593
  this.jdJumpToShopHome({
594
594
  shopId: `${_shopId}`,
595
595
  logEventInfo,
596
596
  })
597
597
  } else if (this.isOpenJdAppUrl(_url)) {
598
598
  const getOpenAppParams = this.jdOpenAppParams(_url)
599
599
  console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams)
600
600
  if (getOpenAppParams) {
601
601
  let _changeOpenAppParams = getOpenAppParams
602
602
  if(isAppHomeForMarketPage){
603
603
  const { operation, ...otherOpenAppParams } = getOpenAppParams
604
604
  if(operation && operation === 'jumpTabInner'){
605
605
  _changeOpenAppParams = otherOpenAppParams
606
606
  }
607
607
  }
608
608
  this.jdNavigateToNative(
609
609
  Object.assign({}, _changeOpenAppParams, {
610
610
  logEventInfo,
611
611
  }),
612
612
  )
613
613
  }
614
614
  } else {
615
615
  this.jdJumpToWeb(_url, logEventInfo)
616
616
  }
617
617
  break
618
618
  }
619
619
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
620
620
  this.jdJumpToShopDetail({
621
621
  venderId: global.info.queryInfo.venderId,
622
622
  shopId: global.info.queryInfo.shopId,
623
623
  logEventInfo,
624
624
  })
625
625
  break
626
626
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
627
627
  this.jdJumpToShopHome({
628
628
  ...configDataValue,
629
629
  logEventInfo,
630
630
  })
631
631
  break
632
632
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
633
633
  break
634
634
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
635
635
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
636
636
  const getShoppingGuideParams = this.jdOpenAppParams(
637
637
  configDataValue.clickUrl,
638
638
  )
639
639
  getShoppingGuideParams &&
640
640
  this.jdJumpToShopActivity(
641
641
  Object.assign({}, getShoppingGuideParams, {
642
642
  logEventInfo,
643
643
  }),
644
644
  )
645
645
  }
646
646
  break
647
647
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
648
648
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '')
649
649
  const search = linkUrl.match(/\?.+/)
650
650
  if (search) {
651
651
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
652
652
  parseQueryUrlString(linkUrl)
653
653
  try {
654
654
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param)
655
655
  } catch (e) {
656
656
  console.warn('解析小程序 param 错误:', miniQueryData.param)
657
657
  }
658
658
  this.jdJumpToMiniProgram(miniQueryData)
659
659
  } else {
660
660
  console.warn('小程序地址错误:', linkUrl)
661
661
  }
662
662
  break
663
663
  }
664
664
  case LinkConfigType.CONFIG_TYPE_SHOP_SEARCH: {
665
665
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
666
666
  const getShopSearchParams = this.jdOpenAppParams(
667
667
  configDataValue.clickUrl,
668
668
  )
669
669
  console.log(
670
670
  'jd web 获取店铺结果落地页链接解析后的参数结果',
671
671
  getShopSearchParams,
672
672
  )
673
673
  getShopSearchParams &&
674
674
  this.jdJumpToShopSearch(
675
675
  Object.assign({}, getShopSearchParams, {
676
676
  logEventInfo,
677
677
  }),
678
678
  )
679
679
  } else {
680
680
  this.jdJumpToWeb(configDataValue.clickUrl, logEventInfo)
681
681
  }
682
682
  break
683
683
  }
684
684
  default:
685
685
  }
686
686
  }
687
687
 
688
688
  jdNavigateToNative(
689
689
  params: {},
690
690
  url = 'openapp.jdmobile://virtual',
691
691
  successBack?: Function | null,
692
692
  failBack?: Function | null,
693
693
  ) {
694
694
  console.log('[降级H5] jdNavigateToNative web.jd:', params)
695
695
  const getResParams: JumpEventReportInterFace.JdMiniJumpParams =
696
696
  Object.assign(
697
697
  {},
698
698
  {
699
699
  sourceValue: 'sourceValue_jshopModuleWeb',
700
700
  sourceType: 'sourceType_jshopModuleWeb',
701
701
  param: {},
702
702
  },
703
703
  params,
704
704
  )
705
705
  const { logEventInfo, ...otherParams } = getResParams
706
706
  console.log(
707
707
  'jd web 获取open协议参数 jdNavigateToNative params: ',
708
708
  getResParams,
709
709
  )
710
710
  console.log('logEventInfo params: ', logEventInfo)
711
711
  global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
712
712
  this.clickEventLog(logEventInfo || getResParams)
713
713
  .then(() => {
714
714
  if (typeof successBack == 'function') {
715
715
  successBack(getResParams)
716
716
  } else {
717
717
  try {
718
718
  const paramsStr = JSON.stringify(otherParams)
719
719
  console.log('跳转web jd open协议', `${url}?params=${paramsStr}`)
720
720
  window.location.href = `${url}?params=${paramsStr}`
721
721
  } catch (e) {
722
722
  console.log('跳转异常', e)
723
723
  }
724
724
  }
725
725
  })
726
726
  .catch(() => {
727
727
  typeof failBack == 'function' && failBack(getResParams)
728
728
  })
729
729
  }
730
730
 
731
731
  clickEventLog(
732
732
  opts: JumpEventReportInterFace.OptEventLogParams = {},
733
733
  reportKey = 'click',
734
734
  ) {
735
735
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
736
736
  if (eventId && jsonParam) {
737
737
  const { etModelInfo, logBaseInfo } = jsonParam
738
738
  let getJsonParam = {}
739
739
  if (etModelInfo && logBaseInfo) {
740
740
  getJsonParam = logBaseInfo
741
741
  } else {
742
742
  if (Array.isArray(jsonParam)){
743
743
  getJsonParam = jsonParam
744
744
  } else {
745
745
  getJsonParam = Object.assign(
746
746
  {},
747
747
  {
748
748
  shopid: global.info.queryInfo?.shopId,
749
749
  },
750
750
  jsonParam,
751
751
  )
752
752
  }
753
753
  }
754
754
  if(reportKey === 'exposure' && /^TerminatorNew/.test(eventId) && !Array.isArray(getJsonParam)){
755
755
  getJsonParam = [getJsonParam]
756
756
  }
757
757
  const webLogParams = {
758
758
  eid: eventId,
759
759
  elevel: eventLevel,
760
760
  jsonParam: JSON.stringify(getJsonParam),
761
761
  etModel: JSON.stringify(etModelInfo || {}),
762
762
  pageId: this.logPageId,
763
763
  pageParam: this.logPageParamStr,
764
764
  ...otherParams,
765
765
  }
766
766
  return /click|exposure/.test(reportKey)
767
767
  ? reportClick(webLogParams)
768
768
  : reportToCart(opts,webLogParams)
769
769
  } else {
770
770
  console.log('暂无埋点参数eventId和eventParam')
771
771
  return Promise.resolve(false)
772
772
  }
773
773
  }
774
774
 
775
775
  exposureEventLog(opts) {
776
776
  return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
777
777
  ? this.clickEventLog(
778
778
  {
779
779
  ...opts,
780
780
  exposureState: true,
781
781
  },
782
782
  'exposure',
783
783
  )
784
784
  : Promise.resolve(false)
785
785
  }