@conecli/cone-render 0.9.1-shop2.0 → 0.9.1-shop2.10

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 (98) 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 -0
  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/common/jssdk.ts +1 -0
  9. package/dist/common/pageType.ts +1 -0
  10. package/dist/common/sgmCustomCode.ts +1 -0
  11. package/dist/common/token/index.h5.ts +1 -1
  12. package/dist/common/token/token.jd.ts +1 -1
  13. package/dist/common/token/token.ts +1 -1
  14. package/dist/common/wxappApi.jd.ts +1 -0
  15. package/dist/components/ErrorBoundary.tsx +1 -1
  16. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  17. package/dist/components/base/CountDown/index.tsx +1 -1
  18. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  19. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  20. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  21. package/dist/components/base/Dialog/index.module.scss +5 -0
  22. package/dist/components/base/Dialog/index.tsx +1 -1
  23. package/dist/components/base/Exposure/index.h5.tsx +1 -1
  24. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  25. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  26. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  27. package/dist/components/base/InViewRender/index.tsx +1 -1
  28. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  29. package/dist/components/base/LazyLayoutLoad/index.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/MobileCommonHeader/index.module.scss +9 -0
  34. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  35. package/dist/components/base/NetworkDataError/const.ts +1 -1
  36. package/dist/components/base/NetworkDataError/index.module.scss +4 -0
  37. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  38. package/dist/components/base/Price/Double/index.tsx +1 -1
  39. package/dist/components/base/Price/index.tsx +1 -1
  40. package/dist/components/decorate/DecorateFloorModule/index.module.scss +21 -2
  41. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  42. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  43. package/dist/components/floorItem.jd.tsx +1 -1
  44. package/dist/components/floorItem.tsx +1 -1
  45. package/dist/components/floorItem.weapp.tsx +1 -1
  46. package/dist/components/isv/Floor/index.tsx +1 -1
  47. package/dist/components/remoteFloorItem.tsx +1 -1
  48. package/dist/interface/common.ts +1 -1
  49. package/dist/interface/component.ts +1 -1
  50. package/dist/interface/jumpEventReport.ts +1 -1
  51. package/dist/interface/service.ts +1 -1
  52. package/dist/interface/utils.ts +1 -1
  53. package/dist/jumpEventReport/base.ts +1 -1
  54. package/dist/jumpEventReport/const.ts +1 -1
  55. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  56. package/dist/jumpEventReport/index.h5.ts +1 -1
  57. package/dist/jumpEventReport/index.jd.ts +1 -1
  58. package/dist/jumpEventReport/index.weapp.ts +1 -1
  59. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  60. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  61. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  62. package/dist/jumpEventReport/web/report.ts +1 -1
  63. package/dist/jumpEventReport/web.base.ts +1 -1
  64. package/dist/jumpEventReport/web.jd.ts +1 -1
  65. package/dist/jumpEventReport/web.jdb.ts +1 -1
  66. package/dist/jumpEventReport/web.jdjch.ts +1 -1
  67. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  68. package/dist/jumpEventReport/web.pc.ts +1 -0
  69. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  70. package/dist/jumpEventReport/web.tjm.ts +1 -0
  71. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  72. package/dist/modules/ContainerFloorList/index.h5.module.scss +17 -1
  73. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  74. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  75. package/dist/open/api/environment.ts +1 -1
  76. package/dist/open/api/index.ts +1 -1
  77. package/dist/open/api/jump copy.ts +1 -1
  78. package/dist/open/api/shopMember.ts +1 -1
  79. package/dist/open/api/track.ts +1 -1
  80. package/dist/open/api/util.ts +1 -1
  81. package/dist/open/components/index.ts +1 -1
  82. package/dist/sass/app.h5.scss +39 -3
  83. package/dist/sass/base.scss +12 -0
  84. package/dist/service/fetchGateway.ts +1 -1
  85. package/dist/service/http/const.ts +1 -1
  86. package/dist/service/requestServer.ts +1 -1
  87. package/dist/utils/connectNativeJsBridge.ts +1 -1
  88. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  89. package/dist/utils/draExceptionAndProfile.ts +1 -1
  90. package/dist/utils/h5Utils.ts +1 -1
  91. package/dist/utils/index.h5.ts +1 -1
  92. package/dist/utils/index.ts +1 -1
  93. package/dist/utils/index.weapp.ts +1 -1
  94. package/dist/utils/jm-common.js +1 -1
  95. package/dist/utils/sgmCodeUtils.ts +1 -0
  96. package/dist/utils/taroRenderUtil.ts +1 -1
  97. package/dist/utils/utils.ts +1 -1
  98. 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
  console.log('jd web',this.isOpenJdAppUrl(url),url)
420
420
  if (this.isOpenJdAppUrl(url)) {
421
421
  const getOpenAppParams = this.jdOpenAppParams(url)
422
422
  console.log(
423
423
  'jd web 获取自定义openApp链接解析后的参数结果',
424
424
  getOpenAppParams,
425
425
  )
426
426
  if (getOpenAppParams) {
427
427
  this.jdNavigateToNative(
428
428
  Object.assign({}, getOpenAppParams, {
429
429
  logEventInfo,
430
430
  }),
431
431
  )
432
432
  }
433
433
  } else {
434
434
  super.jdJumpToWeb(
435
435
  url,
436
436
  {
437
437
  ...logEventInfo,
438
438
  },
439
439
  successBack,
440
440
  failBack,
441
441
  )
442
442
  }
