@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 Taro from '@tarojs/taro'
2
1
  console.log('京购商详页跳转:', this.jumpMiniPath.detail)
2
+ import Taro from '@tarojs/taro';
3
3
  SECTION_HOME_TAB_TYPE,
4
4
  SECTION_HOME_TAB_NAME_TYPE,
5
5
  SHOP_MENU_ID_NAME,
6
6
  SHOP_MENU_ID_TYPE,
7
7
 
8
8
  jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
9
9
  console.log('[降级H5] jdJumpToShopHome index.weapp');
10
10
  const currentShopInfo = {
11
11
  shopId: global.info.queryInfo.shopId,
12
12
  venderId: global.info.queryInfo.venderId,
13
13
  };
14
14
  const restParams =
15
15
  (shopInfo?.shopId && shopInfo.shopId !== currentShopInfo.shopId) ||
16
16
  (shopInfo?.venderId && shopInfo.venderId !== currentShopInfo.venderId)
17
17
  ? {}
18
18
  : currentShopInfo;
19
19
  const getInfo = Object.assign({}, restParams, shopInfo);
20
20
  this.jdJumpToShopBase(getInfo);
21
21
  }
22
22
 
23
23
  jdJumpToShopCategory(shopId, venderId, logEventInfo = {}) {
24
24
  console.log('[降级H5] jdJumpToShopCategory index.weapp');
25
25
  this.jdJumpToAppMiniProgram(this.jumpMiniPath.shopx, {
26
26
  shopId,
27
27
  venderId,
28
28
  tabActive: SHOP_MENU_ID_NAME[SHOP_MENU_ID_TYPE.CLASSIFY],
29
29
  logEventInfo,
30
30
  });
31
31
  }
32
32
 
33
33
  jdJumpToShopBase(shopInfo) {
34
34
  console.log('[降级H5] jdJumpToShopBase index.weapp');
35
35
  this.jdNavigateToNative(
36
36
  `${this.jumpMiniPath.shopx}?${objectToUrlEncode(this.getShopIdOrVenderIdParams(shopInfo))}`,
37
37
  {
38
38
  ...shopInfo,
39
39
  },
40
40
  );
41
41
  }
42
42
 
43
43
  jdJumpToShopLight(shopInfo) {
44
44
  this.jdNavigateToNative(
45
45
  `${this.jumpMiniPath.shopLight}?${objectToUrlEncode(
46
46
  this.getShopIdOrVenderIdParams(shopInfo),
47
47
  )}`,
48
48
  {
49
49
  ...shopInfo,
50
50
  },
51
51
  );
52
52
  }
53
53
 
54
54
  jdJumpToProduct(skuIds, logEventInfo) {
55
55
  skuIds = skuIds.toString().trim();
56
56
  const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds;
57
57
  if (global?.wxAppNavigatorInstance?.goto) {
58
58
  const getParams = {
59
59
  sku: getSkuId,
60
60
  sourceType: 'wx_shop',
61
61
  };
62
62
  this.jdNavigateToNative('none', logEventInfo, () => {
63
63
  global.wxAppNavigatorInstance.goto(this.jumpMiniPath.detail, getParams);
64
64
  });
65
65
  } else {
66
66
  this.jdNavigateToNative(`${this.jumpMiniPath.detail}?sku=${getSkuId}`, logEventInfo);
67
67
  }
68
68
  }
69
69
 
70
70
  jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo) {
71
71
  const { skuId, sourceType = 'wx_shop', skuImage } = skuInfo;
72
72
  if (skuId) {
73
73
  if (global?.wxAppNavigatorInstance?.goto) {
74
74
  const getParams = {
75
75
  sku: skuId,
76
76
  sourceType,
77
77
  };
78
78
  skuImage && (getParams['cover'] = skuImage);
79
79
  this.jdNavigateToNative('none', logEventInfo, () => {
80
80
  global.wxAppNavigatorInstance.goto(this.jumpMiniPath.detail, getParams);
81
81
  });
82
82
  } else {
83
83
  this.jdJumpToProduct(skuId, logEventInfo);
84
84
  }
85
85
  }
86
86
  }
87
87
 
