@conecli/cone-render 0.8.19 → 0.8.20-beta.2

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 (183) hide show
  1. package/README.md +7 -1
  2. package/dist/api/index.ts +1 -1
  3. package/dist/assets/icon_blue_info.svg +1 -0
  4. package/dist/common/const.ts +1 -1
  5. package/dist/common/environmentType.ts +1 -0
  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/isvStorage/index.h5.ts +1 -0
  11. package/dist/common/isvStorage/index.ts +1 -0
  12. package/dist/common/jdplayerSdk.ts +1 -0
  13. package/dist/common/jssdk.ts +1 -0
  14. package/dist/common/pageType.ts +1 -0
  15. package/dist/common/sgmCustomCode.ts +1 -0
  16. package/dist/common/token/const.ts +1 -0
  17. package/dist/common/token/index.h5.ts +1 -0
  18. package/dist/common/token/index.ts +1 -0
  19. package/dist/common/token/token.jd.ts +1 -0
  20. package/dist/common/token/token.ts +1 -0
  21. package/dist/common/token/token.wxapp.ts +1 -0
  22. package/dist/common/wxappApi.jd.ts +1 -0
  23. package/dist/common/wxappApi.ts +1 -1
  24. package/dist/components/ErrorBoundary.tsx +1 -1
  25. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  26. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  27. package/dist/components/base/CountDown/index.module.scss +49 -44
  28. package/dist/components/base/CountDown/index.tsx +1 -1
  29. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  30. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  31. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  32. package/dist/components/base/CustomVideo/common.ts +1 -0
  33. package/dist/components/base/CustomVideo/const.ts +1 -0
  34. package/dist/components/base/CustomVideo/index.module.scss +40 -64
  35. package/dist/components/base/CustomVideo/index.tsx +1 -1
  36. package/dist/components/base/Dialog/index.module.scss +22 -2
  37. package/dist/components/base/Dialog/index.tsx +1 -1
  38. package/dist/components/base/Exposure/index.h5.tsx +1 -1
  39. package/dist/components/base/ExposureSmart/const.ts +1 -0
  40. package/dist/components/base/ExposureSmart/index.h5.module.scss +30 -6
  41. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  42. package/dist/components/base/ExposureSmart/index.module.scss +20 -9
  43. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  44. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  45. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  46. package/dist/components/base/InViewRender/index.tsx +1 -1
  47. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  48. package/dist/components/base/ItemViewExposureSmart/index.module.scss +8 -0
  49. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -0
  50. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  51. package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
  52. package/dist/components/base/LazyLoadImage/const.ts +1 -1
  53. package/dist/components/base/LazyLoadImage/index.h5.module.scss +24 -20
  54. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  55. package/dist/components/base/MobileCommonHeader/index.module.scss +17 -0
  56. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  57. package/dist/components/base/NetworkDataError/const.ts +1 -1
  58. package/dist/components/base/NetworkDataError/index.module.scss +128 -69
  59. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  60. package/dist/components/base/Price/{const.ts → Base/const.ts} +0 -0
  61. package/dist/components/base/Price/Base/index.module.scss +148 -0
  62. package/dist/components/base/Price/Base/index.tsx +1 -0
  63. package/dist/components/base/Price/Double/index.module.scss +190 -0
  64. package/dist/components/base/Price/Double/index.tsx +1 -0
  65. package/dist/components/base/Price/index.tsx +1 -1
  66. package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
  67. package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
  68. package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
  69. package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
  70. package/dist/components/base/Skeleton/index.tsx +1 -1
  71. package/dist/components/debug/DebugLayout/index.module.scss +67 -0
  72. package/dist/components/debug/DebugLayout/index.tsx +1 -0
  73. package/dist/components/debug/DebugLayout/utils.ts +1 -0
  74. package/dist/components/decorate/DecorateFloorModule/index.module.scss +32 -2
  75. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  76. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  77. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  78. package/dist/components/floorItem.jd.tsx +1 -0
  79. package/dist/components/floorItem.tsx +1 -1
  80. package/dist/components/floorItem.weapp.tsx +1 -1
  81. package/dist/components/isv/Floor/index.tsx +1 -1
  82. package/dist/components/remoteFloorItem.tsx +1 -0
  83. package/dist/interface/common.ts +1 -1
  84. package/dist/interface/component.ts +1 -1
  85. package/dist/interface/jumpEventReport.ts +1 -1
  86. package/dist/interface/service.ts +1 -1
  87. package/dist/interface/utils.ts +1 -1
  88. package/dist/jumpEventReport/base.ts +1 -1
  89. package/dist/jumpEventReport/const.ts +1 -1
  90. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  91. package/dist/jumpEventReport/index.h5.ts +1 -1
  92. package/dist/jumpEventReport/index.jd.ts +1 -1
  93. package/dist/jumpEventReport/index.ts +1 -1
  94. package/dist/jumpEventReport/index.weapp.ts +1 -1
  95. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  96. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  97. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  98. package/dist/jumpEventReport/web/report.ts +1 -1
  99. package/dist/jumpEventReport/web.base.ts +1 -1
  100. package/dist/jumpEventReport/web.jd.ts +1 -1
  101. package/dist/jumpEventReport/web.jdb.ts +1 -0
  102. package/dist/jumpEventReport/web.jdjch.ts +1 -0
  103. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  104. package/dist/jumpEventReport/web.pc.ts +1 -0
  105. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  106. package/dist/jumpEventReport/web.tjm.ts +1 -0
  107. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  108. package/dist/language/en_US.json +231 -0
  109. package/dist/language/zh_CN.json +231 -0
  110. package/dist/language/zh_HK.json +231 -0
  111. package/dist/libs/taroAppReport.js +2 -2
  112. package/dist/modules/ContainerFloorList/index.h5.module.scss +66 -27
  113. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  114. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  115. package/dist/open/api/device.ts +1 -1
  116. package/dist/open/api/environment.ts +1 -1
  117. package/dist/open/api/index.ts +1 -1
  118. package/dist/open/api/jump/business.ts +1 -0
  119. package/dist/open/api/jump/index.ts +1 -0
  120. package/dist/open/api/jump/minPath.ts +1 -0
  121. package/dist/open/api/jump/side.ts +1 -0
  122. package/dist/open/api/jump/webUrl.ts +1 -0
  123. package/dist/open/api/jump copy.ts +1 -0
  124. package/dist/open/api/moduleUtil.ts +1 -1
  125. package/dist/open/api/request.ts +1 -0
  126. package/dist/open/api/shopMember.ts +1 -0
  127. package/dist/open/api/track.ts +1 -1
  128. package/dist/open/api/userToken.ts +1 -0
  129. package/dist/open/api/util.ts +1 -1
  130. package/dist/open/components/index.ts +1 -1
  131. package/dist/sass/app.h5.scss +294 -212
  132. package/dist/sass/base.scss +195 -137
  133. package/dist/service/bMallConst.ts +1 -0
  134. package/dist/service/bMallConst.weapp.ts +1 -0
  135. package/dist/service/fetchGateway.ts +1 -0
  136. package/dist/service/fetchGateway.weapp.ts +1 -0
  137. package/dist/service/fetchJsonp.ts +1 -0
  138. package/dist/service/http/colorSign.ts +1 -0
  139. package/dist/service/http/colorSign.weapp.ts +1 -0
  140. package/dist/service/http/const.ts +1 -0
  141. package/dist/service/http/h5Http.ts +1 -0
  142. package/dist/service/http/http.ts +1 -0
  143. package/dist/service/http/httpInterceptors.jd.ts +1 -0
  144. package/dist/service/http/httpInterceptors.ts +1 -0
  145. package/dist/service/http/index.h5.ts +1 -0
  146. package/dist/service/http/index.ts +1 -0
  147. package/dist/service/requestServer.h5.ts +1 -0
  148. package/dist/service/requestServer.ts +1 -0
  149. package/dist/service/requestServer.weapp.ts +1 -0
  150. package/dist/utils/connectNativeJsBridge.ts +1 -1
  151. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  152. package/dist/utils/draExceptionAndProfile.ts +1 -1
  153. package/dist/utils/h5Utils.ts +1 -1
  154. package/dist/utils/index.h5.ts +1 -1
  155. package/dist/utils/index.ts +1 -1
  156. package/dist/utils/index.weapp.ts +1 -1
  157. package/dist/utils/intersectionObserver.ts +1 -1
  158. package/dist/utils/jm-common.js +1 -1
  159. package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
  160. package/dist/utils/jumpExtMapUtil.ts +1 -0
  161. package/dist/utils/priceUtils.js +1 -0
  162. package/dist/utils/ready.ts +1 -0
  163. package/dist/utils/sColor.js +1 -0
  164. package/dist/utils/sgmCodeUtils.ts +1 -0
  165. package/dist/utils/taroRenderUtil.ts +1 -0
  166. package/dist/utils/utils.ts +1 -1
  167. package/dist/wxapp/api/helper.js +1 -0
  168. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  169. package/dist/wxapp/common/user_info.js +1 -1
  170. package/dist/wxapp/components/launch-app/index.js +1 -0
  171. package/dist/wxapp/components/launch-app/index.json +5 -0
  172. package/dist/wxapp/components/launch-app/index.wxml +0 -0
  173. package/dist/wxapp/components/launch-app/index.wxss +0 -0
  174. package/dist/wxapp/components/subscribe-guider/helper.js +1 -0
  175. package/dist/wxapp/components/subscribe-guider/index.js +1 -0
  176. package/dist/wxapp/components/subscribe-guider/index.json +5 -0
  177. package/dist/wxapp/components/subscribe-guider/index.wxml +0 -0
  178. package/dist/wxapp/components/subscribe-guider/index.wxss +0 -0
  179. package/package.json +145 -114
  180. package/dist/components/base/Price/index.module.scss +0 -136
  181. package/dist/components/base/Skeleton/old.tsx +0 -1
  182. package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
  183. package/dist/open/api/jump.ts +0 -1
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  pin?: string
3
2
  visitkey?: string
