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