@conecli/cone-render 0.9.1-shop2.3 → 0.9.1-shop2.4

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 (60) hide show
  1. package/dist/common/const.ts +1 -1
  2. package/dist/common/index.h5.ts +1 -1
  3. package/dist/common/index.jd.ts +1 -1
  4. package/dist/common/index.ts +1 -1
  5. package/dist/common/index.weapp.ts +1 -1
  6. package/dist/common/jssdk.ts +1 -0
  7. package/dist/common/pageType.ts +1 -0
  8. package/dist/common/token/index.h5.ts +1 -1
  9. package/dist/common/token/token.jd.ts +1 -1
  10. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  11. package/dist/components/base/Exposure/index.h5.tsx +1 -1
  12. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  13. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  14. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  15. package/dist/components/base/InViewRender/index.tsx +1 -1
  16. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  17. package/dist/components/base/LazyLoadImage/const.ts +1 -1
  18. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  19. package/dist/components/base/MobileCommonHeader/index.module.scss +9 -0
  20. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  21. package/dist/components/base/NetworkDataError/const.ts +1 -1
  22. package/dist/components/base/NetworkDataError/index.module.scss +4 -0
  23. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  24. package/dist/components/base/Price/Double/index.tsx +1 -1
  25. package/dist/components/base/Price/index.tsx +1 -1
  26. package/dist/components/decorate/DecorateFloorModule/index.module.scss +21 -2
  27. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  28. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  29. package/dist/components/isv/Floor/index.tsx +1 -1
  30. package/dist/components/remoteFloorItem.tsx +1 -1
  31. package/dist/interface/common.ts +1 -1
  32. package/dist/interface/component.ts +1 -1
  33. package/dist/jumpEventReport/const.ts +1 -1
  34. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  35. package/dist/jumpEventReport/index.weapp.ts +1 -1
  36. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  37. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  38. package/dist/jumpEventReport/web/report.ts +1 -1
  39. package/dist/jumpEventReport/web.base.ts +1 -1
  40. package/dist/jumpEventReport/web.jd.ts +1 -1
  41. package/dist/jumpEventReport/web.jdb.ts +1 -1
  42. package/dist/jumpEventReport/web.jdjch.ts +1 -1
  43. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  44. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  45. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  46. package/dist/open/api/environment.ts +1 -1
  47. package/dist/open/api/index.ts +1 -1
  48. package/dist/open/api/track.ts +1 -1
  49. package/dist/open/components/index.ts +1 -1
  50. package/dist/service/fetchGateway.ts +1 -1
  51. package/dist/service/http/const.ts +1 -1
  52. package/dist/service/requestServer.ts +1 -1
  53. package/dist/utils/connectNativeJsBridge.ts +1 -1
  54. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  55. package/dist/utils/h5Utils.ts +1 -1
  56. package/dist/utils/index.h5.ts +1 -1
  57. package/dist/utils/index.ts +1 -1
  58. package/dist/utils/index.weapp.ts +1 -1
  59. package/dist/utils/utils.ts +1 -1
  60. package/package.json +1 -1
@@ -1 +1 @@
1
- import global from '../common'
2
1
  objectToUrlEncode,
3
2
  parseQueryUrlString,
4
3
  isH5AndJingGouMini,
5
4
  SECTION_HOME_TAB_TYPE,
6
5
  SECTION_HOME_TAB_NAME_TYPE,
7
6
  public jingGouMiniState: boolean
8
7
  private isH5OpenToWxapp: boolean
9
8
  constructor(opt) {
10
9
  super(opt)
11
10
  this.jingGouMiniState = false
12
11
  this.getConfig(opt)
13
12
  console.log(
14
13
  'window.shopGlobalSwitch:',
15
14
  JSON.stringify(window.shopGlobalSwitch),
16
15
  )
17
16
  this.isH5OpenToWxapp =
18
17
  window.shopGlobalSwitch?.openMobileShopToWxApp == 'true'
19
18
  this.init()
20
19
  }
21
20
  getConfig(opt) {
22
21
  return Object.assign(this, {}, defaultConfig, super.getConfig(opt), opt)
23
22
  }
24
23
 
25
24
 
