@conecli/cone-render 0.10.1-shop-beta.11 → 0.10.1-shop-beta.13

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 (78) hide show
  1. package/README.md +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/index.dynamic.ts +1 -0
  4. package/dist/common/index.h5.ts +1 -1
  5. package/dist/common/index.jd.ts +1 -1
  6. package/dist/common/index.ts +1 -1
  7. package/dist/common/index.weapp.ts +1 -1
  8. package/dist/common/jssdk.ts +1 -1
  9. package/dist/common/token/index.h5.ts +1 -1
  10. package/dist/common/wxappApi.ts +1 -1
  11. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  12. package/dist/components/base/CountDown/index.tsx +1 -1
  13. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  14. package/dist/components/base/Dialog/index.dynamic.module.scss +126 -0
  15. package/dist/components/base/Dialog/index.dynamic.tsx +1 -0
  16. package/dist/components/base/DynamicTest/index.dynamic.module.scss +15 -0
  17. package/dist/components/base/DynamicTest/index.module.scss +16 -0
  18. package/dist/components/base/DynamicTest/index.tsx +1 -0
  19. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  20. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  21. package/dist/components/base/JdLoading/index.module.scss +2 -0
  22. package/dist/components/base/JdLoading/index.tsx +1 -1
  23. package/dist/components/base/LazyLoadImage/index.tsx +1 -1
  24. package/dist/components/base/NetworkDataError/const.ts +1 -1
  25. package/dist/components/base/NetworkDataError/index.module.scss +116 -70
  26. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  27. package/dist/components/base/Price/Base/index.dynamic.module.scss +63 -0
  28. package/dist/components/base/Price/Base/index.dynamic.tsx +1 -0
  29. package/dist/components/base/Price/Base/index.module.scss +6 -0
  30. package/dist/components/base/Price/Base/index.tsx +1 -1
  31. package/dist/components/base/Price/Double/index.dynamic.module.scss +172 -0
  32. package/dist/components/base/Price/Double/index.dynamic.tsx +1 -0
  33. package/dist/components/base/Price/Double/index.module.scss +6 -0
  34. package/dist/components/base/Price/Double/index.tsx +1 -1
  35. package/dist/components/debug/DebugLayout/index.module.scss +2 -2
  36. package/dist/config/env.ts +1 -1
  37. package/dist/interface/common.ts +1 -1
  38. package/dist/interface/component.ts +1 -1
  39. package/dist/interface/jumpEventReport.ts +1 -1
  40. package/dist/jumpEventReport/const.ts +1 -1
  41. package/dist/jumpEventReport/index.dynamic.ts +1 -0
  42. package/dist/jumpEventReport/index.h5.ts +1 -1
  43. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  44. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  45. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  46. package/dist/jumpEventReport/web.base.ts +1 -1
  47. package/dist/jumpEventReport/web.jd.ts +1 -1
  48. package/dist/language/zh_CN.json +162 -0
  49. package/dist/open/api/index.ts +1 -1
  50. package/dist/open/api/shopMember.dynamic.ts +1 -0
  51. package/dist/open/api/shopMember.ts +1 -1
  52. package/dist/open/components/index.dynamic.ts +1 -0
  53. package/dist/open/components/index.ts +1 -1
  54. package/dist/sass/app.dynamic.scss +306 -0
  55. package/dist/service/fetchGateway.h5.ts +1 -0
  56. package/dist/service/fetchGateway.ts +1 -1
  57. package/dist/service/fetchGateway.weapp.ts +1 -1
  58. package/dist/service/fetchJsonp.h5.ts +1 -0
  59. package/dist/service/fetchJsonp.ts +1 -1
  60. package/dist/service/http/colorSign.dynamic.ts +1 -0
  61. package/dist/service/http/http.ts +1 -1
  62. package/dist/service/requestServer.h5.ts +1 -1
  63. package/dist/service/requestServer.ts +1 -1
  64. package/dist/service/requestServer.weapp.ts +1 -1
  65. package/dist/utils/connectNativeJsBridge.dynamic.ts +1 -0
  66. package/dist/utils/connectNativeJsBridge.ts +1 -1
  67. package/dist/utils/h5Utils.ts +1 -1
  68. package/dist/utils/index.h5.ts +1 -1
  69. package/dist/utils/index.ts +1 -1
  70. package/dist/utils/index.weapp.ts +1 -1
  71. package/dist/utils/intersectionObserver.ts +1 -1
  72. package/dist/utils/jumpExtMapUtil.ts +1 -0
  73. package/dist/utils/log.ts +1 -0
  74. package/dist/utils/utils.ts +1 -1
  75. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  76. package/dist/wxapp/common/user_info.js +1 -1
  77. package/package.json +51 -31
  78. /package/dist/utils/{jumpExtMapUtil.js → jumpExtMapUtil.h5.ts} +0 -0