4
3
  [key: string]: any
5
4
  }
6
5
  jdpin,
7
6
  pinStatus,
8
7
  visitkey,
9
8
  unionid,
10
9
  skey,
11
10
  __jda,
12
11
  __jdv,
13
12
  __wga,
14
13
  wxapp_type
15
14
  } = cookie
16
15
  const getUserCookieObj = {}
17
16
  jdpin,
18
17
  pinStatus,
19
18
  visitkey,
20
19
  unionid,
21
20
  skey,
22
21
  __jda,
23
22
  __jdv,
24
23
  __wga,
25
24
  wid,
26
25
  wq_skey,
27
26
  wq_uin,
28
27
  wq_auth_token,
29
28
  wxapp_scene,
30
29
  wq_unionid,
31
30
  wxapp_openid,
32
31
  wxapp_version,
33
32
  wxapp_type
34
33
  name = name === 'jdpin' ? 'pin' : name;
35
34
  name === 'pin' && (ret.push(`pt_pin=${encodeURIComponent(value)}`))
36
35
  ret.push(`${name}=${encodeURIComponent(value)}`)
37
36
  getUserCookieObj[name] = value
38
37
  }
39
38
  wqCookie: getUserCookieObj
40
39
  exceptionReportFn
41
40
  exceptionReportFn(
42
41
  `店铺首页isv h5楼层隐藏不显示。原因:modularPackResult数据不完备。页面类型-buildType: ${buildType}。楼层顺序-floorIdx: ${floorData?.floorIdx}`,
43
42
  )
44
43
  const isIsvContainer = (containerId, floorListData, containerListData) => {
45
44
  const objContainer = containerListData.find(item => item.containerId === containerId)
46
45
  (itemUid) => {
47
46
  const objectFloor = floorListData.find(floorItem => itemUid === floorItem.uid)
48
47
  return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag)
49
48
  }
50
49
  )?? false
50
+ import Taro from '@tarojs/taro';
51
51
  SHOP_MENU_ID_TYPE,
52
52
  SHOP_MENU_ID_QUERY_NAME,
53
53
  SECTION_HOME_TAB_TYPE,
54
54
  SECTION_HOME_TAB_NAME_TYPE,
55
55
  SECTION_HOME_TAB_QUERY_TYPE,
56
56
  SECTION_HOME_CUSTOM_TAB_TYPE_ARRAY,
57
57
  CHANNEL_TYPE,
58
58
  JDShopViewBusinessPathType,
59
59
  FloorModuleType,
60
60
  RemoteLoadFloorList,
61
61
  FLOOR_KIND,
62
62
  getBundleUrl,
63
63
  getBundleFileName,
64
64
  formatPackResult,
65
65
  getTaroVersion,
66
66
  /ipad/i.test(system) || (/android/i.test(system) && !/mobi|mini|fennec/i.test(system));
67
67
  key: string,
68
68
  value: string | object,
69
69
  successBack?: any,
70
70
  failBack?: any,
71
71
  try {
72
72
  if (isH5 && window && !window.localStorage) {
73
73
  console.log(`setTaroStorage key:${key} window.localStorage不存在:`);
74
74
  return Promise.resolve(null);
75
75
  }
76
76
  return Taro.setStorage({
77
77
  key: key,
78
78
  data: value,
79
79
  success: successBack,
80
80
  fail: failBack,
81
81
  }).catch((e) => {
82
82
  console.log(`setTaroStorage key:${key} 报错:`, e);
83
83
  return null;
84
84
  });
85
85
  } catch (e) {
86
86
  console.log(`setTaroStorage key:${key} 报错:`, e);
87
87
  return Promise.resolve(null);
88
88
  }
89
89
  try {
90
90
  if (isH5 && window && !window.localStorage) {
91
91
  console.log(`getTaroStorageKeyValue key:${key} window.localStorage不存在:`);
92
92
  return Promise.resolve(null);
93
93
  }
94
94
  return Taro.getStorageSync(key);
95
95
  } catch (e) {
96
96
  console.log(`getTaroStorageKeyValue key:${key} 报错:`, e);
97
97
  return null;
98
98
  }
99
99
  try {
100
100
  if (isH5 && window && !window.localStorage) {
101
101
  console.log(`removeTaroStorageKey key:${key} window.localStorage不存在:`);
102
102
  return Promise.resolve(null);
103
103
  }
104
104
  return Taro.removeStorage({
105
105
  key: key,
106
106
  }).catch((e) => {
107
107
  console.log(`removeTaroStorageKey key:${key} 报错:`, e);
108
108
  });
109
109
  } catch (e) {
110
110
  console.log(`removeTaroStorageKey key:${key} 报错:`, e);
111
111
  }
112
112
  try {
113
113
  if (isH5 && window && !window.localStorage) {
114
114
  console.log(`clearTaroStorageKey window.localStorage不存在`);
115
115
  return Promise.resolve(null);
116
116
  }
117
117
  return Taro.clearStorage().catch((e) => {
118
118
  console.log('clearTaroStorageKey报错:', e);
119
119
  });
120
120
  } catch (e) {
121
121
  console.log('clearTaroStorageKey报错:', e);
122
122
  }
123
123
  let hasChecked = false;
