@conecli/cone-render 0.10.1-shop3.21 → 0.10.1-shop3.22

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 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
  const { area, realTimeArea } = areaInfo || {};
20
19
  area && area !== '' && (clientParams.area = area);
21
20
  realTimeArea && realTimeArea !== '' && (clientParams['realTimeArea'] = realTimeArea);
22
21
  console.warn(
23
22
  'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
24
23
  areaInfo,
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
  UUID,
76
76
  isJdApp,
77
77
  jdAppVersionStr,
78
78
  isIosDevice,
79
79
  isPc,
80
80
  isJdAndIosDevice,
81
81
  isJdAndAndroidDevice,
82
82
  isJdAndHarmonyDevice,
83
83
  isNewHarmonyShop,
84
84
  passSmartCouponInfoFunctionIdList,
85
85
  needFixClientValueToHarmonyFunctionIdList,
86
86
  clientVersion: isJdApp && jdAppVersionStr !== '' ? jdAppVersionStr : '11.0.0',
87
87
  client: isJdApp ? (isIosDevice ? 'apple' : 'android') : isPc ? 'pc' : 'wh5',
88
88
  screen: `${Math.ceil(window.screen?.width * devicePixelRatio)}*${Math.ceil(
89
89
  window.screen?.height * devicePixelRatio,
90
90
  )}`,
91
91
  area: '1_72_2799_0',
92
92
  uuid: UUID,
93
93
  const { area, realTimeArea } = areaInfo || {};
94
94
  area && area !== '' && (clientParams.area = area);
95
95
  realTimeArea && realTimeArea !== '' && (clientParams['realTimeArea'] = realTimeArea);
96
96
  console.warn(
97
97
  'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
98
98
  areaInfo,
99
99
  '更新后的接口底层信息',
100
100
  clientParams,
101
101
  );
102
102
  if (isH5 && (isJdAndIosDevice || isJdAndAndroidDevice)) {
103
103
  const smartCouponInfo = await getSmartCouponInfo();
104
104
  if (smartCouponInfo) {
105
105
  requestParams.smartCouponInfo = smartCouponInfo;
106
106
  }
107
107
  } else {
108
108
  console.warn('🚗 ~~ handleSmartCouponInfo ~~ 不支持的环境!');
109
109
  }
110
110
  functionId: string,
111
111
  body = {},
112
112
  options = {},
113
113
  requestOptions = {},
114
114
  const useBodyParams = { ...body };
115
115
  if (passSmartCouponInfoFunctionIdList.includes(functionId)) {
116
116
  await handleSmartCouponInfo(useBodyParams);
117
117
  }
118
118
  const params = Object.assign(
119
119
  {},
120
120
  {
121
121
  t: Date.now(),
122
122
  functionId,
123
123
  appid: 'shop_m_jd_com',
124
124
  body: JSON.stringify(useBodyParams),
125
125
  },
126
126
  clientParams,
127
127
  options,
128
128
  {
129
129
  area: clientParams.area,
130
130
  client: !isJdApp && options?.client ? options?.client : clientParams.client,
131
131
  clientVersion:
132
132
  !isJdApp && options?.clientVersion ? options?.clientVersion : clientParams.clientVersion,
133
133
  },
134
134
  );
135
135
  if (
136
136
  isJdAndHarmonyDevice &&
137
137
  (needFixClientValueToHarmonyFunctionIdList.includes(functionId) || isNewHarmonyShop)
138
138
  ) {
139
139
  params.client = 'harmony';
140
140
  } else {
141
141
  }
142
142
  console.warn(
143
143
  'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
144
144
  '底层默认的clientParams',
145
145
  clientParams,
146
146
  '下发的options',
147
147
  options,
148
148
  '最后params',
149
149
  params,
150
150
  );
151
151
  return http.post(api.apiFunc, params, requestOptions);