@conecli/cone-render 0.10.1-beta.4 → 0.10.1-beta.5
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.weapp.ts +1 -1
- package/dist/common/sgmCustomCode.ts +1 -1
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CustomScrollView/index.tsx +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.weapp.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/index.h5.module.scss +3 -0
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +3 -0
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/decorate/DecorateFloorModule/index.module.scss +11 -0
- package/dist/components/decorate/DecorateFloorModule/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.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/service.ts +1 -1
- package/dist/jumpEventReport/base.ts +1 -1
- package/dist/jumpEventReport/const.ts +1 -1
- package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
- package/dist/jumpEventReport/web.base.ts +1 -1
- package/dist/jumpEventReport/web.jd.ts +1 -1
- package/dist/modules/ContainerFloorList/index.h5.module.scss +1 -0
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/open/api/device.ts +1 -1
- package/dist/open/api/request.ts +1 -1
- package/dist/open/api/shopMember.ts +1 -1
- package/dist/open/api/util.ts +1 -1
- package/dist/open/components/index.ts +1 -1
- package/dist/sass/app.h5.scss +5 -0
- package/dist/sass/base.scss +45 -0
- package/dist/service/requestServer.ts +1 -1
- package/dist/utils/connectNativeJsBridge.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/sgmCodeUtils.ts +1 -1
- package/dist/utils/taroRenderUtil.ts +1 -1
- package/dist/utils/utils.ts +1 -1
- package/package.json +24 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
SECTION_HOME_TAB_TYPE,
|
|
3
2
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
4
3
|
const {
|
|
5
4
|
children,
|
|
6
5
|
containerId,
|
|
7
6
|
type,
|
|
8
7
|
placeholder,
|
|
9
8
|
height,
|
|
10
9
|
sectionType,
|
|
11
10
|
lazyNodeClassName,
|
|
12
11
|
} = props
|
|
13
12
|
const [componentShowState, setComponentShowState] = useState(false)
|
|
14
13
|
const componentLazyRef = useRef<HTMLElement | null>(null)
|
|
15
14
|
const lazyLayoutLoadFloor =
|
|
16
15
|
'lazy-layout-load-floor' + Math.floor(Math.random() * 10000000)
|
|
17
16
|
useEffect(() => {
|
|
18
17
|
Taro.nextTick(() => {
|
|
19
18
|
const createIntersectionObserver = new intersectionObserver({
|
|
20
19
|
selector: `.${lazyLayoutLoadFloor}`,
|
|
21
20
|
context: this,
|
|
22
21
|
onFinal: () => {
|
|
23
22
|
setComponentShowState(true)
|
|
24
23
|
createIntersectionObserver.disconnect()
|
|
25
24
|
},
|
|
26
25
|
})
|
|
27
26
|
createIntersectionObserver.connect()
|
|
28
27
|
})
|
|
29
28
|
}, [])
|
|
30
29
|
return type === LazyType.IMAGE ? (
|
|
31
30
|
children
|
|
32
31
|
) : (
|
|
33
32
|
<View
|
|
34
33
|
id={`${containerId}_lazy`}
|
|
35
34
|
ref={componentLazyRef}
|
|
36
35
|
className={classNames(
|
|
37
36
|
lazyLayoutLoadStyle['d-app-floor-lazy-layout-load'],
|
|
38
37
|
'd-app-floor-lazy-load',
|
|
39
38
|
lazyLayoutLoadFloor,
|
|
40
39
|
)}
|
|
41
40
|
style={{
|
|
42
41
|
minHeight: `${componentShowState ? 'auto' : height + 'px'}`,
|
|
43
42
|
backgroundColor: componentShowState ? 'transparent' : '#ffffff',
|
|
44
43
|
}}
|
|
45
44
|
>
|
|
46
45
|
{componentShowState ? children : placeholder}
|
|
47
46
|
</View>
|
|
48
47
|
)
|
|
49
48
|
sectionType:
|
|
50
49
|
SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN],
|
|
51
50
|
type: LazyType.FLOOR,
|
|
52
51
|
children: null,
|
|
53
52
|
placeholder: null,
|
|
54
53
|
height: 200,
|
|
55
54
|
className: '',
|
|
56
55
|
lazyNodeClassName: '',
|
|
56
|
+
import Taro from '@tarojs/taro'
|
|
57
57
|
SECTION_HOME_TAB_TYPE,
|
|
58
58
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
59
59
|
const {
|
|
60
60
|
sectionType = SECTION_HOME_TAB_NAME_TYPE[
|
|
61
61
|
SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN
|
|
62
62
|
],
|
|
63
63
|
type = LazyType.FLOOR,
|
|
64
64
|
children = null,
|
|
65
65
|
placeholder = null,
|
|
66
66
|
height = 200,
|
|
67
67
|
className = '',
|
|
68
68
|
lazyNodeClassName = '',
|
|
69
69
|
containerId,
|
|
70
70
|
} = props
|
|
71
71
|
const [componentShowState, setComponentShowState] = useState(false)
|
|
72
72
|
const componentLazyRef = useRef<HTMLElement | null>(null)
|
|
73
73
|
const lazyLayoutLoadFloor =
|
|
74
74
|
'lazy-layout-load-floor' + Math.floor(Math.random() * 10000000)
|
|
75
75
|
useEffect(() => {
|
|
76
76
|
Taro.nextTick(() => {
|
|
77
77
|
const createIntersectionObserver = new intersectionObserver({
|
|
78
78
|
selector: `.${lazyLayoutLoadFloor}`,
|
|
79
79
|
context: this,
|
|
80
80
|
onFinal: () => {
|
|
81
81
|
setComponentShowState(true)
|
|
82
82
|
createIntersectionObserver.disconnect()
|
|
83
83
|
},
|
|
84
84
|
})
|
|
85
85
|
createIntersectionObserver.connect()
|
|
86
86
|
})
|
|
87
87
|
}, [])
|
|
88
88
|
return type === LazyType.IMAGE ? (
|
|
89
89
|
children
|
|
90
90
|
) : (
|
|
91
91
|
<View
|
|
92
92
|
id={`${containerId}_lazy`}
|
|
93
93
|
ref={componentLazyRef}
|
|
94
94
|
className={classNames(
|
|
95
95
|
lazyLayoutLoadStyle['d-app-floor-lazy-layout-load'],
|
|
96
96
|
'd-app-floor-lazy-load',
|
|
97
97
|
lazyLayoutLoadFloor,
|
|
98
98
|
)}
|
|
99
99
|
style={{
|
|
100
100
|
minHeight: `${componentShowState ? 'auto' : height + 'px'}`,
|
|
101
101
|
backgroundColor: componentShowState ? 'transparent' : '#ffffff',
|
|
102
102
|
}}
|
|
103
103
|
>
|
|
104
104
|
{componentShowState ? children : placeholder}
|
|
105
105
|
</View>
|
|
106
106
|
)
|