124
124
  if (isH5) {
125
125
  const avifCache = getTaroStorageKeyValue(KEY_AVIF);
126
126
  if (avifCache === null || avifCache === '' || forceUpdate) {
127
127
  hasChecked = true;
128
128
  const img = new Image();
129
129
  img.onload = function () {
130
130
  if (img.height > 0 && img.width > 0) {
131
131
  setTaroStorage(KEY_AVIF, '1');
132
132
  } else {
133
133
  setTaroStorage(KEY_AVIF, '0');
134
134
  }
135
135
  };
136
136
  img.onerror = () => {
137
137
  setTaroStorage(KEY_AVIF, '0');
138
138
  };
139
139
  img.src =
140
140
  'data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=';
141
141
  }
142
142
  const webpCache = getTaroStorageKeyValue(KEY_WEBP);
143
143
  if (webpCache === null || webpCache === '' || forceUpdate) {
144
144
  hasChecked = true;
145
145
  const img = new Image();
146
146
  img.onload = function () {
147
147
  if (img.height > 0 && img.width > 0) {
148
148
  setTaroStorage(KEY_WEBP, '1');
149
149
  } else {
150
150
  setTaroStorage(KEY_WEBP, '0');
151
151
  }
152
152
  };
153
153
  img.onerror = () => {
154
154
  setTaroStorage(KEY_WEBP, '0');
155
155
  };
156
156
  img.src =
157
157
  'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAUAmJaQAA3AA/vz0AAA=';
158
158
  }
159
159
  }
160
160
  return hasChecked;
161
161
  const hasChecked = imageFormatSupport(false);
162
162
  if (!hasChecked) {
163
163
  setTimeout(imageFormatSupport, 5000);
164
164
  }
165
165
  const resultList: Array<any> = [],
166
166
  arrLen = arr.length;
167
167
  if (arrLen) {
168
168
  if (arrLen > size) {
169
169
  for (let i = 0; i < arrLen; i = i + size) {
170
170
  resultList.push(arr.slice(i, i + size));
171
171
  }
172
172
  } else {
173
173
  resultList.push(arr);
174
174
  }
175
175
  }
176
176
  return resultList;
177
177
  let _address = ids;
178
178
  const _areaAreaSplit = ids.split('.');
179
179
  const _areaAreaSplit2 = ids.split('_');
180
180
  _address = _areaAreaSplit.length === 2 ? _areaAreaSplit[0] : _address;
181
181
  _address = _areaAreaSplit2.length === 3 ? `${_areaAreaSplit2}_0` : _address;
182
182
  return _address;
183
183
  let paramStr = '';
184
184
  obj &&
185
185
  Object.keys(obj).forEach((key, index) => {
186
186
  const getValue = `${obj[key]}`.replace(/undefined/, '').replace(/null/, '');
187
187
  paramStr += `${index === 0 ? '' : '&'}${key}=${encodeURIComponent(getValue)}`;
188
188
  });
189
189
  return paramStr;
190
190
  const result = {};
191
191
  if (
192
192
  !urlOrQueryStr ||
193
193
  ('string' !== typeof urlOrQueryStr && String !== urlOrQueryStr.constructor)
194
194
  ) {
195
195
  return result;
196
196
  }
197
197
  if (urlOrQueryStr.indexOf('?') > -1) {
198
198
  const queryStr = urlOrQueryStr.split('?');
199
199
  const queryItemList = queryStr && queryStr.length > 1 ? queryStr[1].split('&') : [];
200
200
  const queryItemListLen = queryItemList.length;
201
201
  queryItemListLen > 0 &&
202
202
  queryItemList.forEach((item) => {
203
203
  const thisItemList = item.split('=');
204
204
  result[thisItemList[0]] = thisItemList[1];
205
205
  });
206
206
  } else {
207
207
  const queryItemList =
208
208
  urlOrQueryStr.indexOf('&') > -1 ? urlOrQueryStr.split('&') : [urlOrQueryStr];
209
209
  const queryItemListLen = queryItemList.length;
210
210
  queryItemListLen > 0 &&
211
211
  queryItemList.forEach((item) => {
212
212
  const thisItemList = item.split('=');
213
213
  result[thisItemList[0]] = thisItemList[1];
214
214
  });
215
215
  }
216
216
  return result;
217
217
  url: string,
218
218
  size?: {
219
219
  w: number;
220
220
  h: number;
221
221
  },
222
222
  quality?: number,
223
223
  if (url && size) {
224
224
  const _w = Math.floor(size.w);
225
225
  const _h = Math.floor(size.h);
226
226
  if (url.match(/gif$/i)) {
227
227
  return url;
228
228
  } else {
229
229
  if (_w > 0 && _h > 0) {
230
230
  url = url.replace('jfs/', `s${_w}x${_h}_jfs/`);
231
231
  }
232
232
  url += quality != null ? `!q${quality}.dpg` : '.dpg';
233
233
  }
234
234
  }
235
235
  return url;
236
236
  if (url.match(/\.(jpg|png|dpg)$/i)) {
237
237
  const { width, height, quality } = jfsImgInfo;
238
238
  if (typeof width === 'number' || typeof height === 'number') {
239
239
  url = url.replace('/jfs/', `/s${Math.floor(width || 0)}x${Math.floor(height || 0)}_jfs/`);
240
240
  }
241
241
  if (typeof quality === 'number' && quality > 0 && quality < 100 && url.match(/\.jpg$/i)) {
242
242
  url += `!q${quality}.dpg`;
243
243
  }
244
244
  }
245
245
  return addHttps(url);
