@conecli/cone-render 0.9.1-shop2.2 → 0.9.1-shop2.4
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/dist/common/const.ts +1 -1
- 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/jssdk.ts +1 -0
- package/dist/common/pageType.ts +1 -0
- package/dist/common/token/index.h5.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/components/base/CustomScrollView/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/ExposureSmart/reporter.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/LazyLoadImage/const.ts +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.module.scss +9 -0
- package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
- 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/Price/Double/index.tsx +1 -1
- package/dist/components/base/Price/index.tsx +1 -1
- package/dist/components/decorate/DecorateFloorModule/index.module.scss +21 -2
- package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
- package/dist/components/decorate/EmptyFloorModule/index.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/jumpEventReport/const.ts +1 -1
- package/dist/jumpEventReport/createReportFloorData.ts +1 -1
- package/dist/jumpEventReport/index.h5.ts +1 -1
- package/dist/jumpEventReport/index.weapp.ts +1 -1
- package/dist/jumpEventReport/jdJumpJdApp.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.wxapp.ts +1 -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/track.ts +1 -1
- package/dist/open/components/index.ts +1 -1
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/http/const.ts +1 -1
- 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/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/utils.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
console.log('PageScrollEnd fire')
|
|
3
2
|
Taro.eventCenter.trigger(TaroEventType.PAGE_SCROLL_END, options)
|
|
4
3
|
Taro.eventCenter.trigger(TaroEventType.PAGE_INIT_EXPOSURE, options)
|
|
4
|
+
import Taro from '@tarojs/taro'
|
|
5
5
|
console.log('PageScrollEnd fire')
|
|
6
6
|
Taro.eventCenter.trigger(TaroEventType.PAGE_SCROLL_END, options)
|
|
7
7
|
Taro.eventCenter.trigger(TaroEventType.PAGE_INIT_EXPOSURE, options)
|
package/dist/utils/h5Utils.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
2
1
|
isApp,
|
|
3
2
|
isIOS,
|
|
4
3
|
getAppVersion,
|
|
5
4
|
version,
|
|
6
5
|
getUUID,
|
|
7
6
|
getUrlQuery,
|
|
8
7
|
assign,
|
|
9
8
|
isString,
|
|
10
9
|
isObject,
|
|
11
10
|
serialize,
|
|
12
11
|
isAndroid, versionCompare,
|
|
13
12
|
CHANNEL_TYPE,
|
|
14
13
|
JDShopViewBusinessPathType,
|
|
15
14
|
JDShopViewBusinessPathList,
|
|
16
15
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
17
16
|
SECTION_HOME_TAB_TYPE,
|
|
18
17
|
parseQueryUrlString(window?.location?.href ?? ''),
|
|
19
18
|
try {
|
|
20
19
|
return JSON.parse(decodeURIComponent(getUrlQuery('cookie')))
|
|
21
20
|
} catch (e) {
|
|
22
21
|
return {}
|
|
23
22
|
}
|
|
24
23
|
isWxMiniH5View && urlCookie['wxapp_type'] == '1'
|
|
25
24
|
if (isJdApp) {
|
|
26
25
|
isIosDevice
|
|
27
26
|
? e && e.stopPropagation()
|
|
28
27
|
: androidDeviceStopNativeScrollEvent(state)
|
|
29
28
|
}
|
|
30
29
|
isJdApp &&
|
|
31
30
|
isAndroidDevice &&
|
|
32
31
|
window?.JdAndroid &&
|
|
33
32
|
window?.JdAndroid.requestEvent(state)
|
|
34
33
|
if (isH5AndJdShopView) {
|
|
35
34
|
return (
|
|
36
35
|
CHANNEL_TYPE[currentChannel] ||
|
|
37
36
|
CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
|
|
38
37
|
)
|
|
39
38
|
}
|
|
40
39
|
return null
|
|
41
40
|
isH5 && ['/app/home', '/app/classify', '/app/newProduct', '/member/shopcard'].includes(urlPathname)
|
|
42
41
|
const getCustomObj = {
|
|
43
42
|
type: 1,
|
|
44
43
|
code: 'all',
|
|
45
44
|
cost1: 1,
|
|
46
45
|
...customObj
|
|
47
46
|
}
|
|
48
47
|
try {
|
|
49
48
|
window.__sgm__.custom(getCustomObj, '9HwAEg@fTtWBB3EnwA5VgLT')
|
|
50
49
|
} catch (e) {}
|
|
50
|
+
import {
|
|
51
51
|
isApp,
|
|
52
52
|
isIOS,
|
|
53
53
|
getAppVersion,
|
|
54
54
|
version,
|
|
55
55
|
getUUID,
|
|
56
56
|
getUrlQuery,
|
|
57
57
|
assign,
|
|
58
58
|
isString,
|
|
59
59
|
isObject,
|
|
60
60
|
serialize,
|
|
61
61
|
isAndroid,
|
|
62
62
|
versionCompare,
|
|
63
63
|
CHANNEL_TYPE,
|
|
64
64
|
JDShopViewBusinessPathType,
|
|
65
65
|
JDShopViewBusinessPathList,
|
|
66
66
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
67
67
|
SECTION_HOME_TAB_TYPE,
|
|
68
68
|
parseQueryUrlString(window?.location?.href ?? ''),
|
|
69
69
|
try {
|
|
70
70
|
return JSON.parse(decodeURIComponent(getUrlQuery('cookie')))
|
|
71
71
|
} catch (e) {
|
|
72
72
|
return {}
|
|
73
73
|
}
|
|
74
74
|
isWxMiniH5View && urlCookie['wxapp_type'] == '1'
|
|
75
75
|
if (isJdApp) {
|
|
76
76
|
isIosDevice
|
|
77
77
|
? e && e.stopPropagation()
|
|
78
78
|
: androidDeviceStopNativeScrollEvent(state)
|
|
79
79
|
}
|
|
80
80
|
isJdApp &&
|
|
81
81
|
isAndroidDevice &&
|
|
82
82
|
window?.JdAndroid &&
|
|
83
83
|
window?.JdAndroid.requestEvent(state)
|
|
84
84
|
if (isH5AndJdShopView) {
|
|
85
85
|
return (
|
|
86
86
|
CHANNEL_TYPE[currentChannel] ||
|
|
87
87
|
CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
|
|
88
88
|
)
|
|
89
89
|
}
|
|
90
90
|
return null
|
|
91
91
|
isH5 && ['/app/home', '/app/classify', '/member/shopcard'].includes(urlPathname)
|
|
92
92
|
isH5 && isJdApp && !['/app/home'].includes(urlPathname)
|
|
93
93
|
return isJdApp ? versionCompare(nowVersion || jdAppVersionStr,compareVersion) >= 0 : -2
|
|
94
94
|
const getCustomObj = {
|
|
95
95
|
type: 1,
|
|
96
96
|
code: 'all',
|
|
97
97
|
cost1: 1,
|
|
98
98
|
...customObj
|
|
99
99
|
}
|
|
100
100
|
try {
|
|
101
101
|
window.__sgm__.custom(getCustomObj, '9HwAEg@fTtWBB3EnwA5VgLT')
|
|
102
102
|
} catch (e) {}
|
package/dist/utils/index.h5.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
nativePageShowToast, ToastAndroidType,
|
|
3
2
|
ToastIosType,
|
|
4
3
|
getAppChannelType, isAndroidDevice, isH5AndJdShopView, isChartH5,
|
|
5
4
|
isH5AndJdShopViewNativeScroll, isIosDevice, isJdAndAndroidDevice, isJdAndIosDevice, isJdApp,
|
|
6
5
|
isWxApp, isWxMiniH5View, isH5AndJingGouMini, urlCookie,
|
|
7
6
|
sgmCustomReport, isMemberPage, isH5AndJdShopViewH5Scroll, isAppClassifyPage, isPc, ipLoc_djd
|
|
8
7
|
addHttps,
|
|
9
8
|
clearTaroStorageKey,
|
|
10
9
|
countStringify,
|
|
11
10
|
dateFormat,
|
|
12
11
|
dealAddress,
|
|
13
12
|
dealShopContentData as originDealShopContentData,
|
|
14
13
|
debounce,
|
|
15
14
|
filterUrlQueryData,
|
|
16
15
|
formatTabActiveMenuType,
|
|
17
16
|
getQualityImage,
|
|
18
17
|
getTaroStorageKeyValue,
|
|
19
18
|
getWxAppCookieStr,
|
|
20
19
|
isH5,
|
|
21
20
|
isJdMin,
|
|
22
21
|
isWxMin,
|
|
23
22
|
isWxMinAndWxapp,
|
|
24
23
|
lodashThrottle,
|
|
25
24
|
objectToUrlEncode,
|
|
26
25
|
parseQueryUrlString,
|
|
27
26
|
removeTaroStorageKey,
|
|
28
27
|
setLowSmallPicUrl,
|
|
29
28
|
setTaroStorage,
|
|
30
29
|
showFailToast,
|
|
31
30
|
showNormalToast,
|
|
32
31
|
showSuccessToast,
|
|
33
32
|
sliceArrToChunkList,
|
|
34
33
|
throttle,
|
|
35
34
|
windowWidth: window.innerWidth,
|
|
36
35
|
containerWidth: buildType === BUILD_TYPE.CLASSIFY ? window.innerWidth - 100 : window.innerWidth,
|
|
37
36
|
screenWidth: window.innerWidth,
|
|
38
37
|
platform: '',
|
|
39
38
|
model: '',
|
|
40
39
|
system: '',
|
|
41
40
|
getSystemInfo.windowWidth = getSystemInfo.screenWidth
|
|
42
41
|
getSystemInfo['containerWidth'] = buildType === BUILD_TYPE.CLASSIFY ? getSystemInfo.screenWidth - 100 : getSystemInfo.screenWidth
|
|
43
42
|
const params = Object.assign(
|
|
44
43
|
{},
|
|
45
44
|
{
|
|
46
45
|
title: '',
|
|
47
46
|
duration: 1500,
|
|
48
47
|
},
|
|
49
48
|
options,
|
|
50
49
|
)
|
|
51
50
|
params.duration = params.duration / 1000
|
|
52
51
|
if (isJdApp && isH5AndJdShopView) {
|
|
53
52
|
const showSuccessType = isIosDevice
|
|
54
53
|
? ToastIosType.SUCCESS
|
|
55
54
|
: ToastAndroidType.SUCCESS
|
|
56
55
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
57
56
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
58
57
|
console.log('执行原生toast success')
|
|
59
58
|
} else {
|
|
60
59
|
showSuccessToast(options)
|
|
61
60
|
}
|
|
62
61
|
const params = Object.assign(
|
|
63
62
|
{},
|
|
64
63
|
{
|
|
65
64
|
title: '',
|
|
66
65
|
duration: 1500,
|
|
67
66
|
},
|
|
68
67
|
options,
|
|
69
68
|
)
|
|
70
69
|
params.duration = params.duration / 1000
|
|
71
70
|
console.log(`isJdApp${isJdApp}`)
|
|
72
71
|
if (isJdApp && isH5AndJdShopView) {
|
|
73
72
|
const showSuccessType = isIosDevice
|
|
74
73
|
? ToastIosType.FAIL
|
|
75
74
|
: ToastAndroidType.FAIL
|
|
76
75
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
77
76
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
78
77
|
console.log('执行原生toast fail')
|
|
79
78
|
} else {
|
|
80
79
|
console.log('执行H5 toast fail')
|
|
81
80
|
showFailToast(options)
|
|
82
81
|
}
|
|
83
82
|
const params = Object.assign(
|
|
84
83
|
{},
|
|
85
84
|
{
|
|
86
85
|
title: '',
|
|
87
86
|
duration: 1500,
|
|
88
87
|
},
|
|
89
88
|
options,
|
|
90
89
|
)
|
|
91
90
|
params.duration = params.duration / 1000
|
|
92
91
|
if (isJdApp) {
|
|
93
92
|
const showSuccessType = isIosDevice
|
|
94
93
|
? ToastIosType.NORMAL
|
|
95
94
|
: ToastAndroidType.NORMAL
|
|
96
95
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
97
96
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
98
97
|
} else {
|
|
99
98
|
showNormalToast(options)
|
|
100
99
|
}
|
|
101
100
|
const createLoadingEle = document.createElement('div')
|
|
102
101
|
createLoadingEle.id = 'J_shopLoading'
|
|
103
102
|
createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`
|
|
104
103
|
createLoadingEle.innerHTML = `<div class='d-loading-content'>
|
|
105
104
|
<span class='d-shop-loading-icon'></span>
|
|
106
105
|
<p class='d-shop-text'>${text}</p>
|
|
107
106
|
</div>`
|
|
108
107
|
const getEle = document.body ? document.body : document.getElementsByTagName('body')[0]
|
|
109
108
|
console.log('获取getEle及append及appendChild方法', getEle, getEle?.append, getEle?.appendChild)
|
|
110
109
|
getEle.appendChild(createLoadingEle)
|
|
111
110
|
const getEle = document.getElementById('J_shopLoading')
|
|
112
111
|
getEle && getEle.remove()
|
|
113
112
|
num,
|
|
114
113
|
widthSize = 375,
|
|
115
114
|
layoutWidth = getSystemInfo.windowWidth,
|
|
116
115
|
const getNum = Number(num)
|
|
117
116
|
return Math.round((getNum / widthSize) * layoutWidth)
|
|
118
117
|
const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfo
|
|
119
118
|
if (!systemInfo.system && window) {
|
|
120
119
|
systemInfo.system = window.navigator.userAgent
|
|
121
120
|
systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i)
|
|
122
121
|
}
|
|
123
122
|
const isIOS = !!systemInfo?.system.match(/ios/i)
|
|
124
123
|
const isAndroid = !!systemInfo?.system.match(/android/i)
|
|
125
124
|
systemInfo.navBarHeight = 0
|
|
126
125
|
systemInfo.statusBarHeight = 0
|
|
127
126
|
systemInfo.capsulePosition = null
|
|
128
127
|
systemInfo.isIOS = isIOS
|
|
129
128
|
systemInfo.isAndroid = isAndroid
|
|
130
129
|
return systemInfo
|
|
131
130
|
return originDealShopContentData(pageData, sgmCustomReport, isvdev)
|
|
132
131
|
isJdApp,
|
|
133
132
|
isWxApp,
|
|
134
133
|
isIosDevice,
|
|
135
134
|
isAndroidDevice,
|
|
136
135
|
isJdAndIosDevice,
|
|
137
136
|
isJdAndAndroidDevice,
|
|
138
137
|
isWxMin,
|
|
139
138
|
isWxMinAndWxapp,
|
|
140
139
|
isJdMin,
|
|
141
140
|
isH5,
|
|
142
141
|
isH5AndJdShopView,
|
|
143
142
|
isChartH5,
|
|
144
143
|
isH5AndJdShopViewNativeScroll,
|
|
145
144
|
isH5AndJdShopViewH5Scroll,
|
|
146
145
|
isH5AndJingGouMini,
|
|
147
146
|
isWxMiniH5View,
|
|
148
147
|
urlCookie,
|
|
149
148
|
sliceArrToChunkList,
|
|
150
149
|
dealAddress,
|
|
151
150
|
objectToUrlEncode,
|
|
152
151
|
parseQueryUrlString,
|
|
153
152
|
setLowSmallPicUrl,
|
|
154
153
|
setTaroStorage,
|
|
155
154
|
getTaroStorageKeyValue,
|
|
156
155
|
removeTaroStorageKey,
|
|
157
156
|
clearTaroStorageKey,
|
|
158
157
|
getQualityImage,
|
|
159
158
|
countStringify,
|
|
160
159
|
getWxAppCookieStr,
|
|
161
160
|
getSystemInfos,
|
|
162
161
|
pxTransformFromData,
|
|
163
162
|
dealShopContentDataAndReport as dealShopContentData,
|
|
164
163
|
dateFormat,
|
|
165
164
|
throttle,
|
|
166
165
|
lodashThrottle,
|
|
167
166
|
debounce,
|
|
168
167
|
addHttps,
|
|
169
168
|
commonShowSuccessToast as showSuccessToast,
|
|
170
169
|
commonShowFailToast as showFailToast,
|
|
171
170
|
commonShowNormalToast as showNormalToast,
|
|
172
171
|
showShopLoading,
|
|
173
172
|
hideShopLoading,
|
|
174
173
|
getAppChannelType,
|
|
175
174
|
formatTabActiveMenuType,
|
|
176
175
|
filterUrlQueryData,
|
|
177
176
|
sgmCustomReport,
|
|
178
177
|
isMemberPage,
|
|
179
178
|
memberFormatUtils,
|
|
180
179
|
getFloorDataToDataDefines,
|
|
181
180
|
isAppClassifyPage,
|
|
182
181
|
isPc,
|
|
183
182
|
ipLoc_djd,
|
|
183
|
+
import Taro from '@tarojs/taro'
|
|
184
184
|
nativePageShowToast, ToastAndroidType,
|
|
185
185
|
ToastIosType,
|
|
186
186
|
getAppChannelType,
|
|
187
187
|
isAndroidDevice,
|
|
188
188
|
isH5AndJdShopView,
|
|
189
189
|
isChartH5,
|
|
190
190
|
isH5AndJdShopViewNativeScroll,
|
|
191
191
|
isIosDevice,
|
|
192
192
|
isJdAndAndroidDevice,
|
|
193
193
|
isJdAndIosDevice,
|
|
194
194
|
isJdAndHarmonyDevice,
|
|
195
195
|
isJdApp,
|
|
196
196
|
isWxApp,
|
|
197
197
|
isWxMiniH5View,
|
|
198
198
|
isH5AndJingGouMini,
|
|
199
199
|
urlCookie,
|
|
200
200
|
sgmCustomReport,
|
|
201
201
|
isMemberPage,
|
|
202
202
|
isH5AndJdShopViewH5Scroll,
|
|
203
203
|
isH5AndJdShopH5CustomScrollView,
|
|
204
204
|
isAppClassifyPage,
|
|
205
205
|
isPc,
|
|
206
206
|
ipLoc_djd,
|
|
207
207
|
jdAppVersionCompare,
|
|
208
208
|
addHttps,
|
|
209
209
|
clearTaroStorageKey,
|
|
210
210
|
countStringify,
|
|
211
211
|
dateFormat,
|
|
212
212
|
dealAddress,
|
|
213
213
|
dealShopContentData as originDealShopContentData,
|
|
214
214
|
debounce,
|
|
215
215
|
filterUrlQueryData,
|
|
216
216
|
formatTabActiveMenuType,
|
|
217
217
|
getQualityImage,
|
|
218
218
|
getTaroStorageKeyValue,
|
|
219
219
|
getWxAppCookieStr,
|
|
220
220
|
isH5,
|
|
221
221
|
isJdMin,
|
|
222
222
|
isWxMin,
|
|
223
223
|
isWxMinAndWxapp,
|
|
224
224
|
lodashThrottle,
|
|
225
225
|
objectToUrlEncode,
|
|
226
226
|
parseQueryUrlString,
|
|
227
227
|
removeTaroStorageKey,
|
|
228
228
|
setLowSmallPicUrl,
|
|
229
229
|
setTaroStorage,
|
|
230
230
|
showFailToast,
|
|
231
231
|
showNormalToast,
|
|
232
232
|
showSuccessToast,
|
|
233
233
|
sliceArrToChunkList,
|
|
234
234
|
throttle,
|
|
235
235
|
dealJdOpenAppData,
|
|
236
236
|
num,
|
|
237
237
|
widthSize = 375,
|
|
238
238
|
layoutWidth,
|
|
239
239
|
const getNum = Number(num)
|
|
240
240
|
let _changeLayoutWidth = layoutWidth
|
|
241
241
|
if (!_changeLayoutWidth) {
|
|
242
242
|
_changeLayoutWidth = _ShopSystemInfo && _ShopSystemInfo?.windowWidth ? _ShopSystemInfo.windowWidth : Taro.getSystemInfoSync()?.windowWidth
|
|
243
243
|
}
|
|
244
244
|
return Math.round((getNum / widthSize) * _changeLayoutWidth)
|
|
245
245
|
const getRootFontSize = 40 * (systemInfo?.windowWidth ?? _ShopSystemInfo.windowWidth) / 750
|
|
246
246
|
const getRealRootFontSize = getRootFontSize > 40 ? 40 : getRootFontSize < 20 ? 20 : getRootFontSize
|
|
247
247
|
return (
|
|
248
248
|
Math.ceil(((parseInt(String(changeSize), 10) / 40) * 750) / designWidth * getRealRootFontSize)
|
|
249
249
|
)
|
|
250
250
|
console.log('获取系统宽度systemInfo?.windowWidth', systemInfo?.windowWidth, 'taroToTransformRoutimePXNumber(changeWidth)', taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo))
|
|
251
251
|
return buildType === BUILD_TYPE.CLASSIFY && systemInfo?.windowWidth ? systemInfo?.windowWidth - taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo) : systemInfo?.windowWidth ?? 0
|
|
252
252
|
const systemInfo = Taro.getSystemInfoSync()
|
|
253
253
|
if (params && params?.pageWidth && params?.pageHeight) {
|
|
254
254
|
systemInfo.windowWidth = params?.pageWidth
|
|
255
255
|
systemInfo.windowHeight = params?.pageHeight
|
|
256
256
|
}
|
|
257
257
|
systemInfo['containerWidth'] = getContainerWidth(buildType, systemInfo)
|
|
258
258
|
console.warn('====获取系统信息=====', systemInfo)
|
|
259
259
|
return systemInfo
|
|
260
260
|
const getSystemInfo = getSystemAndContainerWidthInfo(params) || {
|
|
261
261
|
windowWidth: window.innerWidth,
|
|
262
262
|
containerWidth: getContainerWidth(buildType, {
|
|
263
263
|
windowWidth: window.innerWidth,
|
|
264
264
|
}),
|
|
265
265
|
screenWidth: window.innerWidth,
|
|
266
266
|
platform: '',
|
|
267
267
|
model: '',
|
|
268
268
|
system: '',
|
|
269
269
|
}
|
|
270
270
|
if (isJdApp && isAndroidDevice && getSystemInfo.windowWidth <= 0) {
|
|
271
271
|
getSystemInfo.windowWidth = getSystemInfo.screenWidth
|
|
272
272
|
getSystemInfo['containerWidth'] = getContainerWidth(buildType, getSystemInfo)
|
|
273
273
|
}
|
|
274
274
|
return getSystemInfo
|
|
275
275
|
const params = Object.assign(
|
|
276
276
|
{},
|
|
277
277
|
{
|
|
278
278
|
title: '',
|
|
279
279
|
duration: 1500,
|
|
280
280
|
},
|
|
281
281
|
options,
|
|
282
282
|
)
|
|
283
283
|
params.duration = params.duration / 1000
|
|
284
284
|
if (isJdApp && isH5AndJdShopView) {
|
|
285
285
|
const showSuccessType = isIosDevice
|
|
286
286
|
? ToastIosType.SUCCESS
|
|
287
287
|
: ToastAndroidType.SUCCESS
|
|
288
288
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
289
289
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
290
290
|
console.log('执行原生toast success')
|
|
291
291
|
} else {
|
|
292
292
|
showSuccessToast(options)
|
|
293
293
|
}
|
|
294
294
|
const params = Object.assign(
|
|
295
295
|
{},
|
|
296
296
|
{
|
|
297
297
|
title: '',
|
|
298
298
|
duration: 1500,
|
|
299
299
|
},
|
|
300
300
|
options,
|
|
301
301
|
)
|
|
302
302
|
params.duration = params.duration / 1000
|
|
303
303
|
console.log(`isJdApp${isJdApp}`)
|
|
304
304
|
if (isJdApp && isH5AndJdShopView) {
|
|
305
305
|
const showSuccessType = isIosDevice
|
|
306
306
|
? ToastIosType.FAIL
|
|
307
307
|
: ToastAndroidType.FAIL
|
|
308
308
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
309
309
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
310
310
|
console.log('执行原生toast fail')
|
|
311
311
|
} else {
|
|
312
312
|
console.log('执行H5 toast fail')
|
|
313
313
|
showFailToast(options)
|
|
314
314
|
}
|
|
315
315
|
const params = Object.assign(
|
|
316
316
|
{},
|
|
317
317
|
{
|
|
318
318
|
title: '',
|
|
319
319
|
duration: 1500,
|
|
320
320
|
},
|
|
321
321
|
options,
|
|
322
322
|
)
|
|
323
323
|
params.duration = params.duration / 1000
|
|
324
324
|
if (isJdApp) {
|
|
325
325
|
const showSuccessType = isIosDevice
|
|
326
326
|
? ToastIosType.NORMAL
|
|
327
327
|
: ToastAndroidType.NORMAL
|
|
328
328
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
329
329
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
330
330
|
} else {
|
|
331
331
|
showNormalToast(options)
|
|
332
332
|
}
|
|
333
333
|
const createLoadingEle = document.createElement('div')
|
|
334
334
|
createLoadingEle.id = 'J_shopLoading'
|
|
335
335
|
createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`
|
|
336
336
|
createLoadingEle.innerHTML = `<div class='d-loading-content'>
|
|
337
337
|
<span class='d-shop-loading-icon'></span>
|
|
338
338
|
<p class='d-shop-text'>${text}</p>
|
|
339
339
|
</div>`
|
|
340
340
|
const getEle = document.body ? document.body : document.getElementsByTagName('body')[0]
|
|
341
341
|
getEle.appendChild(createLoadingEle)
|
|
342
342
|
const getEle = document.getElementById('J_shopLoading')
|
|
343
343
|
getEle && getEle.remove()
|
|
344
344
|
const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getReviseSystemInfo(params)
|
|
345
345
|
if (!systemInfo.system && window) {
|
|
346
346
|
systemInfo.system = window.navigator.userAgent
|
|
347
347
|
systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i)
|
|
348
348
|
}
|
|
349
349
|
const isIOS = !!systemInfo?.system.match(/ios/i)
|
|
350
350
|
const isAndroid = !!systemInfo?.system.match(/android/i)
|
|
351
351
|
systemInfo.navBarHeight = 0
|
|
352
352
|
systemInfo.statusBarHeight = 0
|
|
353
353
|
systemInfo.capsulePosition = null
|
|
354
354
|
systemInfo.isIOS = isIOS
|
|
355
355
|
systemInfo.isAndroid = isAndroid
|
|
356
356
|
_ShopSystemInfo = systemInfo
|
|
357
357
|
return systemInfo
|
|
358
358
|
return originDealShopContentData(pageData, sgmCustomReport, isvdev)
|
|
359
359
|
isJdApp,
|
|
360
360
|
isWxApp,
|
|
361
361
|
isIosDevice,
|
|
362
362
|
isAndroidDevice,
|
|
363
363
|
isJdAndIosDevice,
|
|
364
364
|
isJdAndAndroidDevice,
|
|
365
365
|
isJdAndHarmonyDevice,
|
|
366
366
|
isWxMin,
|
|
367
367
|
isWxMinAndWxapp,
|
|
368
368
|
isJdMin,
|
|
369
369
|
isH5,
|
|
370
370
|
isH5AndJdShopView,
|
|
371
371
|
isChartH5,
|
|
372
372
|
isH5AndJdShopViewNativeScroll,
|
|
373
373
|
isH5AndJdShopViewH5Scroll,
|
|
374
374
|
isH5AndJdShopH5CustomScrollView,
|
|
375
375
|
isH5AndJingGouMini,
|
|
376
376
|
isWxMiniH5View,
|
|
377
377
|
urlCookie,
|
|
378
378
|
sliceArrToChunkList,
|
|
379
379
|
dealAddress,
|
|
380
380
|
objectToUrlEncode,
|
|
381
381
|
parseQueryUrlString,
|
|
382
382
|
setLowSmallPicUrl,
|
|
383
383
|
setTaroStorage,
|
|
384
384
|
getTaroStorageKeyValue,
|
|
385
385
|
removeTaroStorageKey,
|
|
386
386
|
clearTaroStorageKey,
|
|
387
387
|
getQualityImage,
|
|
388
388
|
countStringify,
|
|
389
389
|
getWxAppCookieStr,
|
|
390
390
|
getSystemInfos,
|
|
391
391
|
pxTransformFromData,
|
|
392
392
|
dealShopContentDataAndReport as dealShopContentData,
|
|
393
393
|
dateFormat,
|
|
394
394
|
throttle,
|
|
395
395
|
lodashThrottle,
|
|
396
396
|
debounce,
|
|
397
397
|
addHttps,
|
|
398
398
|
commonShowSuccessToast as showSuccessToast,
|
|
399
399
|
commonShowFailToast as showFailToast,
|
|
400
400
|
commonShowNormalToast as showNormalToast,
|
|
401
401
|
showShopLoading,
|
|
402
402
|
hideShopLoading,
|
|
403
403
|
getAppChannelType,
|
|
404
404
|
formatTabActiveMenuType,
|
|
405
405
|
filterUrlQueryData,
|
|
406
406
|
sgmCustomReport,
|
|
407
407
|
isMemberPage,
|
|
408
408
|
memberFormatUtils,
|
|
409
409
|
getFloorDataToDataDefines,
|
|
410
410
|
isAppClassifyPage,
|
|
411
411
|
isPc,
|
|
412
412
|
ipLoc_djd,
|
|
413
413
|
jdAppVersionCompare,
|
|
414
414
|
dealJdOpenAppData,
|
package/dist/utils/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
2
1
|
isChartH5,
|
|
3
2
|
isH5AndJdShopViewH5Scroll,
|
|
4
3
|
isMemberPage,
|
|
5
4
|
isPc,
|
|
6
5
|
ipLoc_djd,
|
|
7
6
|
isChartH5,
|
|
8
7
|
isH5AndJdShopViewH5Scroll,
|
|
9
8
|
isH5AndJingGouMini,
|
|
10
9
|
urlCookie,
|
|
11
10
|
isMemberPage,
|
|
12
11
|
isPc,
|
|
13
12
|
ipLoc_djd,
|
|
13
|
+
import {
|
|
14
14
|
isChartH5,
|
|
15
15
|
isH5AndJdShopViewH5Scroll,
|
|
16
16
|
isH5AndJdShopH5CustomScrollView,
|
|
17
17
|
isMemberPage,
|
|
18
18
|
isPc,
|
|
19
19
|
ipLoc_djd,
|
|
20
20
|
jdAppVersionCompare,
|
|
21
21
|
dealJdOpenAppData
|
|
22
22
|
isJdAndHarmonyDevice,
|
|
23
23
|
isChartH5,
|
|
24
24
|
isH5AndJdShopViewH5Scroll,
|
|
25
25
|
isH5AndJdShopH5CustomScrollView,
|
|
26
26
|
isH5AndJingGouMini,
|
|
27
27
|
urlCookie,
|
|
28
28
|
isMemberPage,
|
|
29
29
|
isPc,
|
|
30
30
|
ipLoc_djd,
|
|
31
31
|
jdAppVersionCompare,
|
|
32
32
|
dealJdOpenAppData
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
2
1
|
isChartH5,
|
|
3
2
|
isH5AndJdShopViewH5Scroll,
|
|
4
3
|
sgmCustomReport,
|
|
5
4
|
isMemberPage,
|
|
6
5
|
isAppClassifyPage
|
|
7
6
|
isH5AndJdShopViewH5Scroll,
|
|
8
7
|
isH5AndJingGouMini,
|
|
9
8
|
urlCookie,
|
|
10
9
|
isMemberPage,
|
|
11
10
|
isAppClassifyPage
|
|
11
|
+
import {
|
|
12
12
|
isChartH5,
|
|
13
13
|
isH5AndJdShopViewH5Scroll,
|
|
14
14
|
isH5AndJdShopH5CustomScrollView,
|
|
15
15
|
sgmCustomReport,
|
|
16
16
|
isMemberPage,
|
|
17
17
|
isAppClassifyPage,
|
|
18
18
|
jdAppVersionCompare,
|
|
19
19
|
dealJdOpenAppData
|
|
20
20
|
isJdAndHarmonyDevice,
|
|
21
21
|
isH5AndJdShopViewH5Scroll,
|
|
22
22
|
isH5AndJdShopH5CustomScrollView,
|
|
23
23
|
isH5AndJingGouMini,
|
|
24
24
|
urlCookie,
|
|
25
25
|
isMemberPage,
|
|
26
26
|
isAppClassifyPage,
|
|
27
27
|
jdAppVersionCompare,
|
|
28
28
|
dealJdOpenAppData
|