@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,306 @@
1
+
2
+
3
+ //注意 JDZH-Regular 在原生底层已经转为V2.0
4
+ .font-jdzht {
5
+ font-family: 'JDZH-Regular';
6
+ }
7
+ .font-jdzht-bold {
8
+ font-family: 'JDZH-Bold';
9
+ }
10
+ .font-jdzht-light {
11
+ font-family: 'JDZH-Light';
12
+ }
13
+ .font-jdzht-v2 {
14
+ font-family: 'JDZH-Regular';
15
+ }
16
+ .font-jdzht-v2-bold {
17
+ font-family: 'JDZH-Bold';
18
+ }
19
+ .font-jdzht-v2-light {
20
+ font-family: 'JDZH-Light';
21
+ }
22
+
23
+ .border-box {
24
+ box-sizing: border-box;
25
+ }
26
+
27
+
28
+ .content-box {
29
+ box-sizing: content-box;
30
+ }
31
+
32
+
33
+ .flexible-box {
34
+ display: flex;
35
+ }
36
+
37
+ .flexible-box-important {
38
+ display: flex !important;
39
+ }
40
+
41
+ //竖向布局
42
+ .flexible-box-h {
43
+ display: flex;
44
+ flex-direction: column;
45
+ }
46
+
47
+ .flexible-box-h-important {
48
+ display: flex !important;
49
+ flex-direction: column !important;
50
+ }
51
+
52
+ //垂直居中布局
53
+ .flexible-vertical-center-box {
54
+ display: flex;
55
+ align-items: center;
56
+ }
57
+
58
+ //水平居中布局
59
+ .flexible-horizontal-center-box {
60
+ display: flex;
61
+ justify-content: center;
62
+ }
63
+
64
+ //水平垂直居中布局
65
+ .flexible-center-box {
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: center;
69
+ }
70
+
71
+
72
+ .adaptive-box-flex {
73
+ flex: 1;
74
+ }
75
+
76
+ .left {
77
+ float: left;
78
+ }
79
+
80
+ .right {
81
+ float: right;
82
+ }
83
+
84
+ .vertical-align-t {
85
+ vertical-align: top;
86
+ }
87
+
88
+ .vertical-align-m {
89
+ vertical-align: middle;
90
+ }
91
+
92
+ .vertical-align-b {
93
+ vertical-align: bottom;
94
+ }
95
+
96
+ .margin-lr-auto {
97
+ margin: 0 auto;
98
+ }
99
+
100
+ .pos-relative {
101
+ position: relative;
102
+ }
103
+
104
+ .pos-absolute {
105
+ position: absolute;
106
+ }
107
+
108
+ .pos-fixed {
109
+ position: fixed;
110
+ }
111
+
112
+ .align-left {
113
+ text-align: left;
114
+ }
115
+
116
+ .align-center {
117
+ text-align: center;
118
+ }
119
+
120
+ .align-right {
121
+ text-align: right;
122
+ }
123
+
124
+ .display-none {
125
+ display: none;
126
+ }
127
+
128
+ .display-none-important {
129
+ display: none !important;
130
+ }
131
+
132
+ .display-block {
133
+ display: block;
134
+ }
135
+
136
+ .display-block-important {
137
+ display: block !important;
138
+ }
139
+
140
+ .display-inline-block {
141
+ display: inline-block;
142
+ }
143
+
144
+ .display-inline-block-important {
145
+ display: inline-block !important;
146
+ }
147
+
148
+ .display-inline {
149
+ display: inline;
150
+ }
151
+
152
+ .display-inline-important {
153
+ display: inline !important;
154
+ }
155
+
156
+ .font-bold {
157
+ font-weight: bold;
158
+ }
159
+
160
+ .pointer {
161
+ cursor: pointer;
162
+ }
163
+
164
+ .over-hidden {
165
+ overflow: hidden;
166
+ }
167
+
168
+ .over-auto {
169
+ overflow: auto;
170
+ }
171
+
172
+ .over-auto-hidden-x {
173
+ overflow: auto;
174
+ overflow-x: hidden;
175
+ }
176
+
177
+ .over-auto-hidden-y {
178
+ overflow: auto;
179
+ overflow-y: hidden;
180
+ }
181
+
182
+ .over-x-auto {
183
+ overflow-x: auto;
184
+ overflow-y: hidden;
185
+ }
186
+
187
+ .over-y-auto {
188
+ overflow-y: auto;
189
+ overflow-x: hidden;
190
+ }
191
+
192
+ .font-size-0 {
193
+ font-size: 0;
194
+ }
195
+
196
+
197
+ .text-ellipsis {
198
+ overflow: hidden;
199
+ white-space: nowrap;
200
+ text-overflow: ellipsis;
201
+ }
202
+
203
+ .text-ellipsis-2 {
204
+ display: -webkit-box;
205
+ overflow: hidden;
206
+ word-break: break-all;
207
+ text-overflow: ellipsis;
208
+ -webkit-line-clamp: 2;
209
+
210
+ -webkit-box-orient: vertical;
211
+ }
212
+
213
+ .text-ellipsis-3 {
214
+ display: -webkit-box;
215
+ overflow: hidden;
216
+ word-break: break-all;
217
+ text-overflow: ellipsis;
218
+ -webkit-line-clamp: 3;
219
+
220
+ -webkit-box-orient: vertical;
221
+ }
222
+
223
+ .text-ellipsis-no-omit {
224
+ overflow: hidden;
225
+ white-space: nowrap;
226
+ text-overflow: clip;
227
+ }
228
+
229
+ .text-ellipsis-1-no-omit {
230
+ display: -webkit-box;
231
+ overflow: hidden;
232
+ word-break: break-all;
233
+ text-overflow: ellipsis;
234
+ -webkit-line-clamp: 1;
235
+
236
+ // -webkit-box-orient: inherit;
237
+ -webkit-box-orient: vertical;
238
+ }
239
+
240
+ .text-ellipsis-2-no-omit {
241
+ display: -webkit-box;
242
+ overflow: hidden;
243
+ word-break: break-all;
244
+ text-overflow: ellipsis;
245
+ -webkit-line-clamp: 2;
246
+
247
+ -webkit-box-orient: inherit;
248
+ }
249
+
250
+ .text-ellipsis-3-no-omit {
251
+ display: -webkit-box;
252
+ overflow: hidden;
253
+ word-break: break-all;
254
+ text-overflow: ellipsis;
255
+ -webkit-line-clamp: 3;
256
+
257
+ -webkit-box-orient: inherit;
258
+ }
259
+
260
+
261
+
262
+ .d-half-1px-line, .d-half-1px-border {
263
+ position: relative;
264
+ &:after {
265
+ content: '';
266
+ position: absolute;
267
+ width: 200%;
268
+ height: 200%;
269
+ top: 0;
270
+ left: 0;
271
+ transform-origin: 0 0;
272
+ border: 1PX solid #fa2c19;
273
+ //transform: perspective(1PX) translate3d(0, 0, 0) scale(0.5, 0.5);
274
+ transform: scale(0.5, 0.5);
275
+ border-radius: 1PX;
276
+ box-sizing: border-box;
277
+ pointer-events: none;
278
+ //-webkit-backface-visibility: hidden;
279
+ //-webkit-transform-style: preserve-3d;
280
+ }
281
+ }
282
+ .visibility-hide {
283
+ visibility: hidden !important;
284
+ }
285
+ .visibility-show {
286
+ visibility: visible !important;
287
+ }
288
+
289
+ .d-half-1px-line::after {
290
+ border-width: 0;
291
+ border-radius: 0;
292
+ border-bottom-width: 1PX;
293
+ }
294
+ .d-button-no-border {
295
+ &::after {
296
+ border: none;
297
+ }
298
+ }
299
+
300
+ .d-imag-rendering-crisp-edges {
301
+ image-rendering: -moz-crisp-edges;
302
+ image-rendering: -o-crisp-edges;
303
+ image-rendering: -webkit-optimize-contrast;
304
+ image-rendering: crisp-edges;
305
+ -ms-interpolation-mode: nearest-neighbor;
306
+ }
@@ -0,0 +1 @@
1
+ import Taro from '@tarojs/taro';
2
  UUID,
