@conecli/cone-render 0.10.1-shop-beta.23 → 0.10.1-shop-beta.26

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 (128) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/accessibility.h5.ts +1 -0
  3. package/dist/common/accessibility.ts +0 -0
  4. package/dist/common/const.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/jdplayerSdk.weapp.tsx +1 -0
  10. package/dist/common/jssdk.weapp.ts +1 -0
  11. package/dist/common/pageType.ts +1 -1
  12. package/dist/common/token/index.h5.ts +1 -1
  13. package/dist/common/token/token.jd.ts +1 -1
  14. package/dist/common/wxappApi.ascf.ts +1 -0
  15. package/dist/components/ErrorBoundary.tsx +1 -1
  16. package/dist/components/base/CountDown/index.tsx +1 -1
  17. package/dist/components/base/CustomVideo/index.tsx +1 -1
  18. package/dist/components/base/CustomVideo/index.weapp.tsx +1 -0
  19. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  20. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  21. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  22. package/dist/components/base/InOrOutViewObserver/index.weapp.tsx +1 -0
  23. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  24. package/dist/components/base/JdLoading/index.module.scss +0 -2
  25. package/dist/components/base/JdLoading/index.tsx +1 -1
  26. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  27. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  28. package/dist/components/base/LazyLoadImage/index.tsx +1 -1
  29. package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
  30. package/dist/components/base/MobileCommonHeader/index.weapp.tsx +1 -0
  31. package/dist/components/base/NetworkDataError/const.ts +1 -1
  32. package/dist/components/base/NetworkDataError/index.module.scss +1 -1
  33. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  34. package/dist/components/base/Price/Base/index.tsx +1 -1
  35. package/dist/components/base/Price/Double/index.module.scss +1 -1
  36. package/dist/components/base/Price/Double/index.tsx +1 -1
  37. package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
  38. package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
  39. package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
  40. package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
  41. package/dist/components/floorItem.tsx +1 -1
  42. package/dist/components/isv/Floor/index.tsx +1 -1
  43. package/dist/components/remoteFloorItem.tsx +1 -1
  44. package/dist/config/env.ts +1 -1
  45. package/dist/interface/common.ts +1 -1
  46. package/dist/interface/component.ts +1 -1
  47. package/dist/interface/jumpEventReport.ts +1 -1
  48. package/dist/interface/service.ts +1 -1
  49. package/dist/jumpEventReport/base.ts +1 -1
  50. package/dist/jumpEventReport/const.ts +1 -1
  51. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  52. package/dist/jumpEventReport/index.h5.ts +1 -1
  53. package/dist/jumpEventReport/index.ts +1 -1
  54. package/dist/jumpEventReport/index.weapp.ts +1 -1
  55. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  56. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  57. package/dist/jumpEventReport/logEventConfig.h5.ts +1 -0
  58. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  59. package/dist/jumpEventReport/web/report.ts +1 -1
  60. package/dist/jumpEventReport/web.base.ts +1 -1
  61. package/dist/jumpEventReport/web.jd.ts +1 -1
  62. package/dist/jumpEventReport/web.pc.ts +1 -1
  63. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  64. package/dist/language/en_US.json +233 -83
  65. package/dist/language/zh_CN.json +232 -82
  66. package/dist/language/zh_HK.json +232 -82
  67. package/dist/libs/openShopBridge.js +161 -0
  68. package/dist/libs/openShopBridge.min.js +1 -0
  69. package/dist/libs/taroAppReport.js +2 -2
  70. package/dist/modules/ContainerFloorList/index.h5.module.scss +16 -2
  71. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  72. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  73. package/dist/modules/DecorateContainerFloorList/index.weapp.tsx +1 -0
  74. package/dist/open/api/index.ts +1 -1
  75. package/dist/open/api/shopMember.ts +1 -1
  76. package/dist/open/api/shopMember.weapp.ts +1 -0
  77. package/dist/open/api/track.ts +1 -1
  78. package/dist/open/api/util.ts +1 -1
  79. package/dist/open/components/index.ts +1 -1
  80. package/dist/open/index.ts +1 -1
  81. package/dist/sass/app.h5.scss +6 -1
  82. package/dist/sass/base.scss +8 -4
  83. package/dist/service/fetchGateway.ts +1 -1
  84. package/dist/service/fetchGateway.weapp.ts +1 -1
  85. package/dist/service/fetchJsonp.ts +1 -1
  86. package/dist/service/fetchJsonp.weapp.ts +1 -0
  87. package/dist/service/http/h5Http.ts +1 -1
  88. package/dist/service/http/http.ts +1 -1
  89. package/dist/service/http/httpInterceptors.weapp.ts +1 -0
  90. package/dist/service/requestServer.h5.ts +1 -1
  91. package/dist/service/requestServer.ts +1 -1
  92. package/dist/service/requestServer.weapp.ts +1 -1
  93. package/dist/utils/connectNativeJsBridge.ts +1 -1
  94. package/dist/utils/h5Utils.ts +1 -1
  95. package/dist/utils/harmonyCallRouter.h5.ts +1 -0
  96. package/dist/utils/harmonyCallRouter.ts +0 -0
  97. package/dist/utils/index.h5.ts +1 -1
  98. package/dist/utils/index.ts +1 -1
  99. package/dist/utils/index.weapp.ts +1 -1
  100. package/dist/utils/intersectionObserver.ts +1 -1
  101. package/dist/utils/sColor.weapp.ts +1 -0
  102. package/dist/utils/utils.ts +1 -1
  103. package/package.json +36 -38
  104. package/dist/common/index.dynamic.ts +0 -1
  105. package/dist/components/base/Dialog/index.dynamic.module.scss +0 -126
  106. package/dist/components/base/Dialog/index.dynamic.tsx +0 -1
  107. package/dist/components/base/DynamicTest/index.dynamic.module.scss +0 -15
  108. package/dist/components/base/DynamicTest/index.module.scss +0 -16
  109. package/dist/components/base/DynamicTest/index.tsx +0 -1
  110. package/dist/components/base/LazyLoadImage/index.dynamic.module.scss +0 -40
  111. package/dist/components/base/LazyLoadImage/index.dynamic.tsx +0 -1
  112. package/dist/components/base/NetworkDataError/index.dynamic.module.scss +0 -95
  113. package/dist/components/base/NetworkDataError/index.dynamic.tsx +0 -1
  114. package/dist/components/base/Price/Base/index.dynamic.module.scss +0 -63
  115. package/dist/components/base/Price/Base/index.dynamic.tsx +0 -1
  116. package/dist/components/base/Price/Double/index.dynamic.module.scss +0 -172
  117. package/dist/components/base/Price/Double/index.dynamic.tsx +0 -1
  118. package/dist/jumpEventReport/index.dynamic.ts +0 -1
  119. package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
  120. package/dist/open/api/shopMember.dynamic.ts +0 -1
  121. package/dist/open/components/index.dynamic.ts +0 -1
  122. package/dist/sass/app.dynamic.scss +0 -306
  123. package/dist/service/fetchGateway.h5.ts +0 -1
  124. package/dist/service/fetchJsonp.h5.ts +0 -1
  125. package/dist/service/http/colorSign.dynamic.ts +0 -1
  126. package/dist/utils/connectNativeJsBridge.dynamic.ts +0 -1
  127. package/dist/utils/priceUtils.js +0 -1
  128. /package/dist/utils/{sColor.js → sColor.ts} +0 -0
