@conecli/cone-render 0.8.20-shop.21 → 0.8.20-shop.211

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