88
88
  jdJumpToCoupon(nowUrlParams: JumpEventReportInterFace.CouponUrlParams, logInfo) {
89
89
  if (nowUrlParams.batchId && (nowUrlParams.bindType === 1 || nowUrlParams.bindType === 3)) {
90
90
  const couponUrlParams = {
91
91
  batch: nowUrlParams.batchId,
92
92
  kind: nowUrlParams.bindType,
93
93
  startTime: nowUrlParams.startTime,
94
94
  endTime: nowUrlParams.endTime,
95
95
  quangoufrom: 6,
96
96
  };
97
97
  this.jdNavigateToNative(
98
98
  `${this.jumpMiniPath.searchCoupon}?${objectToUrlEncode(couponUrlParams)}`,
99
99
  {
100
100
  ...logInfo,
101
101
  },
102
102
  );
103
103
  } else if (nowUrlParams.batchId && nowUrlParams.bindType !== 1 && nowUrlParams.bindType !== 3) {
104
104
  const couponUrlParams = {
105
105
  ...this.getShopIdOrVenderIdParams(global.info.queryInfo),
106
106
  sceneId: 1002,
107
107
  };
108
108
  this.jdNavigateToNative(`${this.jumpMiniPath.shop}?${objectToUrlEncode(couponUrlParams)}`, {
109
109
  ...logInfo,
110
110
  });
111
111
  }
112
112
  }
113
113
 
114
114
  jdJumpToJTCoupon(nowUrlParams: JumpEventReportInterFace.CouponUrlParams, logInfo) {
115
115
  const couponUrlParams = {
116
116
  batch: nowUrlParams.batchId,
117
117
  kind: nowUrlParams.bindType,
118
118
  startTime: nowUrlParams.startTime,
119
119
  endTime: nowUrlParams.endTime,
120
120
  quangoufrom: 6,
121
121
  };
122
122
  this.jdNavigateToNative(
123
123
  `${this.jumpMiniPath.searchCoupon}?${objectToUrlEncode(couponUrlParams)}`,
124
124
  {
125
125
  ...logInfo,
126
126
  },
127
127
  );
128
128
  }
129
129
 
130
130
  jdJumpToRankList(contentId: string | number, rankType = 10, logEventInfo) {
131
131
  const rankUrl = `${this.jumpWebUrl.rank}?contentId=${contentId}&sku=&rankType=${rankType}&fromName=dcpws&hideAd=1`;
132
132
  this.jdJumpToWeb(rankUrl, {
133
133
  contentId,
134
134
  ...logEventInfo,
135
135
  });
136
136
  }
137
137
 
138
138
  jdJumpToWeb(spUrl, logEventInfo) {
139
139
  this.jdNavigateToNative(`${this.jumpMiniPath.h5}?encode_url=${encodeURIComponent(spUrl)}`, {
140
140
  ...logEventInfo,
141
141
  });
142
142
  }
143
143
 
144
144
  weappRedirectToWeb(
145
145
  url: string,
146
146
  logEventInfo: JumpEventReportInterFace.OptEventLogParams = {},
147
147
  otherParam = {},
148
148
  ) {
149
149
  let paramStr = '';
150
150
  const getOtherParamKeysLength = Object.keys(otherParam).length;
151
151
  if (getOtherParamKeysLength > 0) {
152
152
  Object.keys(otherParam).forEach((key) => {
153
153
  const getValue = `${otherParam[key]}`.replace(/undefined/, '').replace(/null/, '');
154
154
  paramStr += `${key}=${getValue}&`;
155
155
  });
156
156
  }
157
157
  const encodeUrl = `/pages/h5/index?${paramStr}encode_url=${encodeURIComponent(url)}`;
158
158
  try {
159
159
  this.clickEventLog(logEventInfo);
160
160
  } catch (e) {
161
161
  console.log(e);
162
162
  }
163
163
  setTimeout(() => {
164
164
  Taro.redirectTo({ url: encodeUrl })
165
165
  .then((res) => {
166
166
  console.log('weappRedirectToWeb.success', res);
167
167
  })
168
168
  .catch((err) => {
169
169
  console.log('weappRedirectToWeb.fail', err);
170
170
  });
171
171
  }, 200);
172
172
  }
173
173
 
174
174
  jdJumpToLive(liveInfo, logEventInfo = {}) {
175
175
  if (liveInfo?.liveId) {
176
176
  if (liveInfo?.openWxappToLiveRoom) {
177
177
  this.jdNavigateToNative(
178
178
  `${this.jumpMiniPath.jdLive}?liveId=${liveInfo.liveId}&origin=473`,
179
179
  {
180
180
  logEventInfo,
181
181
  },
182
182
  );
183
183
  } else {
184
184
  this.jdJumpToWeb(
185
185
  `${this.jumpWebUrl.mLive}/${liveInfo.liveId}?origin=0&appid=jdgw`,
186
186
  logEventInfo,
187
187
  );
188
188
  }
189
189
  }
190
190
  }