@@ -1 +1 @@
1
- import { JdJumpJdApp } from './jdJumpJdApp';
2
1
  isAppHomeForMarketPage,
3
2
  isJdAndHarmonyDevice,
4
3
  isNewHarmonyShop,
5
4
  parseQueryUrlString,
6
5
  objectToUrlEncode,
7
6
  routerInfo: {
8
7
  params: {},
9
8
  },
10
9
  nativeEvent: null,
11
10
  jumpConfig: {
12
11
  venderId: null,
13
12
  shopId: null,
14
13
  sourceValue: '',
15
14
  sourceType: 'App-H5',
16
15
  activityType: 'shopx',
17
16
  moduleId: 'none',
18
17
  entrance: 'none',
19
18
  },
20
19
  logPageParamStr: '',
21
20
  public logPageId: string;
22
21
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig;
23
22
  constructor(opt = {}) {
24
23
  super(opt);
25
24
  this.getConfig(opt);
26
25
  }
27
26
  getConfig(opt = {}) {
28
27
  return Object.assign(this, {}, defaultConfig, opt);
29
28
  }
30
29
  updateInfo(routerInfo, logPname = LogPnameInfo.HOME, pageId = LogPageIdInfo.APP) {
31
30
  this.logPageId = pageId;
32
31
  this.routerInfo = routerInfo;
33
32
  this.jumpConfig = Object.assign({}, this.jumpConfig, routerInfo.params);
34
33
  this.logPname = logPname;
35
34
  }
36
35
  reportInfoPv(
37
36
  pageId = LogPageIdInfo.APP,
38
37
  opt: {
39
38
  pageParam?: any;
40
39
  } = {},
41
40
  ) {
42
41
  const { pageParam } = opt;
43
42
  this.logPageParamStr = pageParam
44
43
  ? pageParam
45
44
  : this.creatParamToLogStr(this.jumpConfig)
46
45
  .replace(/moduleId/, 'JumpmoduleID')
47
46
  .replace(/entrance/, 'Jumpentrance');
48
47
  reportPV({
49
48
  pageId,
50
49
  pageParam: this.logPageParamStr,
51
50
  ...opt,
52
51
  });
53
52
  }
54
53
 
55
54
  jdJumpToDongDongChatGroup(groupId, source = '4') {
56
55
  this.jdNavigateToNative({
57
56
  category: 'jump',
58
57
  des: 'dongdong_group_chat',
59
58
  source: source,
60
59
  groupId: `${groupId}`,
61
60
  });
62
61
  }
63
62
 
64
63
  jdJumpToWeb(
65
64
  url,
66
65
  logEventInfo,
67
66
  successBack?: functionType | undefined,
68
67
  failBack?: functionType | undefined,
69
68
  ) {
70
69
  console.log('jd web', this.isOpenJdAppUrl(url), url);
71
70
  if (this.isOpenJdAppUrl(url)) {
72
71
  const getOpenAppParams = this.jdOpenAppParams(url);
73
72
  console.log('jd web 获取自定义openApp链接解析后的参数结果', getOpenAppParams);
74
73
  if (getOpenAppParams) {
75
74
  this.jdNavigateToNative(
76
75
  Object.assign({}, getOpenAppParams, {
77
76
  logEventInfo,
78
77
  }),
79
78
  );
80
79
  }
81
80
  } else {
82
81
  let _getLastUrl = url;
83
82
  if (/shop\.m\.jd\.com|pages\.jd\.com/.test(_getLastUrl)) {
84
83
  const getUrlSearchParamState = _getLastUrl.indexOf('?') !== -1;
85
84
  if (!/jwebprog=0/.test(_getLastUrl)) {
86
85
  _getLastUrl = `${_getLastUrl}${getUrlSearchParamState ? '&' : '?'}jwebprog=0`;
87
86
  }
88
87
  if (global.info.sysInfo?.isJdTabletDevice && !/device=tablet/.test(_getLastUrl)) {
89
88
  _getLastUrl = `${_getLastUrl}${getUrlSearchParamState ? '&' : '?'}device=tablet`;
90
89
  }
91
90
  }
92
91
  super.jdJumpToWeb(
93
92
  _getLastUrl,
94
93
  {
95
94
  ...logEventInfo,
96
95
  },
97
96
  successBack,
98
97
  failBack,
99
98
  );
100
99
  }
101
100
  }