246
246
  if (imgUrl) {
247
247
  if (
248
248
  !imgUrl.match(
249
249
  /(storage\.360buyimg\.com)|(jdcloud-oss\.com)|(imgcps\.jd\.com)|((\w+)\.300hu\.com)|(thirdwx\.qlogo\.cn)|(!q)|gif|dpg$/i,
250
250
  )
251
251
  ) {
252
252
  if (!imgUrl.includes('360buyimg.com')) {
253
253
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl;
254
254
  }
255
255
  if (quality != 100) imgUrl += /\.png/.test(imgUrl) ? '.dpg' : `!q${quality}`;
256
256
  }
257
257
  imgUrl = imgUrl.match(/^\/\//) ? `https:${imgUrl}` : imgUrl;
258
258
  }
259
259
  return imgUrl;
260
260
  const result = value % step;
261
261
  return result === 0 ? value : Math.ceil(value / step) * step;
262
262
  const MAX = 3.5;
263
263
  return Math.min(window?.devicePixelRatio ?? 2, MAX);
264
264
  isSkuImage: boolean;
265
265
  size: number;
266
266
  imgUrl: string,
267
267
  options: QualityOptions,
268
268
  isIgnoreOptimizeFromServer: boolean = false,
269
269
  if (!imgUrl) {
270
270
  console.error('The input parameter imageUrl for the getQualityImage() cannot be empty!');
271
271
  return imgUrl;
272
272
  }
273
273
  if (isIgnoreOptimizeFromServer) {
274
274
  imgUrl = imgUrl.replace(/\.(jpe?g|png).*/, '.$1');
275
275
  }
276
276
  if (!/^((https?):)?\/\//.test(imgUrl)) {
277
277
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl;
278
278
  }
279
279
  const imgServerRegExp = /(img|m)\d{0,2}\.360buyimg\.com\/.*\.(jpe?g|png)/i;
280
280
  if (!imgServerRegExp.test(imgUrl)) {
281
281
  return imgUrl;
282
282
  }
283
283
  imgUrl = /^\/\//.test(imgUrl) ? `https:${imgUrl}` : imgUrl;
284
284
  const { isSkuImage, size } = options || {};
285
285
  const needReduceSize = isSkuImage && size;
286
286
  if (needReduceSize) {
287
287
  const devicePixelRatio = getDevicePixelRatio();
288
288
  const useWidth = getValueByStep(size * devicePixelRatio, 40);
289
289
  imgUrl = imgUrl.replace(/\/[^\/]*jfs\//, `/s${useWidth}x${useWidth}_jfs/`);
290
290
  }
291
291
  const needCompress = !global?.info?.pageInfo?.isVipShop;
292
292
  const result = imgUrl.match(/\/\w+\.(jpe?g|png)$/);
293
293
  if (needCompress && result) {
294
294
  if (getAvifSupport() === '1') {
295
295
  imgUrl += '.avif';
296
296
  } else if (getWebpSupport() === '1') {
297
297
  imgUrl += '.webp';
298
298
  } else if (/jpe?g/.test(result[1])) {
299
299
  imgUrl += '!q80';
300
300
  }
301
301
  }
302
302
  if (needReduceSize) {
303
303
  imgUrl += '!z2';
304
304
  }
305
305
  return imgUrl;
306
306
  if (imgUrl) {
307
307
  if (
308
308
  !imgUrl.match(
309
309
  /(storage\.360buyimg\.com)|(jdcloud-oss\.com)|((\w+)\.300hu\.com)|(thirdwx\.qlogo\.cn)|(!q)|gif|dpg$/i,
310
310
  )
311
311
  ) {
312
312
  if (!imgUrl.includes('360buyimg.com')) {
313
313
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl;
314
314
  }
315
315
  if (quality != 100) imgUrl += /\.png/.test(imgUrl) ? '.dpg' : `!q${quality}`;
316
316
  }
317
317
  imgUrl = imgUrl.match(/^\/\//) ? `https:${imgUrl}` : imgUrl;
318
318
  }
319
319
  return imgUrl;
320
320
  return getTaroStorageKeyValue(KEY_AVIF) || '0';
321
321
  return getTaroStorageKeyValue(KEY_WEBP) || '0';
322
322
  count: number,
323
323
  fixedNum = 1,
324
324
  unit = '万',
325
325
  maxNum = 10000,
326
326
  count = Number(count);
327
327
  const getMaxNum = count > 100000000 ? 100000000 : maxNum;
328
328
  const getUnit = count > 100000000 ? '亿' : unit;
329
329
  if (count >= getMaxNum) {
330
330
  return (count / getMaxNum).toFixed(fixedNum) + getUnit;
331
331
  }
332
332
  return count;
333
333
  const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfo || {
334
334
  platform: '',
335
335
  model: '',
336
336
  system: '',
337
337
  };
338
338
  const isIOS = !!systemInfo.system.match(/ios/i);
339
339
  const isAndroid = !!systemInfo.system.match(/android/i);
340
340
  if (!systemInfo.statusBarHeight) {
341
341
  systemInfo.statusBarHeight = screenHeight - windowHeight - 20;
342
342
  systemInfo.navBarExtendHeight = 0;
343
343
  } else {
344
344
  if (isIOS) {
345
345
  systemInfo.navBarExtendHeight = 4;
346
346
  } else {
347
347
  systemInfo.navBarExtendHeight = 0;
348
348
  }
349
349
  }
350
350
  let rect = Taro.getMenuButtonBoundingClientRect ? Taro.getMenuButtonBoundingClientRect() : null;
351
351
  if (!rect || !rect.width || !rect.top || !rect.left || !rect.height) {
352
352
  let gap = 0;
353
353
  let width = 96;
354
354
  if (systemInfo.platform === 'android') {
355
355
  gap = 8;
356
356
  width = 96;
357
357
  } else if (systemInfo.platform === 'devtools') {
358
358
  if (isIOS) {
359
359
  gap = 5.5;
360
360
  } else {
361
361
  gap = 7.5;
362
362
  }
363
363
  } else {
364
364
  gap = 4;
365
365
  width = 88;
366
366
  }
367
367
  rect = {
368
368
  bottom: systemInfo.statusBarHeight + gap + 32,
369
369
  height: 32,
370
370
  left: systemInfo.windowWidth - width - 10,
371
371
  right: systemInfo.windowWidth - 10,
372
372
  top: systemInfo.statusBarHeight + gap,
373
373
  width,
374
374
  };
375
375
  }
376
376
  const gap = rect.top - systemInfo.statusBarHeight;
377
377
  systemInfo.navBarTopToStatusBar = gap;
378
378
  systemInfo.navBarHeight = 2 * gap + rect.height;
379
379
  systemInfo.capsulePosition = rect;
380
380
  systemInfo.isIOS = isIOS;
381
381
  systemInfo.isAndroid = isAndroid;
382
382
  return systemInfo;
383
383
  if (str.match(/^\/\//)) {
384
384
  str = 'https:' + str;
385
385
  }
386
386
  return str;
387
387
  dateTimeOrdate: Date | string | number | null,
388
388
  format = 'yyyy-MM-dd HH:mm:ss',
389
389
  noPadStart = {
390
390
  M: '0',
391
391
  d: '0',
392
392
  H: '0',
393
393
  m: '0',
394
394
  s: '0',
395
395
  },
396
396
  let dateResult = '';
397
397
  const padStarts = Object.assign(
398
398
  {
399
399
  M: '0',
400
400
  d: '0',
401
401
  H: '0',
402
402
  m: '0',
403
403
  s: '0',
404
404
  },
405
405
  noPadStart,
406
406
  );
407
407
  if (dateTimeOrdate) {
408
408
  let changeDateTimeOrdate = dateTimeOrdate;
409
409
  const getChangeDateTimeToNumber = Number(changeDateTimeOrdate);
410
410
  if (getChangeDateTimeToNumber) {
411
411
  changeDateTimeOrdate = getChangeDateTimeToNumber;
412
412
  } else {
413
413
  changeDateTimeOrdate = `${changeDateTimeOrdate}`.replace(/-/g, '/').replace(/\./g, '/');
414
414
  }
415
415
  const nowDate =
416
416
  dateTimeOrdate instanceof Date ? dateTimeOrdate : new Date(changeDateTimeOrdate);
417
417
  const dateMap = {
418
418
  y: `${nowDate.getFullYear()}`,
419
419
  M: `${nowDate.getMonth() + 1}`.padStart(2, padStarts['M']),
420
420
  d: `${nowDate.getDate()}`.padStart(2, padStarts['d']),
421
421
  H: `${nowDate.getHours()}`.padStart(2, padStarts['H']),
422
422
  m: `${nowDate.getMinutes()}`.padStart(2, padStarts['m']),
423
423
  s: `${nowDate.getSeconds()}`.padStart(2, padStarts['s']),
424
424
  };
425
425
  const regDate = new RegExp('y+|M+|d+|H+|m+|s+', 'g');
426
426
  const regYear = new RegExp('y');
427
427
  dateResult = format.replace(regDate, (v) => {
428
428
  let changeValue = v;
429
429
  if (regYear.test(changeValue)) {
430
430
  const thisYear = dateMap.y;
431
431
  const subValueLen = 4 - changeValue.length;
432
432
  changeValue = thisYear.substr(subValueLen);
433
433
  } else {
434
434
  const dateKey = v.substr(0, 1);
435
435
  changeValue = dateMap[dateKey];
436
436
  }
437
437
  return changeValue;
438
438
  });
439
439
  }
440
440
  return dateResult;
441
441
  let timer: any = null;
442
442
  let startTime = Date.now();
443
443
  return function () {
444
444
  const curTime = Date.now();
445
445
  const remaining = delay - (curTime - startTime);
446
446
  const context = this;
447
447
  const args = arguments;
448
448
  clearTimeout(timer);
449
449
  if (remaining <= 0) {
450
450
  func.apply(context, args);
451
451
  startTime = Date.now();
452
452
  } else {
453
453
  timer = setTimeout(func, remaining);
454
454
  }
455
455
  };
456
456
  let context, args, result;
457
457
  let timeout = null;
458
458
  let previous = 0;
459
459
  if (!options) options = {};
460
460
  const later = function () {
461
461
  previous = options.leading === false ? 0 : Date.now();
462
462
  timeout = null;
463
463
  result = func.apply(context, args);
464
464
  if (!timeout) context = args = null;
465
465
  };
466
466
  return function () {
467
467
  const now = Date.now();
468
468
  if (!previous && options.leading === false) previous = now;
469
469
  const remaining = wait - (now - previous);
470
470
  context = this;
471
471
  args = arguments;
472
472
  if (remaining <= 0 || remaining > wait) {
473
473
  if (timeout) {
474
474
  clearTimeout(timeout);
475
475
  timeout = null;
476
476
  }
477
477
  previous = now;
478
478
  result = func.apply(context, args);
479
479
  if (!timeout) context = args = null;
480
480
  } else if (!timeout && options.trailing !== false) {
481
481
  timeout = setTimeout(later, remaining);
482
482
  }
483
483
  return result;
484
484
  };
485
485
  let timer: any = null;
486
486
  return function () {
487
487
  const context: any = this;
488
488
  const args = arguments;
489
489
  timer && clearTimeout(timer);
490
490
  timer = setTimeout(function () {
491
491
  fn.apply(context, args);
492
492
  }, delay);
493
493
  };
494
494
  if (txt) {
495
495
  txt = txt.trim();
496
496
  const reg = new RegExp(/[\d-]+/);
497
497
  const res = reg.exec(txt);
498
498
  if (res && res.length > 0) {
499
499
  let tel = res[0];
500
500
  if (tel && delSeparator) {
501
501
  tel = tel.replace(/-/g, '');
502
502
  }
503
503
  return tel;
504
504
  }
505
505
  }
506
506
  return '';
507
507
  if (rgb) {
508
508
  const reg = /^(rgb|RGB)/;
509
509
  const color = rgb;
510
510
  if (reg.test(color)) {
511
511
  let strHex = '#';
512
512
  const colorArr = color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
513
513
  for (let i = 0; i < colorArr.length; i++) {
514
514
  let hex = Number(colorArr[i]).toString(16);
515
515
  if (hex === '0') {
516
516
  hex += hex;
517
517
  }
518
518
  strHex += hex;
519
519
  }
520
520
  return strHex;
521
521
  } else {
522
522
  return String(color);
523
523
  }
524
524
  } else {
525
525
  return '';
526
526
  }
527
527
  if (hex) {
528
528
  const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
529
529
  let color = hex.toLowerCase();
530
530
  if (reg.test(color)) {
531
531
  if (color.length === 4) {
532
532
  let colorNew = '#';
533
533
  for (let i = 1; i < 4; i += 1) {
534
534
  colorNew += color.slice(i, i + 1).concat(color.slice(i, i + 1));
535
535
  }
536
536
  color = colorNew;
537
537
  }
538
538
  const colorChange: number[] = [];
539
539
  for (let i = 1; i < 7; i += 2) {
540
540
  colorChange.push(parseInt('0x' + color.slice(i, i + 2)));
541
541
  }
542
542
  if (returnList) {
543
543
  return colorChange;
544
544
  } else {
545
545
  return 'RGB(' + colorChange.join(',') + ')';
546
546
  }
547
547
  } else {
548
548
  return color;
549
549
  }
550
550
  } else {
551
551
  return '';
552
552
  }
553
553
  const c = m - n + 1;
554
554
  const res = Math.floor(Math.random() * c + n);
555
555
  if (filterNum && filterNum == res) {
556
556
  console.log('随机数二次开始', res, filterNum);
557
557
  return getRandom(n, m, filterNum);
558
558
  } else {
559
559
  return res;
560
560
  }
561
561
  wqCookieStr: string;
562
562
  wqCookie: {
563
563
  pin?: string;
564
564
  visitkey?: string;
565
565
  [key: string]: any;
566
566
  };
567
567
 
568
568
  const {
569
569
  jdpin,
570
570
  pinStatus,
571
571
  visitkey,
572
572
  unionid,
573
573
  skey,
574
574
  __jda,
575
575
  __jdv,
576
576
  __wga,
577
577
  wid,
578
578
  wq_skey,
579
579
  wq_uin,
580
580
  wq_auth_token,
581
581
  wxapp_scene,
582
582
  wq_unionid,
583
583
  wxapp_openid,
584
584
  wxapp_version,
585
585
  wxapp_type,
586
586
  appType,
587
587
  lbs_addr,
588
588
  } = cookie;
589
589
  const ret: string[] = [];
590
590
  const getUserCookieObj = {};
591
591
  const createUseCookieArr = [
592
592
  jdpin,
593
593
  pinStatus,
594
594
  visitkey,
595
595
  unionid,
596
596
  skey,
597
597
  __jda,
598
598
  __jdv,
599
599
  __wga,
600
600
  wid,
601
601
  wq_skey,
602
602
  wq_uin,
603
603
  wq_auth_token,
604
604
  wxapp_scene,
605
605
  wq_unionid,
606
606
  wxapp_openid,
607
607
  wxapp_version,
608
608
  wxapp_type,
609
609
  appType,
610
610
  lbs_addr,
611
611
  ];
612
612
 
613
613
  createUseCookieArr.forEach((keyItem) => {
614
614
  if (keyItem && keyItem['name']) {
615
615
  let { name, value } = keyItem;
616
616
  name = name === 'jdpin' ? 'pin' : name;
617
617
  name === 'pin' && ret.push(`pt_pin=${encodeURIComponent(value)}`);
618
618
  ret.push(`${name}=${encodeURIComponent(value)}`);
619
619
  getUserCookieObj[name] = value;
620
620
  }
621
621
  });
622
622
  return {
623
623
  wqCookieStr: ret.join(';'),
624
624
  wqCookie: getUserCookieObj,
625
625
  };
626
626
  const getLayoutWidth = layoutWidth || global.info?.sysInfo?.windowWidth || windowWidth;
627
627
  const getNum = Number(num);
628
628
  return Math.round((getNum / widthSize) * getLayoutWidth);
629
629
  let checkState = false;
630
630
  const couponFloorModuleType = floorData?.floorExtInfo?.moduleFlag;
631
631
  if (couponFloorModuleType === FloorModuleType.COUPON) {
632
632
  try {
633
633
  const dataDefines = getFloorDataToDataDefines(floorData);
634
634
  const couponDataDefine = dataDefines
635
635
  ? dataDefines.filter((item) => {
636
636
  return item.type === 'coupon';
637
637
  })
638
638
  : [],
639
639
  couponList = couponDataDefine[0]?.nodeText?.data ? couponDataDefine[0]?.nodeText?.data : [],
640
640
  couponLength = couponList.length,
641
641
  numShowPerLine = couponDataDefine[0]?.nodeText?.numShowPerLine
642
642
  ? couponDataDefine[0]?.nodeText?.numShowPerLine
643
643
  : 0;
644
644
  if (numShowPerLine === 0 && couponLength > 3) {
645
645
  checkState = true;
646
646
  }
647
647
  } catch (e) {
648
648
  checkState = false;
649
649
  }
650
650
  return checkState;
651
651
  }
652
652
  const {
653
653
  containers = [],
654
654
  floors = [],
655
655
  clearFirstContaierMarginTop = false,
656
656
  } = pageData;
657
657
  console.log('dealShopContentData:', pageData, 'isvdev:', isvdev);
658
658
  const getThisTimeKey = Date.now();
659
659
  let shopContentContainerListData = containers?.filter(
660
660
  (item) => (!isvdev && item.typeCode !== 'mShopHeader') || isvdev,
661
661
  );
662
662
  const shopContentFloorListData = floors?.filter(
663
663
  ({ floorPosition }) =>
664
664
  (!isvdev && floorPosition !== 'header' && floorPosition !== 'footer') || isvdev,
665
665
  );
666
666
  const unableIsvContainerListData = getUnableIsvContainerListData(
667
667
  shopContentFloorListData,
668
668
  shopContentContainerListData,
669
669
  exceptionReportFn,
670
670
  );
671
671
  shopContentContainerListData.forEach((item, index) => {
672
672
  item.key = `${getThisTimeKey + index}`;
673
673
  item.floors = [];
674
674
  item.includeUids &&
675
675
  item.includeUids.forEach((floorUid) => {
676
676
  const getFloorData = shopContentFloorListData.find(
677
677
  (floorItem) => floorItem.uid === floorUid,
678
678
  );
679
679
  if (getFloorData) {
680
680
  const changeFloorData = {
681
681
  containerId: item.containerId,
682
682
  containerIndex: index,
683
683
  ...getFloorData,
684
684
  };
685
685
  const getCheckMoreCouponState = checkCouponAndChangeContainerSetData(getFloorData);
686
686
  if (getCheckMoreCouponState) {
687
687
  item.marginLeft && (item.marginLeft = 0);
688
688
  item.marginRight && (item.marginRight = 0);
689
689
  item.borderRadius && (item.borderRadius = 0);
690
690
  }
691
691
  if (getFloorData?.floorExtInfo?.floorLoadWay === 2) {
692
692
  const getSysFloorToLoadTypeRes = isIsvFloorUseable(getFloorData, exceptionReportFn);
693
693
  !getSysFloorToLoadTypeRes && (getFloorData.floorExtInfo.floorLoadWay = 1);
694
694
  }
695
695
  item.floors.push(changeFloorData);
696
696
  }
697
697
  });
698
698
  if (
699
699
  ((!isvdev && index === 0) || (isvdev && index === 1)) &&
700
700
  item?.containerPosition == 'content' &&
701
701
  item?.marginBottom > 0 &&
702
702
  !clearFirstContaierMarginTop
703
703
  ) {
704
704
  item.marginTop = item.marginBottom;
705
705
  }
706
706
  });
707
707
  shopContentContainerListData = shopContentContainerListData.filter(
708
708
  (item) =>
709
709
  item.floors.length > 0 &&
710
710
  unableIsvContainerListData.every(
711
711
  (containerItem) => containerItem.containerId != item.containerId,
712
712
  ),
713
713
  );
714
714
  console.log(
715
715
  'dealShopContentData isWxMinAndWxapp:',
716
716
  isWxMinAndWxapp,
717
717
  'weappJumpToH5:',
718
718
  pageData?.homeExtInfo?.weappJumpToH5,
719
719
  );
720
720
  if (isProd && isWxMinAndWxapp) {
721
721
  shopContentContainerListData = shopContentContainerListData.filter(
722
722
  (item) =>
723
723
  item.floors.length > 0 &&
724
724
  !isIsvContainer(item.containerId, shopContentFloorListData, shopContentContainerListData),
725
725
  );
726
726
  }
727
727
  shopContentContainerListData = [].concat(shopContentContainerListData);
728
728
  return {
729
729
  shopContentContainerListData,
730
730
  shopContentFloorListData,
731
731
  };
732
732
  const changeOpts = {
733
733
  title: '',
734
734
  icon: 'success',
735
735
  duration: 1500,
736
736
  mask: true,
737
737
  ...options,
738
738
  };
739
739
  if (changeOpts.title.length > 7) {
740
740
  showNormalToast(options);
741
741
  } else {
742
742
  Taro.showToast(changeOpts as any);
743
743
  }
744
744
  const changeOpts = {
745
745
  title: '',
746
746
  icon: 'error',
747
747
  duration: 1500,
748
748
  mask: true,
749
749
  ...options,
750
750
  };
751
751
  if (changeOpts.title.length > 7) {
752
752
  showNormalToast(options);
753
753
  } else {
754
754
  Taro.showToast(changeOpts as any);
755
755
  }
756
756
  Taro.showToast({
757
757
  title: '',
758
758
  icon: 'none',
759
759
  duration: 1500,
760
760
  mask: true,
761
761
  ...options,
762
762
  });
763
763
  return Taro.showLoading({
764
764
  title: text,
765
765
  });
766
766
  return new Promise(() => {
767
767
  Taro.nextTick(() => {
768
768
  setTimeout(() => {
769
769
  Taro.hideLoading(options);
770
770
  }, 300);
771
771
  });
772
772
  });
773
773
  return CHANNEL_TYPE[JDShopViewBusinessPathType.HOME];
774
774
  const {
775
775
  tabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN],
776
776
  sceneId,
777
777
  currentTabType,
778
778
  } = query;
779
779
  let changeTabActive = tabActive;
780
780
  if (sceneId) {
781
781
  if (isH5) {
782
782
  if (sceneId == '1002') {
783
783
  changeTabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT];
784
784
  }
785
785
  else if (sceneId == '1003') {
786
786
  changeTabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_ACTIVITY];
787
787
  }
788
788
  } else if (isWxMinAndWxapp) {
789
789
  if (sceneId == '1001' || sceneId == '1002') {
790
790
  changeTabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT];
791
791
  }
792
792
  else if (sceneId == '1003') {
793
793
  changeTabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION];
794
794
  }
795
795
  }
