@conecli/cone-render 0.8.18-beta.1 → 0.8.19-beta.0

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 (40) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/components/ErrorBoundary.tsx +1 -1
  4. package/dist/components/base/CustomVideo/index.tsx +1 -1
  5. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  6. package/dist/components/base/LazyLoadImage/const.ts +1 -1
  7. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  8. package/dist/components/base/Price/index.module.scss +9 -0
  9. package/dist/components/base/Price/index.tsx +1 -1
  10. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  11. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  12. package/dist/interface/component.ts +1 -1
  13. package/dist/interface/jumpEventReport.ts +1 -1
  14. package/dist/interface/service.ts +1 -1
  15. package/dist/jumpEventReport/base.ts +1 -1
  16. package/dist/jumpEventReport/const.ts +1 -1
  17. package/dist/jumpEventReport/index.ts +1 -1
  18. package/dist/jumpEventReport/index.weapp.ts +1 -1
  19. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  20. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  21. package/dist/jumpEventReport/web.base.ts +1 -1
  22. package/dist/jumpEventReport/web.jd.ts +1 -1
  23. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  24. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  25. package/dist/modules/DecorateContainerFloorList/index.tsx +1 -1
  26. package/dist/open/api/index.ts +1 -1
  27. package/dist/open/api/jump.ts +1 -1
  28. package/dist/sass/app.h5.scss +7 -139
  29. package/dist/sass/app.scss +8 -0
  30. package/dist/sass/base.scss +0 -9
  31. package/dist/utils/utils.ts +1 -1
  32. package/package.json +1 -1
  33. package/dist/components/base/InOrOutViewObserver/index.module.scss +0 -0
  34. package/dist/open/api/shopMember.ts +0 -1
  35. package/dist/service/http/const.ts +0 -1
  36. package/dist/service/http/http.jd.ts +0 -1
  37. package/dist/service/http/http.ts +0 -1
  38. package/dist/service/http/httpInterceptors.jd.ts +0 -1
  39. package/dist/service/http/httpInterceptors.ts +0 -1
  40. package/dist/service/http/index.ts +0 -1
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  routerInfo: {
3
2
  params: {},
4
3
  },
5
4
  nativeEvent: null,
6
5
  logPageParamStr: '',
7
6
  implements JumpEventReportInterFace.JumpEventReportInit
8
7
  public jingGouMiniState: boolean
9
8
  public logPageId: string
10
9
  public logPageParamStr: string
11
10
  public nativeEvent: any
12
11
  public routerInfo: JumpEventReportInterFace.RouterInfo
13
12
  public logPname: LogPnameInfo
14
13
  public jumpMiniPath: JumpEventReportInterFace.JumpMiniPath
15
14
  public jumpWebUrl: JumpEventReportInterFace.jumpWebUrl
16
15
  public sectionExposureInfo: object
17
16
  constructor(opt = {}) {
18
17
  this.logPageId = LogPageIdInfo.APP
19
18
  this.jingGouMiniState = false
20
19
  this.jumpMiniPath = JumpMiniPath
21
20
  this.jumpWebUrl = JumpWebUrl
22
21
  this.sectionExposureInfo = {}
23
22
  this.getConfig(opt)
24
23
  }
25
24
  getConfig(opt) {
26
25
  return Object.assign(this, {}, defaultConfig, opt)
27
26
  }
28
27
 
29
28
  updateInfo(
30
29
  routerInfo,
31
30
  logPname = LogPnameInfo.HOME,
32
31
  pageId = LogPageIdInfo.APP,
33
32
  ) {
34
33
  this.routerInfo = routerInfo
35
34
  this.logPname = logPname
36
35
  this.logPageId = pageId
37
36
  }
38
37
  reportInfoPv(_pageId, _opt = {}) {}
39
38
 
40
39
  getShopIdOrVenderIdParams(
41
40
  params: JumpEventReportInterFace.ShopIdsInfo = {},
42
41
  ): JumpEventReportInterFace.ShopIdsInfo {
43
42
  const setParams = {}
44
43
  params.shopId && (setParams['shopId'] = `${params.shopId}`)
45
44
  params.venderId && (setParams['venderId'] = `${params.venderId}`)
46
45
  return setParams
47
46
  }
48
47
 
