@conecli/cone-render 0.10.1-shop3.1 → 0.10.1-shop3.100

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 (129) hide show
  1. package/README.md +1 -1
  2. package/dist/api/index.ts +1 -1
  3. package/dist/common/accessibility.h5.ts +1 -0
  4. package/dist/common/accessibility.ts +1 -0
  5. package/dist/common/const.ts +1 -1
  6. package/dist/common/index.h5.ts +1 -1
  7. package/dist/common/index.jd.ts +1 -1
  8. package/dist/common/index.ts +1 -1
  9. package/dist/common/index.weapp.ts +1 -1
  10. package/dist/common/jdplayerSdk.weapp.tsx +1 -0
  11. package/dist/common/jssdk.ts +1 -1
  12. package/dist/common/jssdk.weapp.ts +1 -0
  13. package/dist/common/pageType.ts +1 -1
  14. package/dist/common/token/index.h5.ts +1 -1
  15. package/dist/common/token/token.jd.ts +1 -1
  16. package/dist/common/wxappApi.ascf.ts +1 -0
  17. package/dist/common/wxappApi.ts +1 -1
  18. package/dist/components/ErrorBoundary.tsx +1 -1
  19. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  20. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  21. package/dist/components/base/CountDown/index.module.scss +49 -44
  22. package/dist/components/base/CountDown/index.tsx +1 -1
  23. package/dist/components/base/CustomScrollView/index-back.tsx +1 -0
  24. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  25. package/dist/components/base/CustomVideo/index.tsx +1 -1
  26. package/dist/components/base/CustomVideo/index.weapp.tsx +1 -0
  27. package/dist/components/base/Dialog/index.module.scss +11 -0
  28. package/dist/components/base/ExposureSmart/index.h5.module.scss +12 -2
  29. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  30. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  31. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  32. package/dist/components/base/InOrOutViewObserver/index.weapp.tsx +1 -0
  33. package/dist/components/base/InViewRender/index.tsx +1 -1
  34. package/dist/components/base/ItemViewExposureSmart/index.module.scss +2 -2
  35. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  36. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  37. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  38. package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
  39. package/dist/components/base/MobileCommonHeader/index.weapp.tsx +1 -0
  40. package/dist/components/base/NetworkDataError/const.ts +1 -1
  41. package/dist/components/base/NetworkDataError/index.module.scss +118 -72
  42. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  43. package/dist/components/base/Price/Base/index.module.scss +12 -0
  44. package/dist/components/base/Price/Base/index.tsx +1 -1
  45. package/dist/components/base/Price/Double/index.module.scss +33 -1
  46. package/dist/components/base/Price/Double/index.tsx +1 -1
  47. package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
  48. package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
  49. package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
  50. package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
  51. package/dist/components/debug/DebugLayout/index.module.scss +2 -2
  52. package/dist/components/floorItem.tsx +1 -1
  53. package/dist/components/floorItem.weapp.tsx +1 -1
  54. package/dist/components/isv/Floor/index.tsx +1 -1
  55. package/dist/components/remoteFloorItem.tsx +1 -1
  56. package/dist/config/env.ts +1 -1
  57. package/dist/interface/common.ts +1 -1
  58. package/dist/interface/component.ts +1 -1
  59. package/dist/interface/jumpEventReport.ts +1 -1
  60. package/dist/interface/service.ts +1 -1
  61. package/dist/jumpEventReport/base.ts +1 -1
  62. package/dist/jumpEventReport/const.ts +1 -1
  63. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  64. package/dist/jumpEventReport/index.h5.ts +1 -1
  65. package/dist/jumpEventReport/index.jd.ts +1 -1
  66. package/dist/jumpEventReport/index.weapp.ts +1 -1
  67. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  68. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  69. package/dist/jumpEventReport/logEventConfig.h5.ts +1 -0
  70. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  71. package/dist/jumpEventReport/web/report.ts +1 -1
  72. package/dist/jumpEventReport/web.base.ts +1 -1
  73. package/dist/jumpEventReport/web.jd.ts +1 -1
  74. package/dist/jumpEventReport/web.jdb.ts +1 -1
  75. package/dist/jumpEventReport/web.jdjch.ts +1 -1
  76. package/dist/jumpEventReport/web.jxwxapp.ts +1 -1
  77. package/dist/jumpEventReport/web.pc.ts +1 -1
  78. package/dist/jumpEventReport/web.tjapp.ts +1 -1
  79. package/dist/jumpEventReport/web.tjm.ts +1 -1
  80. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  81. package/dist/language/en_US.json +395 -0
  82. package/dist/language/zh_CN.json +395 -0
  83. package/dist/language/zh_HK.json +395 -0
  84. package/dist/libs/openShopBridge.js +161 -0
  85. package/dist/libs/openShopBridge.min.js +1 -0
  86. package/dist/libs/taroAppReport.js +2 -2
  87. package/dist/modules/ContainerFloorList/index.h5.module.scss +80 -53
  88. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  89. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  90. package/dist/modules/DecorateContainerFloorList/index.weapp.tsx +1 -0
  91. package/dist/open/api/environment.ts +1 -1
  92. package/dist/open/api/shopMember.ts +1 -1
  93. package/dist/open/api/shopMember.weapp.ts +1 -0
  94. package/dist/open/api/track.ts +1 -1
  95. package/dist/open/api/util.ts +1 -1
  96. package/dist/open/components/index.ts +1 -1
  97. package/dist/open/index.ts +1 -1
  98. package/dist/sass/app.h5.scss +278 -224
  99. package/dist/sass/base.scss +150 -145
  100. package/dist/service/fetchGateway.ts +1 -1
  101. package/dist/service/fetchGateway.weapp.ts +1 -0
  102. package/dist/service/fetchJsonp.weapp.ts +1 -0
  103. package/dist/service/http/colorSign.ts +1 -1
  104. package/dist/service/http/const.ts +1 -1
  105. package/dist/service/http/h5Http.ts +1 -1
  106. package/dist/service/http/httpInterceptors.weapp.ts +1 -0
  107. package/dist/service/requestServer.h5.ts +1 -1
  108. package/dist/service/requestServer.ts +1 -1
  109. package/dist/service/requestServer.weapp.ts +1 -0
  110. package/dist/utils/connectNativeJsBridge.ts +1 -1
  111. package/dist/utils/h5Utils.ts +1 -1
  112. package/dist/utils/harmonyCallRouter.h5.ts +1 -0
  113. package/dist/utils/harmonyCallRouter.ts +0 -0
  114. package/dist/utils/index.h5.ts +1 -1
  115. package/dist/utils/index.ts +1 -1
  116. package/dist/utils/index.weapp.ts +1 -1
  117. package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
  118. package/dist/utils/jumpExtMapUtil.ts +1 -0
  119. package/dist/utils/jumpExtMapUtil.weapp.ts +1 -0
  120. package/dist/utils/log.ts +1 -0
  121. package/dist/utils/sColor.ts +1 -0
  122. package/dist/utils/sColor.weapp.ts +1 -0
  123. package/dist/utils/utils.ts +1 -1
  124. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  125. package/dist/wxapp/common/user_info.js +1 -1
  126. package/package.json +162 -141
  127. package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
  128. package/dist/utils/memberFormatUtils.js +0 -1
  129. package/dist/utils/priceUtils.js +0 -1
