@conecli/cone-render 0.8.20 → 0.8.21-shop-beta.3

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 (117) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/index.h5.ts +1 -1
  4. package/dist/common/index.jd.ts +1 -1
  5. package/dist/common/index.ts +1 -1
  6. package/dist/common/index.weapp.ts +1 -1
  7. package/dist/common/isvStorage/index.h5.ts +1 -0
  8. package/dist/common/isvStorage/index.ts +1 -0
  9. package/dist/common/token/const.ts +1 -0
  10. package/dist/common/token/index.h5.ts +1 -0
  11. package/dist/common/token/index.ts +1 -0
  12. package/dist/common/token/token.jd.ts +1 -0
  13. package/dist/common/token/token.ts +1 -0
  14. package/dist/common/token/token.wxapp.ts +1 -0
  15. package/dist/components/ErrorBoundary.tsx +1 -1
  16. package/dist/components/base/CommonFloorHead/index.module.scss +1 -1
  17. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  18. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  19. package/dist/components/base/CustomVideo/const.ts +1 -0
  20. package/dist/components/base/CustomVideo/index.module.scss +40 -64
  21. package/dist/components/base/CustomVideo/index.tsx +1 -1
  22. package/dist/components/base/Dialog/index.module.scss +6 -2
  23. package/dist/components/base/Dialog/index.tsx +1 -1
  24. package/dist/components/base/ExposureSmart/const.ts +1 -0
  25. package/dist/components/base/ExposureSmart/index.h5.module.scss +18 -4
  26. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  27. package/dist/components/base/ExposureSmart/index.module.scss +20 -9
  28. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  29. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  30. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  31. package/dist/components/base/InViewRender/index.tsx +1 -1
  32. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  33. package/dist/components/base/ItemViewExposureSmart/index.module.scss +8 -0
  34. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -0
  35. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  36. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  37. package/dist/components/base/NetworkDataError/const.ts +1 -1
  38. package/dist/components/base/NetworkDataError/index.module.scss +7 -1
  39. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  40. package/dist/components/base/Price/{const.ts → Base/const.ts} +0 -0
  41. package/dist/components/base/Price/Base/index.module.scss +136 -0
  42. package/dist/components/base/Price/Base/index.tsx +1 -0
  43. package/dist/components/base/Price/Double/index.module.scss +158 -0
  44. package/dist/components/base/Price/Double/index.tsx +1 -0
  45. package/dist/components/base/Price/index.tsx +1 -1
  46. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  47. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  48. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  49. package/dist/components/floorItem.jd.tsx +1 -0
  50. package/dist/components/floorItem.tsx +1 -1
  51. package/dist/components/isv/Floor/index.tsx +1 -1
  52. package/dist/components/remoteFloorItem.tsx +1 -0
  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/createReportFloorData.ts +1 -1
  60. package/dist/jumpEventReport/index.h5.ts +1 -1
  61. package/dist/jumpEventReport/index.ts +1 -1
  62. package/dist/jumpEventReport/index.weapp.ts +1 -1
  63. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  64. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  65. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  66. package/dist/jumpEventReport/web/report.ts +1 -1
  67. package/dist/jumpEventReport/web.base.ts +1 -1
  68. package/dist/jumpEventReport/web.jd.ts +1 -1
  69. package/dist/jumpEventReport/web.jdb.ts +1 -0
  70. package/dist/jumpEventReport/web.jdjch.ts +1 -0
  71. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  72. package/dist/libs/taroAppReport.js +2 -2
  73. package/dist/modules/ContainerFloorList/index.h5.module.scss +10 -1
  74. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  75. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  76. package/dist/open/api/device.ts +1 -1
  77. package/dist/open/api/index.ts +1 -1
  78. package/dist/open/api/jump/business.ts +1 -0
  79. package/dist/open/api/jump/index.ts +1 -0
  80. package/dist/open/api/jump/minPath.ts +1 -0
  81. package/dist/open/api/jump/side.ts +1 -0
  82. package/dist/open/api/jump/webUrl.ts +1 -0
  83. package/dist/open/api/jump copy.ts +1 -0
  84. package/dist/open/api/moduleUtil.ts +1 -1
  85. package/dist/open/api/request.ts +1 -0
  86. package/dist/open/api/shopMember.ts +1 -0
  87. package/dist/open/api/track.ts +1 -1
  88. package/dist/open/api/userToken.ts +1 -0
  89. package/dist/open/api/util.ts +1 -1
  90. package/dist/open/components/index.ts +1 -1
  91. package/dist/service/bMallConst.ts +1 -0
  92. package/dist/service/bMallConst.weapp.ts +1 -0
  93. package/dist/service/fetchGateway.ts +1 -0
  94. package/dist/service/fetchJsonp.ts +1 -0
  95. package/dist/service/http/colorSign.ts +1 -0
  96. package/dist/service/http/colorSign.weapp.ts +1 -0
  97. package/dist/service/http/const.ts +1 -0
  98. package/dist/service/http/http.ts +1 -0
  99. package/dist/service/http/httpInterceptors.jd.ts +1 -0
  100. package/dist/service/http/httpInterceptors.ts +1 -0
  101. package/dist/service/http/index.ts +1 -0
  102. package/dist/service/requestServer.ts +1 -0
  103. package/dist/utils/connectNativeJsBridge.ts +1 -1
  104. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  105. package/dist/utils/h5Utils.ts +1 -1
  106. package/dist/utils/index.h5.ts +1 -1
  107. package/dist/utils/index.ts +1 -1
  108. package/dist/utils/index.weapp.ts +1 -1
  109. package/dist/utils/intersectionObserver.ts +1 -1
  110. package/dist/utils/jm-common.js +1 -1
  111. package/dist/utils/memberFormatUtils.js +1 -0
  112. package/dist/utils/priceUtils.js +1 -0
  113. package/dist/utils/ready.ts +1 -0
  114. package/dist/utils/utils.ts +1 -1
  115. package/package.json +9 -5
  116. package/dist/components/base/Price/index.module.scss +0 -136
  117. package/dist/open/api/jump.ts +0 -1