@@ -0,0 +1 @@
1
+ import Taro from '@tarojs/taro';
2
  BUSINESS_TYPE,
1
3
  SHOP_MENU_ID_TYPE,
2
4
  SHOP_MENU_ID_NAME,
3
5
  SECTION_HOME_TAB_NAME_TYPE,
4
6
  SECTION_HOME_TAB_TYPE,
5
7
  WX_BUSINESS_TYPE,
6
8
  WXAPP_BIZ_SHOP_LIGHT_KEY,
7
9
  TaroEventType,
8
10
  abTestLabels: {},
9
11
  nonSellableSkuids: {},
10
12
  loginState: false,
11
13
  cookiesStr: '',
12
14
  userInfo: '',
13
15
  isImmersive: false,
14
16
  pageInfo: {
15
17
  wxBusinessType: WX_BUSINESS_TYPE.SHOP,
16
18
  address: '',
17
19
  addressCommaStr: '',
18
20
  un_area: '',
19
21
  userLbsAddress: '',
20
22
  vapptype: '1',
21
23
  pageType: 'home',
22
24
  dataType: BUSINESS_TYPE.ONLINE,
23
25
  floorExposureInfo: {},
24
26
  floorVideInfo: {},
25
27
  productVideInfo: {},
26
28
  tabsLoadAllDataInfo: {
27
29
  [SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN]]: false,
28
30
  [SHOP_MENU_ID_NAME[SHOP_MENU_ID_TYPE.CLASSIFY]]: true,
29
31
  },
30
32
  updateShopInfosAllState: false,
31
33
  isVipShop: false,
32
34
  isJdShowNativeImmersivePlayer: false,
33
35
  ...shopConfig,
34
36
  pageScrollTop: 0,
35
37
  pageIdxHeightInfo: {
36
38
  list: [],
37
39
  },
38
40
  shopNavBarHeight: 0,
39
41
  },
40
42
  defaultQueryLogInfo: {
41
43
  sourceType: 'JDshop',
42
44
  sourceValue: '',
43
45
  moduleId: 'none',
44
46
  entrance: 'none',
45
47
  },
46
48
  originQueryInfo: {},
47
49
  sysInfo: {
48
50
  windowWidth: 0,
49
51
  windowHeight: 0,
50
52
  netWorkType: '4g',
51
53
  jdBottomBarHeight: 0,
52
54
  jdNativeHeaderHeight: 0,
53
55
  },
54
56
  queryInfo: {},
55
57
  shopInfo: {},
56
58
  openAppData: {},
57
59
  public info: CommonInterFace.BaseConfigInfo;
58
60
  public config: {
59
61
  [key: string]: any;
60
62
  };
61
63
  public lazyContainer: CommonInterFace.lazyContainer;
62
64
  public rootEleNode: HTMLElement | null;
63
65
  public checkStatusAndLoginPromise: object | null;
64
66
  public loadJsSdkList: Array<any>;
65
67
  public loadJsSdkListCachePromise: any;
66
68
  public lbsAddressCachePromise: Promise<any> | null;
67
69
  public languageJsonData: any | null;