26
25
  async init() {
27
26
  if (window.isJingGouMiniViewState) {
28
27
  this.jingGouMiniState = true
29
28
  } else {
30
29
  console.log(
31
30
  '初始化进行小程序环境检查, 当前是否是京购小程序里的H5',
32
31
  isH5AndJingGouMini,
33
32
  )
34
33
  if (isH5AndJingGouMini && this.isH5OpenToWxapp) {
35
34
  console.log('进入了 isH5AndJingGouMini && this.isH5OpenToWxapp 的if')
36
35
  this.jingGouMiniState = true
37
36
  window.isJingGouMiniViewState = true
38
37
  console.log('进入了 iwx?.miniProgram then 但是没有继续跳转的逻辑 ')
39
38
  global.info.isJingGouMiniViewState = true
40
39
  } else {
41
40
  console.log('进入了 isH5AndJingGouMini && this.isH5OpenToWxapp 的esle')
42
41
  }
43
42
  }
44
43
  }
45
44
 
46
45
  jdJumpToMiniPage(pageUrl, logEventInfo, type = 'navigateTo') {
47
46
  this.jdNavigateToNative(
48
47
  pageUrl,
49
48
  logEventInfo,
50
49
  () => {
51
50
  console.log('JD.wxappext.goto')
52
51
  wx?.miniProgram[type] &&
53
52
  wx?.miniProgram[type]({
54
53
  url: pageUrl,
55
54
  })
56
55
  },
57
56
  () => {
58
57
  console.log('JD.wxappext.goto2')
59
58
  wx?.miniProgram[type] &&
60
59
  wx?.miniProgram[type]({
61
60
  url: pageUrl,
62
61
  })
63
62
  },
64
63
  )
65
64
  }
66
65
 
67
66
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
68
67
  console.log('web.wxapp.ts - jdJumpToTabAllProduct')
69
68
  if(typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId
70
69
  if(typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId
71
70
 
72
71
  if (this.jingGouMiniState) {
73
72
  const param = {
74
73
  shopId,
75
74
  venderId,
76
75
  tabActive: SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT],
77
76
  }
78
77
  const url = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(param)}`
79
78
  this.jdJumpToMiniPage(url, logEventInfo)
80
79
  } else {
81
80
  super.jdJumpToTabAllProduct(shopId, venderId, logEventInfo)
82
81
  }
83
82
  }
84
83
 
85
84
  jdJumpToTopTabBase(type, shopInfo = {}) {
86
85
  const getInfo = Object.assign(
87
86
  {},
88
87
  {
89
88
  shopId: global.info.queryInfo.shopId,
90
89
  venderId: global.info.queryInfo.venderId,
91
90
  },
92
91
  shopInfo,
93
92
  )
94
93
  if (this.jingGouMiniState) {
95
94
  const {shopId, venderId, ...otherInfo} = getInfo
96
95
  const param = {
97
96
  shopId,
98
97
  venderId,
99
98
  tabActive: type,
100
99
  }
101
100
  const url = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(param)}`
102
101
  this.jdJumpToMiniPage(url, otherInfo)
103
102
  } else {
104
103
  super.jdJumpToTopTabBase(type, shopInfo)
105
104
  }
106
105
  }
107
106
 
108
107
  jdJumpToWeb(url, logEventInfo) {
109
108
  console.log('web.wxapp.ts - jdJumpToWeb', url)
110
109
  console.log('jingGouMiniState', this.jingGouMiniState)
111
110
  if (this.jingGouMiniState) {
112
111
  const encodeUrl = `${
113
112
  this.jumpMiniPath.h5
114
113
  }?encode_url=${encodeURIComponent(url)}`
115
114
  this.jdJumpToMiniPage(encodeUrl, logEventInfo)
116
115
  } else {
117
116
  super.jdJumpToWeb(url, logEventInfo)
118
117
  }
119
118
  }
120
119
 
121
120
  jdJumpToWebInner(url, logEventInfo) {
122
121
  super.jdJumpToWeb(url, logEventInfo)
123
122
  }
124
123
 
125
124
  jdJumpToProduct(skuIds, logEventInfo) {
126
125
  if (this.jingGouMiniState) {
127
126
  const detailUrl = `${this.jumpMiniPath.detail}?sku=${skuIds}`
128
127
  this.jdJumpToMiniPage(detailUrl, logEventInfo)
129
128
  } else {
130
129
  super.jdJumpToProduct(skuIds, logEventInfo)
131
130
  }
132
131
  }