@@ -1 +1 @@
1
- import global from '../common'
1
+ import global from '../common'
2
2
  BUSINESS_TYPE,
3
3
  SHOP_MENU_ID_TYPE,
4
4
  SHOP_MENU_ID_NAME,
5
5
  SECTION_HOME_TAB_TYPE,
6
6
  SECTION_HOME_TAB_NAME_TYPE,
7
7
  objectToUrlEncode,
8
8
  parseQueryUrlString,
9
9
  filterUrlQueryData,
10
10
  routerInfo: {
11
11
  params: {},
12
12
  },
13
13
  nativeEvent: null,
14
14
  jumpConfig: {
15
15
  venderId: null,
16
16
  shopId: null,
17
17
  sourceValue: '',
18
18
  sourceType: 'M-H5',
19
19
  activityType: 'shopx',
20
20
  moduleId: 'none',
21
21
  entrance: 'none',
22
22
  },
23
23
  logPageParamStr: '',
24
24
  public logPageId: string
25
25
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
26
26
  getConfig(opt) {
27
27
  return Object.assign(this, {}, defaultConfig, opt)
28
28
  }
29
29
  updateInfo(
30
30
  routerInfo,
31
31
  logPname = LogPnameInfo.HOME,
32
32
  pageId = LogPageIdInfo.APP,
33
33
  ) {
34
34
  this.routerInfo = routerInfo
35
35
  this.logPname = logPname
36
36
  this.jumpConfig = Object.assign(
37
37
  {},
38
38
  this.jumpConfig,
39
39
  filterUrlQueryData(routerInfo?.params || {}),
40
40
  )
41
41
  this.logPageId = pageId
42
42
  }
43
43
 