102
101
 
103
102
  jdJumpToWebInner(url, logEventInfo) {
104
103
  this.jdJumpToWeb(url, logEventInfo);
105
104
  }
106
105
 
107
106
  jdJumpConfigUrl(detail, logEventInfo = {}) {
108
107
  const { configDataType, configDataValue } = detail;
109
108
  switch (configDataType) {
110
109
  case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
111
110
  this.jdJumpToShopCategory({
112
111
  ...configDataValue,
113
112
  logEventInfo,
114
113
  });
115
114
  break;
116
115
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
117
116
  if (logEventInfo?.jsonParam?.logBaseInfo?.mInfo) {
118
117
  logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds;
119
118
  }
120
119
  this.jdJumpToProduct(configDataValue.skuIds, logEventInfo);
121
120
  break;
122
121
  case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
123
122
  this.jdJumpToWeb(
124
123
  `${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
125
124
  {},
126
125
  );
127
126
  break;
128
127
  case LinkConfigType.CONFIG_TYPE_CATEGORY:
129
128
  if (isJdAndHarmonyDevice && isNewHarmonyShop && jdAppVersionStr === '15.1.70') {
130
129
  const baseInfo = {
131
130
  shopId: global.info.queryInfo.shopId,
132
131
  venderId: global.info.queryInfo.venderId,
133
132
  };
134
133
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
135
134
  const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
136
135
  console.log('jd web 获取店铺分类链接解析后的参数结果', getShopSearchParams);
137
136
  let openAppParams =
138
137
  typeof getShopSearchParams === 'boolean'
139
138
  ? { categoryId: '', ...baseInfo }
140
139
  : getShopSearchParams;
141
140
  const getInfo = openAppParams['categoryId']
142
141
  ? { ...openAppParams, cateId: openAppParams['categoryId'] }
143
142
  : openAppParams;
144
143
  console.log('处理后的参数', objectToUrlEncode(getInfo));
145
144
  this.jdJumpToWeb(
146
145
  `${this.jumpWebUrl.shopSearch}?${objectToUrlEncode(getInfo)}`,
147
146
  logEventInfo,
148
147
  );
149
148
  } else {
150
149
  const getInfo = configDataValue['cid']
151
150
  ? { ...baseInfo, ...configDataValue, cateId: configDataValue.cid, searchType: '5' }
152
151
  : { ...baseInfo, ...configDataValue };
153
152
  this.jdJumpToWeb(
154
153
  `${this.jumpWebUrl.shopSearch}?${objectToUrlEncode(getInfo)}`,
155
154
  logEventInfo,
156
155
  );
157
156
  }
158
157
  } else {
159
158
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
160
159
  const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
161
160
  console.log('jd web 获取店铺分类链接解析后的参数结果', getShopSearchParams);
162
161
  getShopSearchParams &&
163
162
  this.jdJumpToShopSearch(
164
163
  Object.assign({}, getShopSearchParams, {
165
164
  logEventInfo,
166
165
  }),
167
166
  );
168
167
  } else {
169
168
  this.jdJumpToShopSearch(
170
169
  configDataValue['cid']
171
170
  ? Object.assign(
172
171
  {},
173
172
  {
174
173
  shopId: global.info.queryInfo.shopId,
175
174
  categoryId: configDataValue.cid,
176
175
  searchType: '5',
177
176
  logEventInfo,
178
177
  },
179
178
  )
180
179
  : {
181
180
  shopId: global.info.queryInfo.shopId,
182
181
  logEventInfo,
183
182
  },
184
183
  );
185
184
  }
186
185
  }
187
186
  break;
188
187
  case LinkConfigType.CONFIG_TYPE_MEMBER:
189
188
  if (isAppHomeForMarketPage) {
190
189
  this.jdJumpToBottomTabBrandMember({
191
190
  logEventInfo,
192
191
  });
193
192
  } else {
194
193
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
195
194
  const getShopMemberParams = this.jdOpenAppParams(configDataValue.clickUrl);
196
195
  getShopMemberParams &&
197
196
  this.jdJumpToShopMember(
198
197
  Object.assign({}, getShopMemberParams, {
199
198
  logEventInfo,
200
199
  }),
201
200
  );
202
201
  } else {
203
202
  this.jdJumpToShopMember({
204
203
  shopId: global.info.queryInfo.shopId,
205
204
  venderId: configDataValue.shopDetail,
206
205
  logEventInfo,
207
206
  });
208
207
  }
209
208
  }
210
209
  break;
211
210
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
212
211
  if (this.isNewHarmony()) {
213
212
  const url = `${domain.sale}/m/h5/${configDataValue.data}.html`;
214
213
  this.jdJumpToWeb(url, logEventInfo);
215
214
  } else {
216
215
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
217
216
  const getShopActivityParams = this.jdOpenAppParams(configDataValue.clickUrl);
218
217
  getShopActivityParams &&
219
218
  this.jdJumpToShopActivity(
220
219
  Object.assign({}, getShopActivityParams, {
221
220
  logEventInfo,
222
221
  }),
223
222
  );
224
223
  } else if (configDataValue['projectId']) {
225
224
  this.jdJumpToShopActivity({
226
225
  projectId: configDataValue['projectId'],
227
226
  configDataValue,
228
227
  logEventInfo,
229
228
  });
230
229
  }
231
230
  }
232
231
  break;
233
232
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
234
233
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
235
234
  const _url = configDataValue.linkUrl;
236
235
  if (
237
236
  _url.indexOf('to=') === -1 &&
238
237
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
239
238
  ) {
240
239
  const _shopId = _url.match(/\d+/g)[0];
241
240
  this.jdJumpToShopHome({
242
241
  shopId: `${_shopId}`,
243
242
  logEventInfo,
244
243
  });
245
244
  } else if (this.isOpenJdAppUrl(_url)) {
246
245
  const getOpenAppParams = this.jdOpenAppParams(_url);
247
246
  console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams);
248
247
  if (getOpenAppParams) {
249
248
  let _changeOpenAppParams = getOpenAppParams;
250
249
  if (isAppHomeForMarketPage) {
251
250
  const { operation, ...otherOpenAppParams } = getOpenAppParams;
252
251
  if (operation && operation === 'jumpTabInner') {
253
252
  _changeOpenAppParams = otherOpenAppParams;
254
253
  }
255
254
  }
256
255
  this.jdNavigateToNative(
257
256
  Object.assign({}, _changeOpenAppParams, {
258
257
  logEventInfo,
259
258
  }),
260
259
  );
261
260
  }
262
261
  } else {
263
262
  this.jdJumpToWeb(_url, logEventInfo);
264
263
  }
265
264
  break;
266
265
  }
267
266
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
268
267
  this.jdJumpToShopDetail({
269
268
  venderId: global.info.queryInfo.venderId,
270
269
  shopId: global.info.queryInfo.shopId,
271
270
  logEventInfo,
272
271
  });
273
272
  break;
274
273
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
275
274
  this.jdJumpToShopHome({
276
275
  ...configDataValue,
277
276
  logEventInfo,
278
277
  });
279
278
  break;
280
279
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
281
280
  break;
282
281
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
283
282
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
284
283
  const getShoppingGuideParams = this.jdOpenAppParams(configDataValue.clickUrl);
285
284
  getShoppingGuideParams &&
286
285
  this.jdJumpToShopActivity(
287
286
  Object.assign({}, getShoppingGuideParams, {
288
287
  logEventInfo,
289
288
  }),
290
289
  );
291
290
  }
292
291
  break;
293
292
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
294
293
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '');
295
294
  const search = linkUrl.match(/\?.+/);
296
295
  if (search) {
297
296
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
298
297
  parseQueryUrlString(linkUrl);
299
298
  try {
300
299
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param);
301
300
  } catch (e) {
302
301
  console.warn('解析小程序 param 错误:', miniQueryData.param);
303
302
  }
304
303
  this.jdJumpToMiniProgram(miniQueryData);
305
304
  } else {
306
305
  console.warn('小程序地址错误:', linkUrl);
307
306
  }
308
307
  break;
309
308
  }
310
309
  case LinkConfigType.CONFIG_TYPE_SHOP_SEARCH: {
311
310
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
312
311
  const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
313
312
  console.log('jd web 获取店铺结果落地页链接解析后的参数结果', getShopSearchParams);
314
313
  getShopSearchParams &&
315
314
  this.jdJumpToShopSearch(
316
315
  Object.assign({}, getShopSearchParams, {
317
316
  logEventInfo,
318
317
  }),
319
318
  );
320
319
  } else {
321
320
  this.jdJumpToWeb(configDataValue.clickUrl, logEventInfo);
322
321
  }
323
322
  break;
324
323
  }
325
324
  default:
326
325
  }
327
326
  }
328
327
 
329
328
  isNewHarmony() {
330
329
  return isJdAndHarmonyDevice && isNewHarmonyShop;
331
330
  }
332
331
 
333
332
  jdNavigateToNative(
334
333
  params: object,
335
334
  url = 'openapp.jdmobile://virtual',
336
335
  successBack?: functionType | null,
337
336
  failBack?: functionType | null,
338
337
  ) {
339
338
  console.log('[降级H5] jdNavigateToNative web.jd:', params);
340
339
  const getResParams: JumpEventReportInterFace.JdMiniJumpParams = Object.assign(
341
340
  {},
342
341
  {
343
342
  sourceValue: 'sourceValue_jshopModuleWeb',
344
343
  sourceType: 'sourceType_jshopModuleWeb',
345
344
  param: {},
346
345
  },
347
346
  params,
348
347
  );
349
348
  const { logEventInfo, ...otherParams } = getResParams;
350
349
  console.log('jd web 获取open协议参数 jdNavigateToNative params: ', getResParams);
351
350
  console.log('logEventInfo params: ', logEventInfo);
352
351
  global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
353
352
  this.clickEventLog(logEventInfo || getResParams)
354
353
  .then(() => {
355
354
  if (typeof successBack === 'function') {
356
355
  successBack(getResParams);
357
356
  } else {
358
357
  if (this.isNewHarmony() && params.operation === 'jumpTabInner') {
359
358
  if (params.jumpTab) {
360
359
  JumpTabBarInCurrentShop({ position: 'top', item: params.jumpTab });
361
360
  } else if (params.jumpBottomTab) {
362
361
  JumpTabBarInCurrentShop({ position: 'bottom', item: params.jumpBottomTab });
363
362
  } else {
364
363
  console.log('[降级H5] 跳转异常 params:', params);
365
364
  }
366
365
  } else if (
367
366
  this.isNewHarmony() &&
368
367
  (params.operation === 'jumpBottomTabMember' || params.des === 'jshopMember')
369
368
  ) {
370
369
  JumpTabBarInCurrentShop({ position: 'bottom', item: 'brandMember' });
371
370
  } else {
372
371
  try {
373
372
  const paramsStr = JSON.stringify(otherParams);
374
373
  console.log('跳转web jd open协议', `${url}?params=${paramsStr}`);
375
374
  window.location.href = `${url}?params=${paramsStr}`;
376
375
  } catch (e) {
377
376
  console.log('跳转异常', e);
378
377
  }
379
378
  }
380
379
  }
381
380
  })
382
381
  .catch(() => {
383
382
  typeof failBack === 'function' && failBack(getResParams);
384
383
  });
385
384
  }
386
385
 
387
386
  clickEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}, reportKey = 'click') {
388
387
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts;
389
388
  if (eventId && jsonParam) {
390
389
  const { etModelInfo, logBaseInfo } = jsonParam;
391
390
  let getJsonParam = {};
392
391
  if (etModelInfo && logBaseInfo) {
393
392
  getJsonParam = logBaseInfo;
394
393
  } else {
395
394
  if (Array.isArray(jsonParam)) {
396
395
  getJsonParam = jsonParam;
397
396
  } else {
398
397
  getJsonParam = Object.assign(
399
398
  {},
400
399
  {
401
400
  shopid: global.info.queryInfo?.shopId,
402
401
  },
403
402
  jsonParam,
404
403
  );
405
404
  }
406
405
  }
407
406
  if (
408
407
  reportKey === 'exposure' &&
409
408
  /^TerminatorNew/.test(eventId) &&
410
409
  !Array.isArray(getJsonParam)
411
410
  ) {
412
411
  getJsonParam = [getJsonParam];
413
412
  }
414
413
  const webLogParams = {
415
414
  isExpo: reportKey === 'exposure',
416
415
  eid: eventId,
417
416
  elevel: eventLevel,
418
417
  jsonParam: JSON.stringify(getJsonParam),
419
418
  etModel: JSON.stringify(etModelInfo || {}),
420
419
  pageId: this.logPageId,
421
420
  pageParam: this.logPageParamStr,
422
421
  ...otherParams,
423
422
  };
424
423
  return /click|exposure/.test(reportKey)
425
424
  ? reportClick(webLogParams)
426
425
  : reportToCart(opts, webLogParams);
427
426
  } else {
428
427
  console.log('暂无埋点参数eventId和eventParam');
429
428
  return Promise.resolve(false);
430
429
  }
431
430
  }
432
431
 
433
432
  exposureEventLog(opts) {
434
433
  return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
435
434
  ? this.clickEventLog(
436
435
  {
437
436
  ...opts,
438
437
  exposureState: true,
439
438
  },
440
439
  'exposure',
441
440
  )
442
441
  : Promise.resolve(false);
443
442
  }
443
+ import { JdJumpJdApp } from './jdJumpJdApp';
444
444
  isAppHomeForMarketPage,
445
445
  isJdAndHarmonyDevice,
446
446
  isNewHarmonyShop,
447
447
  parseQueryUrlString,
448
448
  objectToUrlEncode,
449
449
  isInJdShopView,
450
450
  routerInfo: {
451
451
  params: {},
452
452
  },
453
453
  nativeEvent: null,
454
454
  jumpConfig: {
455
455
  venderId: null,
456
456
  shopId: null,
457
457
  sourceValue: '',
458
458
  sourceType: 'App-H5',
459
459
  activityType: 'shopx',
460
460
  moduleId: 'none',
461
461
  entrance: 'none',
462
462
  },
463
463
  logPageParamStr: '',
464
464
  public logPageId: string;
465
465
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig;
466
466
  constructor(opt = {}) {
467
467
  super(opt);
468
468
  this.getConfig(opt);
469
469
  }
470
470
  getConfig(opt = {}) {
471
471
  return Object.assign(this, {}, defaultConfig, opt);
472
472
  }
473
473
  updateInfo(routerInfo, logPname = LogPnameInfo.HOME, pageId = LogPageIdInfo.APP) {
474
474
  this.logPageId = pageId;
475
475
  this.routerInfo = routerInfo;
476
476
  this.jumpConfig = Object.assign({}, this.jumpConfig, routerInfo.params);
477
477
  this.logPname = logPname;
478
478
  }
479
479
  reportInfoPv(
480
480
  pageId = LogPageIdInfo.APP,
481
481
  opt: {
482
482
  pageParam?: any;
483
483
  } = {},
484
484
  ) {
485
485
  const { pageParam, ...otherOpts } = opt;
486
486
  const pageParamStr = typeof pageParam === 'object' ? JSON.stringify(pageParam) : pageParam;
487
487
  this.logPageParamStr = pageParamStr
488
488
  ? pageParamStr
489
489
  : this.creatParamToLogStr(this.jumpConfig)
490
490
  .replace(/moduleId/, 'JumpmoduleID')
491
491
  .replace(/entrance/, 'Jumpentrance');
492
492
  reportPV({
493
493
  pageId,
494
494
  pageParam: this.logPageParamStr,
495
495
  ...otherOpts,
496
496
  });
497
497
  }
498
498
 
499
499
  jdJumpToDongDongChatGroup(groupId, source = '4') {
500
500
  this.jdNavigateToNative({
501
501
  category: 'jump',
502
502
  des: 'dongdong_group_chat',
503
503
  source: source,
504
504
  groupId: `${groupId}`,
505
505
  });
506
506
  }
507
507
 
508
508
  jdJumpToWeb(
509
509
  url,
510
510
  logEventInfo,
511
511
  successBack?: functionType | undefined,
512
512
  failBack?: functionType | undefined,
513
513
  ) {
514
514
  console.log('jd web', this.isOpenJdAppUrl(url), url);
515
515
  if (this.isOpenJdAppUrl(url)) {
516
516
  const getOpenAppParams = this.jdOpenAppParams(url);
517
517
  console.log('jd web 获取自定义openApp链接解析后的参数结果', getOpenAppParams);
518
518
  if (getOpenAppParams) {
519
519
 
520
520
  const { useEncodeParams, ...otherLogInfo } = logEventInfo || {};
521
521
  this.jdNavigateToNative(
522
522
  Object.assign({}, getOpenAppParams, {
523
523
  logEventInfo: otherLogInfo,
524
524
  useEncodeParams: Boolean(useEncodeParams),
525
525
  }),
526
526
  );
527
527
  }
528
528
  } else {
529
529
  let _getLastUrl = url;
530
530
  if (/shop\.m\.jd\.com|pages\.jd\.com/.test(_getLastUrl)) {
531
531
  const getUrlSearchParamState = _getLastUrl.indexOf('?') !== -1;
532
532
  if (!/jwebprog=0/.test(_getLastUrl)) {
533
533
  _getLastUrl = `${_getLastUrl}${getUrlSearchParamState ? '&' : '?'}jwebprog=0`;
534
534
  }
535
535
  if (global.info.sysInfo?.isJdTabletDevice && !/device=tablet/.test(_getLastUrl)) {
536
536
  _getLastUrl = `${_getLastUrl}${_getLastUrl.indexOf('?') !== -1 ? '&' : '?'}device=tablet`;
537
537
  }
538
538
  if (isInJdShopView && /sale\/home/.test(_getLastUrl)) {
539
539
  _getLastUrl = `${_getLastUrl}${_getLastUrl.indexOf('?') !== -1 ? '&' : '?'}origin=appShop`;
540
540
  }
541
541
  }
542
542
  super.jdJumpToWeb(
543
543
  _getLastUrl,
544
544
  {
545
545
  ...logEventInfo,
546
546
  },
547
547
  successBack,
548
548
  failBack,
549
549
  );
550
550
  }
551
551
  }
552
552
 
553
553
  jdJumpToWebInner(url, logEventInfo) {
554
554
  this.jdJumpToWeb(url, logEventInfo);
555
555
  }
556
556
 
557
557
  jdJumpConfigUrl(detail, logEventInfo = {}) {
558
558
  const { configDataType, configDataValue } = detail;
559
559
  switch (configDataType) {
560
560
  case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
561
561
  this.jdJumpToShopCategory({
562
562
  ...configDataValue,
563
563
  logEventInfo,
564
564
  });
565
565
  break;
566
566
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
567
567
  if (logEventInfo?.jsonParam?.logBaseInfo?.mInfo) {
568
568
  logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds;
569
569
  }
570
570
  this.jdJumpToProduct(configDataValue.skuIds, logEventInfo);
571
571
  break;
572
572
  case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
573
573
  this.jdJumpToWeb(
574
574
  `${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
575
575
  {},
576
576
  );
577
577
  break;
578
578
  case LinkConfigType.CONFIG_TYPE_CATEGORY:
579
579
  if (isJdAndHarmonyDevice && isNewHarmonyShop && jdAppVersionStr === '15.1.70') {
580
580
  const baseInfo = {
581
581
  shopId: global.info.queryInfo.shopId,
582
582
  venderId: global.info.queryInfo.venderId,
583
583
  };
584
584
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
585
585
  const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
586
586
  console.log('jd web 获取店铺分类链接解析后的参数结果', getShopSearchParams);
587
587
  let openAppParams =
588
588
  typeof getShopSearchParams === 'boolean'
589
589
  ? { categoryId: '', ...baseInfo }
590
590
  : getShopSearchParams;
591
591
  const getInfo = openAppParams['categoryId']
592
592
  ? { ...openAppParams, cateId: openAppParams['categoryId'] }
593
593
  : openAppParams;
594
594
  console.log('处理后的参数', objectToUrlEncode(getInfo));
595
595
  this.jdJumpToWeb(
596
596
  `${this.jumpWebUrl.shopSearch}?${objectToUrlEncode(getInfo)}`,
597
597
  logEventInfo,
598
598
  );
599
599
  } else {
600
600
  const getInfo = configDataValue['cid']
601
601
  ? { ...baseInfo, ...configDataValue, cateId: configDataValue.cid, searchType: '5' }
602
602
  : { ...baseInfo, ...configDataValue };
603
603
  this.jdJumpToWeb(
604
604
  `${this.jumpWebUrl.shopSearch}?${objectToUrlEncode(getInfo)}`,
605
605
  logEventInfo,
606
606
  );
607
607
  }
608
608
  } else {
609
609
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
610
610
  const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
611
611
  console.log('jd web 获取店铺分类链接解析后的参数结果', getShopSearchParams);
612
612
  getShopSearchParams &&
613
613
  this.jdJumpToShopSearch(
614
614
  Object.assign({}, getShopSearchParams, {
615
615
  logEventInfo,
616
616
  }),
617
617
  );
618
618
  } else {
619
619
  const extraParam = configDataValue?.pageId ? { pageId: configDataValue.pageId } : {};
620
620
  this.jdJumpToShopSearch(
621
621
  configDataValue['cid']
622
622
  ? Object.assign(
623
623
  {},
624
624
  {
625
625
  shopId: global.info.queryInfo.shopId,
626
626
  categoryId: configDataValue.cid,
627
627
  searchType: '5',
628
628
  ...extraParam,
629
629
  logEventInfo,
630
630
  },
631
631
  )
632
632
  : {
633
633
  shopId: global.info.queryInfo.shopId,
634
634
  ...extraParam,
635
635
  logEventInfo,
636
636
  },
637
637
  );
638
638
  }
639
639
  }
640
640
  break;
641
641
  case LinkConfigType.CONFIG_TYPE_MEMBER:
642
642
  if (isAppHomeForMarketPage) {
643
643
  this.jdJumpToBottomTabBrandMember({
644
644
  logEventInfo,
645
645
  });
646
646
  } else {
647
647
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
648
648
  const getShopMemberParams = this.jdOpenAppParams(configDataValue.clickUrl);
649
649
  getShopMemberParams &&
650
650
  this.jdJumpToShopMember(
651
651
  Object.assign({}, getShopMemberParams, {
652
652
  logEventInfo,
653
653
  }),
654
654
  );
655
655
  } else {
656
656
  this.jdJumpToShopMember({
657
657
  shopId: global.info.queryInfo.shopId,
658
658
  venderId: configDataValue.shopDetail,
659
659
  logEventInfo,
660
660
  });
661
661
  }
662
662
  }
