@conecli/cone-render 0.8.19-beta.1 → 0.8.19-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.
- package/dist/assets/networkError.png +0 -0
- 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/components/base/CustomVideo/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/LazyLayoutLoad/index.tsx +1 -1
- 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 +19 -14
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/interface/component.ts +1 -1
- package/dist/interface/utils.ts +1 -1
- package/dist/jumpEventReport/index.weapp.ts +1 -1
- package/dist/libs/taroAppReport.js +2 -4
- package/dist/open/api/index.ts +1 -1
- package/dist/service/http/bMallConst.ts +1 -0
- package/dist/service/http/const.ts +1 -1
- package/dist/service/http/http.ts +1 -1
- package/dist/service/requestServer.ts +1 -0
- package/dist/utils/connectNativeJsBridge.ts +1 -1
- package/dist/utils/utils.ts +1 -1
- package/package.json +1 -1
- package/dist/service/IsvRequestServer.ts +0 -1
- package/dist/service/http/http.jd.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro, { RequestTask } from "@tarojs/taro";
|
|
2
1
|
jsonHeader = "application/json;charset=utf-8",
|
|
3
2
|
formDataHeader = "application/x-www-form-urlencoded"
|
|
4
3
|
constructor() {
|
|
5
4
|
this._init()
|
|
6
5
|
}
|
|
7
6
|
_init(): void {
|
|
8
7
|
httpInterceptors.forEach((item) => {
|
|
9
8
|
Taro.addInterceptor((chain) => item(chain))
|
|
10
9
|
})
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
get(url: string, data: any = null, otherOptions = {}): Taro.RequestTask<any> {
|
|
14
13
|
return this.request({url, data, method:"GET", ...otherOptions})
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
post(
|
|
18
17
|
url: string,
|
|
19
18
|
data: any = null,
|
|
20
19
|
otherOptions = {}
|
|
21
20
|
): Taro.RequestTask<any> {
|
|
22
21
|
return this.request({url, data, method:"POST", ...otherOptions})
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
request({url, method = "POST", timeout = 7000, ...otherOptions}): RequestTask<any> {
|
|
26
25
|
const header = {
|
|
27
26
|
"content-type": method === "POST" ? RequestHeaderContentType.formDataHeader : RequestHeaderContentType.jsonHeader
|
|
28
27
|
}
|
|
29
28
|
return Taro.request({
|
|
30
29
|
url,
|
|
31
30
|
method,
|
|
32
31
|
timeout,
|
|
33
32
|
header,
|
|
34
33
|
credentials: 'include',
|
|
35
34
|
...otherOptions,
|
|
36
35
|
})
|
|
37
36
|
}
|
|
37
|
+
import Taro, { RequestTask } from '@tarojs/taro'
|
|
38
38
|
jsonHeader = 'application/json;charset=utf-8',
|
|
39
39
|
formDataHeader = 'application/x-www-form-urlencoded',
|
|
40
40
|
public fmInfo: {
|
|
41
41
|
eid?: string
|
|
42
42
|
fp?: string
|
|
43
43
|
jsToken?: string
|
|
44
44
|
sdkToken?: string
|
|
45
45
|
}
|
|
46
46
|
public api: ServiceInterFace.HttpApi
|
|
47
47
|
constructor() {
|
|
48
48
|
this._init()
|
|
49
49
|
this.api = api
|
|
50
50
|
this.fmInfo = {}
|
|
51
51
|
}
|
|
52
52
|
_init(): void {
|
|
53
53
|
httpInterceptors.forEach((item) => {
|
|
54
54
|
Taro.addInterceptor((chain) => item(chain))
|
|
55
55
|
})
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
get(url: string, data: any = null, otherOptions = {}): Taro.RequestTask<any> {
|
|
59
59
|
return this.request({ url, data, method: 'GET', ...otherOptions })
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
post(
|
|
63
63
|
url: string,
|
|
64
64
|
data: any = null,
|
|
65
65
|
otherOptions = {},
|
|
66
66
|
): Taro.RequestTask<any> {
|
|
67
67
|
return this.request({ url, data, method: 'POST', ...otherOptions })
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
_getMobileJsToken(): Promise<{
|
|
71
71
|
ok: boolean
|
|
72
72
|
data?: any
|
|
73
73
|
error?: any
|
|
74
74
|
}> {
|
|
75
75
|
return new Promise((resolve, reject) => {
|
|
76
76
|
try {
|
|
77
77
|
if (window?.getJsToken) {
|
|
78
78
|
window.getJsToken(function (res) {
|
|
79
79
|
console.log('JS token 获取结果:', res)
|
|
80
80
|
resolve({
|
|
81
81
|
ok: true,
|
|
82
82
|
data: res,
|
|
83
83
|
})
|
|
84
84
|
}, 600)
|
|
85
85
|
} else {
|
|
86
86
|
reject({
|
|
87
87
|
ok: false,
|
|
88
88
|
error: '没有识别到getJsToken全局方法',
|
|
89
89
|
})
|
|
90
90
|
}
|
|
91
91
|
} catch (e) {
|
|
92
92
|
console.log('获取指纹JS token 异常', e)
|
|
93
93
|
reject({
|
|
94
94
|
ok: false,
|
|
95
95
|
error: e,
|
|
96
96
|
})
|
|
97
97
|
}
|
|
98
98
|
})
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
async _getFmInfo() {
|
|
102
102
|
try {
|
|
103
103
|
const { ok, data } = await this._getMobileJsToken()
|
|
104
104
|
this.fmInfo = ok && data ? data : this.fmInfo
|
|
105
105
|
return this.fmInfo
|
|
106
106
|
} catch (e) {
|
|
107
107
|
console.log('获取指纹信息异常', e)
|
|
108
108
|
return this.fmInfo
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
async request({
|
|
113
113
|
url,
|
|
114
114
|
method = 'POST',
|
|
115
115
|
timeout = 7000,
|
|
116
116
|
...otherOptions
|
|
117
117
|
}): RequestTask<any> {
|
|
118
118
|
const header = {
|
|
119
119
|
'content-type':
|
|
120
120
|
method === 'POST'
|
|
121
121
|
? RequestHeaderContentType.formDataHeader
|
|
122
122
|
: RequestHeaderContentType.jsonHeader,
|
|
123
123
|
}
|
|
124
124
|
const getReqData = otherOptions.data
|
|
125
125
|
if (url === this.api.apiFunc && typeof getReqData === 'object') {
|
|
126
126
|
const { jsToken } = await this._getFmInfo()
|
|
127
127
|
jsToken && (getReqData['x-api-eid-token'] = jsToken)
|
|
128
128
|
}
|
|
129
129
|
const requestTask = Taro.request({
|
|
130
130
|
url,
|
|
131
131
|
method,
|
|
132
132
|
timeout,
|
|
133
133
|
header,
|
|
134
134
|
credentials: 'include',
|
|
135
135
|
...otherOptions,
|
|
136
136
|
})
|
|
137
137
|
const requestTimeoutPromise =
|
|
138
138
|
new Promise<ServiceInterFace.RequestPromiseRes>((resolve) => {
|
|
139
139
|
setTimeout(() => {
|
|
140
140
|
resolve({
|
|
141
141
|
statusCode: 500,
|
|
142
142
|
resTimeoutState: true,
|
|
143
143
|
errMsg: 'request timeout',
|
|
144
144
|
})
|
|
145
145
|
}, timeout)
|
|
146
146
|
})
|
|
147
147
|
return Promise.race([requestTask, requestTimeoutPromise]).then(
|
|
148
148
|
(res: any) => {
|
|
149
149
|
if (res && res.statusCode === 500 && res.resTimeoutState) {
|
|
150
150
|
console.log('request 请求超时 url:' + url)
|
|
151
151
|
requestTask.abort && requestTask.abort()
|
|
152
152
|
}
|
|
153
153
|
return res
|
|
154
154
|
},
|
|
155
155
|
)
|
|
156
156
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import Taro, { RequestTask } from '@tarojs/taro'
|
|
2
|
SHOP_COLOR_APPID,
|
|
1
3
|
JshopxColorFunctionIdList,
|
|
2
4
|
PagesColorFunctionIdList,
|
|
3
5
|
JSHOPX_COLOR_APPID,
|
|
4
6
|
PAGES_COLOR_APPID,
|
|
5
7
|
PAGES_DOMAIN,
|
|
6
8
|
B2BColorFunctionIdList,
|
|
7
9
|
B2B_COLOR_APPID,
|
|
8
10
|
cookiesStr: '',
|
|
9
11
|
requestHeaderContentType: {
|
|
10
12
|
jsonHeader: {
|
|
11
13
|
'content-type': 'application/json;charset=utf-8',
|
|
12
14
|
},
|
|
13
15
|
formDataHeader: {
|
|
14
16
|
'content-type': 'application/x-www-form-urlencoded',
|
|
15
17
|
},
|
|
16
18
|
},
|
|
17
19
|
requestBaseParam: {
|
|
18
20
|
data: null,
|
|
19
21
|
header: {
|
|
20
22
|
'content-type': 'application/json;charset=utf-8',
|
|
21
23
|
},
|
|
22
24
|
},
|
|
23
25
|
timeOut: 7000,
|
|
24
26
|
apiClientParams: {
|
|
25
27
|
appid: SHOP_COLOR_APPID,
|
|
26
28
|
clientVersion:
|
|
27
29
|
isH5AndJdShopView && jdAppVersionStr !== '' ? jdAppVersionStr : '11.0.0',
|
|
28
30
|
client: isH5AndJdShopView ? (isIosDevice ? 'apple' : 'android') : 'wh5',
|
|
29
31
|
area: '1_72_2799_0',
|
|
30
32
|
uuid: UUID,
|
|
31
33
|
},
|
|
32
34
|
public addressFetchInfo: {
|
|
33
35
|
reqState: boolean
|
|
34
36
|
promiseInstance: null | Promise<any>
|
|
35
37
|
}
|
|
36
38
|
public getPromotionConfig: {
|
|
37
39
|
projectId: null | string | number
|
|
38
40
|
pageId: null | string | number
|
|
39
41
|
}
|
|
40
42
|
public resInfo: ServiceInterFace.HttpRequestInfo
|
|
41
43
|
public api: ServiceInterFace.HttpApi
|
|
42
44
|
public isPageDomain: boolean
|
|
43
45
|
constructor(opt) {
|
|
44
46
|
this._init()
|
|
45
47
|
this.addressFetchInfo = {
|
|
46
48
|
reqState: false,
|
|
47
49
|
promiseInstance: null,
|
|
48
50
|
}
|
|
49
51
|
this.getPromotionConfig = {
|
|
50
52
|
projectId: null,
|
|
51
53
|
pageId: null,
|
|
52
54
|
}
|
|
53
55
|
this._userAreaUpdateListen()
|
|
54
56
|
this.resInfo = this._getResConfig(opt)
|
|
55
57
|
this.api = api
|
|
56
58
|
this.isPageDomain = window.location.hostname === PAGES_DOMAIN
|
|
57
59
|
}
|
|
58
60
|
_init(): void {
|
|
59
61
|
httpInterceptors.forEach((item) => {
|
|
60
62
|
Taro.addInterceptor((chain) => item(chain))
|
|
61
63
|
})
|
|
62
64
|
}
|
|
63
65
|
_getResConfig(opt = {}): ServiceInterFace.HttpRequestInfo {
|
|
64
66
|
return Object.assign({}, DefaultConfig, opt)
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
_userAreaUpdateListen() {
|
|
68
70
|
Taro.eventCenter.on(TaroEventType.USER_AREA_UPDATE, (area) => {
|
|
69
71
|
this.updateApiClientParamsResInfo({
|
|
70
72
|
area,
|
|
71
73
|
})
|
|
72
74
|
})
|
|
73
75
|
}
|
|
74
76
|
updateApiClientParamsResInfo(opt = {}) {
|
|
75
77
|
this.resInfo.apiClientParams = {
|
|
76
78
|
...this.resInfo.apiClientParams,
|
|
77
79
|
...opt,
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
_paramsSign(data) {
|
|
82
84
|
return Promise.resolve(data)
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
checkFunctionIdToReturnAppId(functionId) {
|
|
86
88
|
if (JshopxColorFunctionIdList.includes(functionId)) {
|
|
87
89
|
return JSHOPX_COLOR_APPID
|
|
88
90
|
} else if (
|
|
89
91
|
this.isPageDomain &&
|
|
90
92
|
PagesColorFunctionIdList.includes(functionId)
|
|
91
93
|
) {
|
|
92
94
|
return PAGES_COLOR_APPID
|
|
93
95
|
} else if (B2BColorFunctionIdList.includes(functionId)) {
|
|
94
96
|
return B2B_COLOR_APPID
|
|
95
97
|
} else {
|
|
96
98
|
return SHOP_COLOR_APPID
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
gatewayReq(
|
|
101
103
|
functionId: string,
|
|
102
104
|
bodyParams = {},
|
|
103
105
|
clientParams = {},
|
|
104
106
|
): Promise<any> {
|
|
105
107
|
if (
|
|
106
108
|
functionId === 'receiveShopCoupon' &&
|
|
107
109
|
((isH5 && window.isJingGouMiniViewState) || isWxMinAndWxapp)
|
|
108
110
|
) {
|
|
109
111
|
clientParams = Object.assign(
|
|
110
112
|
{},
|
|
111
113
|
{
|
|
112
114
|
loginType: '1',
|
|
113
115
|
loginWQBiz: WXAPP_BIZ_KEY,
|
|
114
116
|
},
|
|
115
117
|
clientParams,
|
|
116
118
|
)
|
|
117
119
|
}
|
|
118
120
|
const apiClientParams = Object.assign(
|
|
119
121
|
{},
|
|
120
122
|
this.resInfo.apiClientParams,
|
|
121
123
|
clientParams,
|
|
122
124
|
)
|
|
123
125
|
apiClientParams.appid = this.checkFunctionIdToReturnAppId(functionId)
|
|
124
126
|
const getReqData = {
|
|
125
127
|
functionId: functionId,
|
|
126
128
|
body: JSON.stringify(bodyParams),
|
|
127
129
|
t: Date.now(),
|
|
128
130
|
...apiClientParams,
|
|
129
131
|
}
|
|
130
132
|
console.log(`gatewayReq:${this.api.apiFunc}`)
|
|
131
133
|
return http
|
|
132
134
|
.request({
|
|
133
135
|
url: this.api.apiFunc,
|
|
134
136
|
data: getReqData,
|
|
135
137
|
method: 'GET',
|
|
136
138
|
})
|
|
137
139
|
.then((res: ServiceInterFace.RequestPromiseRes) => {
|
|
138
140
|
const { statusCode, data } = res
|
|
139
141
|
let changeRes: ServiceInterFace.RequestResponseFormatRes = {
|
|
140
142
|
ok: true,
|
|
141
143
|
}
|
|
142
144
|
if (statusCode === 200 && data) {
|
|
143
145
|
const resCode = Object.prototype.hasOwnProperty.call(res.data, 'code')
|
|
144
146
|
? Number(res.data.code)
|
|
145
147
|
: -1
|
|
146
148
|
const subCode = Object.prototype.hasOwnProperty.call(
|
|
147
149
|
res.data,
|
|
148
150
|
'subCode',
|
|
149
151
|
)
|
|
150
152
|
? Number(res.data.subCode)
|
|
151
153
|
: -1
|
|
152
154
|
if (
|
|
153
155
|
data.success === true ||
|
|
154
156
|
data.isSuccess ||
|
|
155
157
|
resCode === 0 ||
|
|
156
158
|
resCode === 200 ||
|
|
157
159
|
subCode === 0
|
|
158
160
|
) {
|
|
159
161
|
changeRes = {
|
|
160
162
|
result: Object.prototype.hasOwnProperty.call(data, 'result')
|
|
161
163
|
? data.result
|
|
162
164
|
: Object.prototype.hasOwnProperty.call(data, 'data')
|
|
163
165
|
? data.data
|
|
164
166
|
: data,
|
|
165
167
|
code: data.code || 200,
|
|
166
168
|
ok: true,
|
|
167
169
|
source: data,
|
|
168
170
|
}
|
|
169
171
|
return changeRes
|
|
170
172
|
} else {
|
|
171
173
|
changeRes = {
|
|
172
174
|
...data,
|
|
173
175
|
ok: false,
|
|
174
176
|
statusCode: res.statusCode,
|
|
175
177
|
}
|
|
176
178
|
return changeRes
|
|
177
179
|
}
|
|
178
180
|
} else {
|
|
179
181
|
changeRes = {
|
|
180
182
|
...data,
|
|
181
183
|
ok: false,
|
|
182
184
|
statusCode: res.statusCode,
|
|
183
185
|
}
|
|
184
186
|
return changeRes
|
|
185
187
|
}
|
|
186
188
|
})
|
|
187
189
|
.catch((res) => {
|
|
188
190
|
return {
|
|
189
191
|
...res,
|
|
190
192
|
ok: false,
|
|
191
193
|
} as ServiceInterFace.RequestResponseFormatRes
|
|
192
194
|
})
|
|
193
195
|
}
|
|
194
196
|
|
|
195
197
|
async receiveCoupon(param = {}, clientParams) {
|
|
196
198
|
return await this.gatewayReq(
|
|
197
199
|
'receiveShopCoupon',
|
|
198
200
|
{
|
|
199
201
|
operation: '3',
|
|
200
202
|
...param,
|
|
201
203
|
},
|
|
202
204
|
clientParams,
|
|
203
205
|
)
|
|
204
206
|
}
|
|
205
207
|
async bMallAddCart(params = {}) {
|
|
206
208
|
return await this.gatewayReq('bmall_cartAdd', params, {
|
|
207
209
|
client: 'H5',
|
|
208
210
|
})
|
|
209
211
|
}
|
|
210
212
|
async bMallChangeCart(params = {}) {
|
|
211
213
|
return await this.gatewayReq('bmall_cartChange', params, {
|
|
212
214
|
client: 'H5',
|
|
213
215
|
})
|
|
214
216
|
}
|
|
215
217
|
async bMallRemoveCart(params = {}) {
|
|
216
218
|
return await this.gatewayReq(
|
|
217
219
|
'bmall_cartRemove',
|
|
218
220
|
params,
|
|
219
221
|
{
|
|
220
222
|
client: 'H5',
|
|
221
223
|
},
|
|
222
224
|
)
|
|
223
225
|
}
|
|
224
226
|
async bMallGetOmittedProduct(params = {}) {
|
|
225
227
|
return await this.gatewayReq('bmall_getOmittedProduct', params, {
|
|
226
228
|
client: 'H5',
|
|
227
229
|
})
|
|
228
230
|
}
|
|
229
231
|
async bMallAddCartService({ skuId, bMallTag, num }) {
|
|
230
232
|
const params = getParams({ skuId, bMallTag, num })
|
|
231
233
|
return await this.addCart(params)
|
|
232
234
|
}
|
|
233
235
|
async bMallGetSkuNumService(bMallTag = 1) {
|
|
234
236
|
const params = getParams({ bMallTag })
|
|
235
237
|
delete params.operations
|
|
236
238
|
return await this.getOmittedProduct(params)
|
|
237
239
|
}
|
|
238
240
|
async bMallRemoveCartService({ skuId, bMallTag, num, skuUuid }) {
|
|
239
241
|
let params = getParams({ skuId, bMallTag, num, skuUuid })
|
|
240
242
|
return await this.removeCart(params)
|
|
241
243
|
}
|
|
242
244
|
async bMallChangeCartService({ skuId, bMallTag, num, skuUuid }) {
|
|
243
245
|
let params = getParams({ skuId, bMallTag, num, skuUuid })
|
|
244
246
|
return await this.changeCart(params)
|
|
245
247
|
}
|
|
246
248
|
|
|
247
249
|
async bMallGetSkuNumApi(needRequest = false, bMallTag = 1) {
|
|
248
250
|
if (!needRequest && window.bMallCartData) {
|
|
249
251
|
return window.bMallCartData
|
|
250
252
|
}
|
|
251
253
|
const cartData = await this.getSkuNumService(bMallTag)
|
|
252
254
|
let items
|
|
253
255
|
if (cartData.ok && cartData.result) {
|
|
254
256
|
items = cartData?.result?.items || {}
|
|
255
257
|
}
|
|
256
258
|
window.bMallCartData = items
|
|
257
259
|
return items
|
|
258
260
|
}
|
|
259
261
|
|
|
260
262
|
async bMallCartHandle(goodItem, num) {
|
|
261
263
|
try {
|
|
262
264
|
const {
|
|
263
265
|
skuUuid,
|
|
264
266
|
limitUpper,
|
|
265
267
|
limitLower,
|
|
266
268
|
} = goodItem
|
|
267
269
|
let cartNum = Number(num)
|
|
268
270
|
if (limitLower && cartNum && cartNum < limitLower) {
|
|
269
271
|
cartNum = limitLower
|
|
270
272
|
} else if (limitUpper && cartNum && cartNum > limitUpper) {
|
|
271
273
|
cartNum = limitUpper
|
|
272
274
|
}
|
|
273
275
|
if (skuUuid && cartNum > 0) {
|
|
274
276
|
return this.changeCartService({
|
|
275
277
|
...goodItem,
|
|
276
278
|
skuUuid,
|
|
277
279
|
num: cartNum,
|
|
278
280
|
})
|
|
279
281
|
} else if (!skuUuid && cartNum > 0) {
|
|
280
282
|
return this.addCartService({ ...goodItem, num: cartNum })
|
|
281
283
|
} else if (skuUuid && !cartNum) {
|
|
282
284
|
return this.removeCartService({
|
|
283
285
|
...goodItem,
|
|
284
286
|
skuUuid,
|
|
285
287
|
num: cartNum,
|
|
286
288
|
})
|
|
287
289
|
} else {
|
|
288
290
|
console.error('参数不全')
|
|
289
291
|
return false
|
|
290
292
|
}
|
|
291
293
|
} catch (e) {
|
|
292
294
|
console.error(e)
|
|
293
295
|
}
|
|
294
296
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] = {
|
|
3
2
|
displayHeight: 1920,
|
|
4
3
|
offSetY: 0
|
|
5
4
|
}
|
|
6
5
|
console.log('>>>>>>>>>>>>>>>>>>> render taroEventSendPageScrollInfo origin time:', Date.now(), 'res:', options)
|
|
7
6
|
if(options){
|
|
8
7
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] = options
|
|
9
8
|
}
|
|
10
9
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
10
|
+
import Taro from '@tarojs/taro'
|
|
11
11
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] = {
|
|
12
12
|
displayHeight: 1920,
|
|
13
13
|
offSetY: 0
|
|
14
14
|
}
|
|
15
15
|
console.log('>>>>>>>>>>>>>>>>>>> render taroEventSendPageScrollInfo origin time:', Date.now(), 'res:', options)
|
|
16
16
|
if(options){
|
|
17
17
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] = options
|
|
18
18
|
}
|
|
19
19
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
20
20
|
const { displayHeight, offSetY } = res
|
|
21
21
|
if (typeof displayHeight === 'undefined' || typeof offSetY === 'undefined') return
|
|
22
22
|
|
|
23
23
|
if (isIosDevice) return res
|
|
24
24
|
|
|
25
25
|
if (isAndroidDevice) {
|
|
26
26
|
const deviceRatio = window.devicePixelRatio
|
|
27
27
|
const cssDisplayHeight = Math.ceil(displayHeight / deviceRatio)
|
|
28
28
|
const cssOffsetY = Math.ceil(offSetY / deviceRatio)
|
|
29
29
|
return {
|
|
30
30
|
displayHeight: cssDisplayHeight,
|
|
31
31
|
offSetY: cssOffsetY
|
|
32
32
|
}
|
|
33
33
|
}
|
package/dist/utils/utils.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
pinStatus,
|
|
3
2
|
visitkey,
|
|
4
3
|
unionid,
|
|
5
4
|
skey,
|
|
6
5
|
__jda,
|
|
7
6
|
__jdv,
|
|
8
7
|
__wga,
|
|
9
8
|
wxapp_type
|
|
10
9
|
} = cookie
|
|
11
10
|
pin,
|
|
12
11
|
pinStatus,
|
|
13
12
|
visitkey,
|
|
14
13
|
unionid,
|
|
15
14
|
skey,
|
|
16
15
|
__jda,
|
|
17
16
|
__jdv,
|
|
18
17
|
__wga,
|
|
19
18
|
wid,
|
|
20
19
|
wq_skey,
|
|
21
20
|
wq_uin,
|
|
22
21
|
wq_auth_token,
|
|
23
22
|
wxapp_scene,
|
|
24
23
|
wq_unionid,
|
|
25
24
|
wxapp_openid,
|
|
26
25
|
wxapp_version,
|
|
27
26
|
wxapp_type
|
|
28
27
|
exceptionReportFn
|
|
29
28
|
exceptionReportFn(
|
|
30
29
|
`店铺首页isv h5楼层隐藏不显示。原因:modularPackResult数据不完备。页面类型-buildType: ${buildType}。楼层顺序-floorIdx: ${floorData?.floorIdx}`,
|
|
31
30
|
)
|
|
32
31
|
const isIsvContainer = (containerId, floorListData, containerListData) => {
|
|
33
32
|
const objContainer = containerListData.find(item => item.containerId === containerId)
|
|
34
33
|
(itemUid) => {
|
|
35
34
|
const objectFloor = floorListData.find(floorItem => itemUid === floorItem.uid)
|
|
36
35
|
return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag)
|
|
37
36
|
}
|
|
38
37
|
)?? false
|
|
38
|
+
import Taro from '@tarojs/taro'
|
|
39
39
|
pin?: string
|
|
40
40
|
visitkey?: string
|
|
41
41
|
[key: string]: any
|
|
42
42
|
}
|
|
43
43
|
jdpin,
|
|
44
44
|
pinStatus,
|
|
45
45
|
visitkey,
|
|
46
46
|
unionid,
|
|
47
47
|
skey,
|
|
48
48
|
__jda,
|
|
49
49
|
__jdv,
|
|
50
50
|
__wga,
|
|
51
51
|
wxapp_type
|
|
52
52
|
} = cookie
|
|
53
53
|
const getUserCookieObj = {}
|
|
54
54
|
jdpin,
|
|
55
55
|
pinStatus,
|
|
56
56
|
visitkey,
|
|
57
57
|
unionid,
|
|
58
58
|
skey,
|
|
59
59
|
__jda,
|
|
60
60
|
__jdv,
|
|
61
61
|
__wga,
|
|
62
62
|
wid,
|
|
63
63
|
wq_skey,
|
|
64
64
|
wq_uin,
|
|
65
65
|
wq_auth_token,
|
|
66
66
|
wxapp_scene,
|
|
67
67
|
wq_unionid,
|
|
68
68
|
wxapp_openid,
|
|
69
69
|
wxapp_version,
|
|
70
70
|
wxapp_type
|
|
71
71
|
name = name === 'jdpin' ? 'pin' : name;
|
|
72
72
|
name === 'pin' && (ret.push(`pt_pin=${encodeURIComponent(value)}`))
|
|
73
73
|
ret.push(`${name}=${encodeURIComponent(value)}`)
|
|
74
74
|
getUserCookieObj[name] = value
|
|
75
75
|
}
|
|
76
76
|
wqCookie: getUserCookieObj
|
|
77
77
|
exceptionReportFn
|
|
78
78
|
exceptionReportFn(
|
|
79
79
|
`店铺首页isv h5楼层隐藏不显示。原因:modularPackResult数据不完备。页面类型-buildType: ${buildType}。楼层顺序-floorIdx: ${floorData?.floorIdx}`,
|
|
80
80
|
)
|
|
81
81
|
const isIsvContainer = (containerId, floorListData, containerListData) => {
|
|
82
82
|
const objContainer = containerListData.find(item => item.containerId === containerId)
|
|
83
83
|
(itemUid) => {
|
|
84
84
|
const objectFloor = floorListData.find(floorItem => itemUid === floorItem.uid)
|
|
85
85
|
return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag)
|
|
86
86
|
}
|
|
87
87
|
)?? false
|