191
191
 
192
192
  jdJumpToActivityPlace(spUrl, logEventInfo) {
193
193
  this.jdJumpToWeb(spUrl, logEventInfo);
194
194
  }
195
195
 
196
196
  jdJumpToShopFans(fansParams, logEventInfo) {
197
197
  this.jdNavigateToNative(`${this.jumpMiniPath.shopFans}?${objectToUrlEncode(fansParams)}`, {
198
198
  ...logEventInfo,
199
199
  });
200
200
  }
201
201
 
202
202
  jdJumpToShopDetail(shopInfo) {
203
203
  const getInfo = Object.assign(
204
204
  {},
205
205
  {
206
206
  shopId: global.info.queryInfo.shopId,
207
207
  venderId: global.info.queryInfo.venderId,
208
208
  },
209
209
  shopInfo,
210
210
  );
211
211
  const getShopInfo = this.getShopIdOrVenderIdParams(getInfo);
212
212
  this.jdJumpToWeb(`${this.jumpWebUrl.shopIntroduce}?${objectToUrlEncode(getShopInfo)}`, getInfo);
213
213
  }
214
214
 
215
215
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
216
216
  this.jdNavigateToNative(`${this.jumpMiniPath.couponSearch}?batch=${couponId}`, logEventInfo);
217
217
  }
218
218
 
219
219
  jdJumpToShopActivity(shopInfo) {
220
220
  const { configDataValue, logEventInfo, projectId } = shopInfo;
221
221
  if (projectId && configDataValue) {
222
222
  this.jdJumpToWeb(
223
223
  `${this.jumpWebUrl.shopSecondActivity}/${configDataValue.data}.html`,
224
224
  logEventInfo,
225
225
  );
226
226
  }
227
227
  }
228
228
 
229
229
  _checkUrlIsProductAndGetSkuInfo(url) {
230
230
  let skuId = null;
231
231
  if (/\/\/item\.jd\.com\/(\d+)\.html/.test(url)) {
232
232
  const getSkuRes = url.match(/\/\/item\.jd\.com\/(\d+)\.html/);
233
233
  if (getSkuRes && getSkuRes[1]) {
234
234
  skuId = getSkuRes[1];
235
235
  }
236
236
  } else if (/\/\/item\.m\.jd.com\/product\/(\d+)\.html/.test(url)) {
237
237
  const getSkuRes2 = url.match(/\/\/item\.m\.jd\.com\/product\/(\d+)\.html/);
238
238
  if (getSkuRes2 && getSkuRes2[1]) {
239
239
  skuId = getSkuRes2[1];
240
240
  }
241
241
  }
242
242
  return skuId;
243
243
  }
244
244
 
245
245
  jdJumpConfigUrl(detail, logEventInfo = {}) {
246
246
  const { configDataType, configDataValue } = detail;
247
247
  switch (configDataType) {
248
248
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
249
249
  if (logEventInfo?.jsonParam?.logBaseInfo?.mInfo) {
250
250
  logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds;
251
251
  }
252
252
  this.jdJumpToProduct(configDataValue.skuIds, logEventInfo);
253
253
  break;
254
254
  case LinkConfigType.CONFIG_TYPE_CATEGORY:
255
255
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
256
256
  const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
257
257
  getShopSearchParams &&
258
258
  this.jdJumpToShopSearch(
259
259
  Object.assign({}, getShopSearchParams, {
260
260
  logEventInfo,
261
261
  }),
262
262
  );
263
263
  } else {
264
264
  this.jdJumpToShopSearch(
265
265
  configDataValue['cid']
266
266
  ? Object.assign(
267
267
  {},
268
268
  {
269
269
  shopId: global.info.queryInfo.shopId,
270
270
  categoryId: configDataValue.cid,
271
271
  ...configDataValue,
272
272
  logEventInfo,
273
273
  },
274
274
  )
275
275
  : {
276
276
  shopId: global.info.queryInfo.shopId,
277
277
  logEventInfo,
278
278
  },
279
279
  );
280
280
  }
281
281
  break;
282
282
  case LinkConfigType.CONFIG_TYPE_MEMBER:
283
283
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
284
284
  const getShopMemberParams = this.jdOpenAppParams(configDataValue.clickUrl);
285
285
  getShopMemberParams &&
286
286
  this.jdJumpToShopMember(
287
287
  Object.assign({}, getShopMemberParams, {
288
288
  logEventInfo,
289
289
  }),
290
290
  );
291
291
  } else {
292
292
  this.jdJumpToShopMember({
293
293
  shopId: global.info.queryInfo.shopId,
294
294
  venderId: configDataValue.shopDetail,
295
295
  logEventInfo,
296
296
  });
297
297
  }
