@conecli/cone-render 0.8.19 → 0.8.20-beta.2

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