796
796
  }
797
797
  if (SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]) {
798
798
  if (
799
799
  !isNaN(currentTabType) &&
800
800
  SECTION_HOME_CUSTOM_TAB_TYPE_ARRAY.indexOf(currentTabType) !== -1
801
801
  ) {
802
802
  return {
803
803
  menuType: SHOP_MENU_ID_TYPE.HOME,
804
804
  tabActiveType: currentTabType,
805
805
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${currentTabType}`,
806
806
  };
807
807
  }
808
808
  return {
809
809
  menuType: SHOP_MENU_ID_TYPE.HOME,
810
810
  tabActiveType: SECTION_HOME_TAB_QUERY_TYPE[changeTabActive],
811
811
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]}`,
812
812
  };
813
813
  } else if (SHOP_MENU_ID_QUERY_NAME[changeTabActive]) {
814
814
  return {
815
815
  menuType: SHOP_MENU_ID_QUERY_NAME[changeTabActive],
816
816
  tabActiveType: 0,
817
817
  queryMenuTabActiveStr: `${SHOP_MENU_ID_QUERY_NAME[changeTabActive]}@0`,
818
818
  };
819
819
  } else {
820
820
  const defaultMenuType = {
821
821
  menuType: SHOP_MENU_ID_TYPE.HOME,
822
822
  tabActiveType: SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN,
823
823
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN}`,
824
824
  };
825
825
  const isCustomTab = tabActive.indexOf(SECTION_HOME_TAB_NAME_TYPE.HOME_CUSTOM) !== -1;
826
826
  if (isCustomTab) {
827
827
  const customTabType = Number(tabActive.split('-')[2]);
828
828
  if (
829
829
  !isNaN(customTabType) &&
830
830
  SECTION_HOME_CUSTOM_TAB_TYPE_ARRAY.indexOf(customTabType) !== -1
831
831
  ) {
832
832
  return {
833
833
  menuType: SHOP_MENU_ID_TYPE.HOME,
834
834
  tabActiveType: customTabType,
835
835
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${customTabType}`,
836
836
  };
837
837
  } else {
838
838
  return defaultMenuType;
839
839
  }