44
44
  reportInfoPv(
45
45
  pageId = LogPageIdInfo.APP,
46
46
  opt: {
47
47
  pageParam?: any
48
48
  } = {},
49
49
  ) {
50
50
  const { pageParam } = opt
51
51
  const pageParamStr =
52
52
  typeof pageParam === 'object' ? JSON.stringify(pageParam) : pageParam
53
53
  this.logPageParamStr = pageParamStr
54
54
  ? pageParamStr
55
55
  : JSON.stringify(this.jumpConfig)
56
56
  return reportPV({
57
57
  pageId,
58
58
  pageParam: this.logPageParamStr,
59
59
  ...opt,
60
60
  })
61
61
  }
62
62
 
63
63
  jdJumpToProduct(skuIds, logEventInfo) {
64
64
  skuIds = skuIds.toString().trim()
65
65
  const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds
66
66
  this.jdNavigateToNative(
67
67
  `${this.jumpWebUrl.detail}${getSkuId}.html`,
68
68
  logEventInfo,
69
69
  )
70
70
  }
71
71
 
72
72
  jdJumpToRankList(contentId: string | number, rankType = 10, logEventInfo) {
73
73
  const rankUrl = `${this.jumpWebUrl.rank}?contentId=${contentId}&sku=&rankType=${rankType}&fromName=dcpws&hideAd=1`
74
74
  this.jdNavigateToNative(rankUrl, {
75
75
  contentId,
76
76
  ...logEventInfo,
77
77
  })
78
78
  }
79
79
 
80
80
  jdJumpToShopCategory(shopInfo) {
81
81
  this.jdNavigateToNative(
82
82
  `${this.jumpWebUrl.shopHome}?${objectToUrlEncode(
83
83
  this.getShopIdOrVenderIdParams(shopInfo),
84
84
  )}&tabActive=classify`,
85
85
  {
86
86
  ...shopInfo,
87
87
  },
88
88
  )
89
89
  }
90
90
 
91
91
  jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
92
92
  const getInfo = Object.assign(
93
93
  {},
94
94
  {
95
95
  shopId: global.info.queryInfo.shopId,
96
96
  venderId: global.info.queryInfo.venderId,
97
97
  },
98
98
  shopInfo,
99
99
  )
100
100
  this.jdNavigateToNative(
101
101
  `${this.jumpWebUrl.mshop}?${objectToUrlEncode(
102
102
  this.getShopIdOrVenderIdParams(getInfo),
103
103
  )}`,
104
104
  {
105
105
  ...getInfo,
106
106
  },
107
107
  )
108
108
  }
109
109
 
110
110
  jdJumpToShopLight(shopInfo) {
111
111
  this.jdNavigateToNative(
112
112
  `${this.jumpWebUrl.shopLight}?${objectToUrlEncode(
113
113
  this.getShopIdOrVenderIdParams(shopInfo),
114
114
  )}`,
115
115
  {
116
116
  ...shopInfo,
117
117
  },
118
118
  )
119
119
  }
120
120
 
121
121
  jdJumpToShopMember(shopInfo) {
122
122
  const getShopInfo = this.getShopIdOrVenderIdParams(shopInfo)
123
123
  this.jdJumpToWeb(
124
124
  `${this.jumpWebUrl.shopMember}?${objectToUrlEncode(
125
125
  getShopInfo,
126
126
  )}&venderType=1&channel=406`,
127
127
  shopInfo,
128
128
  )
129
129
  }
130
130
 
131
131
  jdJumpToShopMemberCard(shopInfo) {
132
132
  const getShopInfo = this.getShopIdOrVenderIdParams(shopInfo)
133
133
  this.jdJumpToWeb(
134
134
  `${this.jumpWebUrl.shopMember}?${objectToUrlEncode(getShopInfo)}`,
135
135
  shopInfo,
136
136
  )
137
137
  }
138
138
 
139
139
  jdJumpToTotalPromotion(shopInfo) {
140
140
  const { url, logEventInfo } = shopInfo
141
141
  if (this.isOpenJdAppUrl(url)) {
142
142
  const getOpenAppParams: any = this.jdOpenAppParams(url)
143
143
  if (getOpenAppParams) {
144
144
  if (getOpenAppParams?.activityId) {
145
145
  this.jdJumpToWeb(
146
146
  `${this.jumpWebUrl.totalPromotion}?activity_id=${getOpenAppParams?.activityId}`,
147
147
  shopInfo,
148
148
  )
149
149
  }
150
150
  }
151
151
  } else {
152
152
  this.jdJumpToWeb(url, logEventInfo)
153
153
  }
154
154
  }
