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

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