@conecli/cone-render 0.8.15-beta.44 → 0.8.15-beta.46
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import React, { Suspense, lazy } from 'react'
|
|
1
|
+
import React, { Suspense, lazy } from 'react'
|
|
2
2
|
console.log('>>>>>>>>>> floorModuleType === FloorModuleType.ISVDESIGNERH5MODULE >>>>>>>>>>')
|
|
3
3
|
try {
|
|
4
4
|
console.log('>>>>>>>>>> 开始渲染1个isv模块 >>>>>>>>>>')
|
|
5
5
|
console.log('==========当前业务类型renderSourceType、楼层floorId: ', renderSourceType, floorData.uid)
|
|
6
6
|
const modularPackResult = floorData?.floorExtInfo?.modularPackResult
|
|
7
7
|
const modularPackResultObj = typeof modularPackResult === 'string' ? JSON.parse(modularPackResult) : modularPackResult
|
|
8
8
|
|
|
9
9
|
if (modularPackResultObj) {
|
|
10
10
|
const { bundleUrl, bundleFileName } = modularPackResultObj
|
|
11
11
|
if (bundleUrl && bundleFileName) {
|
|
12
12
|
let ISVModule = taroJdBaseInfo?.renderedIsvComponents[`${floorData.uid}_${bundleFileName}`] || null
|
|
13
13
|
if (!ISVModule) {
|
|
14
14
|
ISVModule = lazy(() => import(bundleFileName + '@@@@@@' + bundleUrl))
|
|
15
15
|
console.log('1|加载isv模块==========走lazy import生成新的isv模块react组件', bundleFileName)
|
|
16
16
|
taroJdBaseInfo.renderedIsvComponents[`${floorData.uid}_${bundleFileName}`] = ISVModule
|
|
17
17
|
console.log('2|渲染isv模块的react组件==========,window.taroJshopH5WebpackJsonp上的组件是否已就绪: ', bundleFileName, window['taroJshopH5WebpackJsonp'].find(item => item[0][0] == bundleFileName))
|
|
18
18
|
} else {
|
|
19
19
|
console.log('1|加载isv模块==========不走lazy import生成新的isv模块react组件,从已加载中获取,taroJdBaseInfo: ', taroJdBaseInfo)
|
|
20
20
|
console.log('2|渲染isv模块的react组件==========,taroJdBaseInfo.renderedIsvComponents上的组件是否已就绪: ', taroJdBaseInfo.renderedIsvComponents[`${floorData.uid}_${bundleFileName}`])
|
|
21
21
|
}
|
|
22
22
|
const _floorHeight = getFloorSetHeight(floorData)
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
25
|
<ErrorBoundary {...props}>
|
|
26
26
|
<Suspense fallback={<View style={{
|
|
27
27
|
position: 'relative',
|
|
28
28
|
background: `#ffffff url('${JD_PLACEHOLDER_IMG}') center center no-repeat`,
|
|
29
29
|
height: `${_floorHeight}px`,
|
|
30
30
|
}}></View>}>
|
|
31
31
|
<ISVFloor {...props} dataDefines={dataDefines}>
|
|
32
32
|
<ISVModule {...props} dataDefines={dataDefines}></ISVModule>
|
|
33
33
|
</ISVFloor>
|
|
34
34
|
</Suspense>
|
|
35
35
|
</ErrorBoundary >
|
|
36
36
|
)
|
|
37
37
|
} else {
|
|
38
38
|
console.log('3|isv模块渲染异常,modularPackResult中缺少bundleUrl或bundleFileName==========modularPackResult: ', modularPackResultObj)
|
|
39
39
|
console.log('==========bundleUrl: ', bundleUrl)
|
|
40
40
|
console.log('==========bundleFileName: ', bundleFileName)
|
|
41
41
|
return null
|
|
42
42
|
}
|
|
43
43
|
} else {
|
|
44
44
|
console.log('3|isv模块渲染异常,缺少modularPackResult==========modularPackResult: ', modularPackResultObj)
|
|
45
45
|
return null
|
|
46
46
|
}
|
|
47
47
|
} catch (err) {
|
|
48
48
|
console.log('3|isv模块渲染异常,floorItem逻辑错误==========err: ', err)
|
|
49
49
|
DraException.JSAgent.reportException(err)
|
|
50
50
|
return null
|
|
51
51
|
}
|
|
52
52
|
})()
|
|
53
53
|
if(renderResult === null){
|
|
54
54
|
console.log('renderResult === null: 命中了!')
|
|
55
55
|
taroEventSendPageScrollInfo()
|
|
56
56
|
}else{
|
|
57
57
|
console.log('renderResult !== null: 没命中', renderResult)
|
|
58
58
|
}
|
|
59
59
|
return renderResult
|
|
@@ -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
|
}
|
|
9
|
+
import Taro from '@tarojs/taro'
|
|
10
10
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] = {
|
|
11
11
|
displayHeight: 1920,
|
|
12
12
|
offSetY: 0
|
|
13
13
|
}
|
|
14
14
|
console.log('>>>>>>>>>>>>>>>>>>> render taroEventSendPageScrollInfo origin time:', Date.now(), 'res:', options)
|
|
15
15
|
if(options){
|
|
16
16
|
latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] = options
|
|
17
17
|
}
|
|
18
18
|
const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
|