49
48
  getShopIdsInfo(params = {}): JumpEventReportInterFace.ShopIdsInfo {
50
49
  let setParams = this.getShopIdOrVenderIdParams(params)
51
50
  setParams = {
52
51
  ...params,
53
52
  ...setParams,
54
53
  }
55
54
  return setParams
56
55
  }
57
56
 
58
57
  jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
59
58
  this.jdJumpToShopBase(shopInfo)
60
59
  }
61
60
 
62
61
  jdJumpToShopBase(shopInfo) {
63
62
  this.jdNavigateToNative(
64
63
  `${this.jumpMiniPath.shop}?${objectToUrlEncode(
65
64
  this.getShopIdOrVenderIdParams(shopInfo),
66
65
  )}`,
67
66
  {
68
67
  ...shopInfo,
69
68
  },
70
69
  )
71
70
  }
72
71
 
73
72
  jdJumpToShopLight(shopInfo) {
74
73
  this.jdNavigateToNative(
75
74
  `${this.jumpMiniPath.shopLight}?${objectToUrlEncode(
76
75
  this.getShopIdOrVenderIdParams(shopInfo),
77
76
  )}`,
78
77
  {
79
78
  ...shopInfo,
80
79
  },
81
80
  )
82
81
  }
83
82
 
84
83
  jdJumpToProduct(skuIds, logEventInfo) {
85
84
  skuIds = skuIds.toString().trim()
86
85
  const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds
87
86
  this.jdNavigateToNative(
88
87
  `${this.jumpMiniPath.detail}?sku=${getSkuId}`,
89
88
  logEventInfo,
90
89
  )
91
90
  }
92
91
 
93
92
  jdJumpToFlashSaleTab(_logEventInfo) {
94
93
  console.log('跳转闪购', _logEventInfo)
95
94
  }
96
95
 
97
96
 
98
97
  jdJumpToShopMemberInfo(logEventInfo) {
99
98
  console.log('跳转修改会员信息页', logEventInfo)
100
99
  }
101
100
 
102
101
  jdJumpToShopMemberPointDetail(logEventInfo) {
103
102
  const venderId = global.info.queryInfo.venderId
104
103
  const shopId = global.info.queryInfo.shopId
105
104
  this.jdJumpToWeb(
106
105
  `${this.jumpWebUrl.shopMemberPointDetail}?venderId=${venderId}&shopId=${shopId}`,
107
106
  logEventInfo,
108
107
  )
109
108
  }
110
109
 
111
110
  jdJumpToShopMemberBenefit(logEventInfo) {
112
111
  const venderId = global.info.queryInfo.venderId
113
112
  const shopId = global.info.queryInfo.shopId
114
113
  this.jdJumpToWeb(
115
114
  `${this.jumpWebUrl.shopMemberBenefit}?venderId=${venderId}&shopId=${shopId}`,
116
115
  logEventInfo,
117
116
  )
118
117
  }
119
118
 
120
119
  jdJumpToShopMemberRule(logEventInfo) {
121
120
  const venderId = global.info.queryInfo.venderId
122
121
  const shopId = global.info.queryInfo.shopId
123
122
  this.jdJumpToWeb(
124
123
  `${this.jumpWebUrl.shopMemberRule}?venderId=${venderId}&shopId=${shopId}&sign=member`,
125
124
  logEventInfo,
126
125
  )
127
126
  }
128
127
 
129
128
  jdJumpToShopMemberCloseAccount(venderType, logEventInfo) {
130
129
  const venderId = global.info.queryInfo.venderId
131
130
  const shopId = global.info.queryInfo.shopId
132
131
  this.jdJumpToWeb(
133
132
  `${this.jumpWebUrl.shopMemberCloseAccount}?venderId=${venderId}&shopId=${shopId}&venderType=${venderType}`,
134
133
  logEventInfo,
135
134
  )
136
135
  }
137
136
 
138
137
  jdJumpToShopMemberPointExchange(
139
138
  venderType,
140
139
  levelZeroMenuUrl,
141
140
  logEventInfo,
142
141
  ) {
143
142
  const venderId = global.info.queryInfo.venderId
144
143
  const shopId = global.info.queryInfo.shopId
145
144
  const channel = CHANNEL.h5
146
145
  this.jdJumpToWeb(
147
146
  `${this.jumpWebUrl.shopMemberPointExchange}?venderId=${venderId}&shopId=${shopId}&venderType=${venderType}&channel=${channel}&levelZeroMenuUrl=${levelZeroMenuUrl}`,
148
147
  logEventInfo,
149
148
  )
150
149
  }