663
663
  break;
664
664
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
665
665
  if (this.isNewHarmony()) {
666
666
  const url = `${domain.sale}/m/h5/${configDataValue.data}.html`;
667
667
  this.jdJumpToWeb(url, logEventInfo);
668
668
  } else {
669
669
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
670
670
  const getShopActivityParams = this.jdOpenAppParams(configDataValue.clickUrl);
671
671
  getShopActivityParams &&
672
672
  this.jdJumpToShopActivity(
673
673
  Object.assign({}, getShopActivityParams, {
674
674
  logEventInfo,
675
675
  }),
676
676
  );
677
677
  } else if (configDataValue['projectId']) {
678
678
  this.jdJumpToShopActivity({
679
679
  projectId: configDataValue['projectId'],
680
680
  configDataValue,
681
681
  logEventInfo,
682
682
  });
683
683
  }
684
684
  }
685
685
  break;
686
686
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
687
687
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
688
688
  const _url = configDataValue.linkUrl;
689
689
  if (
690
690
  _url.indexOf('to=') === -1 &&
691
691
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
692
692
  ) {
693
693
  const _shopId = _url.match(/\d+/g)[0];
694
694
  this.jdJumpToShopHome({
695
695
  shopId: `${_shopId}`,
696
696
  logEventInfo,
697
697
  });
698
698
  } else if (this.isOpenJdAppUrl(_url)) {
699
699
  const getOpenAppParams = this.jdOpenAppParams(_url);
700
700
  console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams);
