@conecli/cone-render 0.10.1-shop3.15 → 0.10.1-shop3.17

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.
@@ -1 +1 @@
1
- import taroJdBaseInfo from '../../common'
2
1
  isIosDevice,
3
2
  isAndroidDevice,
4
3
  isH5,
5
4
  isJdApp,
6
5
  isJdMin,
7
6
  isWxApp,
8
7
  isWxMin,
9
8
  isMin,
10
9
  isWxMinAndWxapp,
11
10
  getNetworkType,
12
11
  isIos: isIosDevice,
13
12
  isAndroid: isAndroidDevice,
14
13
  isH5,
15
14
  isJdApp,
16
15
  isJdMin,
17
16
  isWxApp,
18
17
  isWxMin,
19
18
  isMin,
20
19
  isWxJgMin: isWxMinAndWxapp,
21
20
 
22
21
  pageType: pageType,
23
22
  return sysInfo.netWorkType
23
+ import taroJdBaseInfo from '../../common'
24
24
  isIosDevice,
25
25
  isAndroidDevice,
26
26
  isHarmonyDevice,
27
27
  isH5,
28
28
  isJdApp,
29
29
  isJdMin,
30
30
  isWxApp,
31
31
  isWxMin,
32
32
  isMin,
33
33
  isWxMinAndWxapp,
34
34
  getNetworkType,
35
35
  isIos: isIosDevice,
36
36
  isAndroid: isAndroidDevice,
37
37
  isHarmony: isHarmonyDevice,
38
38
  isH5,
39
39
  isJdApp,
40
40
  isJdMin,
41
41
  isWxApp,
42
42
  isWxMin,
43
43
  isMin,
44
44
  isWxJgMin: isWxMinAndWxapp,
45
45
 
46
46
  pageType: pageType,
47
47
  return sysInfo.netWorkType
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro';
2
1
  clientVersion: isJdApp && jdAppVersionStr !== '' ? jdAppVersionStr : '11.0.0',
3
2
  client: isJdApp ? (isIosDevice ? 'apple' : 'android') : isPc ? 'pc' : 'wh5',
