修改ScrollView样式和隐藏滚动条

v2
king 1 year ago
parent 3a777d0b57
commit aeb6e1bbc5
  1. 2
      config/index.js
  2. 30
      src/components/lineChart/lineChart.module.scss
  3. 13
      src/components/lineChart/lineChart.tsx
  4. 4
      src/pages/manage/depAdmin/depAdmin.scss
  5. 15
      src/pages/manage/userInfo/components/info.tsx
  6. 19
      src/pages/manage/userInfo/userInfo.module.scss

@ -20,7 +20,7 @@ const config = {
framework: 'react', framework: 'react',
compiler: 'webpack5', compiler: 'webpack5',
cache: { cache: {
enable: true // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache enable: false // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
}, },
sass: {}, sass: {},
alias: { alias: {

@ -3,8 +3,18 @@
align-items: flex-end; align-items: flex-end;
justify-content: left; justify-content: left;
flex-wrap: nowrap; flex-wrap: nowrap;
height: 400px; height: 380px;
position: relative; position: relative;
padding-bottom: 10rpx;
}
.overlay {
width: 100%;
height: 10rpx;
background: #fff;
position: absolute;
bottom: 0;
left: 0
} }
.empty { .empty {
@ -19,7 +29,7 @@
align-items: center; align-items: center;
background: rgba(#fff, .9); background: rgba(#fff, .9);
view{ view {
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
@ -54,6 +64,22 @@
overflow: hidden; overflow: hidden;
animation: rise 300ms ease-in-out forwards; animation: rise 300ms ease-in-out forwards;
max-height: 0; max-height: 0;
margin-top: 10rpx;
}
.value {
whiteSpace: nowrap;
font-size: 20rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #606563;
}
.time {
font-size: 20rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #323635;
} }
.line { .line {

@ -29,12 +29,12 @@ const LineChart: FC<Props> = ({data}) => {
}, [data]) }, [data])
return ( return (
<> <View style={{width: '100%', position: 'relative'}}>
<View className={style.records}> <View className={style.records}>
<Text>{formatDateTime(new Date(maxHeight.time), 'MM月dd日')}</Text> <Text>{formatDateTime(new Date(maxHeight.time), 'MM月dd日')}</Text>
{maxHeight.value > 0 ? `日最努力` : `期间没有学习记录`}{formatTime(maxHeight.value, 0)} {maxHeight.value > 0 ? `日最努力` : `期间没有学习记录`}{formatTime(maxHeight.value, 0)}
</View> </View>
<ScrollView scrollX={!!maxHeight.value} enhanced showScrollbar={false}> <ScrollView scrollX={!!maxHeight.value} enhanced showScrollbar={false} type='list'>
<View className={style.lineChart}> <View className={style.lineChart}>
{ {
!maxHeight.value && <View className={style.empty}> !maxHeight.value && <View className={style.empty}>
@ -45,19 +45,20 @@ const LineChart: FC<Props> = ({data}) => {
{ {
!!maxHeight.value !!maxHeight.value
&& lineChartList.map(d => <View key={d.time}> && lineChartList.map(d => <View key={d.time}>
<View className={style.columnBox} style={{width: "100px"}}> <View className={style.columnBox} style={{width: "80px"}}>
<View className={style.line} style={{height: height - 10 - (d.value / maxHeight.value * height) + "px"}}/> <View className={style.line} style={{height: height - 10 - (d.value / maxHeight.value * height) + "px"}}/>
{ {
d.value > 0 && <View style={{whiteSpace: "nowrap"}}>{formatTime(d.value, 0)}</View> d.value > 0 && <View className={style.value}>{formatTime(d.value, 0)}</View>
} }
<View className={style.column} style={{height: d.value / maxHeight.value * height + "px"}}/> <View className={style.column} style={{height: d.value / maxHeight.value * height + "px"}}/>
<View>{d.time}</View> <View className={style.time}>{d.time}</View>
</View> </View>
</View>) </View>)
} }
</View> </View>
</ScrollView> </ScrollView>
</> <View className={style.overlay}/>
</View>
) )
} }

@ -3,7 +3,7 @@
background: white; background: white;
min-height: calc(100vh - 20rpx - env(safe-area-inset-bottom)); min-height: calc(100vh - 20rpx - env(safe-area-inset-bottom));
box-sizing: border-box; box-sizing: border-box;
padding-bottom: calc(env(safe-area-inset-bottom) + 80rpx); padding-bottom: calc(env(safe-area-inset-bottom) + 100rpx);
} }
.operation { .operation {
@ -16,7 +16,7 @@
left: 0; left: 0;
.safeAreaInsetBottom { .safeAreaInsetBottom {
height: 80rpx; height: 100rpx;
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);

@ -14,16 +14,15 @@ const Info: FC<Props> = ({data}) => {
<> <>
<View className={styles.box} style={{height: '184rpx'}}> <View className={styles.box} style={{height: '184rpx'}}>
<Img width={120} height={120} src={data?.avatar || ''} className={styles.image} errorType='avatar'/> <Img width={120} height={120} src={data?.avatar || ''} className={styles.image} errorType='avatar'/>
<View className='ml-2'> <View className='ml-3'>
<View> <View className='flex align-center'>
<Text className='font-weight font-32'>{data?.name}</Text> <Text className='font-weight font-32'>{data?.name}</Text>
<Text <View
className={data?.is_lock ? styles.tag_muted : styles.tag}> className={data?.is_lock ? styles.tag_muted : styles.tag}>
{data?.is_lock ? '禁用' : '正常'} {data?.is_lock ? '禁用' : '正常'}
</Text>
</View> </View>
<View className='text-muted font-28' </View>
style={{marginTop: '2px'}}> <View className='text-muted font-28 mt-2'>
{['学员', '管理员', '超级管理员'][data?.role_type || 0]} {['学员', '管理员', '超级管理员'][data?.role_type || 0]}
</View> </View>
</View> </View>
@ -31,11 +30,11 @@ const Info: FC<Props> = ({data}) => {
<View className={`${styles.box}`} style={{display: 'block', margin: '16rpx 0', padding: '0 32rpx'}}> <View className={`${styles.box}`} style={{display: 'block', margin: '16rpx 0', padding: '0 32rpx'}}>
<View className={styles.information} style={{borderBottom: "1px solid #F5F8F7"}}> <View className={styles.information} style={{borderBottom: "1px solid #F5F8F7"}}>
<Text style={{width: '100px', display: 'inline-block'}}></Text> <Text style={{width: '100px', display: 'inline-block', color: '#323635'}}></Text>
<Text>{data?.id}</Text> <Text>{data?.id}</Text>
</View> </View>
<View className={styles.information}> <View className={styles.information}>
<Text style={{width: '100px', display: 'inline-block'}}></Text> <Text style={{width: '100px', display: 'inline-block', color: '#323635'}}></Text>
<Text>{data?.phone_number}</Text> <Text>{data?.phone_number}</Text>
</View> </View>
</View> </View>

@ -10,6 +10,8 @@
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
line-height: 1.75; line-height: 1.75;
color: #606563;
font-family: PingFang SC-Regular, PingFang SC;
} }
.image { .image {
@ -25,10 +27,14 @@
font-family: PingFang SC-Regular, PingFang SC; font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
margin-left: 20rpx; margin-left: 16rpx;
padding: 3rpx 10rpx;
border-radius: 8rpx; border-radius: 8rpx;
box-sizing: border-box; box-sizing: border-box;
height: 32rpx;
width: 60rpx;
display: inline-flex;
justify-content: center;
align-items: center;
} }
.tag_muted { .tag_muted {
@ -37,17 +43,20 @@
font-family: PingFang SC-Regular, PingFang SC; font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
margin-left: 20rpx; margin-left: 16rpx;
padding: 3rpx 10rpx;
border-radius: 8rpx; border-radius: 8rpx;
box-sizing: border-box; box-sizing: border-box;
height: 32rpx;
width: 60rpx;
display: inline-flex;
justify-content: center;
align-items: center;
} }
.information { .information {
height: 96rpx; height: 96rpx;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
color: #606563;
padding: 20rpx 0; padding: 20rpx 0;
} }

Loading…
Cancel
Save