151
150
 
152
151
  jdJumpToShopMemberBonusPurchase(customerLevel, logEventInfo) {
153
152
  const venderId = global.info.queryInfo.venderId
154
153
  const shopId = global.info.queryInfo.shopId
155
154
  this.jdJumpToWeb(
156
155
  `${this.jumpWebUrl.shopMemberBonusPurchase}?venderId=${venderId}&shopId=${shopId}`,
157
156
  logEventInfo,
158
157
  )
159
158
  }
160
159
 
161
160
  jdJumpToShopMemberGood(customerLevel, logEventInfo) {
162
161
  const venderId = global.info.queryInfo.venderId
163
162
  const shopId = global.info.queryInfo.shopId
164
163
  this.jdJumpToWeb(
165
164
  `${this.jumpWebUrl.shopMemberGood}?venderId=${venderId}&shopId=${shopId}&customerLevel=${customerLevel}`,
166
165
  logEventInfo,
167
166
  )
168
167
  }
169
168
 
170
169
  jdJumpToBeanDetail(logEventInfo) {
171
170
  console.log('this.jumpWebUrl.beanDetail', this.jumpWebUrl.beanDetail)
172
171
  this.jdJumpToWeb(
173
172
  `${this.jumpWebUrl.beanDetail}?source=dianpuhuiyuan`,
174
173
  logEventInfo,
175
174
  )
176
175
  }
177
176
 
178
177
  jdJumpToMyRedEnvelope(logEventInfo) {
179
178
  console.log('跳转红包页', logEventInfo)
180
179
  }
181
180
 
182
181
  jdJumpToMyCoupon(logEventInfo) {
183
182
  console.log('跳转优惠券页', logEventInfo)
184
183
  }
185
184
 
186
185
 
187
186
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
188
187
  this.jdJumpToWeb(
189
188
  `${this.jumpWebUrl.pages}?shopId=${shopId}&venderId=${venderId}&tabActive=home-product`,
190
189
  logEventInfo,
191
190
  )
192
191
  }
193
192
 
194
193
  jdJumpToAppHome(logEventInfo) {
195
194
  this.jdJumpToWeb(
196
195
  `${this.jumpWebUrl.mobileHome}?originReferer=shopx`,
197
196
  logEventInfo,
198
197
  )
199
198
  }
200
199
 
201
200
  jdJumpToShopSearch(queryParams) {
202
201
  const { shopId, categoryId, keyword, pageId, description, shopName } =
203
202
  queryParams
204
203
  const cateId = categoryId ? `&cateId=${categoryId}` : ''
205
204
  const addKeyWord = keyword ? `&keyword=${keyword}` : ''
206
205
  const addPageId = pageId ? `&pageId=${pageId}` : ''
207
206
  const searchDes = description ? `&description=${description}` : ''
208
207
  const shopNameDes = shopName ? `&shopName=${shopName}` : ''
209
208
  const searchType = categoryId ? 5 : keyword ? 4 : 3
210
209
  this.jdJumpToWeb(
211
210
  `${this.jumpWebUrl.shopSearch}?shopId=${shopId}&searchType=${searchType}${cateId}${addKeyWord}${addPageId}${searchDes}${shopNameDes}`,
212
211
  queryParams,
213
212
  )
214
213
  }
215
214
 
216
215
  jdJumpToOrderList() {
217
216
  console.warn(
218
217
  '触发基类的jdJumpToOrderList,这不是一个期望的结果,应该调用各端子类来实现',
219
218
  )
220
219
  }
221
220
 
222
221
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
223
222
  this.jdJumpToWeb(
224
223
  `${this.jumpWebUrl.couponSearch}?couponbatch=${couponId}&sceneval=2`,
225
224
  logEventInfo,
226
225
  )
227
226
  }
228
227
 
229
228
  jdJumpToWeb(
230
229
  spUrl,
231
230
  logEventInfo,
232
231
  successBack?: Function | undefined,
233
232
  failBack?: Function | undefined,
234
233
  ) {
235
234
  this.jdNavigateToNative(
236
235
  `${this.jumpMiniPath.h5}?encode_url=` + encodeURIComponent(spUrl),
237
236
  {
238
237
  ...logEventInfo,
239
238
  },
240
239
  successBack,
241
240
  failBack,
242
241
  )
243
242
  }