@@ -0,0 +1 @@
1
+ import Taro from '@tarojs/taro';
2
  cookiesStr: '',
1
3
  requestHeaderContentType: {
2
4
  jsonHeader: {
3
5
  'content-type': 'application/json;charset=utf-8',
4
6
  },
5
7
  formDataHeader: {
6
8
  'content-type': 'application/x-www-form-urlencoded',
7
9
  },
8
10
  },
9
11
  requestBaseParam: {
10
12
  data: null,
11
13
  header: {
12
14
  'content-type': 'application/json;charset=utf-8',
13
15
  },
14
16
  },
15
17
  timeOut: 7000,
16
18
  apiClientParams: {
17
19
  appid: 'wx_mini_app',
18
20
  clientVersion: '11.0.0',
19
21
  client: 'wh5',
20
22
  area: '1_72_2799_0',
21
23
  screen: `${Math.ceil(getSystemInfo?.screenWidth * devicePixelRatio)}*${Math.ceil(
22
24
  getSystemInfo?.screenHeight * devicePixelRatio,
23
25
  )}`,
24
26
  uuid: '-1',
25
27
  loginType: '11',
26
28
  },
27
29
  public addressFetchInfo: {
28
30
  reqState: boolean;
29
31
  promiseInstance: null | Promise<any>;
30
32
  };