1
3
  isJdApp,
2
4
  jdAppVersionStr,
3
5
  isIosDevice,
4
6
  isPc,
5
7
  isJdAndIosDevice,
6
8
  isJdAndAndroidDevice,
7
9
  isJdAndHarmonyDevice,
8
10
  isNewHarmonyShop,
9
11
  passSmartCouponInfoFunctionIdList,
10
12
  needFixClientValueToHarmonyFunctionIdList,
11
13
  clientVersion: isJdApp && jdAppVersionStr !== '' ? jdAppVersionStr : '11.0.0',
12
14
  client: isJdApp ? (isIosDevice ? 'apple' : 'android') : isPc ? 'pc' : 'wh5',
13
15
  screen: `${Math.ceil(window.screen?.width * devicePixelRatio)}*${Math.ceil(
14
16
  window.screen?.height * devicePixelRatio,
15
17
  )}`,
16
18
  area: '1_72_2799_0',
17
19
  uuid: UUID,
18
20
  const { area, realTimeArea } = areaInfo || {};
19
21
  area && area !== '' && (clientParams.area = area);
20
22
  realTimeArea && realTimeArea !== '' && (clientParams['realTimeArea'] = realTimeArea);
21
23
  console.warn(
22
24
  'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
23
25
  areaInfo,
24
26
  '更新后的接口底层信息',
25
27
  clientParams,
26
28
  );