298
298
  break;
299
299
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
300
300
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
301
301
  const getShopActivityParams = this.jdOpenAppParams(configDataValue.clickUrl);
302
302
  if (getShopActivityParams && getShopActivityParams['des'] == 'jshopActivity') {
303
303
  this.jdJumpToShopActivity({
304
304
  projectId: configDataValue['projectId'],
305
305
  configDataValue,
306
306
  logEventInfo,
307
307
  });
308
308
  }
309
309
  } else if (configDataValue['projectId']) {
310
310
  this.jdJumpToShopActivity({
311
311
  projectId: configDataValue['projectId'],
312
312
  configDataValue,
313
313
  logEventInfo,
314
314
  });
315
315
  }
316
316
  break;
317
317
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
318
318
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
319
319
  const _url = configDataValue.linkUrl;
320
320
  if (
321
321
  _url.indexOf('to=') === -1 &&
322
322
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
323
323
  ) {
324
324
  const _shopId = _url.match(/\d+/g)[0];
325
325
  this.jdJumpToShopHome({
326
326
  shopId: `${_shopId}`,
327
327
  logEventInfo,
328
328
  });
329
329
  } else if (this.isOpenJdAppUrl(_url)) {
330
330
  const getOpenAppParams: any = this.jdOpenAppParams(_url);
331
331
  if (getOpenAppParams) {
332
332
  if (getOpenAppParams.jumpTab == 'allProduct') {
333
333
  this.jdJumpToTabAllProduct(
334
334
  global.info.queryInfo.shopId,
335
335
  global.info.queryInfo.venderId,
336
336
  );
337
337
  } else if (
338
338
  getOpenAppParams.des == 'productList' &&
339
339
  getOpenAppParams.from == 'couponBatch'
340
340
  ) {
341
341
  console.log('优惠券跳转至京购优惠券可用商品列表');
342
342
  this.jdJumpToCouponSearchProductList(getOpenAppParams?.couponId);
343
343
  } else if (getOpenAppParams.des == 'vapp') {
344
344
  this.jdJumpToWeb(
345
345
  `https://conecli.com/apps/mpshare/index.html?category=${
346
346
  getOpenAppParams.category
347
347
  }&des=${getOpenAppParams.des}&vapptype=${
348
348
  getOpenAppParams.vapptype
349
349
  }&appId=${getOpenAppParams.appId}&path=${
350
350
  getOpenAppParams.path
351
351
  }&param=${encodeURI(JSON.stringify(getOpenAppParams.param))}`,
352
352
  logEventInfo,
353
353
  );
354
354
  } else {
355
355
  this.jdNavigateToNative(
356
356
  '',
357
357
  Object.assign({}, getOpenAppParams, {
358
358
  logEventInfo,
359
359
  }),
360
360
  );
361
361
  }
362
362
  }
363
363
  } else {
364
364
  const getSkuId = this._checkUrlIsProductAndGetSkuInfo(_url);
365
365
  getSkuId
366
366
  ? this.jdJumpToProduct(getSkuId, logEventInfo)
367
367
  : this.jdJumpToWeb(_url, logEventInfo);
368
368
  }
369
369
  break;
370
370
  }
371
371
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
372
372
  this.jdJumpToShopDetail({
373
373
  venderId: global.info.queryInfo.venderId,
374
374
  shopId: global.info.queryInfo.shopId,
375
375
  logEventInfo,
376
376
  });
377
377
  break;
378
378
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
379
379
  this.jdJumpToShopHome({
380
380
  ...configDataValue,
381
381
  logEventInfo,
382
382
  });
383
383
  break;
384
384
  case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
385
385
  this.jdJumpToShopCategory(global.info.queryInfo.shopId, global.info.queryInfo.venderId);
