@conecli/cone-render 0.10.1-isv2.1 → 0.10.1-isv2.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 (111) 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/common/jssdk.ts +1 -1
  9. package/dist/common/pageType.ts +1 -1
  10. package/dist/common/sgmCustomCode.ts +1 -1
  11. package/dist/common/token/index.h5.ts +1 -1
  12. package/dist/common/token/token.jd.ts +1 -1
  13. package/dist/common/wxappApi.ts +1 -1
  14. package/dist/components/ErrorBoundary.tsx +1 -1
  15. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  16. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  17. package/dist/components/base/CountDown/index.module.scss +49 -44
  18. package/dist/components/base/CountDown/index.tsx +1 -1
  19. package/dist/components/base/CustomScrollView/index-back.tsx +1 -0
  20. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  21. package/dist/components/base/CustomVideo/common.ts +1 -0
  22. package/dist/components/base/CustomVideo/index.tsx +1 -1
  23. package/dist/components/base/Dialog/index.module.scss +11 -0
  24. package/dist/components/base/ExposureSmart/index.h5.module.scss +12 -2
  25. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  26. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  27. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  28. package/dist/components/base/InViewRender/index.tsx +1 -1
  29. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  30. package/dist/components/base/ItemViewExposureSmart/index.module.scss +2 -2
  31. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  32. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  33. package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
  34. package/dist/components/base/LazyLoadImage/index.h5.module.scss +11 -3
  35. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  36. package/dist/components/base/LazyLoadImage/index.tsx +1 -1
  37. package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
  38. package/dist/components/base/NetworkDataError/index.module.scss +3 -0
  39. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  40. package/dist/components/base/Price/Base/index.tsx +1 -1
  41. package/dist/components/base/Price/Double/index.module.scss +8 -0
  42. package/dist/components/base/Price/Double/index.tsx +1 -1
  43. package/dist/components/debug/DebugLayout/index.module.scss +2 -2
  44. package/dist/components/decorate/DecorateFloorModule/index.module.scss +11 -0
  45. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  46. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  47. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  48. package/dist/components/floorItem.jd.tsx +1 -1
  49. package/dist/components/floorItem.tsx +1 -1
  50. package/dist/components/floorItem.weapp.tsx +1 -1
  51. package/dist/components/isv/Floor/index.tsx +1 -1
  52. package/dist/components/remoteFloorItem.tsx +1 -1
  53. package/dist/interface/common.ts +1 -1
  54. package/dist/interface/component.ts +1 -1
  55. package/dist/interface/jumpEventReport.ts +1 -1
  56. package/dist/interface/service.ts +1 -1
  57. package/dist/jumpEventReport/base.ts +1 -1
  58. package/dist/jumpEventReport/const.ts +1 -1
  59. package/dist/jumpEventReport/index.jd.ts +1 -1
  60. package/dist/jumpEventReport/index.weapp.ts +1 -1
  61. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  62. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  63. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  64. package/dist/jumpEventReport/web/report.ts +1 -1
  65. package/dist/jumpEventReport/web.base.ts +1 -1
  66. package/dist/jumpEventReport/web.jd.ts +1 -1
  67. package/dist/jumpEventReport/web.jdb.ts +1 -1
  68. package/dist/jumpEventReport/web.jdjch.ts +1 -1
  69. package/dist/jumpEventReport/web.jxwxapp.ts +1 -1
  70. package/dist/jumpEventReport/web.pc.ts +1 -1
  71. package/dist/jumpEventReport/web.tjapp.ts +1 -1
  72. package/dist/jumpEventReport/web.tjm.ts +1 -1
  73. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  74. package/dist/libs/taroAppReport.js +2 -2
  75. package/dist/modules/ContainerFloorList/index.h5.module.scss +66 -52
  76. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  77. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  78. package/dist/open/api/device.ts +1 -1
  79. package/dist/open/api/environment.ts +1 -1
  80. package/dist/open/api/request.ts +1 -1
  81. package/dist/open/api/shopMember.ts +1 -1
  82. package/dist/open/api/util.ts +1 -1
  83. package/dist/open/components/index.ts +1 -1
  84. package/dist/sass/app.h5.scss +275 -221
  85. package/dist/sass/base.scss +183 -137
  86. package/dist/service/fetchGateway.ts +1 -1
  87. package/dist/service/fetchGateway.weapp.ts +1 -0
  88. package/dist/service/http/colorSign.ts +1 -1
  89. package/dist/service/http/const.ts +1 -1
  90. package/dist/service/http/h5Http.ts +1 -0
  91. package/dist/service/http/index.h5.ts +1 -0
  92. package/dist/service/requestServer.h5.ts +1 -0
  93. package/dist/service/requestServer.ts +1 -1
  94. package/dist/service/requestServer.weapp.ts +1 -0
  95. package/dist/utils/connectNativeJsBridge.ts +1 -1
  96. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  97. package/dist/utils/h5Utils.ts +1 -1
  98. package/dist/utils/index.h5.ts +1 -1
  99. package/dist/utils/index.ts +1 -1
  100. package/dist/utils/index.weapp.ts +1 -1
  101. package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
  102. package/dist/utils/jumpExtMapUtil.ts +1 -0
  103. package/dist/utils/log.ts +1 -0
  104. package/dist/utils/sColor.js +1 -0
  105. package/dist/utils/sgmCodeUtils.ts +1 -1
  106. package/dist/utils/taroRenderUtil.ts +1 -1
  107. package/dist/utils/utils.ts +1 -1
  108. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  109. package/dist/wxapp/common/user_info.js +1 -1
  110. package/package.json +158 -135
  111. package/dist/utils/memberFormatUtils.js +0 -1