701
701
  if (getOpenAppParams) {
702
702
  let _changeOpenAppParams = getOpenAppParams;
703
703
  if (isAppHomeForMarketPage) {
704
704
  const { operation, ...otherOpenAppParams } = getOpenAppParams;
705
705
  if (operation && operation === 'jumpTabInner') {
706
706
  _changeOpenAppParams = otherOpenAppParams;
707
707
  }
708
708
  }
709
709
  this.jdNavigateToNative(
710
710
  Object.assign({}, _changeOpenAppParams, {
711
711
  logEventInfo,
712
712
  }),
713
713
  );
714
714
  }
715
715
  } else {
716
716
  this.jdJumpToWeb(_url, logEventInfo);
717
717
  }
718
718
  break;
719
719
  }
720
720
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
721
721
  this.jdJumpToShopDetail({
722
722
  venderId: global.info.queryInfo.venderId,
723
723
  shopId: global.info.queryInfo.shopId,
724
724
  logEventInfo,
725
725
  });
726
726
  break;
727
727
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
728
728
  this.jdJumpToShopHome({
729
729
  ...configDataValue,
730
730
  logEventInfo,
731
731
  });
732
732
  break;
733
733
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
734
734
  break;
735
735
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
736
736
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
737
737
  const getShoppingGuideParams = this.jdOpenAppParams(configDataValue.clickUrl);