68
70
  constructor(opt) {
69
71
  this.info = this._getConfig(opt);
70
72
  this.config = {};
71
73
  this.lazyContainer = {
72
74
  [SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN]]: {
73
75
  appLazyContainerList: [],
74
76
  appLazyFinishContainerList: [],
75
77
  },
76
78
  [SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION]]: {
77
79
  appLazyContainerList: [],
78
80
  appLazyFinishContainerList: [],
79
81
  },
80
82
  };
81
83
  this.loadJsSdkList = [];
82
84
  this.loadJsSdkListCachePromise = {};
83
85
  this.rootEleNode = null;
84
86
  this.lbsAddressCachePromise = null;
85
87
  this.languageJsonData = langeJsonDataForCn;
86
88
  this.getSystemInfo();
87
89
  this.checkLoginStatus();
88
90
  }
89
91
  _getConfig(opt) {
90
92
  return Object.assign({}, DefaultConfig, opt);
91
93
  }
92
94
 
93
95
  taskTimeoutPromise(callBack, timeout = 2000) {
94
96
  return new Promise((resolve) => {
95
97
  setTimeout(() => {
96
98
  const getCallBackRes = typeof callBack === 'function' && callBack();
97
99
  return resolve(getCallBackRes || false);
98
100
  }, timeout);
99
101
  });
100
102
  }
101
103
 
102
104
  updateBusinessDomainAndApi(domain, api) {
103
105
  console.log('=================>', 'updateBusinessDomainAndApi');
104
106
  }
105
107
 
106
108
  getTabBarHeight(systemInfo) {
107
109
  const { statusBarHeight, isAndroid, isIOS } = systemInfo;
108
110
  let result = 50;
109
111
  if (statusBarHeight > 20) {
110
112
  if (isIOS) {
111
113
  result = 84;
112
114
  } else if (isAndroid) {
113
115
  result = 53;
114
116
  }
115
117
  }
116
118
  return result;
117
119
  }
118
120
 
119
121
  getSystemInfo() {
120
122
  const info: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfos() || {};
121
123
  const actualNavBarHeight = (info?.navBarHeight || 0) + (info?.navBarExtendHeight || 0);
122
124
  const headerHeight = actualNavBarHeight + (info?.statusBarHeight || 0);
123
125
  const fullScreenHeight = info?.screenHeight;
124
126
  const tabBarHeight = this.getTabBarHeight(info);
125
127
  const safeContentHeight = info?.safeArea?.height;
126
128
  this.info.sysInfo = {
127
129
  ...this.info.sysInfo,
128
130
  ...info,
129
131
  actualNavBarHeight,
130
132
  headerHeight,
131
133
  fullScreenHeight,
132
134
  tabBarHeight,
133
135
  safeContentHeight,
134
136
  };
135
137
  if (this.info.sysInfo['hostVersionName']) {
136
138
  this.info.sysInfo['hostAppVersion'] = Number(
137
139
  this.info.sysInfo['hostVersionName'].replace(/\./g, ''),
138
140
  );
139
141
  }
140
142
  this.getAddressCachePromise();
141
143
  this.getLbsAddressCachePromise();
142
144
  this.info.sysInfo['wifiVideoAutoPlay'] = false;
143
145
  this.getNetWorkType();
144
146
  console.log('获取系统信息', this.info.sysInfo);
145
147
  }
146
148
  async updateMPaasConfig() {}
147
149
 
148
150
  getNetWorkType() {
149
151
  Taro.getNetworkType().then((getRes) => {
150
152
  getRes && getRes.networkType && (this.info.sysInfo['netWorkType'] = getRes.networkType);
151
153
  });
152
154
  }
153
155
  getAPPUseStraightCorner() {
154
156
  return Promise.resolve(false);
155
157
  }
156
158
 
157
159
  checkStatusAndLogin(options = {}) {
158
160
  this.checkStatusAndLoginPromise = new Promise(async (resolve, reject) => {
159
161
  try {
160
162
  const getLoginState = await this.checkLoginStatus(options);
161
163
  if (getLoginState) {
162
164
  const { pin } = await this.getLoginCookie(options);
163
165
  this.info.userInfo = {
164
166
  pin,
165
167
  encodePin: encodeURIComponent(pin),
166
168
  ptkey: '',
167
169
  };
168
170
  resolve(true);
169
171
  } else {
170
172
  reject(false);
171
173
  }
172
174
  } catch (e) {
173
175
  reject(false);
174
176
  }
175
177
  });
176
178
  return this.checkStatusAndLoginPromise;
177
179
  }
