@conecli/cone-render 0.10.1-shop3.94 → 0.10.1-shop3.95

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
  isNewHarmonyShop,
11
10
  passSmartCouponInfoFunctionIdList,
12
11
  needFixClientValueToHarmonyFunctionIdList,
13
12
  clientVersion: isJdApp && jdAppVersionStr !== '' ? jdAppVersionStr : '11.0.0',
14
13
  client: isJdApp ? (isIosDevice ? 'apple' : 'android') : isPc ? 'pc' : 'wh5',
15
14
  screen: `${Math.ceil(window.screen?.width * devicePixelRatio)}*${Math.ceil(
16
15
  window.screen?.height * devicePixelRatio,
17
16
  )}`,
18
17
  area: '1_72_2799_0',
19
18
  uuid: UUID,
20
19
  const { area, realTimeArea } = areaInfo || {};
21
20
  area && area !== '' && (clientParams.area = area);
22
21
  realTimeArea && realTimeArea !== '' && (clientParams['realTimeArea'] = realTimeArea);
23
22
  console.warn(
24
23
  'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
25
24
  areaInfo,
26
25
  '更新后的接口底层信息',
27
26
  clientParams,
28
27
  );
29
28
  if (isH5 && (isJdAndIosDevice || isJdAndAndroidDevice)) {
30
29
  const smartCouponInfo = await getSmartCouponInfo();
31
30
  if (smartCouponInfo) {
32
31
  requestParams.smartCouponInfo = smartCouponInfo;
33
32
  }
34
33
  } else {
35
34
  console.warn('🚗 ~~ handleSmartCouponInfo ~~ 不支持的环境!');
36
35
  }
37
36
  functionId: string,
38
37
  body = {},
39
38
  options = {},
40
39
  requestOptions = {},
41
40
  const useBodyParams = { ...body };
42
41
  if (passSmartCouponInfoFunctionIdList.includes(functionId)) {
43
42
  await handleSmartCouponInfo(useBodyParams);
44
43
  }
45
44
  const params = Object.assign(
46
45
  {},
47
46
  {
48
47
  t: Date.now(),
49
48
  functionId,
50
49
  appid: 'shop_m_jd_com',
51
50
  body: JSON.stringify(useBodyParams),
52
51
  },
53
52
  clientParams,
54
53
  options,
55
54
  {
56
55
  area: clientParams.area,
57
56
  client: !isJdApp && options?.client ? options?.client : clientParams.client,
58
57
  clientVersion:
59
58
  !isJdApp && options?.clientVersion ? options?.clientVersion : clientParams.clientVersion,
60
59
  },
61
60
  );
62
61
  if (
63
62
  isJdAndHarmonyDevice &&
64
63
  (needFixClientValueToHarmonyFunctionIdList.includes(functionId) || isNewHarmonyShop)
65
64
  ) {
66
65
  params.client = 'harmony';
67
66
  } else {
68
67
  }
69
68
  console.warn(
70
69
  'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
71
70
  '底层默认的clientParams',
72
71
  clientParams,
73
72
  '下发的options',
74
73
  options,
75
74
  '最后params',
76
75
  params,
77
76
  );
78
77
  return http.post(api.apiFunc, params, requestOptions);
78
+ import Taro from '@tarojs/taro';
79
79
  UUID,
80
80
  isJdApp,
81
81
  jdAppVersionStr,
82
82
  isIosDevice,
83
83
  isPc,
84
84
  isJdAndIosDevice,
85
85
  isJdAndAndroidDevice,
86
86
  isJdAndHarmonyDevice,
87
87
  isNewHarmonyShop,
88
88
  passSmartCouponInfoFunctionIdList,
89
89
  needFixClientValueToHarmonyFunctionIdList,
90
90
  clientVersion: isJdApp && jdAppVersionStr !== '' ? jdAppVersionStr : '11.0.0',
91
91
  client: isJdApp ? (isIosDevice ? 'apple' : 'android') : isPc ? 'pc' : 'wh5',
92
92
  screen: `${Math.ceil(window.screen?.width * devicePixelRatio)}*${Math.ceil(
93
93
  window.screen?.height * devicePixelRatio,
94
94
  )}`,
95
95
  area: '1_72_2799_0',
96
96
  uuid: UUID,
97
97
  const { area, realTimeArea } = areaInfo || {};
98
98
  area && area !== '' && (clientParams.area = area);
99
99
  realTimeArea && realTimeArea !== '' && (clientParams['realTimeArea'] = realTimeArea);
100
100
  console.warn(
101
101
  'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
102
102
  areaInfo,
103
103
  '更新后的接口底层信息',
104
104
  clientParams,
105
105
  );
106
106
  const smartCouponInfo = await getSmartCouponInfo();
107
107
  if (smartCouponInfo) {
108
108
  requestParams.smartCouponInfo = smartCouponInfo;
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);