11import React , { useState , useEffect , CSSProperties } from 'react'
22import { Cell , InfiniteLoading , Toast } from '@nutui/nutui-react-taro'
3+ import { View } from '@tarojs/components'
4+ import pxTransform from '@/utils/px-transform'
35
46const sleep = ( time : number ) : Promise < unknown > =>
57 new Promise ( ( resolve ) => {
68 setTimeout ( resolve , time )
79 } )
810const InfiniteUlStyle : CSSProperties = {
9- height : '300px' ,
11+ height : pxTransform ( 200 ) ,
1012 width : '100%' ,
1113 padding : '0' ,
1214 overflowY : 'auto' ,
1315 overflowX : 'hidden' ,
1416}
1517
1618const InfiniteLiStyle : CSSProperties = {
17- marginTop : '10px' ,
18- fontSize : '14px' ,
19+ marginTop : pxTransform ( 10 ) ,
20+ fontSize : pxTransform ( 14 ) ,
1921 color : 'rgba(100, 100, 100, 1)' ,
2022 textAlign : 'center' ,
2123}
@@ -62,13 +64,13 @@ const Demo2 = () => {
6264 return (
6365 < >
6466 < Cell >
65- < ul id = "refreshScroll" style = { InfiniteUlStyle } >
67+ < View id = "refreshScroll" style = { InfiniteUlStyle } >
6668 < InfiniteLoading
6769 pullingText = {
6870 < >
6971 < img
7072 alt = ""
71- style = { { height : '26px' , width : '36px' } }
73+ style = { { height : pxTransform ( 36 ) , width : pxTransform ( 36 ) } }
7274 src = "https://img13.360buyimg.com/imagetools/jfs/t1/219180/19/37902/438/65fa8cbbF5278d022/5eabe69b64bba791.png"
7375 className = "nut-infinite-top-tips-icons"
7476 />
@@ -79,7 +81,7 @@ const Demo2 = () => {
7981 < >
8082 < img
8183 alt = ""
82- style = { { height : '24px' , width : '24px' } }
84+ style = { { height : pxTransform ( 24 ) , width : pxTransform ( 24 ) } }
8385 src = "https://img11.360buyimg.com/imagetools/jfs/t1/180248/35/42577/173/65fab7e9Fa868ae37/41e33477f960b5b2.png"
8486 className = "nut-infinite-bottom-tips-icons"
8587 />
@@ -94,13 +96,17 @@ const Demo2 = () => {
9496 >
9597 { refreshList . map ( ( item , index ) => {
9698 return (
97- < li className = "infiniteLi" key = { index } style = { InfiniteLiStyle } >
99+ < View
100+ className = "infiniteLi"
101+ key = { index }
102+ style = { InfiniteLiStyle }
103+ >
98104 { item }
99- </ li >
105+ </ View >
100106 )
101107 } ) }
102108 </ InfiniteLoading >
103- </ ul >
109+ </ View >
104110 < Toast
105111 type = "text"
106112 visible = { show }
0 commit comments