133
132
 
134
133
  jdJumpToShopHome(params) {
135
134
  console.log('[降级H5] jdJumpToShopHome web.wxapp')
136
135
  const getInfo = Object.assign(
137
136
  {},
138
137
  {
139
138
  shopId: global.info.queryInfo.shopId,
140
139
  venderId: global.info.queryInfo.venderId,
141
140
  },
142
141
  params,
143
142
  )
144
143
  const { type = 'navigateTo', ...otherShopInfo } = getInfo
145
144
  if (this.jingGouMiniState) {
146
145
  let shopUrl = `${this.jumpMiniPath.shopx}${window.location.search}`
147
146
  if (/\/shop\/(samCenter|samCard)/.test(window.location.pathname)) {
148
147
  shopUrl = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(
149
148
  this.getShopIdsInfo(otherShopInfo),
150
149
  )}`
151
150
  }
152
151
  this.jdJumpToMiniPage(shopUrl, otherShopInfo, type)
153
152
  } else {
154
153
  super.jdJumpToShopHome(otherShopInfo)
155
154
  }
156
155
  }
157
156
 
158
157
  jdJumpToShopCategory(params) {
159
158
  console.log('[降级H5] jdJumpToShopCategory web.wxapp')
160
159
  const { type = 'navigateTo', ...otherShopInfo } = params
161
160
  if (this.jingGouMiniState) {
162
161
  let shopUrl = `${this.jumpMiniPath.shopx}${window.location.search}`
163
162
  this.jdJumpToMiniPage(shopUrl, otherShopInfo, type)
164
163
  } else {
165
164
  super.jdJumpToShopCategory(otherShopInfo)
166
165
  }
167
166
  }
168
167
 
169
168
  jdJumpToLive(liveInfo, logEventInfo = {}) {
170
169
  if (liveInfo?.liveId) {
171
170
  this.jdJumpToWeb(
172
171
  `${this.jumpWebUrl.mLive}/${liveInfo?.liveId}?${
173
172
  this.jingGouMiniState ? 'origin=0&appid=jdgw' : 'origin=30'
174
173
  }`,
175
174
  logEventInfo,
176
175
  )
177
176
  }
178
177
  }
179
178
 
180
179
  jdJumpToShopLight(shopInfo) {
181
180
  if (this.jingGouMiniState) {
182
181
  this.jdJumpToMiniPage(
183
182
  `${this.jumpMiniPath.shopLight}?${objectToUrlEncode(
184
183
  this.getShopIdOrVenderIdParams(shopInfo),
185
184
  )}`,
186
185
  {
187
186
  ...shopInfo,
188
187
  },
189
188
  )
190
189
  } else {
191
190
  this.jdNavigateToNative(
192
191
  `${this.jumpWebUrl.shopLight}?${objectToUrlEncode(
193
192
  this.getShopIdOrVenderIdParams(shopInfo),
194
193
  )}`,
195
194
  {
196
195
  ...shopInfo,
197
196
  },
198
197
  )
199
198
  }
200
199
  }
201
200
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
202
201
  if (this.jingGouMiniState) {
203
202
  const detailUrl = `${this.jumpMiniPath.searchCoupon}?batch=${couponId}`
204
203
  this.jdJumpToMiniPage(detailUrl, logEventInfo)
205
204
  } else {
206
205
  super.jdJumpToCouponSearchProductList(couponId, logEventInfo)
207
206
  }
208
207
  }
208
+ import global from '../common'
209
209
  objectToUrlEncode,
210
210
  parseQueryUrlString,
211
211
  isH5AndJingGouMini,
212
212
  SECTION_HOME_TAB_TYPE,
213
213
  SECTION_HOME_TAB_NAME_TYPE,
214
214
  public jingGouMiniState: boolean
215
215
  private isH5OpenToWxapp: boolean
216
216
  constructor(opt) {
217
217
  super(opt)
218
218
  this.jingGouMiniState = false
219
219
  this.getConfig(opt)
220
220
  console.log(
221
221
  'window.shopGlobalSwitch:',
222
222
  JSON.stringify(window.shopGlobalSwitch),
223
223
  )
224
224
  this.isH5OpenToWxapp =
225
225
  window.shopGlobalSwitch?.openMobileShopToWxApp == 'true'
226
226
  this.init()
227
227
  }
228
228
  getConfig(opt) {
229
229
  return Object.assign(this, {}, defaultConfig, super.getConfig(opt), opt)
230
230
  }
231
231
 
232
232
 
233
233
  async init() {
234
234
  if (window.isJingGouMiniViewState) {
235
235
  this.jingGouMiniState = true
236
236
  } else {
237
237
  console.log(
238
238
  '初始化进行小程序环境检查, 当前是否是京购小程序里的H5',
239
239
  isH5AndJingGouMini,
240
240
  )
241
241
  if (isH5AndJingGouMini && this.isH5OpenToWxapp) {
242
242
  console.log('进入了 isH5AndJingGouMini && this.isH5OpenToWxapp 的if')
243
243
  this.jingGouMiniState = true
244
244
  window.isJingGouMiniViewState = true
245
245
  console.log('进入了 iwx?.miniProgram then 但是没有继续跳转的逻辑 ')
246
246
  global.info.isJingGouMiniViewState = true
247
247
  } else {
248
248
  console.log('进入了 isH5AndJingGouMini && this.isH5OpenToWxapp 的esle')
249
249
  }
250
250
  }
251
251
  }
252
252
 
253
253
  jdJumpToMiniPage(pageUrl, logEventInfo, type = 'navigateTo') {
254
254
  this.jdNavigateToNative(
255
255
  pageUrl,
256
256
  logEventInfo,
257
257
  () => {
258
258
  console.log('JD.wxappext.goto')
259
259
  wx?.miniProgram[type] &&
260
260
  wx?.miniProgram[type]({
261
261
  url: pageUrl,
262
262
  })
263
263
  },
264
264
  () => {
265
265
  console.log('JD.wxappext.goto2')
266
266
  wx?.miniProgram[type] &&
267
267
  wx?.miniProgram[type]({
268
268
  url: pageUrl,
269
269
  })
270
270
  },
271
271
  )
272
272
  }
273
273
 
274
274
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
275
275
  console.log('web.wxapp.ts - jdJumpToTabAllProduct')
276
276
  if(typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId
277
277
  if(typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId
278
278
  if (this.jingGouMiniState) {
279
279
  const param = {
280
280
  shopId,
281
281
  venderId,
282
282
  tabActive: SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT],
283
283
  }
284
284
  const url = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(param)}`
285
285
  this.jdJumpToMiniPage(url, logEventInfo)
286
286
  } else {
287
287
  super.jdJumpToTabAllProduct(shopId, venderId, logEventInfo)
288
288
  }
289
289
  }