244
243
 
245
244
  jdJumpToLive(liveInfo, logEventInfo = {}) {
246
245
  if (liveInfo?.liveId) {
247
246
  this.jdJumpToWeb(
248
247
  `${this.jumpWebUrl.mLive}/${liveInfo?.liveId}?origin=30`,
249
248
  logEventInfo,
250
249
  )
251
250
  }
252
251
  }
253
252
 
254
253
  jdJumpToUgcContent(urlObj, logEventInfo = {}) {
255
254
  if (typeof urlObj === 'object') {
256
255
  this.jdJumpToWeb(
257
256
  `${this.jumpWebUrl.shopUseShareOrderUgcContent}?${objectToUrlEncode(
258
257
  urlObj,
259
258
  )}`,
260
259
  { logEventInfo },
261
260
  )
262
261
  } else {
263
262
  const getShopUgcParams = this.jdOpenAppParams(urlObj)
264
263
  console.log('getShopUgcParams=====', getShopUgcParams)
265
264
  if (getShopUgcParams) {
266
265
  getShopUgcParams['category'] && delete getShopUgcParams['category']
267
266
  getShopUgcParams['des'] && delete getShopUgcParams['des']
268
267
  this.jdJumpToWeb(
269
268
  `${this.jumpWebUrl.shopUseShareOrderUgcContent}?${objectToUrlEncode(
270
269
  getShopUgcParams as Object,
271
270
  )}`,
272
271
  { logEventInfo },
273
272
  )
274
273
  }
275
274
  }
276
275
  }
277
276
 
278
277
  jdJumpToShopActivity(shopInfo) {
279
278
  const getParams = Object.assign(
280
279
  {},
281
280
  {
282
281
  category: 'jump',
283
282
  des: 'jshopActivity',
284
283
  shopId: global.info.queryInfo.shopId,
285
284
  venderId: global.info.queryInfo.venderId,
286
285
  },
287
286
  shopInfo,
288
287
  )
289
288
  getParams['projectId'] &&
290
289
  (getParams['projectId'] = `${getParams['projectId']}`)
291
290
  }
292
291
 
293
292
  jdJumpToShopMember(shopInfo) {
294
293
  const getShopInfo = this.getShopIdOrVenderIdParams(shopInfo)
295
294
  this.jdJumpToWeb(
296
295
  `${this.jumpWebUrl.wqShopMember}?${objectToUrlEncode(getShopInfo)}`,
297
296
  shopInfo,
298
297
  )
299
298
  }
300
299
 
301
300
  jdJumpToShopMemberCard(shopInfo) {
302
301
  const getShopInfo = this.getShopIdOrVenderIdParams(shopInfo)
303
302
  this.jdJumpToWeb(
304
303
  `${this.jumpWebUrl.shopMember}?${objectToUrlEncode(getShopInfo)}`,
305
304
  shopInfo,
306
305
  )
307
306
  }
308
307
 
309
308
  jdJumpToTotalPromotion(shopInfo) {
310
309
  const { url, logEventInfo } = shopInfo
311
310
  if (this.isOpenJdAppUrl(url)) {
312
311
  const getOpenAppParams: any = this.jdOpenAppParams(url)
313
312
  if (getOpenAppParams) {
314
313
  if (getOpenAppParams?.activityId) {
315
314
  this.jdJumpToWeb(
316
315
  `${this.jumpWebUrl.totalPromotion}?activity_id=${getOpenAppParams?.activityId}`,
317
316
  shopInfo,
318
317
  )
319
318
  }
320
319
  }
321
320
  } else {
322
321
  this.jdJumpToWeb(url, logEventInfo)
323
322
  }
324
323
  }
325
324
 
326
325
  jdJumpToDongDongChat(paramInfo) {
327
326
  const { venderId = '1', entry = 'm_shop', ...otherInfo } = paramInfo
328
327
  const dongdongUrl = `${this.jumpWebUrl.dongDongChat}?venderId=${venderId}&entry=${entry}&sceneval=2`
329
328
  this.jdJumpToWeb(dongdongUrl, otherInfo)
330
329
  }
331
330
 