31
33
  public getPromotionConfig: {
32
34
  projectId: null | string | number;
33
35
  pageId: null | string | number;
34
36
  };
35
37
  public resInfo: ServiceInterFace.HttpRequestInfo;
36
38
  public api: ServiceInterFace.HttpApi;
37
39
  public verifyColorList: string[];
38
40
  constructor(opt) {
39
41
  this._init();
40
42
  this.addressFetchInfo = {
41
43
  reqState: false,
42
44
  promiseInstance: null,
43
45
  };
44
46
  this.getPromotionConfig = {
45
47
  projectId: null,
46
48
  pageId: null,
47
49
  };
48
50
  this._userAreaUpdateListen();
49
51
  this.resInfo = this._getResConfig(opt);
50
52
  this.api = api;
51
53
  this.verifyColorList = [...WxappVerifyColorList];
52
54
  }
53
55
  _init(): void {
54
56
  httpInterceptors.forEach((item) => {
55
57
  Taro.addInterceptor((chain) => item(chain));
56
58
  });
57
59
  }
58
60
  _getResConfig(opt = {}): ServiceInterFace.HttpRequestInfo {
59
61
  return Object.assign({}, DefaultConfig, opt);
60
62
  }
61
63
 
62
64
  _userAreaUpdateListen() {
63
65
  Taro.eventCenter.on(TaroEventType.USER_AREA_UPDATE, (areaInfo) => {
64
66
  this.updateApiClientParamsResInfo(areaInfo);
65
67
  });
66
68
  }
67
69
  updateApiClientParamsResInfo(opt = {}) {
68
70
  const { area, realTimeArea, ...others } = opt;
69
71
  this.resInfo.apiClientParams = {
70
72
  ...this.resInfo.apiClientParams,
71
73
  ...others,
72
74
  };
73
75
  area && area !== '' && (this.resInfo.apiClientParams.area = area);
74
76
  realTimeArea &&
75
77
  realTimeArea !== '' &&
76
78
  (this.resInfo.apiClientParams.realTimeArea = realTimeArea);
77
79
  }
78
80
 
79
81
  gatewayReq(functionId: string, bodyParams = {}, clientParams = {}): Promise<any> {
80
82
  if (functionId === 'receiveShopCoupon') {
81
83
  clientParams = Object.assign(
82
84
  {},
83
85
  {
84
86
  loginType: '1',
85
87
  loginWQBiz: WXAPP_BIZ_KEY,
86
88
  },
87
89
  clientParams,
88
90
  );
89
91
  }
90
92
  const apiClientParams = Object.assign({}, this.resInfo.apiClientParams, clientParams);
91
93
  const isColorVerify = this.verifyColorList.includes(functionId);
92
94
  const getReqData = {
93
95
  functionId: functionId,
94
96
  body: JSON.stringify(bodyParams),
95
97
  t: Date.now(),
96
98
  ...apiClientParams,
97
99
  };
98
100
  return http
99
101
  .request({
100
102
  url: this.api.apiFunc,
101
103
  data: getReqData,
102
104
  isColorVerify,
103
105
  })
104
106
  .then((res: ServiceInterFace.RequestPromiseRes) => {
105
107
  const { statusCode, data } = res;
106
108
  let changeRes: ServiceInterFace.RequestResponseFormatRes = {
107
109
  ok: true,
108
110
  };
109
111
  if (statusCode === 200 && data) {
110
112
  const resCode = Object.prototype.hasOwnProperty.call(res.data, 'code')
111
113
  ? Number(res.data.code)
112
114
  : -1;
113
115
  const subCode = Object.prototype.hasOwnProperty.call(res.data, 'subCode')
114
116
  ? Number(res.data.subCode)
115
117
  : -1;
116
118
  if (
117
119
  data.success === true ||
118
120
  data.isSuccess ||
119
121
  resCode === 0 ||
120
122
  resCode === 200 ||
121
123
  subCode === 0
122
124
  ) {
123
125
  changeRes = {
124
126
  result: Object.prototype.hasOwnProperty.call(data, 'result')
125
127
  ? data.result
126
128
  : Object.prototype.hasOwnProperty.call(data, 'data')
127
129
  ? data.data
128
130
  : data,
129
131
  code: data.code || 200,
130
132
  ok: true,
131
133
  source: data,
132
134
  };
133
135
  return changeRes;
134
136
  } else {
135
137
  changeRes = {
136
138
  ...data,
137
139
  ok: false,
138
140
  statusCode: res.statusCode,
139
141
  };
140
142
  return changeRes;
141
143
  }
142
144
  } else {
143
145
  changeRes = {
144
146
  ...data,
145
147
  ok: false,
146
148
  statusCode: res.statusCode,
147
149
  };
148
150
  return changeRes;
149
151
  }
150
152
  })
151
153
  .catch((res) => {
152
154
  return {
153
155
  ...res,
154
156
  ok: false,
155
157
  } as ServiceInterFace.RequestResponseFormatRes;
156
158
  });
157
159
  }