290
290
 
291
291
  jdJumpToTopTabBase(type, shopInfo = {}) {
292
292
  const getInfo = Object.assign(
293
293
  {},
294
294
  {
295
295
  shopId: global.info.queryInfo.shopId,
296
296
  venderId: global.info.queryInfo.venderId,
297
297
  },
298
298
  shopInfo,
299
299
  )
300
300
  if (this.jingGouMiniState) {
301
301
  const {shopId, venderId, ...otherInfo} = getInfo
302
302
  const param = {
303
303
  shopId,
304
304
  venderId,
305
305
  tabActive: type,
306
306
  }
307
307
  const url = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(param)}`
308
308
  this.jdJumpToMiniPage(url, otherInfo)
309
309
  } else {
310
310
  super.jdJumpToTopTabBase(type, shopInfo)
311
311
  }
312
312
  }
313
313
 
314
314
  jdJumpToWeb(url, logEventInfo) {
315
315
  console.log('web.wxapp.ts - jdJumpToWeb', url)
316
316
  console.log('jingGouMiniState', this.jingGouMiniState)
317
317
  if (this.jingGouMiniState) {
318
318
  const encodeUrl = `${
319
319
  this.jumpMiniPath.h5
320
320
  }?encode_url=${encodeURIComponent(url)}`
321
321
  this.jdJumpToMiniPage(encodeUrl, logEventInfo)
322
322
  } else {
323
323
  super.jdJumpToWeb(url, logEventInfo)
324
324
  }
325
325
  }
326
326
 
327
327
  jdJumpToWebInner(url, logEventInfo) {
328
328
  super.jdJumpToWeb(url, logEventInfo)
329
329
  }
330
330
 
331
331
  jdJumpToProduct(skuIds, logEventInfo) {
332
332
  if (this.jingGouMiniState) {
333
333
  const detailUrl = `${this.jumpMiniPath.detail}?sku=${skuIds}`
334
334
  this.jdJumpToMiniPage(detailUrl, logEventInfo)
335
335
  } else {
336
336
  super.jdJumpToProduct(skuIds, logEventInfo)
337
337
  }
338
338
  }
339
339
 
340
340
  jdJumpToShopHome(params) {
341
341
  console.log('[降级H5] jdJumpToShopHome web.wxapp', params)
342
342
  console.log('global.info.queryInfo.shopId', global.info.queryInfo.shopId, global.info.queryInfo.venderId)
343
343
  const getInfo = Object.assign(
344
344
  {},
345
345
  {
346
346
  shopId: global.info.queryInfo.shopId,
347
347
  venderId: global.info.queryInfo.venderId,
348
348
  },
349
349
  params,
350
350
  )
351
351
  const { type = 'navigateTo', ...otherShopInfo } = getInfo
352
352
  if (this.jingGouMiniState) {
353
353
  let shopUrl = `${this.jumpMiniPath.shopx}${window.location.search}`
354
354
  if (/(\/shop\/(samCenter|samCard))|(\/sale\/home)/.test(window.location.pathname)) {
355
355
  shopUrl = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(
356
356
  this.getShopIdsInfo(otherShopInfo),
357
357
  )}`
358
358
  }