332
331
  jdJumpToShopDetail(shopInfo) {
333
332
  const getShopInfo = this.getShopIdOrVenderIdParams(shopInfo)
334
333
  this.jdJumpToWeb(
335
334
  `${this.jumpWebUrl.shopIntroduce}?${objectToUrlEncode(getShopInfo)}`,
336
335
  shopInfo,
337
336
  )
338
337
  }
339
338
 
340
339
  jdJumpToMiniProgram({
341
340
  appId,
342
341
  path,
343
342
  param = {},
344
343
  }: JumpEventReportInterFace.LinkMiniParams) {
345
344
  const pageName = param['pageType'] || 'home'
346
345
  path = `pages/${pageName}/index`
347
346
  if (appId === global.info.pageInfo?.appId) {
348
347
  Taro.navigateTo({
349
348
  url: `/${path}?${objectToUrlEncode(param)}`,
350
349
  }).catch((err) => {
351
350
  console.warn('跳转小程序页面错误:', err)
352
351
  })
353
352
  } else {
354
353
  console.log('一个小程序跳转到另一个小程序暂无此业务')
355
354
  }
356
355
  }
357
356
 
358
357
  jdJumpToAppMiniProgram(
359
358
  path: string,
360
359
  param = {},
361
360
  successBack?: Function,
362
361
  failBack?: Function,
363
362
  ) {
364
363
  this.jdNavigateToNative(path, param, successBack, failBack)
365
364
  }
366
365
 
