@conecli/cone-render 0.10.1-shop-beta.24 → 0.10.1-shop-beta.26

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