27
29
  if (isH5 && (isJdAndIosDevice || isJdAndAndroidDevice)) {
28
30
  const smartCouponInfo = await getSmartCouponInfo();
29
31
  if (smartCouponInfo) {
30
32
  requestParams.smartCouponInfo = smartCouponInfo;
31
33
  }
32
34
  } else {
33
35
  console.warn('🚗 ~~ handleSmartCouponInfo ~~ 不支持的环境!');
34
36
  }
35
37
  functionId: string,
36
38
  body = {},
37
39
  options = {},
38
40
  requestOptions = {},
39
41
  const useBodyParams = { ...body };
40
42
  if (passSmartCouponInfoFunctionIdList.includes(functionId)) {
41
43
  await handleSmartCouponInfo(useBodyParams);
42
44
  }
43
45
  const params = Object.assign(
44
46
  {},
45
47
  {
46
48
  t: Date.now(),
47
49
  functionId,
48
50
  appid: 'shop_m_jd_com',
49
51
  body: JSON.stringify(useBodyParams),
50
52
  },
51
53
  clientParams,
52
54
  options,
53
55
  {
54
56
  area: clientParams.area,
55
57
  client: !isJdApp && options?.client ? options?.client : clientParams.client,
56
58
  clientVersion:
57
59
  !isJdApp && options?.clientVersion ? options?.clientVersion : clientParams.clientVersion,
58
60
  },
59
61
  );
60
62
  if (
61
63
  isJdAndHarmonyDevice &&
62
64
  (needFixClientValueToHarmonyFunctionIdList.includes(functionId) || isNewHarmonyShop)
63
65
  ) {
64
66
  params.client = 'harmony';
65
67
  } else {
66
68
  }
67
69
  console.warn(
68
70
  'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
69
71
  '底层默认的clientParams',
70
72
  clientParams,
71
73
  '下发的options',
72
74
  options,
73
75
  '最后params',
74
76
  params,
75
77
  );
76
78
  return http.post(api.apiFunc, params, requestOptions);
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro';
2
1
  UUID,
3
2
  isJdApp,
4
3
  jdAppVersionStr,
5
4
  isIosDevice,
6
5
  isPc,
7
6
  isJdAndIosDevice,
8
7
  isJdAndAndroidDevice,
9
8
  isJdAndHarmonyDevice,
10
9
  passSmartCouponInfoFunctionIdList,
11
10
  needFixClientValueToHarmonyFunctionIdList,
12
11
  clientVersion: isJdApp && jdAppVersionStr !== '' ? jdAppVersionStr : '11.0.0',
13
12
  client: isJdApp ? (isIosDevice ? 'apple' : 'android') : isPc ? 'pc' : 'wh5',