@@ -1 +1 @@
1
- import { JdJumpJdApp } from './jdJumpJdApp'
2
1
  reportClick,
3
2
  reportPV,
4
3
  reportToCart,
5
4
  routerInfo: {
6
5
  params: {},
7
6
  },
8
7
  nativeEvent: null,
9
8
  jumpConfig: {
10
9
  venderId: null,
11
10
  shopId: null,
12
11
  sourceValue: '',
13
12
  sourceType: 'App-H5',
14
13
  activityType: 'shopx',
15
14
  moduleId: 'none',
16
15
  entrance: 'none',
17
16
  },
18
17
  logPageParamStr: '',
19
18
  public logPageId: string
20
19
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
21
20
  constructor(opt = {}) {
22
21
  super(opt)
23
22
  this.getConfig(opt)
24
23
  }
25
24
  getConfig(opt = {}) {
26
25
  return Object.assign(this, {}, defaultConfig, opt)
27
26
  }
28
27
  updateInfo(
29
28
  routerInfo,
30
29
  logPname = LogPnameInfo.HOME,
31
30
  pageId = LogPageIdInfo.APP,
32
31
  ) {
33
32
  this.logPageId = pageId
34
33
  this.routerInfo = routerInfo
35
34
  this.jumpConfig = Object.assign({}, this.jumpConfig, routerInfo.params)
36
35
  this.logPname = logPname
37
36
  }
38
37
  reportInfoPv(
39
38
  pageId = LogPageIdInfo.APP,
40
39
  opt: {
41
40
  pageParam?: any
42
41
  } = {},
43
42
  ) {
44
43
  const { pageParam } = opt
45
44
  this.logPageParamStr = pageParam
46
45
  ? pageParam
47
46
  : this.creatParamToLogStr(this.jumpConfig)
48
47
  .replace(/moduleId/, 'JumpmoduleID')
49
48
  .replace(/entrance/, 'Jumpentrance')
50
49
  reportPV({
51
50
  pageId,
52
51
  pageParam: this.logPageParamStr,
53
52
  ...opt,
54
53
  })
55
54
  }
56
55
 
57
56
  jdJumpToDongDongChatGroup(groupId, source = '4') {
58
57
  this.jdNavigateToNative({
59
58
  category: 'jump',
60
59
  des: 'dongdong_group_chat',
61
60
  source: source,
62
61
  groupId: `${groupId}`,
63
62
  })
64
63
  }
65
64
 