738
738
  getShoppingGuideParams &&
739
739
  this.jdJumpToShopActivity(
740
740
  Object.assign({}, getShoppingGuideParams, {
741
741
  logEventInfo,
742
742
  }),
743
743
  );
744
744
  }
745
745
  break;
746
746
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
747
747
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '');
748
748
  const search = linkUrl.match(/\?.+/);
749
749
  if (search) {
750
750
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
751
751
  parseQueryUrlString(linkUrl);
752
752
  try {
753
753
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param);
754
754
  } catch (e) {
755
755
  console.warn('解析小程序 param 错误:', miniQueryData.param);
756
756
  }
757
757
  this.jdJumpToMiniProgram(miniQueryData);
758
758
  } else {
759
759
  console.warn('小程序地址错误:', linkUrl);
760
760
  }
761
761
  break;
762
762
  }
763
763
  case LinkConfigType.CONFIG_TYPE_SHOP_SEARCH: {
764
764
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
765
765
  const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
766
766
  console.log('jd web 获取店铺结果落地页链接解析后的参数结果', getShopSearchParams);
767
767
  getShopSearchParams &&
768
768
  this.jdJumpToShopSearch(
769
769
  Object.assign({}, getShopSearchParams, {
770
770
  logEventInfo,
771
771
  }),
772
772
  );
773
773
  } else {
774
774
  this.jdJumpToWeb(configDataValue.clickUrl, logEventInfo);
775
775
  }
