@conecli/cone-render 0.8.19 → 0.8.20-beta.0
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/api/index.ts +1 -1
- 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/isvStorage/index.h5.ts +1 -0
- package/dist/common/isvStorage/index.ts +1 -0
- package/dist/common/token/const.ts +1 -0
- package/dist/common/token/index.h5.ts +1 -0
- package/dist/common/token/index.ts +1 -0
- package/dist/common/token/token.jd.ts +1 -0
- package/dist/common/token/token.ts +1 -0
- package/dist/common/token/token.wxapp.ts +1 -0
- package/dist/components/base/CommonFloorHead/index.module.scss +1 -1
- package/dist/components/base/CommonFloorHead/index.tsx +1 -1
- package/dist/components/base/CustomVideo/const.ts +1 -0
- package/dist/components/base/CustomVideo/index.module.scss +40 -64
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/Dialog/index.module.scss +6 -2
- package/dist/components/base/Dialog/index.tsx +1 -1
- package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
- package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
- package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +3 -0
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/{const.ts → Base/const.ts} +0 -0
- package/dist/components/base/Price/Base/index.module.scss +136 -0
- package/dist/components/base/Price/Base/index.tsx +1 -0
- package/dist/components/base/Price/Double/index.module.scss +158 -0
- package/dist/components/base/Price/Double/index.tsx +1 -0
- package/dist/components/base/Price/index.tsx +1 -1
- package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
- package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
- package/dist/components/floorItem.jd.tsx +1 -0
- package/dist/components/floorItem.tsx +1 -1
- package/dist/components/isv/Floor/index.tsx +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/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.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 -0
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/libs/taroAppReport.js +2 -2
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/open/api/index.ts +1 -1
- package/dist/open/api/jump/business.ts +1 -0
- package/dist/open/api/jump/index.ts +1 -0
- package/dist/open/api/jump/minPath.ts +1 -0
- package/dist/open/api/jump/side.ts +1 -0
- package/dist/open/api/jump/webUrl.ts +1 -0
- package/dist/open/api/jump copy.ts +1 -0
- package/dist/open/api/moduleUtil.ts +1 -1
- package/dist/open/api/request.ts +1 -0
- package/dist/open/api/shopMember.ts +1 -0
- package/dist/open/api/userToken.ts +1 -0
- package/dist/service/bMallConst.ts +1 -0
- package/dist/service/bMallConst.wxapp.ts +1 -0
- package/dist/service/fetchGateway.ts +1 -0
- package/dist/service/fetchJsonp.ts +1 -0
- package/dist/service/http/colorSign.ts +1 -0
- package/dist/service/http/colorSign.wxapp.ts +1 -0
- package/dist/service/http/const.ts +1 -0
- package/dist/service/http/http.ts +1 -0
- package/dist/service/http/httpInterceptors.jd.ts +1 -0
- package/dist/service/http/httpInterceptors.ts +1 -0
- package/dist/service/http/index.ts +1 -0
- package/dist/service/requestServer.ts +1 -0
- 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/memberFormatUtils.js +1 -0
- package/dist/utils/priceUtils.js +1 -0
- package/dist/utils/ready.ts +1 -0
- package/dist/utils/utils.ts +1 -1
- package/package.json +5 -4
- package/dist/components/base/Price/index.module.scss +0 -136
- package/dist/open/api/jump.ts +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import Taro from '@tarojs/taro'
|
|
2
|
APPID,
|
|
1
3
|
JshopxColorFunctionIdList,
|
|
2
4
|
PagesColorFunctionIdList,
|
|
3
5
|
PAGES_DOMAIN,
|
|
4
6
|
B2BColorFunctionIdList,
|
|
5
7
|
MobileVerifyColorList,
|
|
6
8
|
AppVerifyColorList,
|
|
7
9
|
JshopxVerifyColorList,
|
|
8
10
|
BMallVerifyColorList,
|
|
9
11
|
shopMemberColorFunctionIdList
|
|
10
12
|
cookiesStr: '',
|
|
11
13
|
requestHeaderContentType: {
|
|
12
14
|
jsonHeader: {
|
|
13
15
|
'content-type': 'application/json;charset=utf-8',
|
|
14
16
|
},
|
|
15
17
|
formDataHeader: {
|
|
16
18
|
'content-type': 'application/x-www-form-urlencoded',
|
|
17
19
|
},
|
|
18
20
|
},
|
|
19
21
|
requestBaseParam: {
|
|
20
22
|
data: null,
|
|
21
23
|
header: {
|
|
22
24
|
'content-type': 'application/json;charset=utf-8',
|
|
23
25
|
},
|
|
24
26
|
},
|
|
25
27
|
timeOut: 7000,
|
|
26
28
|
apiClientParams: {
|
|
27
29
|
clientVersion:
|
|
28
30
|
isH5AndJdShopView && jdAppVersionStr !== '' ? jdAppVersionStr : '11.0.0',
|
|
29
31
|
client: isH5AndJdShopView ? (isIosDevice ? 'apple' : 'android') : 'wh5',
|
|
30
32
|
area: '1_72_2799_0',
|
|
31
33
|
uuid: UUID,
|
|
32
34
|
},
|
|
33
35
|
public addressFetchInfo: {
|
|
34
36
|
reqState: boolean
|
|
35
37
|
promiseInstance: null | Promise<any>
|
|
36
38
|
}
|
|
37
39
|
public getPromotionConfig: {
|
|
38
40
|
projectId: null | string | number
|
|
39
41
|
pageId: null | string | number
|
|
40
42
|
}
|
|
41
43
|
public resInfo: ServiceInterFace.HttpRequestInfo
|
|
42
44
|
public api: ServiceInterFace.HttpApi
|
|
43
45
|
public isPageDomain: boolean
|
|
44
46
|
public verifyColorList: string[]
|
|
45
47
|
constructor(opt) {
|
|
46
48
|
this._init()
|
|
47
49
|
this.addressFetchInfo = {
|
|
48
50
|
reqState: false,
|
|
49
51
|
promiseInstance: null,
|
|
50
52
|
}
|
|
51
53
|
this.getPromotionConfig = {
|
|
52
54
|
projectId: null,
|
|
53
55
|
pageId: null,
|
|
54
56
|
}
|
|
55
57
|
this._userAreaUpdateListen()
|
|
56
58
|
this.resInfo = this._getResConfig(opt)
|
|
57
59
|
this.api = api
|
|
58
60
|
this.isPageDomain = isH5 ? window?.location?.hostname === PAGES_DOMAIN : false
|
|
59
61
|
this.verifyColorList = [
|
|
60
62
|
...MobileVerifyColorList,
|
|
61
63
|
...AppVerifyColorList,
|
|
62
64
|
...JshopxVerifyColorList,
|
|
63
65
|
...BMallVerifyColorList,
|
|
64
66
|
]
|
|
65
67
|
}
|
|
66
68
|
_init(): void {
|
|
67
69
|
httpInterceptors.forEach((item) => {
|
|
68
70
|
Taro.addInterceptor((chain) => item(chain))
|
|
69
71
|
})
|
|
70
72
|
}
|
|
71
73
|
_getResConfig(opt = {}): ServiceInterFace.HttpRequestInfo {
|
|
72
74
|
return Object.assign({}, DefaultConfig, opt)
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
_userAreaUpdateListen() {
|
|
76
78
|
Taro.eventCenter.on(TaroEventType.USER_AREA_UPDATE, (area) => {
|
|
77
79
|
this.updateApiClientParamsResInfo({
|
|
78
80
|
area,
|
|
79
81
|
})
|
|
80
82
|
})
|
|
81
83
|
}
|
|
82
84
|
updateApiClientParamsResInfo(opt = {}) {
|
|
83
85
|
this.resInfo.apiClientParams = {
|
|
84
86
|
...this.resInfo.apiClientParams,
|
|
85
87
|
...opt,
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
checkFunctionIdToReturnAppId(functionId) {
|
|
90
92
|
if (JshopxColorFunctionIdList.includes(functionId)) {
|
|
91
93
|
return APPID.JSHOPX_COLOR_APPID
|
|
92
94
|
} else if (
|
|
93
95
|
this.isPageDomain &&
|
|
94
96
|
PagesColorFunctionIdList.includes(functionId)
|
|
95
97
|
) {
|
|
96
98
|
return APPID.PAGES_COLOR_APPID
|
|
97
99
|
} else if (shopMemberColorFunctionIdList.includes(functionId)) {
|
|
98
100
|
return APPID.SHOP_MEMBER_COLOR_APPID
|
|
99
101
|
}else if (B2BColorFunctionIdList.includes(functionId)) {
|
|
100
102
|
return APPID.B2B_COLOR_APPID
|
|
101
103
|
} else {
|
|
102
104
|
return APPID.SHOP_COLOR_APPID
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
gatewayReq(
|
|
107
109
|
functionId: string,
|
|
108
110
|
bodyParams = {},
|
|
109
111
|
clientParams = {},
|
|
110
112
|
): Promise<any> {
|
|
111
113
|
if (
|
|
112
114
|
functionId === 'receiveShopCoupon' &&
|
|
113
115
|
((isH5 && window?.isJingGouMiniViewState) || isWxMinAndWxapp)
|
|
114
116
|
) {
|
|
115
117
|
clientParams = Object.assign(
|
|
116
118
|
{},
|
|
117
119
|
{
|
|
118
120
|
loginType: '1',
|
|
119
121
|
loginWQBiz: WXAPP_BIZ_KEY,
|
|
120
122
|
},
|
|
121
123
|
clientParams,
|
|
122
124
|
)
|
|
123
125
|
}
|
|
124
126
|
const apiClientParams = Object.assign(
|
|
125
127
|
{},
|
|
126
128
|
this.resInfo.apiClientParams,
|
|
127
129
|
clientParams,
|
|
128
130
|
)
|
|
129
131
|
typeof apiClientParams.appid === 'undefined' && (apiClientParams.appid = this.checkFunctionIdToReturnAppId(functionId))
|
|
130
132
|
const isColorVerify = this.verifyColorList.includes(functionId)
|
|
131
133
|
const getReqData = {
|
|
132
134
|
functionId: functionId,
|
|
133
135
|
body: JSON.stringify(bodyParams),
|
|
134
136
|
t: Date.now(),
|
|
135
137
|
...apiClientParams,
|
|
136
138
|
}
|
|
137
139
|
return http
|
|
138
140
|
.request({
|
|
139
141
|
url: this.api.apiFunc,
|
|
140
142
|
data: getReqData,
|
|
141
143
|
isColorVerify,
|
|
142
144
|
})
|
|
143
145
|
.then((res: ServiceInterFace.RequestPromiseRes) => {
|
|
144
146
|
const { statusCode, data } = res
|
|
145
147
|
let changeRes: ServiceInterFace.RequestResponseFormatRes = {
|
|
146
148
|
ok: true,
|
|
147
149
|
}
|
|
148
150
|
if (statusCode === 200 && data) {
|
|
149
151
|
const resCode = Object.prototype.hasOwnProperty.call(res.data, 'code')
|
|
150
152
|
? Number(res.data.code)
|
|
151
153
|
: -1
|
|
152
154
|
const subCode = Object.prototype.hasOwnProperty.call(
|
|
153
155
|
res.data,
|
|
154
156
|
'subCode',
|
|
155
157
|
)
|
|
156
158
|
? Number(res.data.subCode)
|
|
157
159
|
: -1
|
|
158
160
|
if (
|
|
159
161
|
data.success === true ||
|
|
160
162
|
data.isSuccess ||
|
|
161
163
|
resCode === 0 ||
|
|
162
164
|
resCode === 200 ||
|
|
163
165
|
subCode === 0
|
|
164
166
|
) {
|
|
165
167
|
changeRes = {
|
|
166
168
|
result: Object.prototype.hasOwnProperty.call(data, 'result')
|
|
167
169
|
? data.result
|
|
168
170
|
: Object.prototype.hasOwnProperty.call(data, 'data')
|
|
169
171
|
? data.data
|
|
170
172
|
: data,
|
|
171
173
|
code: data.code || 200,
|
|
172
174
|
ok: true,
|
|
173
175
|
source: data,
|
|
174
176
|
}
|
|
175
177
|
return changeRes
|
|
176
178
|
} else {
|
|
177
179
|
changeRes = {
|
|
178
180
|
...data,
|
|
179
181
|
ok: false,
|
|
180
182
|
statusCode: res.statusCode,
|
|
181
183
|
}
|
|
182
184
|
return changeRes
|
|
183
185
|
}
|
|
184
186
|
} else {
|
|
185
187
|
changeRes = {
|
|
186
188
|
...data,
|
|
187
189
|
ok: false,
|
|
188
190
|
statusCode: res.statusCode,
|
|
189
191
|
}
|
|
190
192
|
return changeRes
|
|
191
193
|
}
|
|
192
194
|
})
|
|
193
195
|
.catch((res) => {
|
|
194
196
|
return {
|
|
195
197
|
...res,
|
|
196
198
|
ok: false,
|
|
197
199
|
} as ServiceInterFace.RequestResponseFormatRes
|
|
198
200
|
})
|
|
199
201
|
}
|
|
200
202
|
|
|
201
203
|
async receiveCoupon(param = {}, clientParams) {
|
|
202
204
|
return await this.gatewayReq(
|
|
203
205
|
'receiveShopCoupon',
|
|
204
206
|
{
|
|
205
207
|
operation: '3',
|
|
206
208
|
...param,
|
|
207
209
|
},
|
|
208
210
|
clientParams,
|
|
209
211
|
)
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
getCustomerCenterDispatch(params = {}) {
|
|
213
215
|
return this.gatewayReq('customerCenterDispatch', params, {
|
|
214
216
|
clientVersion: '9.2.0',
|
|
215
217
|
client: 'H5',
|
|
216
218
|
uuid: 88888,
|
|
217
219
|
appid: 'shopmember_m_jd_com',
|
|
218
220
|
})
|
|
219
221
|
}
|
|
220
222
|
bMallGetUserInfo = () => {
|
|
221
223
|
return getBMallUserInfo()
|
|
222
224
|
}
|
|
223
225
|
async bMallAddCart(params = {}) {
|
|
224
226
|
return await this.gatewayReq('bmall_cartAdd', params, {
|
|
225
227
|
client: 'H5',
|
|
226
228
|
clientVersion: '5.5.0'
|
|
227
229
|
})
|
|
228
230
|
}
|
|
229
231
|
async bMallChangeCart(params = {}) {
|
|
230
232
|
return await this.gatewayReq('bmall_cartChange', params, {
|
|
231
233
|
client: 'H5',
|
|
232
234
|
clientVersion: '5.5.0'
|
|
233
235
|
})
|
|
234
236
|
}
|
|
235
237
|
async bMallRemoveCart(params = {}) {
|
|
236
238
|
return await this.gatewayReq(
|
|
237
239
|
'bmall_cartRemove',
|
|
238
240
|
params,
|
|
239
241
|
{
|
|
240
242
|
client: 'H5',
|
|
241
243
|
clientVersion: '5.5.0'
|
|
242
244
|
},
|
|
243
245
|
)
|
|
244
246
|
}
|
|
245
247
|
async bMallGetOmittedProduct(params = {}) {
|
|
246
248
|
return await this.gatewayReq('bmall_getOmittedProduct', params, {
|
|
247
249
|
client: 'H5',
|
|
248
250
|
clientVersion: '5.5.0'
|
|
249
251
|
})
|
|
250
252
|
}
|
|
251
253
|
async bMallAddCartService({ skuId, bMallTag, num, data = {} }) {
|
|
252
254
|
const params = await getParams({ ...data, skuId, bMallTag, num })
|
|
253
255
|
return await this.bMallAddCart(params)
|
|
254
256
|
}
|
|
255
257
|
async bMallGetSkuNumService(bMallTag = 1) {
|
|
256
258
|
const params = await getParams({ bMallTag })
|
|
257
259
|
delete params.operations
|
|
258
260
|
return await this.bMallGetOmittedProduct(params)
|
|
259
261
|
}
|
|
260
262
|
async bMallRemoveCartService({ skuId, bMallTag, num, skuUuid, data = {} }) {
|
|
261
263
|
let params = await getParams({ ...data, skuId, bMallTag, num, skuUuid })
|
|
262
264
|
return await this.bMallRemoveCart(params)
|
|
263
265
|
}
|
|
264
266
|
async bMallChangeCartService({ skuId, bMallTag, num, skuUuid, data = {} }) {
|
|
265
267
|
let params = await getParams({ ...data, skuId, bMallTag, num, skuUuid })
|
|
266
268
|
return await this.bMallChangeCart(params)
|
|
267
269
|
}
|
|
268
270
|
|
|
269
271
|
async bMallGetSkuNumApi(needRequest = false, bMallTag = 1) {
|
|
270
272
|
if (!needRequest && isH5 && window?.bMallCartData) {
|
|
271
273
|
return window?.bMallCartData
|
|
272
274
|
}
|
|
273
275
|
const cartData = await this.bMallGetSkuNumService(bMallTag)
|
|
274
276
|
let items
|
|
275
277
|
if (cartData.ok && cartData.result) {
|
|
276
278
|
items = cartData?.result?.items || {}
|
|
277
279
|
}
|
|
278
280
|
if (isH5) {
|
|
279
281
|
window.bMallCartData = items
|
|
280
282
|
}
|
|
281
283
|
return items
|
|
282
284
|
}
|
|
283
285
|
|
|
284
286
|
async bMallCartHandle(goodItem, num) {
|
|
285
287
|
try {
|
|
286
288
|
const {
|
|
287
289
|
skuUuid,
|
|
288
290
|
limitUpper,
|
|
289
291
|
limitLower,
|
|
290
292
|
} = goodItem
|
|
291
293
|
let cartNum = Number(num)
|
|
292
294
|
if (limitLower && cartNum && cartNum < limitLower) {
|
|
293
295
|
cartNum = limitLower
|
|
294
296
|
} else if (limitUpper && cartNum && cartNum > limitUpper) {
|
|
295
297
|
cartNum = limitUpper
|
|
296
298
|
}
|
|
297
299
|
if (skuUuid && cartNum > 0) {
|
|
298
300
|
return this.bMallChangeCartService({
|
|
299
301
|
...goodItem,
|
|
300
302
|
skuUuid,
|
|
301
303
|
num: cartNum,
|
|
302
304
|
})
|
|
303
305
|
} else if (!skuUuid && cartNum > 0) {
|
|
304
306
|
return this.bMallAddCartService({ ...goodItem, num: cartNum })
|
|
305
307
|
} else if (skuUuid && !cartNum) {
|
|
306
308
|
return this.bMallRemoveCartService({
|
|
307
309
|
...goodItem,
|
|
308
310
|
skuUuid,
|
|
309
311
|
num: cartNum,
|
|
310
312
|
})
|
|
311
313
|
} else {
|
|
312
314
|
console.error('参数不全')
|
|
313
315
|
return false
|
|
314
316
|
}
|
|
315
317
|
} catch (e) {
|
|
316
318
|
console.error(e)
|
|
317
319
|
}
|
|
318
320
|
}
|
|
@@ -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] || {}
|
|
11
10
|
const { displayHeight, offSetY } = res
|
|
12
11
|
if (typeof displayHeight === 'undefined' || typeof offSetY === 'undefined') return
|
|
13
12
|
|
|
14
13
|
if (isIosDevice) return res
|
|
15
14
|
|
|
16
15
|
if (isAndroidDevice) {
|
|
17
16
|
const deviceRatio = window.devicePixelRatio
|
|
18
17
|
const cssDisplayHeight = Math.ceil(displayHeight / deviceRatio)
|
|
19
18
|
const cssOffsetY = Math.ceil(offSetY / deviceRatio)
|
|
20
19
|
return {
|
|
21
20
|
displayHeight: cssDisplayHeight,
|
|
22
21
|
offSetY: cssOffsetY
|
|
23
22
|
}
|
|
24
23
|
}
|
|
24
|
+
import Taro from '@tarojs/taro'
|
|
25
25
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] = {
|
|
26
26
|
displayHeight: 1920,
|
|
27
27
|
offSetY: 0
|
|
28
28
|
}
|
|
29
29
|
console.log('>>>>>>>>>>>>>>>>>>> render taroEventSendPageScrollInfo origin time:', Date.now(), 'res:', options)
|
|
30
30
|
if(options){
|
|
31
31
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] = options
|
|
32
32
|
}
|
|
33
33
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|
|
34
34
|
PAGE_PV_PARAM: 'pagePvParam',
|
|
35
35
|
NATIVE_SCORLL_VIEW: 'nativeScrollControl',
|
|
36
36
|
OPEN: 'open',
|
|
37
37
|
const { displayHeight, offSetY } = res
|
|
38
38
|
if (typeof displayHeight === 'undefined' || typeof offSetY === 'undefined') return
|
|
39
39
|
if (isIosDevice) return res
|
|
40
40
|
if (isAndroidDevice) {
|
|
41
41
|
const deviceRatio = window.devicePixelRatio
|
|
42
42
|
const cssDisplayHeight = Math.ceil(displayHeight / deviceRatio)
|
|
43
43
|
const cssOffsetY = Math.ceil(offSetY / deviceRatio)
|
|
44
44
|
return {
|
|
45
45
|
displayHeight: cssDisplayHeight,
|
|
46
46
|
offSetY: cssOffsetY
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from "@tarojs/taro";
|
|
1
|
+
import Taro from "@tarojs/taro";
|
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,
|
|
13
12
|
CHANNEL_TYPE,
|
|
14
13
|
JDShopViewBusinessPathType,
|
|
15
14
|
JDShopViewBusinessPathList,
|
|
16
15
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
17
16
|
parseQueryUrlString(window?.location?.href ?? ''),
|
|
18
17
|
try {
|
|
19
18
|
return JSON.parse(decodeURIComponent(getUrlQuery('cookie')))
|
|
20
19
|
} catch (e) {
|
|
21
20
|
return {}
|
|
22
21
|
}
|
|
23
22
|
isWxMiniH5View && urlCookie['wxapp_type'] == '1'
|
|
24
23
|
if (isJdApp) {
|
|
25
24
|
isIosDevice
|
|
26
25
|
? e && e.stopPropagation()
|
|
27
26
|
: androidDeviceStopNativeScrollEvent(state)
|
|
28
27
|
}
|
|
29
28
|
isJdApp &&
|
|
30
29
|
isAndroidDevice &&
|
|
31
30
|
window?.JdAndroid &&
|
|
32
31
|
window?.JdAndroid.requestEvent(state)
|
|
33
32
|
if (isH5AndJdShopView) {
|
|
34
33
|
return (
|
|
35
34
|
CHANNEL_TYPE[currentChannel] ||
|
|
36
35
|
CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
|
|
37
36
|
)
|
|
38
37
|
}
|
|
39
38
|
return null
|
|
40
39
|
isH5 && ['/app/home', '/app/classify'].includes(urlPathname)
|
|
40
|
+
import {
|
|
41
41
|
isApp,
|
|
42
42
|
isIOS,
|
|
43
43
|
getAppVersion,
|
|
44
44
|
version,
|
|
45
45
|
getUUID,
|
|
46
46
|
getUrlQuery,
|
|
47
47
|
assign,
|
|
48
48
|
isString,
|
|
49
49
|
isObject,
|
|
50
50
|
serialize,
|
|
51
51
|
isAndroid,
|
|
52
52
|
CHANNEL_TYPE,
|
|
53
53
|
JDShopViewBusinessPathType,
|
|
54
54
|
JDShopViewBusinessPathList,
|
|
55
55
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
56
56
|
parseQueryUrlString(window?.location?.href ?? ''),
|
|
57
57
|
try {
|
|
58
58
|
return JSON.parse(decodeURIComponent(getUrlQuery('cookie')))
|
|
59
59
|
} catch (e) {
|
|
60
60
|
return {}
|
|
61
61
|
}
|
|
62
62
|
isWxMiniH5View && urlCookie['wxapp_type'] == '1'
|
|
63
63
|
if (isJdApp) {
|
|
64
64
|
isIosDevice
|
|
65
65
|
? e && e.stopPropagation()
|
|
66
66
|
: androidDeviceStopNativeScrollEvent(state)
|
|
67
67
|
}
|
|
68
68
|
isJdApp &&
|
|
69
69
|
isAndroidDevice &&
|
|
70
70
|
window?.JdAndroid &&
|
|
71
71
|
window?.JdAndroid.requestEvent(state)
|
|
72
72
|
if (isH5AndJdShopView) {
|
|
73
73
|
return (
|
|
74
74
|
CHANNEL_TYPE[currentChannel] ||
|
|
75
75
|
CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
|
|
76
76
|
)
|
|
77
77
|
}
|
|
78
78
|
return null
|
|
79
79
|
isH5 && ['/app/home', '/app/classify', '/member/shopcard'].includes(urlPathname)
|
|
80
80
|
const getCustomObj = {
|
|
81
81
|
type: 1,
|
|
82
82
|
code: 'all',
|
|
83
83
|
cost1: 1,
|
|
84
84
|
...customObj
|
|
85
85
|
}
|
|
86
86
|
try {
|
|
87
87
|
window.__sgm__.custom(getCustomObj, '9HwAEg@fTtWBB3EnwA5VgLT')
|
|
88
88
|
} 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,
|
|
5
4
|
isH5AndJdShopViewNativeScroll, isIosDevice, isJdAndAndroidDevice, isJdAndIosDevice, isJdApp,
|
|
6
5
|
isWxApp, isWxMiniH5View, isH5AndJingGouMini, urlCookie
|
|
7
6
|
addHttps, clearTaroStorageKey, countStringify, dateFormat, dealAddress, dealShopContentData as originDealShopContentData, debounce, filterUrlQueryData, formatTabActiveMenuType, getQualityImage, getTaroStorageKeyValue,
|
|
8
7
|
getWxAppCookieStr, isH5, isJdMin, isWxMin,
|
|
9
8
|
isWxMinAndWxapp, lodashThrottle, objectToUrlEncode, parseQueryUrlString, removeTaroStorageKey, setLowSmallPicUrl,
|
|
10
9
|
setTaroStorage, showFailToast,
|
|
11
10
|
showNormalToast, showSuccessToast, sliceArrToChunkList, throttle
|
|
12
11
|
<span class="d-shop-loading-icon"></span>
|
|
13
12
|
<p class="d-shop-text">${text}</p>
|
|
14
13
|
</div>`
|
|
15
14
|
return originDealShopContentData(pageData, DraJSAgentReport, isvdev)
|
|
16
15
|
isJdApp,
|
|
17
16
|
isWxApp,
|
|
18
17
|
isIosDevice,
|
|
19
18
|
isAndroidDevice,
|
|
20
19
|
isJdAndIosDevice,
|
|
21
20
|
isJdAndAndroidDevice,
|
|
22
21
|
isWxMin,
|
|
23
22
|
isWxMinAndWxapp,
|
|
24
23
|
isJdMin,
|
|
25
24
|
isH5,
|
|
26
25
|
isH5AndJdShopView,
|
|
27
26
|
isH5AndJdShopViewNativeScroll,
|
|
28
27
|
isH5AndJingGouMini,
|
|
29
28
|
isWxMiniH5View,
|
|
30
29
|
urlCookie,
|
|
31
30
|
sliceArrToChunkList,
|
|
32
31
|
dealAddress,
|
|
33
32
|
objectToUrlEncode,
|
|
34
33
|
parseQueryUrlString,
|
|
35
34
|
setLowSmallPicUrl,
|
|
36
35
|
setTaroStorage,
|
|
37
36
|
getTaroStorageKeyValue,
|
|
38
37
|
removeTaroStorageKey,
|
|
39
38
|
clearTaroStorageKey,
|
|
40
39
|
getQualityImage,
|
|
41
40
|
countStringify,
|
|
42
41
|
getWxAppCookieStr,
|
|
43
42
|
getSystemInfos,
|
|
44
43
|
pxTransformFromData,
|
|
45
44
|
dateFormat,
|
|
46
45
|
throttle,
|
|
47
46
|
lodashThrottle,
|
|
48
47
|
debounce,
|
|
49
48
|
addHttps,
|
|
50
49
|
commonShowSuccessToast as showSuccessToast,
|
|
51
50
|
commonShowFailToast as showFailToast,
|
|
52
51
|
commonShowNormalToast as showNormalToast,
|
|
53
52
|
showShopLoading,
|
|
54
53
|
hideShopLoading,
|
|
55
54
|
getAppChannelType,
|
|
56
55
|
formatTabActiveMenuType,
|
|
57
56
|
filterUrlQueryData,
|
|
57
|
+
import Taro from '@tarojs/taro'
|
|
58
58
|
nativePageShowToast, ToastAndroidType,
|
|
59
59
|
ToastIosType,
|
|
60
60
|
getAppChannelType, isAndroidDevice, isH5AndJdShopView,
|
|
61
61
|
isH5AndJdShopViewNativeScroll, isIosDevice, isJdAndAndroidDevice, isJdAndIosDevice, isJdApp,
|
|
62
62
|
isWxApp, isWxMiniH5View, isH5AndJingGouMini, urlCookie,
|
|
63
63
|
sgmCustomReport, isMemberPage
|
|
64
64
|
addHttps,
|
|
65
65
|
clearTaroStorageKey,
|
|
66
66
|
countStringify,
|
|
67
67
|
dateFormat,
|
|
68
68
|
dealAddress,
|
|
69
69
|
dealShopContentData as originDealShopContentData,
|
|
70
70
|
debounce,
|
|
71
71
|
filterUrlQueryData,
|
|
72
72
|
formatTabActiveMenuType,
|
|
73
73
|
getQualityImage,
|
|
74
74
|
getTaroStorageKeyValue,
|
|
75
75
|
getWxAppCookieStr,
|
|
76
76
|
isH5,
|
|
77
77
|
isJdMin,
|
|
78
78
|
isWxMin,
|
|
79
79
|
isWxMinAndWxapp,
|
|
80
80
|
lodashThrottle,
|
|
81
81
|
objectToUrlEncode,
|
|
82
82
|
parseQueryUrlString,
|
|
83
83
|
removeTaroStorageKey,
|
|
84
84
|
setLowSmallPicUrl,
|
|
85
85
|
setTaroStorage,
|
|
86
86
|
showFailToast,
|
|
87
87
|
showNormalToast,
|
|
88
88
|
showSuccessToast,
|
|
89
89
|
sliceArrToChunkList,
|
|
90
90
|
throttle,
|
|
91
91
|
windowWidth: window.innerWidth,
|
|
92
92
|
screenWidth: window.innerWidth,
|
|
93
93
|
platform: '',
|
|
94
94
|
model: '',
|
|
95
95
|
system: '',
|
|
96
96
|
getSystemInfo.windowWidth = getSystemInfo.screenWidth
|
|
97
97
|
const params = Object.assign(
|
|
98
98
|
{},
|
|
99
99
|
{
|
|
100
100
|
title: '',
|
|
101
101
|
duration: 1500,
|
|
102
102
|
},
|
|
103
103
|
options,
|
|
104
104
|
)
|
|
105
105
|
params.duration = params.duration / 1000
|
|
106
106
|
if (isJdApp && isH5AndJdShopView) {
|
|
107
107
|
const showSuccessType = isIosDevice
|
|
108
108
|
? ToastIosType.SUCCESS
|
|
109
109
|
: ToastAndroidType.SUCCESS
|
|
110
110
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
111
111
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
112
112
|
console.log('执行原生toast success')
|
|
113
113
|
} else {
|
|
114
114
|
showSuccessToast(options)
|
|
115
115
|
}
|
|
116
116
|
const params = Object.assign(
|
|
117
117
|
{},
|
|
118
118
|
{
|
|
119
119
|
title: '',
|
|
120
120
|
duration: 1500,
|
|
121
121
|
},
|
|
122
122
|
options,
|
|
123
123
|
)
|
|
124
124
|
params.duration = params.duration / 1000
|
|
125
125
|
console.log(`isJdApp${isJdApp}`)
|
|
126
126
|
if (isJdApp && isH5AndJdShopView) {
|
|
127
127
|
const showSuccessType = isIosDevice
|
|
128
128
|
? ToastIosType.FAIL
|
|
129
129
|
: ToastAndroidType.FAIL
|
|
130
130
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
131
131
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
132
132
|
console.log('执行原生toast fail')
|
|
133
133
|
} else {
|
|
134
134
|
console.log('执行H5 toast fail')
|
|
135
135
|
showFailToast(options)
|
|
136
136
|
}
|
|
137
137
|
const params = Object.assign(
|
|
138
138
|
{},
|
|
139
139
|
{
|
|
140
140
|
title: '',
|
|
141
141
|
duration: 1500,
|
|
142
142
|
},
|
|
143
143
|
options,
|
|
144
144
|
)
|
|
145
145
|
params.duration = params.duration / 1000
|
|
146
146
|
if (isJdApp) {
|
|
147
147
|
const showSuccessType = isIosDevice
|
|
148
148
|
? ToastIosType.NORMAL
|
|
149
149
|
: ToastAndroidType.NORMAL
|
|
150
150
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
151
151
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
152
152
|
} else {
|
|
153
153
|
showNormalToast(options)
|
|
154
154
|
}
|
|
155
155
|
const createLoadingEle = document.createElement('div')
|
|
156
156
|
createLoadingEle.id = 'J_shopLoading'
|
|
157
157
|
createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`
|
|
158
158
|
createLoadingEle.innerHTML = `<div class='d-loading-content'>
|
|
159
159
|
<span class='d-shop-loading-icon'></span>
|
|
160
160
|
<p class='d-shop-text'>${text}</p>
|
|
161
161
|
</div>`
|
|
162
162
|
const getEle = document.body ? document.body : document.getElementsByTagName('body')[0]
|
|
163
163
|
console.log('获取getEle及append及appendChild方法', getEle, getEle?.append, getEle?.appendChild)
|
|
164
164
|
getEle.appendChild(createLoadingEle)
|
|
165
165
|
const getEle = document.getElementById('J_shopLoading')
|
|
166
166
|
getEle && getEle.remove()
|
|
167
167
|
num,
|
|
168
168
|
widthSize = 375,
|
|
169
169
|
layoutWidth = getSystemInfo.windowWidth,
|
|
170
170
|
const getNum = Number(num)
|
|
171
171
|
return Math.round((getNum / widthSize) * layoutWidth)
|
|
172
172
|
const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfo
|
|
173
173
|
if (!systemInfo.system && window) {
|
|
174
174
|
systemInfo.system = window.navigator.userAgent
|
|
175
175
|
systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i)
|
|
176
176
|
}
|
|
177
177
|
const isIOS = !!systemInfo?.system.match(/ios/i)
|
|
178
178
|
const isAndroid = !!systemInfo?.system.match(/android/i)
|
|
179
179
|
systemInfo.navBarHeight = 0
|
|
180
180
|
systemInfo.statusBarHeight = 0
|
|
181
181
|
systemInfo.capsulePosition = null
|
|
182
182
|
systemInfo.isIOS = isIOS
|
|
183
183
|
systemInfo.isAndroid = isAndroid
|
|
184
184
|
return systemInfo
|
|
185
185
|
return originDealShopContentData(pageData, DraJSAgentReport, isvdev)
|
|
186
186
|
isJdApp,
|
|
187
187
|
isWxApp,
|
|
188
188
|
isIosDevice,
|
|
189
189
|
isAndroidDevice,
|
|
190
190
|
isJdAndIosDevice,
|
|
191
191
|
isJdAndAndroidDevice,
|
|
192
192
|
isWxMin,
|
|
193
193
|
isWxMinAndWxapp,
|
|
194
194
|
isJdMin,
|
|
195
195
|
isH5,
|
|
196
196
|
isH5AndJdShopView,
|
|
197
197
|
isH5AndJdShopViewNativeScroll,
|
|
198
198
|
isH5AndJingGouMini,
|
|
199
199
|
isWxMiniH5View,
|
|
200
200
|
urlCookie,
|
|
201
201
|
sliceArrToChunkList,
|
|
202
202
|
dealAddress,
|
|
203
203
|
objectToUrlEncode,
|
|
204
204
|
parseQueryUrlString,
|
|
205
205
|
setLowSmallPicUrl,
|
|
206
206
|
setTaroStorage,
|
|
207
207
|
getTaroStorageKeyValue,
|
|
208
208
|
removeTaroStorageKey,
|
|
209
209
|
clearTaroStorageKey,
|
|
210
210
|
getQualityImage,
|
|
211
211
|
countStringify,
|
|
212
212
|
getWxAppCookieStr,
|
|
213
213
|
getSystemInfos,
|
|
214
214
|
pxTransformFromData,
|
|
215
215
|
dealShopContentDataAndReport as dealShopContentData,
|
|
216
216
|
dateFormat,
|
|
217
217
|
throttle,
|
|
218
218
|
lodashThrottle,
|
|
219
219
|
debounce,
|
|
220
220
|
addHttps,
|
|
221
221
|
commonShowSuccessToast as showSuccessToast,
|
|
222
222
|
commonShowFailToast as showFailToast,
|
|
223
223
|
commonShowNormalToast as showNormalToast,
|
|
224
224
|
showShopLoading,
|
|
225
225
|
hideShopLoading,
|
|
226
226
|
getAppChannelType,
|
|
227
227
|
formatTabActiveMenuType,
|
|
228
228
|
filterUrlQueryData,
|
|
229
229
|
sgmCustomReport,
|
|
230
230
|
isMemberPage,
|
|
231
231
|
memberFormatUtils
|