155
155
 
156
156
  jdJumpToDongDongChat(paramInfo) {
157
157
  const getInfo = Object.assign(
158
158
  {},
159
159
  {
160
160
  venderId: global.info.queryInfo.venderId,
161
161
  },
162
162
  paramInfo,
163
163
  )
164
164
  const { venderId = '1', entry = 'm_shop', ...otherInfo } = getInfo
165
165
  const dongdongUrl = `${this.jumpWebUrl.dongDongChat}?venderId=${venderId}&entry=${entry}&sceneval=2`
166
166
  this.jdJumpToWeb(dongdongUrl, otherInfo)
167
167
  }
168
168
 
169
169
  jdJumpToShopDetail(shopInfo) {
170
170
  const getInfo = Object.assign(
171
171
  {},
172
172
  {
173
173
  shopId: global.info.queryInfo.shopId,
174
174
  venderId: global.info.queryInfo.venderId,
175
175
  },
176
176
  shopInfo,
177
177
  )
178
178
  const getShopInfo = this.getShopIdOrVenderIdParams(getInfo)
179
179
  this.jdJumpToWeb(
180
180
  `${this.jumpWebUrl.shopIntroduce}?${objectToUrlEncode(getShopInfo)}`,
181
181
  getInfo,
182
182
  )
183
183
  }
184
184
 
185
185
  jdJumpToShopSearch(shopInfo) {
186
186
  const getInfo = Object.assign(
187
187
  {},
188
188
  {
189
189
  shopId: global.info.queryInfo.shopId,
190
190
  venderId: global.info.queryInfo.venderId,
191
191
  },
192
192
  shopInfo,
193
193
  )
194
194
  const { shopId, categoryId, keyword, pageId, description, shopName } =
195
195
  getInfo
196
196
  const cateId = categoryId ? `&cateId=${typeof categoryId === 'string' ? categoryId?.trim() : categoryId}` : ''
197
197
  const addKeyWord = keyword ? `&keyword=${keyword}` : ''
198
198
  const addPageId = pageId ? `&pageId=${pageId}` : ''
199
199
  const searchDes = description ? `&description=${description}` : ''
200
200
  const shopNameDes = shopName ? `&shopName=${shopName}` : ''
201
201
  const searchType = categoryId ? 5 : keyword ? 4 : 3
202
202
  this.jdJumpToWeb(
203
203
  `${this.jumpWebUrl.shopSearch}?shopId=${shopId}&searchType=${searchType}${cateId}${addKeyWord}${addPageId}${searchDes}${shopNameDes}`,
204
204
  getInfo,
205
205
  )
206
206
  }
207
207
 
208
208
  jdJumpToWeb(
209
209
  url,
210
210
  logEventInfo,
211
211
  successBack?: Function | undefined,
212
212
  failBack?: Function | undefined,
213
213
  ) {
214
214
  console.log('web.base.ts - jdJumpToWeb')
215
215
  this.jdNavigateToNative(
216
216
  url,
217
217
  {
218
218
  ...logEventInfo,
219
219
  },
220
220
  successBack,
221
221
  failBack,
222
222
  )
223
223
  }
224
224
 
225
225
  jdJumpToWebInner(url, logEventInfo) {
226
226
  this.jdJumpToWeb(url, logEventInfo)
227
227
  }
228
228
 
229
229
  jdJumpToLive(liveInfo, logEventInfo = {}) {
230
230
  if (liveInfo?.liveId) {
231
231
  this.jdJumpToWeb(
232
232
  `${this.jumpWebUrl.mLive}/${liveInfo?.liveId}?origin=30`,
233
233
  logEventInfo,
234
234
  )
235
235
  }
236
236
  }
237
237
 
