修改学员信息页面

v2
king 1 year ago
parent 13c6a2d7b9
commit a70dcc2de1
  1. 2
      src/components/learningRecord/learningRecord.module.scss
  2. 3
      src/components/lineChart/lineChart.module.scss
  3. 3
      src/components/popPut/popPut.tsx
  4. 1
      src/pages/manage/depAdmin/depAdmin.tsx
  5. 13
      src/pages/manage/userInfo/components/info.tsx
  6. 26
      src/pages/manage/userInfo/userInfo.module.scss
  7. 8
      src/pages/manage/userInfo/userInfo.tsx

@ -9,7 +9,7 @@
}
.total {
font-size: 40px;
font-size: 40rpx;
font-family: PingFang SC-Heavy, PingFang SC;
font-weight: 800;
color: #323635;

@ -22,10 +22,11 @@
}
.records {
font-size: 30rpx;
font-size: 28rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #323635;
margin-top: 18rpx;
margin-bottom: 42rpx;
}

@ -16,6 +16,7 @@ interface Props {
onClick?: () => void
no_border?: boolean
leftImage?: string
errorType?: "acquiesce" | 'avatar'
}
const PopPut: FC<Props> = ({title, chevron, content, image, isProp, children, show, ...opt}: Props) => {
@ -47,7 +48,7 @@ const PopPut: FC<Props> = ({title, chevron, content, image, isProp, children, sh
<>
<View className='card' onClick={click} style={style()}>
<View className='flex align-center'>
{opt.leftImage != null && <Img width={68} height={68} src={opt.leftImage} className='mr-3' mode='aspectFit'/>}
{opt.leftImage != null && <Img errorType={opt.errorType} width={68} height={68} src={opt.leftImage} className='mr-3' mode='aspectFit'/>}
<View>{title}</View>
</View>
<View className='card-content'>

@ -151,6 +151,7 @@ const DepAdmin: FC = () => {
/>)}
{users.map(d => <PopPut
errorType='avatar'
key={d.id}
leftImage={d.avatar}
title={d.name}

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

@ -1,8 +1,16 @@
.page {
padding: 15rpx;
padding: 30rpx;
}
.box {
background: #fff;
border-radius: 20rpx;
padding: 32rpx;
display: flex;
align-items: center;
box-sizing: border-box;
line-height: 1.75;
}
.image {
width: 120rpx;
@ -13,8 +21,10 @@
.tag {
background: #00D6AC;
font-size: 24rpx;
color: #fff;
font-size: 22rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
margin-left: 20rpx;
padding: 3rpx 10rpx;
border-radius: 8rpx;
@ -23,8 +33,10 @@
.tag_muted {
background: #909795;
font-size: 24rpx;
color: #fff;
font-size: 22rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
margin-left: 20rpx;
padding: 3rpx 10rpx;
border-radius: 8rpx;
@ -32,6 +44,8 @@
}
.information {
height: 96rpx;
box-sizing: border-box;
width: 100%;
color: #606563;
padding: 20rpx 0;

@ -79,7 +79,7 @@ const UserInfo: FC = () => {
<LearningRecord userId={userId}/>
<View className='mt-5'>
<View className='mt-2'>
{
data?.role_type !== 2
&& <MyButton onClick={setRoleType}>{['设置为管理员', '设置为学员'][data?.role_type || 0]}</MyButton>
@ -87,14 +87,12 @@ const UserInfo: FC = () => {
<MyButton
type='default'
style={{background: '#fff'}}
onClick={() => Taro.navigateTo({url: "/pages/manage/addStudent/addStudent?id=" + userId})}
className={'mt-3'}>
onClick={() => Taro.navigateTo({url: "/pages/manage/addStudent/addStudent?id=" + userId})}>
</MyButton>
<MyButton
type='default'
style={{background: '#fff', color: 'red'}}
className={'mt-3'}
style={{background: '#fff', color: 'red', marginTop: "16rpx"}}
onClick={delUser}>
</MyButton>

Loading…
Cancel
Save