66
65
  jdJumpToWeb(
67
66
  url,
68
67
  logEventInfo,
69
68
  successBack?: Function | undefined,
70
69
  failBack?: Function | undefined,
71
70
  ) {
72
71
  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
  routerInfo: {
370
370
  params: {},
371
371
  },
372
372
  nativeEvent: null,
373
373
  jumpConfig: {
374
374
  venderId: null,
375
375
  shopId: null,
376
376
  sourceValue: '',
377
377
  sourceType: 'App-H5',
378
378
  activityType: 'shopx',
379
379
  moduleId: 'none',
380
380
  entrance: 'none',
381
381
  },
382
382
  logPageParamStr: '',
383
383
  public logPageId: string;
384
384
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig;
385
385
  constructor(opt = {}) {
386
386
  super(opt);
387
387
  this.getConfig(opt);
388
388
  }
389
389
  getConfig(opt = {}) {
390
390
  return Object.assign(this, {}, defaultConfig, opt);
391
391
  }
392
392
  updateInfo(routerInfo, logPname = LogPnameInfo.HOME, pageId = LogPageIdInfo.APP) {
393
393
  this.logPageId = pageId;
394
394
  this.routerInfo = routerInfo;
395
395
  this.jumpConfig = Object.assign({}, this.jumpConfig, routerInfo.params);
396
396
  this.logPname = logPname;
397
397
  }
398
398
  reportInfoPv(
399
399
  pageId = LogPageIdInfo.APP,
400
400
  opt: {
401
401
  pageParam?: any;
402
402
  } = {},
403
403
  ) {
404
404
  const { pageParam } = opt;
405
405
  this.logPageParamStr = pageParam
406
406
  ? pageParam
407
407
  : this.creatParamToLogStr(this.jumpConfig)
408
408
  .replace(/moduleId/, 'JumpmoduleID')
409
409
  .replace(/entrance/, 'Jumpentrance');
410
410
  reportPV({
411
411
  pageId,
412
412
  pageParam: this.logPageParamStr,
413
413
  ...opt,
414
414
  });
415
415
  }
416
416
 
417
417
  jdJumpToDongDongChatGroup(groupId, source = '4') {
418
418
  this.jdNavigateToNative({
419
419
  category: 'jump',
420
420
  des: 'dongdong_group_chat',
421
421
  source: source,
422
422
  groupId: `${groupId}`,
423
423
  });
424
424
  }
425
425
 
426
426
  jdJumpToWeb(
427
427
  url,
428
428
  logEventInfo,
429
429
  successBack?: functionType | undefined,
430
430
  failBack?: functionType | undefined,
431
431
  ) {
432
432
  console.log('jd web', this.isOpenJdAppUrl(url), url);
433
433
  if (this.isOpenJdAppUrl(url)) {
434
434
  const getOpenAppParams = this.jdOpenAppParams(url);
435
435
  console.log('jd web 获取自定义openApp链接解析后的参数结果', getOpenAppParams);
436
436
  if (getOpenAppParams) {
437
437
  this.jdNavigateToNative(
438
438
  Object.assign({}, getOpenAppParams, {
439
439
  logEventInfo,
440
440
  }),
441
441
  );
442
442
  }
443
443
  } else {
444
444
  let _getLastUrl = url;
445
445
  if (/shop\.m\.jd\.com|pages\.jd\.com/.test(_getLastUrl)) {
446
446
  const getUrlSearchParamState = _getLastUrl.indexOf('?') !== -1;
447
447
  if (!/jwebprog=0/.test(_getLastUrl)) {
448
448
  _getLastUrl = `${_getLastUrl}${getUrlSearchParamState ? '&' : '?'}jwebprog=0`;
449
449
  }
450
450
  if (global.info.sysInfo?.isJdTabletDevice && !/device=tablet/.test(_getLastUrl)) {
451
451
  _getLastUrl = `${_getLastUrl}${getUrlSearchParamState ? '&' : '?'}device=tablet`;
452
452
  }
453
453
  }
454
454
  super.jdJumpToWeb(
455
455
  _getLastUrl,
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(configDataValue.clickUrl);
493
493
  console.log('jd web 获取店铺分类链接解析后的参数结果', getShopSearchParams);
494
494
  getShopSearchParams &&
495
495
  this.jdJumpToShopSearch(
496
496
  Object.assign({}, getShopSearchParams, {
497
497
  logEventInfo,
498
498
  }),
499
499
  );
500
500
  } else {
501
501
  this.jdJumpToShopSearch(
502
502
  configDataValue['cid']
503
503
  ? Object.assign(
504
504
  {},
505
505
  {
506
506
  shopId: global.info.queryInfo.shopId,
507
507
  categoryId: configDataValue.cid,
508
508
  searchType: '5',
509
509
  logEventInfo,
510
510
  },
511
511
  )
512
512
  : {
513
513
  shopId: global.info.queryInfo.shopId,
514
514
  logEventInfo,
515
515
  },
516
516
  );
517
517
  }
518
518
  break;
519
519
  case LinkConfigType.CONFIG_TYPE_MEMBER:
520
520
  if (isAppHomeForMarketPage) {
521
521
  this.jdJumpToBottomTabBrandMember({
522
522
  logEventInfo,
523
523
  });
524
524
  } else {
525
525
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
526
526
  const getShopMemberParams = this.jdOpenAppParams(configDataValue.clickUrl);
527
527
  getShopMemberParams &&
528
528
  this.jdJumpToShopMember(
529
529
  Object.assign({}, getShopMemberParams, {
530
530
  logEventInfo,
531
531
  }),
532
532
  );
533
533
  } else {
534
534
  this.jdJumpToShopMember({
535
535
  shopId: global.info.queryInfo.shopId,
536
536
  venderId: configDataValue.shopDetail,
537
537
  logEventInfo,
538
538
  });
539
539
  }
540
540
  }
541
541
  break;
542
542
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
543
543
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
544
544
  const getShopActivityParams = this.jdOpenAppParams(configDataValue.clickUrl);
545
545
  getShopActivityParams &&
546
546
  this.jdJumpToShopActivity(
547
547
  Object.assign({}, getShopActivityParams, {
548
548
  logEventInfo,
549
549
  }),
550
550
  );
551
551
  } else if (configDataValue['projectId']) {
552
552
  this.jdJumpToShopActivity({
553
553
  projectId: configDataValue['projectId'],
554
554
  configDataValue,
555
555
  logEventInfo,
556
556
  });
557
557
  }
558
558
  break;
559
559
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
560
560
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
561
561
  const _url = configDataValue.linkUrl;
562
562
  if (
563
563
  _url.indexOf('to=') === -1 &&
564
564
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
565
565
  ) {
566
566
  const _shopId = _url.match(/\d+/g)[0];
567
567
  this.jdJumpToShopHome({
568
568
  shopId: `${_shopId}`,
569
569
  logEventInfo,
570
570
  });
571
571
  } else if (this.isOpenJdAppUrl(_url)) {
572
572
  const getOpenAppParams = this.jdOpenAppParams(_url);
573
573
  console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams);
574
574
  if (getOpenAppParams) {
575
575
  let _changeOpenAppParams = getOpenAppParams;
576
576
  if (isAppHomeForMarketPage) {
577
577
  const { operation, ...otherOpenAppParams } = getOpenAppParams;
578
578
  if (operation && operation === 'jumpTabInner') {
579
579
  _changeOpenAppParams = otherOpenAppParams;
580
580
  }
581
581
  }
582
582
  this.jdNavigateToNative(
583
583
  Object.assign({}, _changeOpenAppParams, {
584
584
  logEventInfo,
585
585
  }),
586
586
  );
587
587
  }
588
588
  } else {
589
589
  this.jdJumpToWeb(_url, logEventInfo);
590
590
  }