14
13
  screen: `${Math.ceil(window.screen?.width * devicePixelRatio)}*${Math.ceil(
15
14
  window.screen?.height * devicePixelRatio,
16
15
  )}`,
17
16
  area: '1_72_2799_0',
18
17
  uuid: UUID,
19
18
  if (area && area !== '') {
20
19
  clientParams.area = area;
21
20
  }
22
21
  console.warn(
23
22
  'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
24
23
  area,
25
24
  '更新后的接口底层信息',
26
25
  clientParams,
27
26
  );
28
27
  if (isH5 && (isJdAndIosDevice || isJdAndAndroidDevice)) {
29
28
  const smartCouponInfo = await getSmartCouponInfo();
30
29
  if (smartCouponInfo) {
31
30
  requestParams.smartCouponInfo = smartCouponInfo;
32
31
  }
33
32
  } else {
34
33
  console.warn('🚗 ~~ handleSmartCouponInfo ~~ 不支持的环境!');
35
34
  }
36
35
  functionId: string,
37
36
  body = {},
38
37
  options = {},
39
38
  requestOptions = {},
40
39
  const useBodyParams = { ...body };
41
40
  if (passSmartCouponInfoFunctionIdList.includes(functionId)) {
42
41
  await handleSmartCouponInfo(useBodyParams);
43
42
  }
44
43
  const params = Object.assign(
45
44
  {},
46
45
  {
47
46
  t: Date.now(),
48
47
  functionId,
49
48
  appid: 'shop_m_jd_com',
50
49
  body: JSON.stringify(useBodyParams),
51
50
  },
52
51
  clientParams,
53
52
  options,
54
53
  {
55
54
  area: clientParams.area,
56
55
  client: !isJdApp && options?.client ? options?.client : clientParams.client,
57
56
  clientVersion:
58
57
  !isJdApp && options?.clientVersion ? options?.clientVersion : clientParams.clientVersion,
59
58
  },
60
59
  );
61
60
  if (isJdAndHarmonyDevice && needFixClientValueToHarmonyFunctionIdList.includes(functionId)) {
62
61
  params.client = 'harmony';
63
62
  } else {
64
63
  }
65
64
  console.warn(
66
65
  'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
67
66
  '底层默认的clientParams',
68
67
  clientParams,
69
68
  '下发的options',
70
69
  options,
71
70
  '最后params',
72
71
  params,
73
72
  );
74
73
  return http.post(api.apiFunc, params, requestOptions);
74
+ import Taro from '@tarojs/taro';
75
75
  clientVersion: '11.0.0',
76
76
  client: 'wh5',
77
77
  screen: `${Math.ceil(
78
78
  getSystemInfo?.screenWidth * devicePixelRatio,
79
79
  )}*${Math.ceil(getSystemInfo?.screenHeight * devicePixelRatio)}`,
80
80
  area: '1_72_2799_0',
81
81
  uuid: "-1",
82
82
  const { area, realTimeArea } = areaInfo || {};
83
83
  area && area !== '' && (clientParams.area = area);
84
84
  realTimeArea && realTimeArea !== '' && (clientParams['realTimeArea'] = realTimeArea);
85
85
  console.warn(
86
86
  'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
87
87
  areaInfo,
88
88
  '更新后的接口底层信息',
89
89
  clientParams,
90
90
  );
91
91
  functionId: string,
92
92
  body = {},
93
93
  options = {},
94
94
  requestOptions = {},
95
95
  const useBodyParams = { ...body };
96
96
  const params = Object.assign(
97
97
  {},
98
98
  {
99
99
  t: Date.now(),
100
100
  functionId,
101
101
  appid: 'shop_m_jd_com',
102
102
  body: JSON.stringify(useBodyParams),
103
103
  },
104
104
  clientParams,
105
105
  options,
106
106
  {
107
107
  area: clientParams.area,
108
108
  client: !isJdApp && options?.client ? options?.client : clientParams.client,
109
109
  clientVersion:
110
110
  !isJdApp && options?.clientVersion ? options?.clientVersion : clientParams.clientVersion,
111
111
  },
112
112
  );