386
386
  break;
387
387
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
388
388
  break;
389
389
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
390
390
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
391
391
  const getShoppingGuideParams = this.jdOpenAppParams(configDataValue.clickUrl);
392
392
  getShoppingGuideParams &&
393
393
  this.jdJumpToShopActivity(
394
394
  Object.assign({}, getShoppingGuideParams, {
395
395
  logEventInfo,
396
396
  }),
397
397
  );
398
398
  }
399
399
  break;
400
400
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
401
401
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '');
402
402
  const search = linkUrl.match(/\?.+/);
403
403
  if (search) {
404
404
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
405
405
  parseQueryUrlString(linkUrl);
406
406
  try {
407
407
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param);
408
408
  } catch (e) {
409
409
  console.warn('解析小程序 param 错误:', miniQueryData.param);
410
410
  }
411
411
  this.jdJumpToMiniProgram(miniQueryData);
412
412
  } else {
413
413
  console.warn('小程序地址错误:', linkUrl);
414
414
  }
415
415
  break;
416
416
  }
417
417
  default:
418
418
  }
419
419
  }
420
420
 
421
421
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
422
422
  console.log('index.weapp.ts - jdJumpToTabAllProduct');
423
423
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
424
424
  if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
425
425
  this.jdJumpToAppMiniProgram(this.jumpMiniPath.shopx, {
426
426
  shopId,
427
427
  venderId,
428
428
  tabActive: SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT],
429
429
  logEventInfo,
430
430
  });
431
431
  }
432
432
 
433
433
  jdJumpToTopTabBase(type, shopInfo = {}) {
434
434
  const getInfo = Object.assign(
435
435
  {},
436
436
  {
437
437
  shopId: global.info.queryInfo.shopId,
438
438
  venderId: global.info.queryInfo.venderId,
439
439
  },
440
440
  shopInfo,
441
441
  );
442
442
  console.log('小程序原生跳转 jdJumpToTopTabBase');
443
443
  const { shopId, venderId, ...logEventInfo } = getInfo;
444
444
  this.jdJumpToAppMiniProgram(this.jumpMiniPath.shopx, {
445
445
  shopId,
446
446
  venderId,
447
447
  tabActive: type,
448
448
  ...logEventInfo,
449
449
  });
450
450
  }
451
451
 
452
452
  jdJumpToSearch(shopId, suggestWord) {
453
453
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
454
454
  this.jdJumpToAppMiniProgram(this.jumpMiniPath.shopSearch, {
455
455
  shopId,
456
456
  });
457
457
  }
458
458
 
459
459
  jdJumpToAppHome(params = {}) {
460
460
  this.jdJumpToAppMiniProgram(this.jumpMiniPath.jingGouHome, params);
461
461
  }
462
462
 
463
463
  jdJumpToThreePlatform(spUrl, logEventInfo) {
464
464
  this.jdJumpToWeb(spUrl, logEventInfo);
465
465
  }
466
466
 
467
467
  jdJumpToMiniProgram({ appId, path, param = {} }: JumpEventReportInterFace.LinkMiniParams) {
468
468
  const pageName = param['pageType'] || 'home';
469
469
  path = `pages/${pageName}/index`;
470
470
  if (appId === global.info.pageInfo?.appId) {
471
471
  Taro.navigateTo({
472
472
  url: `/${path}?${objectToUrlEncode(param)}`,
473
473
  }).catch((err) => {
474
474
  console.warn('跳转小程序页面错误:', err);
475
475
  });
476
476
  } else {
477
477
  console.log('一个小程序跳转到另一个小程序暂无此业务');
478
478
  }
479
479
  }
480
480
 
481
481
  jdJumpToAppMiniProgram(
482
482
  path: string,
483
483
  param = {},
484
484
  successBack?: functionType,
485
485
  failBack?: functionType,
486
486
  ) {
487
487
  this.jdNavigateToNative(path, param, successBack, failBack);
488
488
  }
489
489
 