4
3
  screen: `${Math.ceil(window.screen?.width * devicePixelRatio)}*${Math.ceil(
5
4
  window.screen?.height * 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
  if (isH5 && (isJdAndIosDevice || isJdAndAndroidDevice)) {
19
18
  const smartCouponInfo = await getSmartCouponInfo();
20
19
  if (smartCouponInfo) {
21
20
  requestParams.smartCouponInfo = smartCouponInfo;
22
21
  }
23
22
  } else {
24
23
  console.warn('🚗 ~~ handleSmartCouponInfo ~~ 不支持的环境!');
25
24
  }
26
25
  functionId: string,
27
26
  body = {},
28
27
  options = {},
29
28
  requestOptions = {},
30
29
  const useBodyParams = { ...body };
31
30
  if (passSmartCouponInfoFunctionIdList.includes(functionId)) {
32
31
  await handleSmartCouponInfo(useBodyParams);
33
32
  }
34
33
  const params = Object.assign(
35
34
  {},
36
35
  {
37
36
  t: Date.now(),
38
37
  functionId,
39
38
  appid: 'shop_m_jd_com',
40
39
  body: JSON.stringify(useBodyParams),
41
40
  },
42
41
  clientParams,
43
42
  options,
44
43
  {
45
44
  area: clientParams.area,
46
45
  client: !isJdApp && options?.client ? options?.client : clientParams.client,
47
46
  clientVersion:
48
47
  !isJdApp && options?.clientVersion ? options?.clientVersion : clientParams.clientVersion,
49
48
  },
50
49
  );
51
50
  console.warn(
52
51
  'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
53
52
  '底层默认的clientParams',
54
53
  clientParams,
55
54
  '下发的options',
56
55
  options,
57
56
  '最后params',
58
57
  params,
59
58
  );
60
59
  return http.post(api.apiFunc, params, requestOptions);
60
+ import Taro from '@tarojs/taro';
61
61
  UUID,
62
62
  isJdApp,
63
63
  jdAppVersionStr,
64
64
  isIosDevice,
65
65
  isPc,
66
66
  isJdAndIosDevice,
67
67
  isJdAndAndroidDevice,
68
68
  isJdAndHarmonyDevice,
69
69
  passSmartCouponInfoFunctionIdList,
70
70
  needFixClientValueToHarmonyFunctionIdList,
71
71
  clientVersion: isJdApp && jdAppVersionStr !== '' ? jdAppVersionStr : '11.0.0',
72
72
  client: isJdApp ? (isIosDevice ? 'apple' : 'android') : isPc ? 'pc' : 'wh5',
73
73
  screen: `${Math.ceil(window.screen?.width * devicePixelRatio)}*${Math.ceil(
74
74
  window.screen?.height * devicePixelRatio,
75
75
  )}`,
76
76
  area: '1_72_2799_0',
77
77
  uuid: UUID,
78
78
  if (area && area !== '') {
79
79
  clientParams.area = area;
80
80
  }
81
81
  console.warn(
82
82
  'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
83
83
  area,
84
84
  '更新后的接口底层信息',
85
85
  clientParams,
86
86
  );
87
87
  if (isH5 && (isJdAndIosDevice || isJdAndAndroidDevice)) {
88
88
  const smartCouponInfo = await getSmartCouponInfo();
89
89
  if (smartCouponInfo) {
90
90
  requestParams.smartCouponInfo = smartCouponInfo;
91
91
  }
92
92
  } else {
93
93
  console.warn('🚗 ~~ handleSmartCouponInfo ~~ 不支持的环境!');
94
94
  }
95
95
  functionId: string,
96
96
  body = {},
97
97
  options = {},
98
98
  requestOptions = {},
99
99
  const useBodyParams = { ...body };
100
100
  if (passSmartCouponInfoFunctionIdList.includes(functionId)) {
101
101
  await handleSmartCouponInfo(useBodyParams);
102
102
  }
103
103
  const params = Object.assign(
104
104
  {},
105
105
  {
106
106
  t: Date.now(),
107
107
  functionId,
108
108
  appid: 'shop_m_jd_com',
109
109
  body: JSON.stringify(useBodyParams),
110
110
  },
111
111
  clientParams,
112
112
  options,
113
113
  {
114
114
  area: clientParams.area,
115
115
  client: !isJdApp && options?.client ? options?.client : clientParams.client,
116
116
  clientVersion:
117
117
  !isJdApp && options?.clientVersion ? options?.clientVersion : clientParams.clientVersion,
118
118
  },
119
119
  );
120
120
  if (isJdAndHarmonyDevice && needFixClientValueToHarmonyFunctionIdList.includes(functionId)) {
121
121
  params.client = 'harmony';
122
122
  } else {
123
123
  }
124
124
  console.warn(
125
125
  'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
126
126
  '底层默认的clientParams',
127
127
  clientParams,
128
128
  '下发的options',
129
129
  options,
130
130
  '最后params',
131
131
  params,
132
132
  );
133
133
  return http.post(api.apiFunc, params, requestOptions);
@@ -1 +1 @@
1
- export const HttpStatus = {
2
1
  SUCCESS: 200,
3
2
  CREATED: 201,
4
3
  ACCEPTED: 202,
5
4
  CLIENT_ERROR: 400,
6
5
  AUTHENTICATE: 401,
7
6
  FORBIDDEN: 403,
8
7
  NOT_FOUND: 404,
9
8
  SERVER_ERROR: 500,
10
9
  BAD_GATEWAY: 502,
11
10
  SERVICE_UNAVAILABLE: 503,
12
11
  GATEWAY_TIMEOUT: 504,
13
12
  [HttpStatus.NOT_FOUND]: '请求资源不存在',
14
13
  [HttpStatus.BAD_GATEWAY]: '服务端异常,请稍后重试',
15
14
  [HttpStatus.FORBIDDEN]: '没有权限访问',
16
15
  [HttpStatus.AUTHENTICATE]: '需要鉴权',
17
16
  [HttpStatus.SUCCESS]: '成功',
18
17
  'whx_getShopHomeFloorInfo',
19
18
  'whx_searchWare',
20
19
  'shopGuessYouLike',
21
20
  'whx_getMShopCategory',
22
21
  'whx_newWareList',
23
22
  'getShopHomePromotionWebPage',
24
23
  'whx_getShopCampaignPage',
25
24
  'whx_getPromotionWares',
26
25
  'whx_buyerShowPage',
27
26
  'whx_getShopGwredPage',
28
27
  'whx_getShopSpeciSecKillPage',
29
28
  'whx_getSignInfo',
30
29
  'whx_getSignPrize',
31
30
  'getShopHomeFloorInfo',
32
31
  'shopGuessYouLike',
33
32
  'getShopHomePromotionWebPage',
34
33
  'getVipDetail',
35
34
  'getShopCategory',
36
35
  'getShopNavigationCategory',
37
36
  'colorApiPreview',
38
37
  'bmall_cart',
39
38
  'bmall_getOmittedProduct',
40
39
  'bmall_cartAdd',
41
40
  'bmall_cartChange',
42
41
  'bmall_cartRemove',
43
42
  'whx_getShopHomeFloorInfo',
44
43
  'whx_searchWare',
45
44
  'shopGuessYouLike',
46
45
  'whx_getMShopCategory',
47
46
  'whx_newWareList',
48
47
  'getShopHomePromotionWebPage',
49
48
  'whx_getShopCampaignPage',
50
49
  'whx_getPromotionWares',
51
50
  'whx_buyerShowPage',
52
51
  'getShopHomeFloorInfo',
53
52
  'getShopCategory',
54
53
  'getShopNavigationCategory',
55
54
  'giftCardAddCart',
56
55
  'receiveShopCoupon',
57
56
  'getShopHomePromotionWebPage',
58
57
  'shopGuessYouLike',
59
58
  'addRemind',
60
59
  'cancelRemind',
61
60
  'getVipDetail',
62
61
  'shopDetail',
63
62
  'address_queryAddress',
64
63
  'shopMemberSprintJoinActivity',
65
64
  'shopMemberSprintReceivePrize',
66
65
  'bmall_cart',
67
66
  'bmall_getOmittedProduct',
68
67
  'bmall_cartAdd',
69
68
  'bmall_cartChange',
70
69
  'bmall_cartRemove',
71
70
  SHOP_COLOR_APPID: 'shop_m_jd_com',
72
71
  JSHOPX_COLOR_APPID: 'jshopx_jd_com',
73
72
  PAGES_COLOR_APPID: 'pages_jd_com',
74
73
  B2B_COLOR_APPID: 'b2b',
75
74
  SHOP_MEMBER_COLOR_APPID: 'shopmember_m_jd_com',
76
75
  MALL_COLOR_APPID: 'mall_jd_com',
77
76
  'getSeriesTabData',
78
77
  'searchWare',
79
78
  'getDrShopDiscoveryFeeds',
79
+ export const HttpStatus = {
80
80
  SUCCESS: 200,
81
81
  CREATED: 201,
82
82
  ACCEPTED: 202,
83
83
  CLIENT_ERROR: 400,
84
84
  AUTHENTICATE: 401,
85
85
  FORBIDDEN: 403,
86
86
  NOT_FOUND: 404,
87
87
  SERVER_ERROR: 500,
88
88
  BAD_GATEWAY: 502,
89
89
  SERVICE_UNAVAILABLE: 503,
90
90
  GATEWAY_TIMEOUT: 504,
91
91
  [HttpStatus.NOT_FOUND]: '请求资源不存在',
92
92
  [HttpStatus.BAD_GATEWAY]: '服务端异常,请稍后重试',
93
93
  [HttpStatus.FORBIDDEN]: '没有权限访问',
94
94
  [HttpStatus.AUTHENTICATE]: '需要鉴权',
95
95
  [HttpStatus.SUCCESS]: '成功',
96
96
  'whx_getShopHomeFloorInfo',
97
97
  'whx_searchWare',
98
98
  'shopGuessYouLike',
99
99
  'whx_getMShopCategory',
100
100
  'whx_newWareList',
101
101
  'getShopHomePromotionWebPage',
102
102
  'whx_getShopCampaignPage',
103
103
  'whx_getPromotionWares',
104
104
  'whx_buyerShowPage',
105
105
  'whx_getShopGwredPage',
106
106
  'whx_getShopSpeciSecKillPage',
107
107
  'whx_getSignInfo',
108
108
  'whx_getSignPrize',
109
109
  'getShopHomeFloorInfo',
110
110
  'shopGuessYouLike',
111
111
  'getShopHomePromotionWebPage',
112
112
  'getVipDetail',
113
113
  'getShopCategory',
114
114
  'getShopNavigationCategory',
115
115
  'colorApiPreview',
116
116
  'bmall_cart',
117
117
  'bmall_getOmittedProduct',
118
118
  'bmall_cartAdd',
119
119
  'bmall_cartChange',
120
120
  'bmall_cartRemove',
121
121
  'whx_getShopHomeFloorInfo',
122
122
  'whx_searchWare',
123
123
  'shopGuessYouLike',
124
124
  'whx_getMShopCategory',
125
125
  'whx_newWareList',
126
126
  'getShopHomePromotionWebPage',
127
127
  'whx_getShopCampaignPage',
128
128
  'whx_getPromotionWares',
129
129
  'whx_buyerShowPage',
130
130
  'getShopHomeFloorInfo',
131
131
  'getShopCategory',
132
132
  'getShopNavigationCategory',
133
133
  'giftCardAddCart',
134
134
  'receiveShopCoupon',
135
135
  'getShopHomePromotionWebPage',
136
136
  'shopGuessYouLike',
137
137
  'addRemind',
138
138
  'cancelRemind',
139
139
  'getVipDetail',
140
140
  'shopDetail',
141
141
  'address_queryAddress',
142
142
  'shopMemberSprintJoinActivity',
143
143
  'shopMemberSprintReceivePrize',
144
144
  'bmall_cart',
145
145
  'bmall_getOmittedProduct',
146
146
  'bmall_cartAdd',
147
147
  'bmall_cartChange',
148
148
  'bmall_cartRemove',
149
149
  SHOP_COLOR_APPID: 'shop_m_jd_com',
150
150
  JSHOPX_COLOR_APPID: 'jshopx_jd_com',
151
151
  PAGES_COLOR_APPID: 'pages_jd_com',
152
152
  B2B_COLOR_APPID: 'b2b',
153
153
  SHOP_MEMBER_COLOR_APPID: 'shopmember_m_jd_com',
154
154
  MALL_COLOR_APPID: 'mall_jd_com',
155
155
  'getSeriesTabData',
156
156
  'searchWare',
157
157
  'getDrShopDiscoveryFeeds',
158
158
  'searchWare',