443
443
  }
444
444
 
445
445
  jdJumpToWebInner(url, logEventInfo) {
446
446
  this.jdJumpToWeb(url, logEventInfo)
447
447
  }
448
448
 
449
449
  jdJumpConfigUrl(detail, logEventInfo = {}) {
450
450
  const { configDataType, configDataValue } = detail
451
451
  switch (configDataType) {
452
452
  case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
453
453
  this.jdJumpToShopCategory({
454
454
  ...configDataValue,
455
455
  logEventInfo,
456
456
  })
457
457
  break
458
458
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
459
459
  if(logEventInfo?.jsonParam?.logBaseInfo?.mInfo){
460
460
  logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds
461
461
  }
462
462
  this.jdJumpToProduct(configDataValue.skuIds, logEventInfo)
463
463
  break
464
464
  case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
465
465
  this.jdJumpToWeb(
466
466
  `${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
467
467
  {},
468
468
  )
469
469
  break
470
470
  case LinkConfigType.CONFIG_TYPE_CATEGORY:
471
471
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
472
472
  const getShopSearchParams = this.jdOpenAppParams(
473
473
  configDataValue.clickUrl,
474
474
  )
475
475
  console.log(
476
476
  'jd web 获取店铺分类链接解析后的参数结果',
477
477
  getShopSearchParams,
478
478
  )
479
479
  getShopSearchParams &&
480
480
  this.jdJumpToShopSearch(
481
481
  Object.assign({}, getShopSearchParams, {
482
482
  logEventInfo,
483
483
  }),
484
484
  )
485
485
  } else {
486
486
  this.jdJumpToShopSearch(
487
487
  configDataValue['cid']
488
488
  ? Object.assign(
489
489
  {},
490
490
  {
491
491
  shopId: global.info.queryInfo.shopId,
492
492
  categoryId: configDataValue.cid,
493
493
  searchType: '5',
494
494
  logEventInfo,
495
495
  },
496
496
  )
497
497
  : {
498
498
  shopId: global.info.queryInfo.shopId,
499
499
  logEventInfo,
500
500
  },
501
501
  )
502
502
  }
503
503
  break
504
504
  case LinkConfigType.CONFIG_TYPE_MEMBER:
505
505
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
506
506
  const getShopMemberParams = this.jdOpenAppParams(
507
507
  configDataValue.clickUrl,
508
508
  )
509
509
  getShopMemberParams &&
510
510
  this.jdJumpToShopMember(
511
511
  Object.assign({}, getShopMemberParams, {
512
512
  logEventInfo,
513
513
  }),
514
514
  )
515
515
  } else {
516
516
  this.jdJumpToShopMember({
517
517
  shopId: global.info.queryInfo.shopId,
518
518
  venderId: configDataValue.shopDetail,
519
519
  logEventInfo,
520
520
  })
521
521
  }
522
522
  break
523
523
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
524
524
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
525
525
  const getShopActivityParams = this.jdOpenAppParams(
526
526
  configDataValue.clickUrl,
527
527
  )
528
528
  getShopActivityParams &&
529
529
  this.jdJumpToShopActivity(
530
530
  Object.assign({}, getShopActivityParams, {
531
531
  logEventInfo,
532
532
  }),
533
533
  )
534
534
  } else if (configDataValue['projectId']) {
535
535
  this.jdJumpToShopActivity({
536
536
  projectId: configDataValue['projectId'],
537
537
  configDataValue,
538
538
  logEventInfo,
539
539
  })
540
540
  }
541
541
  break
542
542
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
543
543
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
544
544
  const _url = configDataValue.linkUrl
545
545
  if (
546
546
  _url.indexOf('to=') === -1 &&
547
547
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
548
548
  ) {
549
549
  const _shopId = _url.match(/\d+/g)[0]
550
550
  this.jdJumpToShopHome({
551
551
  shopId: `${_shopId}`,
552
552
  logEventInfo,
553
553
  })
554
554
  } else if (this.isOpenJdAppUrl(_url)) {
555
555
  const getOpenAppParams = this.jdOpenAppParams(_url)
556
556
  console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams)
557
557
  if (getOpenAppParams) {
558
558
  this.jdNavigateToNative(
559
559
  Object.assign({}, getOpenAppParams, {
560
560
  logEventInfo,
561
561
  }),
562
562
  )
563
563
  }
564
564
  } else {
565
565
  this.jdJumpToWeb(_url, logEventInfo)
566
566
  }
567
567
  break
568
568
  }
569
569
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
570
570
  this.jdJumpToShopDetail({
571
571
  venderId: global.info.queryInfo.venderId,
572
572
  shopId: global.info.queryInfo.shopId,
573
573
  logEventInfo,
574
574
  })
575
575
  break
576
576
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
577
577
  this.jdJumpToShopHome({
578
578
  ...configDataValue,
579
579
  logEventInfo,
580
580
  })
581
581
  break
582
582
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
583
583
  break
584
584
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
585
585
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
586
586
  const getShoppingGuideParams = this.jdOpenAppParams(
587
587
  configDataValue.clickUrl,
588
588
  )
589
589
  getShoppingGuideParams &&
590
590
  this.jdJumpToShopActivity(
591
591
  Object.assign({}, getShoppingGuideParams, {
592
592
  logEventInfo,
593
593
  }),
594
594
  )
595
595
  }
596
596
  break
597
597
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
598
598
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '')
599
599
  const search = linkUrl.match(/\?.+/)
600
600
  if (search) {
601
601
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
602
602
  parseQueryUrlString(linkUrl)
603
603
  try {
604
604
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param)
605
605
  } catch (e) {
606
606
  console.warn('解析小程序 param 错误:', miniQueryData.param)
607
607
  }
608
608
  this.jdJumpToMiniProgram(miniQueryData)
609
609
  } else {
610
610
  console.warn('小程序地址错误:', linkUrl)
611
611
  }
612
612
  break
613
613
  }
614
614
  default:
615
615
  }
616
616
  }
617
617
 
618
618
  jdNavigateToNative(
619
619
  params: {},
620
620
  url = 'openapp.jdmobile://virtual',
621
621
  successBack?: Function | null,
622
622
  failBack?: Function | null,
623
623
  ) {
624
624
  console.log('[降级H5] jdNavigateToNative web.jd:', params)
625
625
  const getResParams: JumpEventReportInterFace.JdMiniJumpParams =
626
626
  Object.assign(
627
627
  {},
628
628
  {
629
629
  sourceValue: 'sourceValue_jshopModuleWeb',
630
630
  sourceType: 'sourceType_jshopModuleWeb',
631
631
  param: {},
632
632
  },
633
633
  params,
634
634
  )
635
635
  const { logEventInfo, ...otherParams } = getResParams
636
636
  console.log(
637
637
  'jd web 获取open协议参数 jdNavigateToNative params: ',
638
638
  getResParams,
639
639
  )
640
640
  console.log('logEventInfo params: ', logEventInfo)
641
641
  global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
642
642
  this.clickEventLog(logEventInfo || getResParams)
643
643
  .then(() => {
644
644
  if (typeof successBack == 'function') {
645
645
  successBack(getResParams)
646
646
  } else {
647
647
  try {
648
648
  const paramsStr = JSON.stringify(otherParams)
649
649
  console.log('跳转web jd open协议', `${url}?params=${paramsStr}`)
650
650
  window.location.href = `${url}?params=${paramsStr}`
651
651
  } catch (e) {
652
652
  console.log('跳转异常', e)
653
653
  }
654
654
  }
655
655
  })
656
656
  .catch(() => {
657
657
  typeof failBack == 'function' && failBack(getResParams)
658
658
  })
659
659
  }
660
660
 
661
661
  clickEventLog(
662
662
  opts: JumpEventReportInterFace.OptEventLogParams = {},
663
663
  reportKey = 'click',
664
664
  ) {
665
665
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
666
666
  if (eventId && jsonParam) {
667
667
  const { etModelInfo, logBaseInfo } = jsonParam
668
668
  let getJsonParam = {}
669
669
  if (etModelInfo && logBaseInfo) {
670
670
  getJsonParam = logBaseInfo
671
671
  } else {
672
672
  if (Array.isArray(jsonParam)){
673
673
  getJsonParam = jsonParam
674
674
  } else {
675
675
  getJsonParam = Object.assign(
676
676
  {},
677
677
  {
678
678
  shopid: global.info.queryInfo?.shopId,
679
679
  },
680
680
  jsonParam,
681
681
  )
682
682
  }
683
683
  }
684
684
  if(reportKey === 'exposure' && /^TerminatorNew/.test(eventId) && !Array.isArray(getJsonParam)){
685
685
  getJsonParam = [getJsonParam]
686
686
  }
687
687
  const webLogParams = {
688
688
  eid: eventId,
689
689
  elevel: eventLevel,
690
690
  jsonParam: JSON.stringify(getJsonParam),
691
691
  etModel: JSON.stringify(etModelInfo || {}),
692
692
  pageId: this.logPageId,
693
693
  pageParam: this.logPageParamStr,
694
694
  ...otherParams,
695
695
  }
696
696
  return /click|exposure/.test(reportKey)
697
697
  ? reportClick(webLogParams)
698
698
  : reportToCart(opts,webLogParams)
699
699
  } else {
700
700
  console.log('暂无埋点参数eventId和eventParam')
701
701
  return Promise.resolve(false)
702
702
  }
703
703
  }
704
704
 
705
705
  exposureEventLog(opts) {
706
706
  return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
707
707
  ? this.clickEventLog(
708
708
  {
709
709
  ...opts,
710
710
  exposureState: true,
711
711
  },
712
712
  'exposure',
713
713
  )
714
714
  : Promise.resolve(false)
715
715
  }