591
591
  break;
592
592
  }
593
593
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
594
594
  this.jdJumpToShopDetail({
595
595
  venderId: global.info.queryInfo.venderId,
596
596
  shopId: global.info.queryInfo.shopId,
597
597
  logEventInfo,
598
598
  });
599
599
  break;
600
600
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
601
601
  this.jdJumpToShopHome({
602
602
  ...configDataValue,
603
603
  logEventInfo,
604
604
  });
605
605
  break;
606
606
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
607
607
  break;
608
608
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
609
609
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
610
610
  const getShoppingGuideParams = this.jdOpenAppParams(configDataValue.clickUrl);
611
611
  getShoppingGuideParams &&
612
612
  this.jdJumpToShopActivity(
613
613
  Object.assign({}, getShoppingGuideParams, {
614
614
  logEventInfo,
615
615
  }),
616
616
  );
617
617
  }
618
618
  break;
619
619
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
620
620
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '');
621
621
  const search = linkUrl.match(/\?.+/);
622
622
  if (search) {
623
623
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
624
624
  parseQueryUrlString(linkUrl);
625
625
  try {
626
626
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param);
627
627
  } catch (e) {
628
628
  console.warn('解析小程序 param 错误:', miniQueryData.param);
629
629
  }
630
630
  this.jdJumpToMiniProgram(miniQueryData);
631
631
  } else {
632
632
  console.warn('小程序地址错误:', linkUrl);
633
633
  }
634
634
  break;
635
635
  }
