1
This commit is contained in:
@@ -82,10 +82,11 @@
|
||||
|
||||
// 内容区域
|
||||
.modal_content {
|
||||
padding: 0px 16px 20px;
|
||||
padding: 16px 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.input_container {
|
||||
display: flex;
|
||||
@@ -96,7 +97,13 @@
|
||||
border-radius: 12px;
|
||||
padding: 10px 16px;
|
||||
box-shadow: 0px 4px 36px 0px rgba(0, 0, 0, 0.06);
|
||||
min-height: 120px;
|
||||
|
||||
|
||||
// 名字输入时的容器样式
|
||||
&:has(.nickname_input) {
|
||||
min-height: 40px;
|
||||
padding: 10px 16px;
|
||||
}
|
||||
|
||||
.text_input {
|
||||
flex: 1;
|
||||
@@ -109,11 +116,21 @@
|
||||
background: transparent;
|
||||
outline: none;
|
||||
resize: none;
|
||||
min-height: 80px;
|
||||
|
||||
min-height: 120px;
|
||||
|
||||
&::placeholder {
|
||||
color: rgba(60, 60, 67, 0.3);
|
||||
}
|
||||
|
||||
// 名字输入特殊样式
|
||||
&.nickname_input {
|
||||
min-height: 80px;
|
||||
min-height: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.char_count {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { View, Text, Textarea, Button } from '@tarojs/components';
|
||||
import { View, Text, Textarea, Input, Picker } from '@tarojs/components';
|
||||
import Taro from '@tarojs/taro';
|
||||
import './EditModal.scss';
|
||||
|
||||
interface EditModalProps {
|
||||
visible: boolean;
|
||||
title: string;
|
||||
type: string;
|
||||
placeholder: string;
|
||||
initialValue: string;
|
||||
maxLength: number;
|
||||
@@ -17,6 +18,7 @@ interface EditModalProps {
|
||||
const EditModal: React.FC<EditModalProps> = ({
|
||||
visible,
|
||||
title,
|
||||
type,
|
||||
placeholder,
|
||||
initialValue,
|
||||
maxLength,
|
||||
@@ -82,17 +84,34 @@ const EditModal: React.FC<EditModalProps> = ({
|
||||
<View className="modal_content">
|
||||
{/* 文本输入区域 */}
|
||||
<View className="input_container">
|
||||
<Textarea
|
||||
className="text_input"
|
||||
|
||||
{type === 'nickname' ? (
|
||||
<Input
|
||||
className="text_input nickname_input"
|
||||
value={value}
|
||||
type="nickname"
|
||||
placeholder={placeholder}
|
||||
maxlength={maxLength}
|
||||
onInput={handle_input_change}
|
||||
adjustPosition={true}
|
||||
confirmType="done"
|
||||
autoFocus={true}
|
||||
/>
|
||||
<View className="char_count">
|
||||
<Text className="count_text">{value.length}/{maxLength}</Text>
|
||||
</View>
|
||||
) : (
|
||||
<>
|
||||
<Textarea
|
||||
className="text_input"
|
||||
value={value}
|
||||
placeholder={placeholder}
|
||||
maxlength={maxLength}
|
||||
onInput={handle_input_change}
|
||||
autoFocus={true}
|
||||
/>
|
||||
<View className="char_count">
|
||||
<Text className="count_text">{value.length}/{maxLength}</Text>
|
||||
</View>
|
||||
</>
|
||||
)}
|
||||
</View>
|
||||
|
||||
{/* 验证提示 */}
|
||||
|
||||
@@ -15,7 +15,7 @@ export interface UserInfo {
|
||||
hosted: number;
|
||||
participated: number;
|
||||
};
|
||||
bio: string;
|
||||
personal_profile: string;
|
||||
location: string;
|
||||
occupation: string;
|
||||
ntrp_level: string;
|
||||
@@ -155,7 +155,7 @@ export const UserInfoCard: React.FC<UserInfoCardProps> = ({
|
||||
<Text className="tag_text">{user_info.location || '未设置'}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<Text className="bio_text">{user_info.bio}</Text>
|
||||
<Text className="bio_text">{user_info.personal_profile}</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user