490
490
  jdNavigateToNative(
491
491
  url: string,
492
492
  params: {
493
493
  logEventInfo?: object;
494
494
  } = {},
495
495
  successBack?: functionType,
496
496
  failBack?: functionType,
497
497
  ) {
498
498
  const { logEventInfo, ...otherParams } = params;
499
499
  const getEparam = logEventInfo || params;
500
500
  console.log(
501
501
  '[wxmin] index.weapp jdNavigateToNative params: ',
502
502
  params,
503
503
  'logEventInfo',
504
504
  logEventInfo,
505
505
  'otherParams',
506
506
  otherParams,
507
507
  );
508
508
  try {
509
509
  this.clickEventLog(getEparam);
510
510
  } catch (e) {
511
511
  console.log(e);
512
512
  }
513
513
  setTimeout(() => {
514
514
  const getValidOtherParamState = otherParams && Object.keys(otherParams).length > 0;
515
515
  const goToPath = `${url}${getValidOtherParamState ? '?' + objectToUrlEncode(otherParams) : ''}`;
516
516
  console.log('打印最终wxapp原生跳转地址path', goToPath);
517
517
  if (url === this.jumpMiniPath.jingGouHome) {
518
518
  Taro.switchTab({
519
519
  url: goToPath,
520
520
  })
521
521
  .then((res) => {
522
522
  typeof successBack === 'function' && successBack(res);
523
523
  console.log('navigateToWxapp.success', res);
524
524
  })
525
525
  .catch((err) => {
526
526
  typeof failBack === 'function' && failBack(err);
527
527
  console.log('navigateToWxapp.fail', err);
528
528
  });
529
529
  } else {
530
530
  if (url !== 'none') {
531
531
  Taro.navigateTo({
532
532
  url: goToPath,
533
533
  })
534
534
  .then((res) => {
535
535
  typeof successBack === 'function' && successBack(res);
536
536
  console.log('navigateToWxapp.success', res);
537
537
  })
538
538
  .catch((err) => {
539
539
  typeof failBack === 'function' && failBack(err);
540
540
  console.log('navigateToWxapp.fail', err);
541
541
  });
542
542
  } else {
543
543
  typeof successBack === 'function' && successBack(url);
544
544
  }
545
545
  }
546
546
  }, 200);
547
547
  }
548
548
 
549
549
  clickEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}, clickKey = 'click') {
550
550
  const { eventId, jsonParam, eventLevel = 3, skuId, ...otherParams } = opts;
551
551
  if (eventId && jsonParam) {
552
552
  if (/TerminatorNew_/.test(eventId + '')) {
553
553
  console.log('mini eventId==========', eventId);
554
554
  }
555
555
  const { etModelInfo, logBaseInfo } = jsonParam;
556
556
  let getJsonParam = {};
557
557
  if (etModelInfo && logBaseInfo) {
558
558
  getJsonParam = logBaseInfo;
559
559
  } else {
560
560
  if (Array.isArray(jsonParam)) {
561
561
  getJsonParam = jsonParam;
562
562
  } else {
563
563
  getJsonParam = Object.assign(
564
564
  {},
565
565
  {
566
566
  shopid: global.info.queryInfo?.shopId,
567
567
  },
568
568
  jsonParam,
569
569
  );
570
570
  }
571
571
  }
572
572
  if (
573
573
  clickKey === 'exposure' &&
574
574
  /^TerminatorNew/.test(eventId) &&
575
575
  !Array.isArray(getJsonParam)
576
576
  ) {
577
577
  getJsonParam = [getJsonParam];
578
578
  }
579
579
  const miniLogParams = {
580
580
  eid: eventId,
581
581
  elevel: eventLevel,
582
582
  eparam: JSON.stringify(getJsonParam),
583
583
  pageId: this.logPageId,
584
584
  pname: this.logPname,
585
585
  pparam: JSON.stringify(this.routerInfo.params),
586
586
  target: this.routerInfo.path,
587
587
  event: this.nativeEvent,
588
588
  ...otherParams,
589
589
  };
590
590
  if (clickKey === 'addToCart' && skuId) {
591
591
  miniLogParams['shoppingList'] = {
592
592
  [skuId]: 1,
593
593
  };
594
594
  }
595
595
  return new Promise((resolve) => {
596
596
  global.miniAppLogInstance && global.miniAppLogInstance[clickKey](miniLogParams);
597
597
  setTimeout(() => {
598
598
  resolve(true);
599
599
  }, 300);
600
600
  });
601
601
  } else {
602
602
  console.log('暂无埋点参数eventId和eventParam');
603
603
  return Promise.resolve(false);
604
604
  }
605
605
  }
606
606
 
607
607
  exposureEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}) {
608
608
  return this.clickEventLog(opts, 'exposure');
609
609
  }