776
776
  break;
777
777
  }
778
778
  default:
779
779
  }
780
780
  }
781
781
 
782
782
  isNewHarmony() {
783
783
  return isJdAndHarmonyDevice && isNewHarmonyShop;
784
784
  }
785
785
 
786
786
  jdNavigateToNative(
787
787
  params: object,
788
788
  url = 'openapp.jdmobile://virtual',
789
789
  successBack?: functionType | null,
790
790
  failBack?: functionType | null,
791
791
  ) {
792
792
  console.log('[降级H5] jdNavigateToNative web.jd:', params);
793
793
  const getResParams: JumpEventReportInterFace.JdMiniJumpParams = Object.assign(
794
794
  {},
795
795
  {
796
796
  sourceValue: 'sourceValue_jshopModuleWeb',
797
797
  sourceType: 'sourceType_jshopModuleWeb',
798
798
  param: {},
799
799
  },
800
800
  params,
801
801
  );
802
802
  const { logEventInfo, useEncodeParams, ...otherParams } = getResParams;
803
803
  console.log('jd web 获取open协议参数 jdNavigateToNative params: ', getResParams);
804
804
  console.log('logEventInfo params: ', logEventInfo);
805
805
  global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
806
806
  this.clickEventLog(logEventInfo || getResParams)
807
807
  .then(() => {
808
808
  if (typeof successBack === 'function') {
809
809
  successBack(getResParams);
810
810
  } else {
811
811
  if (this.isNewHarmony() && params.operation === 'jumpTabInner') {
812
812
  if (params.jumpTab) {
813
813
  JumpTabBarInCurrentShop({ position: 'top', item: params.jumpTab, ...params });
814
814
  } else if (params.jumpBottomTab) {
815
815
  JumpTabBarInCurrentShop({
816
816
  position: 'bottom',
817
817
  item: params.jumpBottomTab,
818
818
  ...params,
819
819
  });
820
820
  } else {
821
821
  console.log('[降级H5] 跳转异常 params:', params);
822
822
  }
823
823
  } else if (
824
824
  this.isNewHarmony() &&
825
825
  (params.operation === 'jumpBottomTabMember' || params.des === 'jshopMember')
826
826
  ) {
827
827
  JumpTabBarInCurrentShop({ position: 'bottom', item: 'brandMember', ...params });
828
828
  } else {
829
829
  try {
830
830
  const paramsStr = JSON.stringify(otherParams);
831
831
  console.log('跳转web jd open协议', `${url}?params=${paramsStr}`);
832
832
  window.location.href =
833
833
  isJdAndHarmonyDevice || useEncodeParams
834
834
  ? `${url}?params=${encodeURIComponent(paramsStr)}`
835
835
  : `${url}?params=${paramsStr}`;
836
836
  } catch (e) {
837
837
  draBusinessCustomReport({
838
838
  eventName: 'entryProtocol',
839
839
  errorName: 'shop_jdNavigateToNative_error',
840
840
  errorMessage: '跳转web jd open协议发生错误',
841
841
  extraData: JSON.stringify({
842
842
  url,
843
843
  isJdApp,
844
844
  jdAppVersion: jdAppVersionStr,
845
845
  ...otherParams,
846
846
  }),
847
847
  });
848
848
  }
849
849
  }
850
850
  }
851
851
  })
852
852
  .catch(() => {
853
853
  typeof failBack === 'function' && failBack(getResParams);
854
854
  });
855
855
  }