113
113
  console.warn(
114
114
  'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
115
115
  '底层默认的clientParams',
116
116
  clientParams,
117
117
  '下发的options',
118
118
  options,
119
119
  '最后params',
120
120
  params,
121
121
  );
122
122
  return http.post(api.apiFunc, params, requestOptions);
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro';
2
1
  clientVersion: '11.0.0',
3
2
  client: 'wh5',
4
3
  screen: `${Math.ceil(getSystemInfo?.screenWidth * devicePixelRatio)}*${Math.ceil(
5
4
  getSystemInfo?.screenHeight * devicePixelRatio,
6
5
  )}`,
7
6
  area: '1_72_2799_0',
8
7
  uuid: UUID,
9
8
  if (area && area !== '') {
10
9
  clientParams.area = area;
11
10
  }
12
11
  console.warn(
13
12
  'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
14
13
  area,
15
14
  '更新后的接口底层信息',
16
15
  clientParams,
17
16
  );
18
17
  functionId: string,
19
18
  body = {},
20
19
  options = {},
21
20
  requestOptions = {},
22
21
  const params = Object.assign(
23
22
  {},
24
23
  {
25
24
  t: Date.now(),
26
25
  functionId,
27
26
  appid: 'shop_m_jd_com',
28
27
  body: JSON.stringify(body),
29
28
  },
30
29
  clientParams,
31
30
  options,
32
31
  {
33
32
  area: clientParams.area,
34
33
  client: options?.client || clientParams.client,
35
34
  clientVersion: options?.clientVersion || clientParams.clientVersion,
36
35
  },
37
36
  );
38
37
  console.warn(
39
38
  'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
40
39
  '底层默认的clientParams',
41
40
  clientParams,
42
41
  '下发的options',
43
42
  options,
44
43
  '最后params',
45
44
  params,
46
45
  );
47
46
  return http.post(api.apiFunc, params, requestOptions);
47
+ import Taro from '@tarojs/taro';
48
48
  clientVersion: '11.0.0',
49
49
  client: 'wh5',
50
50
  screen: `${Math.ceil(getSystemInfo?.screenWidth * devicePixelRatio)}*${Math.ceil(
51
51
  getSystemInfo?.screenHeight * devicePixelRatio,
52
52
  )}`,
53
53
  area: '1_72_2799_0',
54
54
  uuid: UUID,
55
55
  const { area, realTimeArea } = areaInfo || {};
56
56
  area && area !== '' && (clientParams.area = area);
57
57
  realTimeArea && realTimeArea !== '' && (clientParams['realTimeArea'] = realTimeArea);
58
58
  console.warn(
59
59
  'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
60
60
  areaInfo,
61
61
  '更新后的接口底层信息',
62
62
  clientParams,
63
63
  );
64
64
  functionId: string,
65
65
  body = {},
66
66
  options = {},
67
67
  requestOptions = {},
68
68
  const params = Object.assign(
69
69
  {},
70
70
  {
71
71
  t: Date.now(),
72
72
  functionId,
73
73
  appid: 'shop_m_jd_com',
74
74
  body: JSON.stringify(body),
75
75
  },
76
76
  clientParams,
77
77
  options,
78
78
  {
79
79
  area: clientParams.area,
80
80
  client: options?.client || clientParams.client,
81
81
  clientVersion: options?.clientVersion || clientParams.clientVersion,
82
82
  },
83
83
  );
84
84
  console.warn(
85
85
  'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
86
86
  '底层默认的clientParams',
87
87
  clientParams,
88
88
  '下发的options',
89
89
  options,
90
90
  '最后params',
91
91
  params,
92
92
  );
93
93
  return http.post(api.apiFunc, params, requestOptions);