178
180
 
179
181
  checkJdStatusAndLogin(
180
182
  options = {
181
183
  loginColor: {
182
184
  biz: WXAPP_BIZ_SHOP_LIGHT_KEY,
183
185
  dpin: 0,
184
186
  },
185
187
  },
186
188
  ) {
187
189
  return this.checkStatusAndLogin(options);
188
190
  }
189
191
 
190
192
  toLogin(options = {}): Promise<any> {
191
193
  return Taro.JDLogin.login(options)
192
194
  }
193
195
 
194
196
  doLogin(options) {
195
197
  return this.toLogin(options);
196
198
  }
197
199
 
198
200
  doLoginForJdPin(options = {}) {
199
201
  return this.doLogin({
200
202
  loginColor: {
201
203
  biz: WXAPP_BIZ_SHOP_LIGHT_KEY,
202
204
  dpin: 0,
203
205
  },
204
206
  ...options,
205
207
  });
206
208
  }
207
209
 
208
210
  getLoginCookie(options = {}) {
209
211
  return new Promise((resolve) => {
210
212
  Taro.JDLogin.getUserPin(options).then(res => {
211
213
  resolve({
212
214
  pin: res?.data || ""
213
215
  })
214
216
  })
215
217
  })
216
218
  }
217
219
 
218
220
 
219
221
  checkLoginStatus(options = {}) {
220
222
  return new Promise((resolve) => {
221
223
  Taro.JDLogin.isLogin(options).then(res => {
222
224
  const getIsLoginState = res?.data || false
223
225
  getIsLoginState && (this.info.loginState = getIsLoginState)
224
226
  resolve(getIsLoginState)
225
227
  })
226
228
  })
227
229
  }
228
230
 
229
231
  getAddressCachePromise() {
230
232
  return new Promise((resolve) => {
231
233
  if (this?.info?.sysInfo?.lat && this?.info?.sysInfo?.lng && this?.info?.sysInfo?.area) {
232
234
  resolve({
233
235
  lat: this.info.sysInfo.lat,
234
236
  lng: this.info.sysInfo.lng,
235
237
  area: this?.info?.sysInfo?.area,
236
238
  });
237
239
  } else {
238
240
  Taro.JDAddress.getCacheAddress({
239
241
  businessId: '219f70bbbf7e4ede7968bedaa1beafb4',
240
242
  sceneId: 'basicShoppingProcess',
241
243
  })
242
244
  .then((res) => {
243
245
  const { errno, data } = res;
244
246
  console.log('taro动态化获取松果getCacheAddress经纬度及四级地址原始数返回结果', errno, data, res);
245
247
  if (errno === 0 && data) {
246
248
  const { latitude, longitude, provinceId, cityId, countyId, townId } =
247
249
  data || {};
248
250
  let area = '';
249
251
  this.info.sysInfo['lat'] = `${latitude || ''}`;
250
252
  this.info.sysInfo['lng'] = `${longitude || ''}`;
251
253
  const getProvinceIdNum = provinceId ? Number(provinceId) : 0;
252
254
  if (getProvinceIdNum && getProvinceIdNum > 0) {
253
255
  area = `${provinceId}_${cityId || 0}_${countyId || 0}_${townId || 0}`;
254
256
  this.info.pageInfo['address'] = area;
255
257
  this.info.pageInfo['addressCommaStr'] = area.replace(/_/g, ',');
256
258
  this.info.sysInfo['area'] = area;
257
259
  Taro.eventCenter.trigger(TaroEventType.USER_AREA_UPDATE, {
258
260
  area: this.info.pageInfo.address,
259
261
  });
260
262
  }
261
263
  resolve({
262
264
  lat: this.info.sysInfo['lat'],
263
265
  lng: this.info.sysInfo['lng'],
264
266
  area: area,
265
267
  });
266
268
  } else {
267
269
  if (typeof res === 'object') {
268
270
  draBusinessCustomReport({
269
271
  type: 'taro_JDAddress_getCacheAddress_info_err',
270
272
  errMsg: '松果app内通过Taro动态化获取获取用户地址及经纬度信息异常',
271
273
  originReqDataStr: JSON.stringify(res),
272
274
  });
273
275
  }
274
276
  resolve({ lat: '', lng: '', area: '' });
275
277
  }
276
278
  })
277
279
  .catch((error) => {
278
280
  console.error('Taro.JDAddress.getCacheAddress error:', error);
279
281
  draBusinessCustomReport({
280
282
  type: 'taro_JDAddress_getCacheAddress_info_err',
281
283
  errMsg: '松果app内通过Taro动态化获取获取用户地址及经纬度信息catch异常',
282
284
  });
283
285
  resolve({ lat: '', lng: '', area: '' });
284
286
  });
285
287
  }
286
288
  });
287
289
  }