367
366
  jdJumpConfigUrl(detail, logEventInfo = {}) {
368
367
  const { configDataType, configDataValue } = detail
369
368
  switch (configDataType) {
370
369
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
371
370
  this.jdJumpToProduct(configDataValue.skuIds, logEventInfo)
372
371
  break
373
372
  case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
374
373
  this.jdJumpToWeb(
375
374
  `${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
376
375
  logEventInfo,
377
376
  )
378
377
  break
379
378
  case LinkConfigType.CONFIG_TYPE_CATEGORY:
380
379
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
381
380
  const getShopSearchParams = this.jdOpenAppParams(
382
381
  configDataValue.clickUrl,
383
382
  )
384
383
  getShopSearchParams &&
385
384
  this.jdJumpToShopSearch(
386
385
  Object.assign({}, getShopSearchParams, {
387
386
  logEventInfo,
388
387
  }),
389
388
  )
390
389
  } else {
391
390
  this.jdJumpToShopSearch(
392
391
  configDataValue['cid']
393
392
  ? Object.assign(
394
393
  {},
395
394
  {
396
395
  shopId: global.info.queryInfo.shopId,
397
396
  categoryId: configDataValue.cid,
398
397
  logEventInfo,
399
398
  },
400
399
  )
401
400
  : {
402
401
  shopId: global.info.queryInfo.shopId,
403
402
  logEventInfo,
404
403
  },
405
404
  )
406
405
  }
407
406
  break
408
407
  case LinkConfigType.CONFIG_TYPE_MEMBER:
409
408
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
410
409
  const getShopMemberParams = this.jdOpenAppParams(
411
410
  configDataValue.clickUrl,
412
411
  )
413
412
  getShopMemberParams &&
414
413
  this.jdJumpToShopMember(
415
414
  Object.assign({}, getShopMemberParams, {
416
415
  logEventInfo,
417
416
  }),
418
417
  )
419
418
  } else {
420
419
  this.jdJumpToShopMember({
421
420
  shopId: global.info.queryInfo.shopId,
422
421
  venderId: configDataValue.shopDetail,
423
422
  logEventInfo,
424
423
  })
425
424
  }
426
425
  break
427
426
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
428
427
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
429
428
  const getShopActivityParams = this.jdOpenAppParams(
430
429
  configDataValue.clickUrl,
431
430
  )
432
431
  getShopActivityParams &&
433
432
  this.jdJumpToShopActivity(
434
433
  Object.assign({}, getShopActivityParams, {
435
434
  logEventInfo,
436
435
  }),
437
436
  )
438
437
  } else if (configDataValue['projectId']) {
439
438
  this.jdJumpToShopActivity({
440
439
  projectId: configDataValue['projectId'],
441
440
  configDataValue,
442
441
  logEventInfo,
443
442
  })
444
443
  }
445
444
  break
446
445
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
447
446
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
448
447
  const _url = configDataValue.linkUrl
449
448
  if (
450
449
  _url.indexOf('to=') === -1 &&
451
450
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
452
451
  ) {
453
452
  const _shopId = _url.match(/\d+/g)[0]
454
453
  this.jdJumpToShopHome({
455
454
  shopId: `${_shopId}`,
456
455
  logEventInfo,
457
456
  })
458
457
  } else if (this.isOpenJdAppUrl(_url)) {
459
458
  const getOpenAppParams = this.jdOpenAppParams(_url)
460
459
  console.log('获取解析后的参数结果', getOpenAppParams)
461
460
  if (getOpenAppParams) {
462
461
  isJdApp
463
462
  ? this.jdNavigateToNative(
464
463
  Object.assign({}, getOpenAppParams, {
465
464
  logEventInfo,
466
465
  }),
467
466
  )
468
467
  : this.jdNavigateToNative(
469
468
  '',
470
469
  Object.assign({}, getOpenAppParams, {
471
470
  logEventInfo,
472
471
  }),
473
472
  )
474
473
  } else {
475
474
  this.jdNavigateToNative(
476
475
  '',
477
476
  Object.assign({}, getOpenAppParams, {
478
477
  logEventInfo,
479
478
  }),
480
479
  )
481
480
  }
482
481
  } else {
483
482
  this.jdJumpToWeb(_url, logEventInfo)
484
483
  }
485
484
  break
486
485
  }
487
486
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
488
487
  this.jdJumpToShopDetail({
489
488
  venderId: global.info.queryInfo.venderId,
490
489
  shopId: global.info.queryInfo.shopId,
491
490
  logEventInfo,
492
491
  })
493
492
  break
494
493
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
495
494
  this.jdJumpToShopHome({
496
495
  ...configDataValue,
497
496
  logEventInfo,
498
497
  })
499
498
  break
500
499
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
501
500
  break
502
501
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
503
502
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
504
503
  const getShoppingGuideParams = this.jdOpenAppParams(
505
504
  configDataValue.clickUrl,
506
505
  )
507
506
  getShoppingGuideParams &&
508
507
  this.jdJumpToShopActivity(
509
508
  Object.assign({}, getShoppingGuideParams, {
510
509
  logEventInfo,
511
510
  }),
512
511
  )
513
512
  }
514
513
  break
515
514
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
516
515
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '')
517
516
  const search = linkUrl.match(/\?.+/)
518
517
  if (search) {
519
518
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
520
519
  parseQueryUrlString(linkUrl)
521
520
  try {
522
521
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param)
523
522
  } catch (e) {
524
523
  console.warn('解析小程序 param 错误:', miniQueryData.param)
525
524
  }
526
525
  this.jdJumpToMiniProgram(miniQueryData)
527
526
  } else {
528
527
  console.warn('小程序地址错误:', linkUrl)
529
528
  }
530
529
  break
531
530
  }
532
531
  default:
533
532
  }
534
533
  }
535
534
 
536
535
  jdOpenAppParams(openAppUrl): Object | boolean {
537
536
  let getParams: boolean | Object = false
538
537
  if (this.isOpenJdAppUrl(openAppUrl)) {
539
538
  try {
540
539
  getParams = openAppUrl.replace(
541
540
  /openApp\.jdMobile:\/\/virtual\?params=/i,
542
541
  '',
543
542
  )
544
543
  getParams = JSON.parse(String(getParams))
545
544
  } catch (e) {
546
545
  console.log(e)
547
546
  }
548
547
  }
549
548
  return getParams
550
549
  }
551
550
  isOpenJdAppUrl(openAppUrl) {
552
551
  return /openApp\.jdMobile:\/\/virtual\?params=/i.test(openAppUrl)
553
552
  }
554
553
 
555
554
  creatParamToLogStr(eventParam) {
556
555
  return eventParam
557
556
  ? Object.keys(eventParam)
558
557
  .map((key) => {
559
558
  return `${key}_${eventParam[key]}`
560
559
  })
561
560
  .join('_')
562
561
  : ''
563
562
  }
564
563
 
565
564
  jdNavigateToNative(
566
565
  url: string,
567
566
  params: {
568
567
  logEventInfo?: object
569
568
  } = {},
570
569
  successBack?: Function | undefined,
571
570
  failBack?: Function | undefined,
572
571
  ) {
573
572
  const { logEventInfo } = params
574
573
  const getEparam = logEventInfo || params
575
574
  console.log('jdNavigateToNative params: ', params)
576
575
  console.log('logEventInfo params: ', logEventInfo)
577
576
  try {
578
577
  this.clickEventLog(getEparam)
579
578
  } catch (e) {
580
579
  console.log(e)
581
580
  }
582
581
  setTimeout(() => {
583
582
  Taro.navigateTo({
584
583
  url,
585
584
  })
586
585
  .then((res) => {
587
586
  typeof successBack === 'function' && successBack(res)
588
587
  console.log('navigateToWxapp.success', res)
589
588
  })
590
589
  .catch((err) => {
591
590
  typeof failBack === 'function' && failBack(err)
592
591
  console.log('navigateToWxapp.fail', err)
593
592
  })
594
593
  }, 200)
595
594
  }
596
595
 
597
596
  clickEventLog(
598
597
  opts: JumpEventReportInterFace.OptEventLogParams = {},
599
598
  clickKey = 'click',
600
599
  ) {
601
600
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
602
601
  if (eventId && jsonParam) {
603
602
  const { etModelInfo, logBaseInfo } = jsonParam
604
603
  const miniClickKey = clickKey === 'addToCart' ? 'addToCart' : 'click'
605
604
  const miniLogParams = {
606
605
  eid: eventId,
607
606
  elevel: eventLevel,
608
607
  ext: JSON.stringify(logBaseInfo || jsonParam),
609
608
  etModel: JSON.stringify(etModelInfo || {}),
610
609
  pname: this.logPname,
611
610
  pparam: JSON.stringify(this.routerInfo.params),
612
611
  target: this.routerInfo.path,
613
612
  event: this.nativeEvent,
614
613
  pageId: this.logPageId,
615
614
  ...otherParams,
616
615
  }
617
616
  console.log('点击埋点参数对象', miniLogParams, miniClickKey)
618
617
  global.miniAppLogInstance &&
619
618
  global.miniAppLogInstance[miniClickKey](miniLogParams)
620
619
  }
621
620
  }
622
621
 
623
622
  exposureEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}) {
624
623
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
625
624
  if (eventId && jsonParam) {
626
625
  const { etModelInfo, logBaseInfo } = jsonParam
627
626
  const miniLogParams = {
628
627
  eid: eventId,
629
628
  elevel: eventLevel,
630
629
  ext: JSON.stringify(logBaseInfo || jsonParam),
631
630
  etModel: JSON.stringify(etModelInfo || {}),
632
631
  pname: this.logPname,
633
632
  pparam: JSON.stringify(this.routerInfo.params),
634
633
  target: this.routerInfo.path,
635
634
  pageId: this.logPageId,
636
635
  ...otherParams,
637
636
  }
638
637
  global.miniAppLogInstance &&
639
638
  global.miniAppLogInstance['exposure'](miniLogParams)
640
639
  }
641
640
  }
642
641
 
643
642
  initOpenTriggerExposure(type) {
644
643
  if (!this.sectionExposureInfo[type]) {
645
644
  Taro.nextTick(() => {
646
645
  setTimeout(() => {
647
646
  global.info.pageInfo.isExposureState = true
648
647
  taroEventInitExposure()
649
648
  this.sectionExposureInfo[`${type}`] = true
650
649
  }, 200)
651
650
  })
652
651
  }
653
652
  }
653
+ import Taro from '@tarojs/taro'
@@ -1 +1 @@
1
- import { isH5 } from '../utils'
1
+ import { isH5 } from '../utils'
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  console.log('京购商详页跳转:', this.jumpMiniPath.detail)
3
2
  if(global){
4
3
  if(global.miniAppLogInstance){
5
4
  }else{
6
5
  console.log('global.miniAppLogInstance为空!')
7
6
  }
8
7
  }else{
9
8
  console.log('global为空!')
10
9
  }
10
+ import Taro from '@tarojs/taro'
11
11
  console.log('京购商详页跳转:', this.jumpMiniPath.detail)
12
12
  if(global){
13
13
  if(global.miniAppLogInstance){
14
14
  }else{
15
15
  console.log('global.miniAppLogInstance为空!')
16
16
  }
17
17
  }else{
18
18
  console.log('global为空!')
19
19
  }