158
160
 
159
161
  async receiveCoupon(param = {}, clientParams) {
160
162
  console.warn('receiveCoupon 方法在微信京购小程序环境未经验证,请不要使用!');
161
163
  return await this.gatewayReq(
162
164
  'receiveShopCoupon',
163
165
  {
164
166
  operation: '3',
165
167
  ...param,
166
168
  },
167
169
  { ...clientParams },
168
170
  );
169
171
  }
170
172
 
171
173
  getCustomerCenterDispatch(params = {}) {
172
174
  return this.gatewayReq('customerCenterDispatch', params, {
173
175
  clientVersion: '9.2.0',
174
176
  client: 'H5',
175
177
  uuid: 88888,
176
178
  appid: 'shopmember_m_jd_com',
177
179
  });
178
180
  }
179
181
 
180
182
  batchAddCart(...args) {
181
183
  let skuIds, num, showToast, giftCard;
182
184
  if (['number', 'string'].includes(typeof args[0])) {
183
185
  [skuIds, num = 1, showToast = true, giftCard = false] = args;
184
186
  } else if (typeof args[0] === 'object' && args[0] !== null) {
185
187
  const params = args[0];
186
188
  skuIds = params.skuIds;
187
189
  num = params.num || 1;
188
190
  showToast = params.showToast !== undefined ? params.showToast : true;
189
191
  giftCard = params.giftCard !== undefined ? params.giftCard : false;
190
192
  } else {
191
193
  console.error('batchAddCart() Invalid arguments!', args);
192
194
  const msg = isLanguageForEn ? 'Please retry later' : '加入购物车失败,请稍后重试!';
193
195
  showFailToast({
194
196
  title: msg,
195
197
  });
196
198
  return Promise.resolve({
197
199
  ok: false,
198
200
  msg,
199
201
  });
200
202
  }
201
203
  const addToWhereText = giftCard ? '购物清单' : '购物车';
202
204
  const successMsg = isLanguageForEn ? 'Success' : `加入${addToWhereText}成功`;
203
205
  const failMsg = isLanguageForEn
204
206
  ? 'Please retry later'
205
207
  : `加入${addToWhereText}失败,请稍后重试!`;
206
208
  if (skuIds) {
207
209
  return this._addShopGoodCart(`${skuIds}`, `${num}`, { giftCard })
208
210
  .then((res: ServiceInterFace.SkuToCartDataRes) => {
209
211
  if (res?.ok) {
210
212
  if (showToast && !res?.isOpenApp)
211
213
  showSuccessToast({
212
214
  title: successMsg,
213
215
  });
214
216
  } else {
215
217
  showToast &&
216
218
  showFailToast({
217
219
  title: res?.errMsg || failMsg,
218
220
  });
219
221
  }
220
222
  return Promise.resolve(res);
221
223
  })
222
224
  .catch((e) => {
223
225
  console.log('调用加购方法异常=======>', e);
224
226
  return Promise.resolve({
225
227
  ok: false,
226
228
  msg: failMsg,
227
229
  });
228
230
  });
229
231
  } else {
230
232
  return Promise.resolve({
231
233
  ok: false,
232
234
  msg: failMsg,
233
235
  });
234
236
  }
235
237
  }