636
636
  case LinkConfigType.CONFIG_TYPE_SHOP_SEARCH: {
637
637
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
638
638
  const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
639
639
  console.log('jd web 获取店铺结果落地页链接解析后的参数结果', getShopSearchParams);
640
640
  getShopSearchParams &&
641
641
  this.jdJumpToShopSearch(
642
642
  Object.assign({}, getShopSearchParams, {
643
643
  logEventInfo,
644
644
  }),
645
645
  );
646
646
  } else {
647
647
  this.jdJumpToWeb(configDataValue.clickUrl, logEventInfo);
648
648
  }
649
649
  break;
650
650
  }
651
651
  default:
652
652
  }
653
653
  }
654
654
 
655
655
  jdNavigateToNative(
656
656
  params: object,
657
657
  url = 'openapp.jdmobile://virtual',
658
658
  successBack?: functionType | null,
659
659
  failBack?: functionType | null,
660
660
  ) {
661
661
  console.log('[降级H5] jdNavigateToNative web.jd:', params);
662
662
  const getResParams: JumpEventReportInterFace.JdMiniJumpParams = Object.assign(
663
663
  {},
664
664
  {
665
665
  sourceValue: 'sourceValue_jshopModuleWeb',
666
666
  sourceType: 'sourceType_jshopModuleWeb',
667
667
  param: {},
668
668
  },
669
669
  params,
670
670
  );
671
671
  const { logEventInfo, ...otherParams } = getResParams;
672
672
  console.log('jd web 获取open协议参数 jdNavigateToNative params: ', getResParams);
673
673
  console.log('logEventInfo params: ', logEventInfo);
674
674
  global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
675
675
  this.clickEventLog(logEventInfo || getResParams)
676
676
  .then(() => {
677
677
  if (typeof successBack === 'function') {
678
678
  successBack(getResParams);
679
679
  } else {
680
680
  try {
681
681
  const paramsStr = JSON.stringify(otherParams);
682
682
  console.log('跳转web jd open协议', `${url}?params=${paramsStr}`);
683
683
  window.location.href = `${url}?params=${paramsStr}`;
684
684
  } catch (e) {
685
685
  console.log('跳转异常', e);
686
686
  }
687
687
  }
688
688
  })
689
689
  .catch(() => {
690
690
  typeof failBack === 'function' && failBack(getResParams);
691
691
  });
692
692
  }
693
693
 
694
694
  clickEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}, reportKey = 'click') {
695
695
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts;
696
696
  if (eventId && jsonParam) {
697
697
  const { etModelInfo, logBaseInfo } = jsonParam;
698
698
  let getJsonParam = {};
699
699
  if (etModelInfo && logBaseInfo) {
700
700
  getJsonParam = logBaseInfo;
701
701
  } else {
702
702
  if (Array.isArray(jsonParam)) {
703
703
  getJsonParam = jsonParam;
704
704
  } else {
705
705
  getJsonParam = Object.assign(
706
706
  {},
707
707
  {
708
708
  shopid: global.info.queryInfo?.shopId,
709
709
  },
710
710
  jsonParam,
711
711
  );
712
712
  }
713
713
  }
714
714
  if (
715
715
  reportKey === 'exposure' &&
716
716
  /^TerminatorNew/.test(eventId) &&
717
717
  !Array.isArray(getJsonParam)
718
718
  ) {
719
719
  getJsonParam = [getJsonParam];
720
720
  }
721
721
  const webLogParams = {
722
722
  isExpo: reportKey === 'exposure',
723
723
  eid: eventId,
724
724
  elevel: eventLevel,
725
725
  jsonParam: JSON.stringify(getJsonParam),
726
726
  etModel: JSON.stringify(etModelInfo || {}),
727
727
  pageId: this.logPageId,
728
728
  pageParam: this.logPageParamStr,
729
729
  ...otherParams,
730
730
  };
731
731
  return /click|exposure/.test(reportKey)
732
732
  ? reportClick(webLogParams)
733
733
  : reportToCart(opts, webLogParams);
734
734
  } else {
735
735
  console.log('暂无埋点参数eventId和eventParam');
736
736
  return Promise.resolve(false);
737
737
  }
738
738
  }
739
739
 
740
740
  exposureEventLog(opts) {
741
741
  return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
742
742
  ? this.clickEventLog(
743
743
  {
744
744
  ...opts,
745
745
  exposureState: true,
746
746
  },
747
747
  'exposure',
748
748
  )
749
749
  : Promise.resolve(false);
750
750
  }