288
290
 
289
291
  getLbsAddressCachePromise(): Promise<{
290
292
  ok: boolean;
291
293
  msg?: string;
292
294
  realTimeArea: string;
293
295
  data?: any;
294
296
  }> {
295
297
  if (!this.lbsAddressCachePromise) {
296
298
  this.lbsAddressCachePromise = new Promise((resolve) => {
297
299
  Taro.JDLocation.getCacheLocation({
298
300
  businessId: '219f70bbbf7e4ede7968bedaa1beafb4',
299
301
  sceneId: 'basicShoppingProcess',
300
302
  })
301
303
  .then((res) => {
302
304
  const { errno, data } = res;
303
305
  console.log('taro动态化获取松果appGetJdLbsCacheAddressRes,返回结果', errno, data, res);
304
306
  if (errno === 0 && data) {
305
307
  const { lat, lng, provinceId, cityId, districtId, townId } =
306
308
  data || {};
307
309
  let realTimeArea = '';
308
310
  this.info.sysInfo['srclat'] = `${lat || ''}`;
309
311
  this.info.sysInfo['srclng'] = `${lng || ''}`;
310
312
  const getProvinceIdNum = provinceId ? Number(provinceId) : 0;
311
313
  if (getProvinceIdNum && getProvinceIdNum > 0) {
312
314
  realTimeArea = `${getProvinceIdNum}_${cityId || 0}_${districtId || 0}_${townId || 0}`;
313
315
  this.info.pageInfo['userLbsAddress'] = realTimeArea;
314
316
  this.info.sysInfo['realTimeArea'] = realTimeArea;
315
317
  Taro.eventCenter.trigger(TaroEventType.USER_AREA_UPDATE, {
316
318
  realTimeArea: this.info.pageInfo.userLbsAddress,
317
319
  });
318
320
  } else {
319
321
  this.lbsAddressCachePromise = null;
320
322
  }
321
323
  const getValidRealTimeArea = realTimeArea !== '';
322
324
  resolve({
323
325
  lat: this.info.sysInfo['srclat'],
324
326
  lng: this.info.sysInfo['srclng'],
325
327
  realTimeArea: realTimeArea,
326
328
  ok: getValidRealTimeArea,
327
329
  msg: getValidRealTimeArea
328
330
  ? '成功'
329
331
  : '根据Taro.JDLocation.getCacheLocation底层获取lbs地址信息异常,详情见data',
330
332
  data: getValidRealTimeArea ? null : res,
331
333
  });
332
334
  } else {
333
335
  if (typeof res === 'object') {
334
336
  draBusinessCustomReport({
335
337
  type: 'taro_JDLocation_getCacheLocation_info_err',
336
338
  errMsg: '根据Taro.JDLocation.getCacheLocation底层获取lbs地址信息异常异常',
337
339
  originReqDataStr: JSON.stringify(res),
338
340
  });
339
341
  }
340
342
  this.lbsAddressCachePromise = null;
341
343
  resolve({ realTimeArea: '', ok: false });
342
344
  }
343
345
  })
344
346
  .catch((error) => {
345
347
  console.error('Taro.JDLocation.getCacheLocation error:', error);
346
348
  draBusinessCustomReport({
347
349
  type: 'taro_JDLocation_getCacheLocation_info_err',
348
350
  errMsg: '根据Taro.JDLocation.getCacheLocation底层获取lbs地址信息catch异常',
349
351
  });
350
352
  this.lbsAddressCachePromise = null;
351
353
  resolve({ realTimeArea: '', ok: false });
352
354
  });
353
355
  });
354
356
  }
355
357
  return this.lbsAddressCachePromise;
356
358
  }