856
856
 
857
857
  clickEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}, reportKey = 'click') {
858
858
  const { eventId, spmAllCode, spmCodeForCD, jsonParam, eventLevel = 3, ...otherParams } = opts;
859
859
  if ((eventId || spmAllCode || spmCodeForCD) && jsonParam) {
860
860
  const { etModelInfo, logBaseInfo } = jsonParam;
861
861
  let getJsonParam = {};
862
862
  if (etModelInfo && logBaseInfo) {
863
863
  getJsonParam = logBaseInfo;
864
864
  } else {
865
865
  if (Array.isArray(jsonParam)) {
866
866
  getJsonParam = jsonParam;
867
867
  } else {
868
868
  getJsonParam = Object.assign(
869
869
  {},
870
870
  {
871
871
  shopid: global.info.queryInfo?.shopId,
872
872
  },
873
873
  jsonParam,
874
874
  );
875
875
  }
876
876
  }
877
877
  if (
878
878
  reportKey === 'exposure' &&
879
879
  /^TerminatorNew/.test(eventId) &&
880
880
  !Array.isArray(getJsonParam)
881
881
  ) {
882
882
  getJsonParam = [getJsonParam];
883
883
  }
884
884
  const webLogParams = {
885
885
  isExpo: reportKey === 'exposure',
886
886
  eid: eventId,
887
887
  elevel: eventLevel,
888
888
  jsonParam: JSON.stringify(getJsonParam),
889
889
  etModel: JSON.stringify(etModelInfo || {}),
890
890
  pageId: this.logPageId,
891
891
  pageParam: this.logPageParamStr,
892
892
  spmAllCode,
893
893
  spmCodeForCD,
894
894
  ...otherParams,
895
895
  };
896
896
  return /click|exposure/.test(reportKey)
897
897
  ? reportClick(webLogParams)
898
898
  : reportToCart(opts, webLogParams);
899
899
  } else {
900
900
  console.log('暂无埋点参数eventId和eventParam');
901
901
  return Promise.resolve(false);
902
902
  }
903
903
  }
904
904
 
905
905
  exposureEventLog(opts) {
906
906
  return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
907
907
  ? this.clickEventLog(
908
908
  {
909
909
  ...opts,
910
910
  exposureState: true,
911
911
  },
912
912
  'exposure',
913
913
  )
914
914
  : Promise.resolve(false);
915
915
  }