@conecli/cone-render 0.8.44 → 0.8.46-beta.0

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