236
238
 
237
239
  async giftCardAddCart(skuList, num) {
238
240
  return this.gatewayReq('giftCardAddCart', {
239
241
  skuList,
240
242
  num: Number(num),
241
243
  });
242
244
  }
243
245
 
244
246
  _addShopGoodCart(skuIdsStr, addCardNum = '1', { giftCard }) {
245
247
  return new Promise((resolve) => {
246
248
  const productIdsArr = skuIdsStr ? `${skuIdsStr}`.split(',') : [];
247
249
  if (productIdsArr.length > 0) {
248
250
  if (giftCard) {
249
251
  this.giftCardAddCart(productIdsArr, addCardNum)
250
252
  .then((res) => {
251
253
  if (res?.code === '0' && res?.result?.value) {
252
254
  resolve({
253
255
  ok: true,
254
256
  });
255
257
  } else {
256
258
  resolve({
257
259
  ok: false,
258
260
  msg: '加购失败,请稍后重试',
259
261
  });
260
262
  }
261
263
  })
262
264
  .catch((e) => {
263
265
  console.error('礼品卡加车失败: ', e);
264
266
  resolve({
265
267
  ok: false,
266
268
  msg: '加购失败,请稍后重试',
267
269
  });
268
270
  });
269
271
  } else if (isJdApp) {
270
272
  console.log('==========>', 'app原生批量加车!,小程序端暂不涉及');
271
273
  } else if (isMin) {
272
274
  console.log('==========>', '京购批量加车!');
273
275
  let singleSkuAdParams;
274
276
  if (productIdsArr.length === 1) {
275
277
  const adInfos = getAdInfoBySkuId(productIdsArr[0]);
276
278
  if (adInfos) {
277
279
  singleSkuAdParams = {
278
280
  addExtendParams: adInfos,
279
281
  skuId: Number(productIdsArr[0]),
280
282
  };
281
283
  }
282
284
  }
283
285
  const productsAddCartList = productIdsArr.map((skuItem) => {
284
286
  return {
285
287
  skuId: skuItem,
286
288
  buyNum: addCardNum,
287
289
  };
288
290
  });
289
291
  global.wxAppBizInstance
290
292
  .addCart({
291
293
  ...(singleSkuAdParams ? singleSkuAdParams : { commArr: productsAddCartList }),
292
294
  })
293
295
  .then((res) => {
294
296
  console.log('dealCartSuccess: ', res);
295
297
  resolve({
296
298
  ok: true,
297
299
  msg: '已加入购物车!',
298
300
  data: res,
299
301
  });
300
302
  })
301
303
  .catch((e) => {
302
304
  console.log('京购小程序批量加车失败dealCartFail: ', e);
303
305
  resolve({
304
306
  ok: false,
305
307
  msg: '加购失败,请稍后重试',
306
308
  });
307
309
  });
308
310
  } else {
309
311
  console.log('==========>', 'M站批量加车!');
310
312
  return this.productAddToCart(skuIdsStr, addCardNum).then((res) => resolve(res));
311
313
  }
312
314
  } else {
313
315
  resolve({
314
316
  ok: false,
315
317
  msg: '加购sku不能为空',
316
318
  });
317
319
  }
318
320
  });
319
321
  }
320
322
 
321
323
  productAddToCart() {
322
324
  return Promise.resolve({
323
325
  ok: false,
324
326
  msg: 'productAddToCart暂不支持小程序',
325
327
  });
326
328
  }
327
329
  bMallGetUserInfo() {
328
330
  return Promise.resolve({
329
331
  ok: false,
330
332
  msg: 'productAddToCart暂不支持小程序',
331
333
  });
332
334
  }
333
335
  bMallGetSkuNumApi() {
334
336
  return Promise.resolve({
335
337
  ok: false,
336
338
  msg: 'productAddToCart暂不支持小程序',
337
339
  });
338
340
  }
339
341
  bMallCartHandle() {
340
342
  return Promise.resolve({
341
343
  ok: false,
342
344
  msg: 'productAddToCart暂不支持小程序',
343
345
  });
344
346
  }