238
238
  jdJumpToShopActivity(shopInfo) {
239
239
  const { configDataValue, logEventInfo, projectId } = shopInfo
240
240
  if (projectId && configDataValue) {
241
241
  this.jdJumpToWeb(
242
242
  `${this.jumpWebUrl.shopSecondActivity}${configDataValue.data}.html`,
243
243
  logEventInfo,
244
244
  )
245
245
  }
246
246
  }
247
247
 
248
248
  jdJumpToActivityPlace(spUrl, logEventInfo) {
249
249
  this.jdNavigateToNative(spUrl, logEventInfo)
250
250
  }
251
251
 
252
252
  jdJumpConfigUrl(detail, logEventInfo = {}) {
253
253
  const { configDataType, configDataValue } = detail
254
254
  console.log(
255
255
  'jdJumpConfigUrl web.base configDataType:',
256
256
  configDataType,
257
257
  configDataValue,
258
258
  )
259
259
  switch (configDataType) {
260
260
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
261
261
  if(logEventInfo?.jsonParam?.logBaseInfo?.mInfo){
262
262
  logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds
263
263
  }
264
264
  this.jdJumpToProduct(configDataValue.skuIds, logEventInfo)
265
265
  break
266
266
  case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
267
267
  this.jdJumpToWeb(
268
268
  `${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
269
269
  {},
270
270
  )
271
271
  break
272
272
  case LinkConfigType.CONFIG_TYPE_CATEGORY:
273
273
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
274
274
  const getShopSearchParams = this.jdOpenAppParams(
275
275
  configDataValue.clickUrl,
276
276
  )
277
277
  getShopSearchParams &&
278
278
  this.jdJumpToShopSearch(
279
279
  Object.assign({}, getShopSearchParams, {
280
280
  logEventInfo,
281
281
  }),
282
282
  )
283
283
  } else {
284
284
  this.jdJumpToShopSearch(
285
285
  configDataValue['cid']
286
286
  ? Object.assign(
287
287
  {},
288
288
  {
289
289
  shopId: global.info.queryInfo.shopId,
290
290
  categoryId: configDataValue.cid,
291
291
  ...configDataValue,
292
292
  logEventInfo,
293
293
  },
294
294
  )
295
295
  : {
296
296
  shopId: global.info.queryInfo.shopId,
297
297
  logEventInfo,
298
298
  },
299
299
  )
300
300
  }
301
301
  break
302
302
  case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
303
303
  this.jdJumpToShopCategory({
304
304
  ...configDataValue,
305
305
  logEventInfo,
306
306
  })
307
307
  break
308
308
  case LinkConfigType.CONFIG_TYPE_MEMBER:
309
309
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
310
310
  const getShopMemberParams = this.jdOpenAppParams(
311
311
  configDataValue.clickUrl,
312
312
  )
313
313
  getShopMemberParams &&
314
314
  this.jdJumpToShopMember(
315
315
  Object.assign({}, getShopMemberParams, {
316
316
  logEventInfo,
317
317
  }),
318
318
  )
319
319
  } else {
320
320
  this.jdJumpToShopMember({
321
321
  shopId: global.info.queryInfo.shopId,
322
322
  venderId: configDataValue.shopDetail,
323
323
  logEventInfo,
324
324
  })
325
325
  }
326
326
  break
327
327
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
328
328
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
329
329
  const getShopActivityParams = this.jdOpenAppParams(
330
330
  configDataValue.clickUrl,
331
331
  )
332
332
  if (
333
333
  getShopActivityParams &&
334
334
  getShopActivityParams['des'] == 'jshopActivity'
335
335
  ) {
336
336
  this.jdJumpToShopActivity({
337
337
  projectId: configDataValue['projectId'],
338
338
  configDataValue,
339
339
  logEventInfo,
340
340
  })
341
341
  }
342
342
  } else if (configDataValue['projectId']) {
343
343
  this.jdJumpToShopActivity({
344
344
  projectId: configDataValue['projectId'],
345
345
  configDataValue,
346
346
  logEventInfo,
347
347
  })
348
348
  }
349
349
  break
350
350
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
351
351
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON:
352
352
  const _url = configDataValue.linkUrl
353
353
  const isProductM = /item\.m\.jd\.com/.test(_url)
354
354
  const isProductPC = /item\.jd\.com/.test(_url)
355
355
  if (
356
356
  _url.indexOf('to=') === -1 &&
357
357
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
358
358
  ) {
359
359
  const _shopId = _url.match(/\d+/g)[0]
360
360
  this.jdJumpToShopHome({
361
361
  shopId: `${_shopId}`,
362
362
  logEventInfo,
363
363
  })
364
364
  } else if (this.isOpenJdAppUrl(_url)) {
365
365
  const getOpenAppParams: any = this.jdOpenAppParams(_url)
366
366
  if (getOpenAppParams) {
367
367
  if (getOpenAppParams.jumpTab == 'allProduct') {
368
368
  this.jdJumpToTabAllProduct(
369
369
  global.info.queryInfo.shopId,
370
370
  global.info.queryInfo.venderId,
371
371
  )
372
372
  } else if (
373
373
  getOpenAppParams.des == 'productList' &&
374
374
  getOpenAppParams.from == 'couponBatch'
375
375
  ) {
376
376
  this.jdJumpToCouponSearchProductList(getOpenAppParams?.couponId)
377
377
  } else if (getOpenAppParams.des == 'vapp') {
378
378
  this.jdJumpToWeb(
379
379
  `https:
380
380
  getOpenAppParams.category
381
381
  }&des=${getOpenAppParams.des}&vapptype=${
382
382
  getOpenAppParams.vapptype
383
383
  }&appId=${getOpenAppParams.appId}&path=${
384
384
  getOpenAppParams.path
385
385
  }&param=${encodeURI(JSON.stringify(getOpenAppParams.param))}`,
386
386
  logEventInfo,
387
387
  )
388
388
  } else {
389
389
  this.jdNavigateToNative(
390
390
  '',
391
391
  Object.assign({}, getOpenAppParams, {
392
392
  logEventInfo,
393
393
  }),
394
394
  )
395
395
  }
396
396
  }
397
397
  } else if (isProductM || isProductPC) {
398
398
  const skuid = _url.match(/\d+/g)[0]
399
399
  if (skuid) {
400
400
  this.jdJumpToProduct(skuid, logEventInfo)
401
401
  }
402
402
  } else {
403
403
  this.jdJumpToWeb(_url, logEventInfo)
404
404
  }
405
405
  break
406
406
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
407
407
  this.jdJumpToShopDetail({
408
408
  venderId: global.info.queryInfo.venderId,
409
409
  shopId: global.info.queryInfo.shopId,
410
410
  logEventInfo,
411
411
  })
412
412
  break
413
413
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
414
414
  this.jdJumpToShopHome({
415
415
  ...configDataValue,
416
416
  logEventInfo,
417
417
  })
418
418
  break
419
419
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
420
420
  break
421
421
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
422
422
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
423
423
  const getShoppingGuideParams = this.jdOpenAppParams(
424
424
  configDataValue.clickUrl,
425
425
  )
426
426
  getShoppingGuideParams &&
427
427
  this.jdJumpToShopActivity(
428
428
  Object.assign({}, getShoppingGuideParams, {
429
429
  logEventInfo,
430
430
  }),
431
431
  )
432
432
  }
433
433
  break
434
434
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
435
435
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '')
436
436
  const search = linkUrl.match(/\?.+/)
437
437
  if (search) {
438
438
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
439
439
  parseQueryUrlString(linkUrl)
440
440
  try {
441
441
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param)
442
442
  } catch (e) {
443
443
  console.warn('解析小程序 param 错误:', miniQueryData.param)
444
444
  }
445
445
  this.jdJumpToMiniProgram(miniQueryData)
446
446
  } else {
447
447
  console.warn('小程序地址错误:', linkUrl)
448
448
  }
449
449
  break
450
450
  }
451
451
  default:
452
452
  }
453
453
  }
454
454
 
455
455
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
456
456
  console.log('web.base.ts - jdJumpToTabAllProduct')
457
457
  if(typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId
458
458
  if(typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId
459
459
  this.jdJumpToWeb(
460
460
  `${this.jumpWebUrl.shopHome}?shopId=${shopId}&venderId=${venderId}&tabActive=home-product`,
461
461
  logEventInfo,
462
462
  )
463
463
  }
464
464
 
465
465
  jdJumpToTabAllProductInner(shopId, venderId, logEventInfo = {}) {
466
466
  if(typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId
467
467
  if(typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId
468
468
  this.jdJumpToTabAllProduct(shopId, venderId, logEventInfo)
469
469
  }
470
470
 
471
471
  jdJumpToTopTabBase(type, shopInfo = {}) {
472
472
  const getInfo = Object.assign(
473
473
  {},
474
474
  {
475
475
  shopId: global.info.queryInfo.shopId,
476
476
  venderId: global.info.queryInfo.venderId,
477
477
  },
478
478
  shopInfo,
479
479
  )
480
480
  this.jdJumpToWeb(
481
481
  `${this.jumpWebUrl.shopHome}?${objectToUrlEncode(
482
482
  this.getShopIdOrVenderIdParams(getInfo),
483
483
  )}&tabActive=${type}`,
484
484
  getInfo,
485
485
  )
486
486
  }
487
487
 
488
488
  jdJumpToTabNew(shopInfo = {}) {
489
489
  console.log('上新tab')
490
490
  this.jdJumpToTopTabBase(
491
491
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_NEW_PRODUCT],
492
492
  shopInfo,
493
493
  )
494
494
  }
495
495
 
496
496
  jdJumpToTabNewInner(shopInfo = {}) {
497
497
  this.jdJumpToTabNew(shopInfo)
498
498
  }
499
499
 
500
500
  jdJumpToTabRank(shopInfo = {}) {
501
501
  console.log('榜单tab')
502
502
  this.jdJumpToTopTabBase(
503
503
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_RANK],
504
504
  shopInfo,
505
505
  )
506
506
  }
507
507
  jdJumpToTabRankInner(shopInfo = {}) {
508
508
  this.jdJumpToTabRank(shopInfo)
509
509
  }
510
510
  jdJumpToTabBuyerShow(shopInfo = {}) {
511
511
  console.log('买家秀tab')
512
512
  this.jdJumpToTopTabBase(
513
513
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_BUYER_SHOW],
514
514
  shopInfo,
515
515
  )
516
516
  }
517
517
  jdJumpToTabBuyerShowInner(shopInfo = {}) {
518
518
  this.jdJumpToTabBuyerShow(shopInfo)
519
519
  }
520
520
  jdJumpToTabActivity(shopInfo = {}) {
521
521
  console.log('活动tab')
522
522
  this.jdJumpToTopTabBase(
523
523
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_ACTIVITY],
524
524
  shopInfo,
525
525
  )
526
526
  }
527
527
  jdJumpToTabActivityInner(shopInfo = {}) {
528
528
  this.jdJumpToTabActivity(shopInfo)
529
529
  }
530
530
  jdJumpToTabSecKill(shopInfo = {}) {
531
531
  console.log('秒杀tab')
532
532
  this.jdJumpToTopTabBase(
533
533
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_SECKILL],
534
534
  shopInfo,
535
535
  )
536
536
  }
537
537
  jdJumpToTabSecKillInner(shopInfo = {}) {
538
538
  this.jdJumpToTabSecKill(shopInfo)
539
539
  }
540
540
 
541
541
  jdJumpToBottomTabBase(type, shopInfo = {}) {
542
542
  this.jdJumpToTopTabBase(type, shopInfo)
543
543
  }
544
544
  jdJumpToBottomTabProduct(shopInfo = {}) {
545
545
  this.jdJumpToBottomTabBase(
546
546
  SHOP_MENU_ID_NAME[SHOP_MENU_ID_TYPE.PRODUCT],
547
547
  shopInfo,
548
548
  )
549
549
  }
550
550
  jdJumpToBottomTabCategory(shopInfo = {}) {
551
551
  this.jdJumpToBottomTabBase(
552
552
  SHOP_MENU_ID_NAME[SHOP_MENU_ID_TYPE.CLASSIFY],
553
553
  shopInfo,
554
554
  )
555
555
  }
556
556
  jdJumpToBottomTabFind(shopInfo = {}) {
557
557
  console.log('发现tab')
558
558
  }
559
559
  jdJumpToBottomTabBrandMember(shopInfo = {}) {
560
560
  const getInfo = Object.assign(
561
561
  {},
562
562
  {
563
563
  shopId: global.info.queryInfo.shopId,
564
564
  venderId: global.info.queryInfo.venderId,
565
565
  },
566
566
  shopInfo,
567
567
  )
568
568
  this.jdJumpToWeb(
569
569
  `${this.jumpWebUrl.shopMember}?${objectToUrlEncode(
570
570
  this.getShopIdOrVenderIdParams(getInfo),
571
571
  )}`,
572
572
  getInfo,
573
573
  )
574
574
  }
575
575
  jdJumpToBottomTabBrandMemberInner(shopInfo = {}) {
576
576
  this.jdJumpToBottomTabBrandMember(shopInfo)
577
577
  }
578
578
 
579
579
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
580
580
  this.jdJumpToWeb(
581
581
  `${this.jumpWebUrl.couponSearch}?couponbatch=${couponId}&sceneval=2`,
582
582
  logEventInfo,
583
583
  )
584
584
  }
585
585
 
586
586
  jdNavigateToNative(
587
587
  url: string,
588
588
  params: {
589
589
  logEventInfo?: object
590
590
  } = {},
591
591
  successBack?: Function | undefined,
592
592
  failBack?: Function | undefined,
593
593
  ) {
594
594
  const { logEventInfo } = params
595
595
  const getEparam = logEventInfo || params
596
596
  console.log(`url:::::::${url}`)
597
597
  global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
598
598
  this.clickEventLog(getEparam)
599
599
  .then(() => {
600
600
  typeof successBack == 'function'
601
601
  ? successBack(url)
602
602
  : (window.location.href = url)
603
603
  })
604
604
  .catch(() => {
605
605
  typeof failBack == 'function' && failBack(url)
606
606
  })
607
607
  }
608
608
 
609
609
  clickEventLog(
610
610
  opts: JumpEventReportInterFace.OptEventLogParams = {},
611
611
  reportKey = 'click',
612
612
  ) {
613
613
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
614
614
  ;/TerminatorNew_/.test(`${eventId}`) &&
615
615
  console.log(`当前h5的楼层模块eventId为====${eventId}`)
616
616
  if (eventId && jsonParam) {
617
617
  const { etModelInfo, logBaseInfo } = jsonParam
618
618
  const getJsonParam =
619
619
  etModelInfo && logBaseInfo
620
620
  ? logBaseInfo
621
621
  : Object.assign(
622
622
  {},
623
623
  {
624
624
  shopid: global.info.queryInfo?.shopId,
625
625
  },
626
626
  jsonParam,
627
627
  )
628
628
  const webLogParams = {
629
629
  eid: eventId,
630
630
  elevel: eventLevel,
631
631
  jsonParam: JSON.stringify(getJsonParam),
632
632
  etModel: JSON.stringify(etModelInfo || {}),
633
633
  pageId: this.logPageId,
634
634
  pageParam: this.logPageParamStr,
635
635
  ...otherParams,
636
636
  }
637
637
  return /click|exposure/.test(reportKey)
638
638
  ? reportClick(webLogParams)
639
639
  : reportToCart(opts, webLogParams)
640
640
  } else {
641
641
  console.log('暂无埋点参数eventId和jsonParam')
642
642
  return Promise.resolve(false)
643
643
  }
644
644
  }
645
645
 
646
646
  exposureEventLog(opts) {
647
647
  return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
648
648
  ? this.clickEventLog(
649
649
  {
650
650
  ...opts,
651
651
  exposureState: true,
652
652
  },
653
653
  'exposure',
654
654
  )
655
655
  : Promise.resolve(false)
656
656
  }