840
840
  } else {
841
841
  if (
842
842
  !isNaN(currentTabType) &&
843
843
  SECTION_HOME_CUSTOM_TAB_TYPE_ARRAY.indexOf(currentTabType) !== -1
844
844
  ) {
845
845
  return {
846
846
  menuType: SHOP_MENU_ID_TYPE.HOME,
847
847
  tabActiveType: currentTabType,
848
848
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${currentTabType}`,
849
849
  };
850
850
  }
851
851
  return defaultMenuType;
852
852
  }
853
853
  }
854
854
  const deleteKeyList = [
855
855
  '$taroTimestamp',
856
856
  'cookie',
857
857
  'wdref',
858
858
  'navStart',
859
859
  'originOpts',
860
860
  'originParams',
861
861
  'originUrl',
862
862
  'referer',
863
863
  'stamp',
864
864
  'hybrid',
865
865
  'sr',
866
866
  'navh',
867
867
  'stath',
868
868
  ];
869
869
  let changeQueryData: any = { ...queryData };
870
870
  const qrCodeScene = changeQueryData?.scene ? changeQueryData?.scene : false;
871
871
  const sceneQuery =
872
872
  qrCodeScene && typeof qrCodeScene === 'string'
873
873
  ? parseQueryUrlString(decodeURIComponent(qrCodeScene))
874
874
  : {};
875
875
  changeQueryData = { ...changeQueryData, ...sceneQuery };
876
876
  deleteKeyList.forEach((key) => {
877
877
  changeQueryData[key] && delete changeQueryData[key];
878
878
  });
879
879
  Object.keys(changeQueryData).forEach((key) => {
880
880
  if (changeQueryData[key] && Array.isArray(changeQueryData[key])) {
881
881
  changeQueryData[key] = changeQueryData[key][0] || '';
882
882
  }
883
883
  });
884
884
  changeQueryData['shopid'] &&
885
885
  (changeQueryData['shopId'] = changeQueryData['shopid']) &&
886
886
  delete changeQueryData['shopid'];
887
887
  changeQueryData['venderid'] &&
888
888
  (changeQueryData['venderId'] = changeQueryData['venderid']) &&
889
889
  delete changeQueryData['venderid'];
890
890
  changeQueryData['vendorId'] &&
891
891
  (changeQueryData['venderId'] = changeQueryData['vendorId']) &&
892
892
  delete changeQueryData['vendorId'];
893
893
  changeQueryData['shopId'] &&
894
894
  changeQueryData['shopId'] === 'undefined' &&
895
895
  delete changeQueryData['shopId'];
896
896
  changeQueryData['venderId'] &&
897
897
  changeQueryData['venderId'] === 'undefined' &&
898
898
  delete changeQueryData['venderId'];
899
899
  return changeQueryData;
900
900
  let isUsable = false;
901
901
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult;
902
902
  const modularPackResultObj = formatPackResult(modularPackResult);
903
903
  const bundleUrl = getBundleUrl(modularPackResultObj);
904
904
  const bundleFileName = getBundleFileName(modularPackResultObj);
905
905
  const taroVersion = getTaroVersion(modularPackResultObj);
906
906
  if (bundleUrl && bundleFileName) {
907
907
  isUsable = true;
908
908
  }
909
909
  if (!isUsable && typeof exceptionReportFn === 'function') {
910
910
  exceptionReportFn({
911
911
  code: `${NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG}${
912
912
  floorData?.floorExtInfo?.floorKind === FLOOR_KIND.PDC_SYSTEM_MODULE
913
913
  ? SgmCustomCode.SYSTEMPDCMODULE_DATA
914
914
  : SgmCustomCode.REMOTEMODULE_DATA
915
915
  }`,
916
916
  msg: {
917
917
  msg: `店铺h5楼层隐藏不显示。原因:模块数据不完备,楼层过滤。`,
918
918
  floorIdx: floorData?.floorIdx,
919
919
  uid: floorData?.uid,
920
920
  shopId: floorData?.floorExtInfo?.shopId,
921
921
  moduleId: floorData?.moduleId,
922
922
  moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
923
923
  floorLoadWay: floorData?.floorExtInfo?.floorLoadWay,
924
924
  floorKind: floorData?.floorExtInfo?.floorKind,
925
925
  middleTemplateId: floorData?.middleTemplateId,
926
926
  modularPackResult: {
927
927
  bundleUrl,
928
928
  taroVersion,
929
929
  },
930
930
  },
931
931
  });
932
932
  }
933
933
  return isUsable;
934
934
  const objContainer = containerListData.find((item) => item.containerId === containerId);
935
935
  return (
936
936
  objContainer?.includeUids?.some((itemUid) => {
937
937
  const objectFloor = floorListData.find((floorItem) => itemUid === floorItem.uid);
938
938
  return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag);
939
939
  }) ?? false
940
940
  );
941
941
  const unableIsvFloorListData = floorListData.filter(
942
942
  (floorItem) =>
943
943
  RemoteLoadFloorList.includes(floorItem?.floorExtInfo?.moduleFlag) &&
944
944
  !isIsvFloorUseable(floorItem, exceptionReportFn),
945
945
  );
946
946
  const unableIsvFloorUidList = unableIsvFloorListData.map((floorItem) => floorItem.uid);
947
947
  const unableIsvContainerListData = containerListData.filter(
948
948
  (item) =>
949
949
  item.includeUids &&
950
950
  item.includeUids.every((itemUid) => unableIsvFloorUidList.indexOf(itemUid) != -1),
951
951
  );
952
952
  return unableIsvContainerListData;
953
953
  console.log('暂无对应渠道比较', compareVersion, nowVersion);
954
954
  return -2;
955
955
  return customObj;
956
956
  return customObj;
957
957
  return customObj;
958
958
  return customObj;
959
959
  return customObj;
960
960
  return customObj;
961
961
  return /openApp\.jdMobile:\/\/virtual\?params=/i.test(openAppUrl);
962
962
  let getParams = false;
963
963
  if (isOpenJdAppUrl(openAppUrl)) {
964
964
  try {
965
965
  getParams = openAppUrl.replace(/openApp\.jdMobile:\/\/virtual\?params=/i, '');
966
966
  getParams = JSON.parse(String(getParams));
967
967
  } catch (e) {
968
968
  console.log(e);
969
969
  }
970
970
  }
971
971
  return getParams;
972
972
  const getLastParams = Object.assign({}, openParams);
973
973
  return `openapp.jdmobile://virtual?params=${JSON.stringify(getLastParams)}`;
974
974
  if (val === null || val === '' || typeof val === 'undefined') {
975
975
  return true;
976
976
  }
977
977
  return false;
978
978
  const {
979
979
  moduleId = 'none',
980
980
  entrance = 'none',
981
981
  sourceType = 'none',
982
982
  sourceValue = 'none',
983
983
  } = params;
984
984
  if (isIosDevice) {
985
985
  return `${moduleId}#${entrance}`;
986
986
  } else if (isAndroidDevice) {
987
987
  return `${sourceType}#${sourceValue}`;
988
988
  }
989
989
  return 'none#none';
990
990
  if (data && typeof data === 'object') {
991
991
  let getOpenAppData = { ...data };
992
992
  try {
993
993
  const { sourceInfo, designerId, templateId, source } = getOpenAppData;
994
994
  if (designerId && templateId) {
995
995
  getOpenAppData = Object.assign({}, getOpenAppData, {
996
996
  sourceInfo: {
997
997
  entrance: '设计师预览',
998
998
  },
999
999
  });
1000
1000
  } else if (sourceInfo) {
1001
1001
  const { entrance } = sourceInfo;
1002
1002
  getOpenAppData.sourceInfo.entrance = entrance && entrance.length > 0 ? entrance : '其他';
1003
1003
  } else if (source && !sourceInfo) {
1004
1004
  if (typeof source === 'object') {
1005
1005
  const { sourceType, entrance, sourceValue, moduleId } = source;
1006
1006
  getOpenAppData = Object.assign({}, getOpenAppData, {
1007
1007
  sourceInfo: {
1008
1008
  entrance: sourceType || entrance || '其他',
1009
1009
  moduleId: sourceValue || moduleId || '-100',
1010
1010
  },
1011
1011
  });
1012
1012
  if (sourceType === 'shop_from_product_detail' && sourceValue) {
1013
1013
  getOpenAppData.sourceSku = sourceValue;
1014
1014
  }
1015
1015
  } else {
1016
1016
  getOpenAppData = Object.assign({}, getOpenAppData, {
1017
1017
  sourceInfo: {
1018
1018
  entrance: source,
1019
1019
  },
1020
1020
  });
1021
1021
  }
1022
1022
  } else {
1023
1023
  getOpenAppData = Object.assign({}, getOpenAppData, {
1024
1024
  sourceInfo: {
1025
1025
  entrance: '其他',
1026
1026
  },
1027
1027
  });
1028
1028
  }
1029
1029
  } catch (e) {
1030
1030
  console.log(e);
1031
1031
  }
1032
1032
  return getOpenAppData;
1033
1033
  }
1034
1034
  return data;
1035
1035
  return displayObj;
1036
1036
  if (typeof input === 'string') {
1037
1037
  try {
1038
1038
  return JSON.parse(input);
1039
1039
  } catch (e) {
1040
1040
  console.error('JSON解析失败', e);
1041
1041
  return {};
1042
1042
  }
1043
1043
  }
1044
1044
  return input || {};
1045
1045
  return false;
1046
1046
  const borderStyle: { [key: string]: any } = {};
1047
1047
  if (item?.borderRadius) {
1048
1048
  let borderTopRadius = 0;
1049
1049
  let borderBottomRadius = 0;
1050
1050
  if (index === 0) {
1051
1051
  borderTopRadius = item.borderRadius;
1052
1052
  borderBottomRadius = floorDataLen === 1 || item?.marginBottom !== 0 ? item.borderRadius : 0;
1053
1053
  } else if (index === floorDataLen - 1) {
1054
1054
  borderTopRadius = floorData[index - 1]?.marginBottom === 0 ? 0 : item.borderRadius;
1055
1055
  borderBottomRadius = item.borderRadius;
1056
1056
  } else {
1057
1057
  borderTopRadius = floorData[index - 1]?.marginBottom === 0 ? 0 : item.borderRadius;
1058
1058
  borderBottomRadius = item?.marginBottom === 0 ? 0 : item.borderRadius;
1059
1059
  }
1060
1060
  borderStyle.borderTopLeftRadius = item?.borderTopLeftRadius
1061
1061
  ? `${item?.borderTopLeftRadius}px`
1062
1062
  : `${borderTopRadius}px`;
1063
1063
  borderStyle.borderTopRightRadius = item?.borderTopRightRadius
1064
1064
  ? `${item?.borderTopRightRadius}px`
1065
1065
  : `${borderTopRadius}px`;
1066
1066
  borderStyle.borderBottomLeftRadius = `${borderBottomRadius}px`;
1067
1067
  borderStyle.borderBottomRightRadius = `${borderBottomRadius}px`;
1068
1068
  } else {
1069
1069
  borderStyle.borderTopLeftRadius = borderStyle?.borderTopLeftRadius || '0px';
1070
1070
  borderStyle.borderTopRightRadius = borderStyle?.borderTopRightRadius || '0px';
1071
1071
  borderStyle.borderBottomRightRadius = borderStyle?.borderBottomRightRadius || '0px';
1072
1072
  borderStyle.borderBottomLeftRadius = borderStyle?.borderBottomLeftRadius || '0px';
1073
1073
  }
1074
1074
  return borderStyle;
1075
1075
  return customObj;
1076
1076
  isJdApp,
1077
1077
  isWxApp,
1078
1078
  isIosDevice,
1079
1079
  isAndroidDevice,
1080
1080
  isJdAndIosDevice,
1081
1081
  isJdAndAndroidDevice,
1082
1082
  isWxMin,
1083
1083
  isWxMinAndWxapp,
1084
1084
  isJdMin,
1085
1085
  isMin,
1086
1086
  isJdMinAndHarmony,
1087
1087
  isH5,
1088
1088
  isH5AndJdShopView,
1089
1089
  isImageOptimizeEnable,
1090
1090
  isChartH5,
1091
1091
  isH5AndJdShopViewNativeScroll,
1092
1092
  isH5AndJdShopViewH5Scroll,
1093
1093
  isH5AndJdShopH5CustomScrollView,
1094
1094
  isWxMiniH5View,
1095
1095
  sliceArrToChunkList,
1096
1096
  dealAddress,
1097
1097
  objectToUrlEncode,
1098
1098
  parseQueryUrlString,
1099
1099
  setLowSmallPicUrl,
1100
1100
  getJfsImage,
1101
1101
  getQualityImage,
1102
1102
  countStringify,
1103
1103
  setTaroStorage,
1104
1104
  getTaroStorageKeyValue,
1105
1105
  removeTaroStorageKey,
1106
1106
  clearTaroStorageKey,
1107
1107
  getSystemInfos,
1108
1108
  addHttps,
1109
1109
  dateFormat,
1110
1110
  throttle,
1111
1111
  lodashThrottle,
1112
1112
  debounce,
1113
1113
  getTelephone,
1114
1114
  rgbToHex,
1115
1115
  hexToRgb,
1116
1116
  getRandom,
1117
1117
  getWxAppCookieStr,
1118
1118
  pxTransformFromData,
1119
1119
  dealShopContentData,
1120
1120
  showSuccessToast,
1121
1121
  showFailToast,
1122
1122
  showNormalToast,
1123
1123
  showShopLoading,
1124
1124
  hideShopLoading,
1125
1125
  getAppChannelType,
1126
1126
  formatTabActiveMenuType,
1127
1127
  filterUrlQueryData,
1128
1128
  getAvifSupport,
1129
1129
  getWebpSupport,
1130
1130
  isMemberPage,
1131
1131
  sgmCustomReport,
1132
1132
  draCustomReport,
1133
1133
  remoteCustomReport,
1134
1134
  draInterfaceCustomReport,
1135
1135
  draBusinessCustomReport,
1136
1136
  draBusinessCustomLogReport,
1137
1137
  isOpenJdAppUrl,
1138
1138
  jdOpenAppParams,
1139
1139
  createJdOpenAppUrl,
1140
1140
  dealJdOpenAppData,
1141
1141
  isEmpty,
1142
1142
  getJdAppReportPageSource,
1143
1143
  isAppClassifyPage,
1144
1144
  getQualityImageNew,
1145
1145
  getQualityImageOld,
1146
1146
  isPc,
1147
1147
  ipLoc_djd,
1148
1148
  jdAppVersionCompare,
1149
1149
  dealNativePixelToCssPixel,
1150
1150
  isAppStowShop,
1151
1151
  isIpadDevice,
1152
1152
  getBorderStyle,
1153
1153
  isLanguageForEn,
1154
1154
  sColor,
1155
1155
  draInterfaceDSMCustomReport,
1156
1156
  isTabletDevice,