@@ -0,0 +1 @@
1
+ const defaultOptions = {
2
  timeout: 5000,
1
3
  jsonpCallback: 'callback',
2
4
  return `jsonp_${Date.now()}_${Math.ceil(Math.random() * 100000)}`
3
5
  try {
4
6
  delete window[functionName]
5
7
  } catch (e) {
6
8
  window[functionName] = undefined
7
9
  }
8
10
  const script = document.getElementById(scriptId)
9
11
  document.getElementsByTagName('head')[0].removeChild(script)
10
12
  const timeout =
11
13
 
12
14
  options.timeout != null ? options.timeout : defaultOptions.timeout
13
15
  const jsonpCallback =
14
16
 
15
17
  options.jsonpCallback != null
16
18
  ? options.jsonpCallback
17
19
  : defaultOptions.jsonpCallback
18
20
  let timeoutId: string | number | NodeJS.Timeout | undefined
19
21
  return new Promise((resolve, reject) => {
20
22
  const callbackFunction = generateCallbackFunction()
21
23
  window[callbackFunction] = function (response: any) {
22
24
  resolve({
23
25
  ok: true,
24
26
  json: function () {
25
27
  return Promise.resolve(response)
26
28
  },
27
29
  })
28
30
  if (timeoutId) clearTimeout(timeoutId)
29
31
  removeScript(jsonpCallback + '_' + callbackFunction)
30
32
  clearFunction(callbackFunction)
31
33
  }
32
34
  url += url.indexOf('?') === -1 ? '?' : '&'
33
35
  const jsonpScript = document.createElement('script')
34
36
  jsonpScript.setAttribute(
35
37
  'src',
36
38
  url + jsonpCallback + '=' + callbackFunction,
37
39
  )
38
40
  jsonpScript.id = jsonpCallback + '_' + callbackFunction
39
41
  document.getElementsByTagName('head')[0].appendChild(jsonpScript)
40
42
  timeoutId = setTimeout(() => {
41
43
  reject(new Error(`JSONP request to ${url} timed out`))
42
44
  clearFunction(callbackFunction)
43
45
  removeScript(jsonpCallback + '_' + callbackFunction)
44
46
  }, timeout)
45
47
  })
@@ -1 +1 @@
1
- const defaultOptions = {
2
1
  timeout: 5000,
3
2
  jsonpCallback: 'callback',
4
3
  return `jsonp_${Date.now()}_${Math.ceil(Math.random() * 100000)}`
5
4
  try {
6
5
  delete window[functionName]
7
6
  } catch (e) {
8
7
  window[functionName] = undefined
9
8
  }
10
9
  const script = document.getElementById(scriptId)
11
10
  document.getElementsByTagName('head')[0].removeChild(script)
12
11
  const timeout =
13
12
 
14
13
  options.timeout != null ? options.timeout : defaultOptions.timeout
15
14
  const jsonpCallback =
16
15
 
17
16
  options.jsonpCallback != null
18
17
  ? options.jsonpCallback
19
18
  : defaultOptions.jsonpCallback
20
19
  let timeoutId: string | number | NodeJS.Timeout | undefined
21
20
  return new Promise((resolve, reject) => {
22
21
  const callbackFunction = generateCallbackFunction()
23
22
  window[callbackFunction] = function (response: any) {
24
23
  resolve({
25
24
  ok: true,
26
25
  json: function () {
27
26
  return Promise.resolve(response)
28
27
  },
29
28
  })
30
29
  if (timeoutId) clearTimeout(timeoutId)
31
30
  removeScript(jsonpCallback + '_' + callbackFunction)
32
31
  clearFunction(callbackFunction)
33
32
  }
34
33
  url += url.indexOf('?') === -1 ? '?' : '&'
35
34
  const jsonpScript = document.createElement('script')
36
35
  jsonpScript.setAttribute(
37
36
  'src',
38
37
  url + jsonpCallback + '=' + callbackFunction,
39
38
  )
40
39
  jsonpScript.id = jsonpCallback + '_' + callbackFunction
41
40
  document.getElementsByTagName('head')[0].appendChild(jsonpScript)
42
41
  timeoutId = setTimeout(() => {
43
42
  reject(new Error(`JSONP request to ${url} timed out`))
44
43
  clearFunction(callbackFunction)
45
44
  removeScript(jsonpCallback + '_' + callbackFunction)
46
45
  }, timeout)
47
46
  })
47
+ const fetchJsonp = function (url: string | string[], options = {}) {
48
48
  return Promise.reject(() => {
49
49
  console.log("暂未实现jsonp的请求方式",url)
50
50
  })