359
359
  this.jdJumpToMiniPage(shopUrl, otherShopInfo, type)
360
360
  } else {
361
361
  super.jdJumpToShopHome(otherShopInfo)
362
362
  }
363
363
  }
364
364
 
365
365
  jdJumpToShopCategory(params) {
366
366
  console.log('[降级H5] jdJumpToShopCategory web.wxapp')
367
367
  const { type = 'navigateTo', ...otherShopInfo } = params
368
368
  if (this.jingGouMiniState) {
369
369
  let shopUrl = `${this.jumpMiniPath.shopx}${window.location.search}`
370
370
  this.jdJumpToMiniPage(shopUrl, otherShopInfo, type)
371
371
  } else {
372
372
  super.jdJumpToShopCategory(otherShopInfo)
373
373
  }
374
374
  }
375
375
 
376
376
  jdJumpToLive(liveInfo, logEventInfo = {}) {
377
377
  if (liveInfo?.liveId) {
378
378
  this.jdJumpToWeb(
379
379
  `${this.jumpWebUrl.mLive}/${liveInfo?.liveId}?${
380
380
  this.jingGouMiniState ? 'origin=0&appid=jdgw' : 'origin=30'
381
381
  }`,
382
382
  logEventInfo,
383
383
  )
384
384
  }
385
385
  }
386
386
 
387
387
  jdJumpToShopLight(shopInfo) {
388
388
  if (this.jingGouMiniState) {
389
389
  this.jdJumpToMiniPage(
390
390
  `${this.jumpMiniPath.shopLight}?${objectToUrlEncode(
391
391
  this.getShopIdOrVenderIdParams(shopInfo),
392
392
  )}`,
393
393
  {
394
394
  ...shopInfo,
395
395
  },
396
396
  )
397
397
  } else {
398
398
  this.jdNavigateToNative(
399
399
  `${this.jumpWebUrl.shopLight}?${objectToUrlEncode(
400
400
  this.getShopIdOrVenderIdParams(shopInfo),
401
401
  )}`,
402
402
  {
403
403
  ...shopInfo,
404
404
  },
405
405
  )
406
406
  }
407
407
  }
408
408
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
409
409
  if (this.jingGouMiniState) {
410
410
  const detailUrl = `${this.jumpMiniPath.searchCoupon}?batch=${couponId}`
411
411
  this.jdJumpToMiniPage(detailUrl, logEventInfo)
412
412
  } else {
413
413
  super.jdJumpToCouponSearchProductList(couponId, logEventInfo)
414
414
  }
415
415
  }