357
359
 
358
360
  updatePageAndLogInfo(updateQuery = {}) {
359
361
  const createUpdateQueryInfo: {
360
362
  query: {
361
363
  shopId?: string | number;
362
364
  venderId?: string | number;
363
365
  };
364
366
  updateShopInfoState: boolean;
365
367
  } = Object.assign(
366
368
  {},
367
369
  {
368
370
  query: {},
369
371
  updateShopInfoState: false,
370
372
  },
371
373
  updateQuery,
372
374
  );
373
375
  console.log(
374
376
  '获取当前下发的店铺查询参数',
375
377
  updateQuery,
376
378
  '获取之前保存的shopInfo店铺查询参数',
377
379
  this.info?.shopInfo,
378
380
  );
379
381
  const { query, updateShopInfoState } = createUpdateQueryInfo;
380
382
  const { shopId, venderId } = query;
381
383
  if (updateShopInfoState) {
382
384
  this.info.queryInfo = {
383
385
  ...this.info.queryInfo,
384
386
  ...query,
385
387
  };
386
388
  if (shopId && venderId) {
387
389
  this.info.shopInfo = {
388
390
  shopId: `${shopId}`,
389
391
  venderId: `${venderId}`,
390
392
  };
391
393
  }
392
394
  } else {
393
395
  this.info.queryInfo = {
394
396
  ...query,
395
397
  };
396
398
  this.info.originQueryInfo = {
397
399
  ...query,
398
400
  };
399
401
  if (
400
402
  this.info.shopInfo?.shopId &&
401
403
  this.info.shopInfo?.venderId &&
402
404
  (this.info.shopInfo.shopId == shopId || this.info.shopInfo.venderId == venderId)
403
405
  ) {
404
406
  this.info.queryInfo.shopId = this.info.shopInfo.shopId;
405
407
  this.info.queryInfo.venderId = this.info.shopInfo.venderId;
406
408
  console.log(
407
409
  '当前存储的店铺shopId和venderId与下发的店铺信息shopId或者venderId为同一个,补充shopId或者venderId查询参数',
408
410
  this.info.queryInfo,
409
411
  );
410
412
  }
411
413
  }
412
414
  this.info.queryInfo['shopId'] &&
413
415
  (this.info.queryInfo['shopId'] = `${this.info.queryInfo['shopId']}`);
414
416
  this.info.queryInfo['venderId'] &&
415
417
  (this.info.queryInfo['venderId'] = `${this.info.queryInfo['venderId']}`);
416
418
  console.log(
417
419
  'dynamic===获取店铺下发查询参数\n',
418
420
  query,
419
421
  '\n获取店铺最后查询参数\n',
420
422
  this.info.queryInfo,
421
423
  '\n是否为更新店铺状态\n',
422
424
  updateShopInfoState,
423
425
  );
424
426
  }
425
427
 
426
428
  getDynamicConfig(key: string) {
427
429
  console.warn('调用微信小程序的 getDynamicConfig(),注意,此方法还未实现!');
428
430
  return null;
429
431
  }
430
432
  renderNextTickLoadSdk() {
431
433
  console.warn('暂未实现 index.weapp.ts');
432
434
  }
433
435
  loadOtherSdk() {
434
436
  console.warn('暂未实现 index.weapp.ts');
435
437
  }
436
438
  loadItemSdkPromise() {
437
439
  console.warn('暂未实现 index.weapp.ts');
438
440
  }