修改发布

This commit is contained in:
筱野
2025-08-23 21:39:46 +08:00
parent 8bc2fa8d97
commit c6f4f11259
29 changed files with 384 additions and 241 deletions

View File

@@ -0,0 +1,35 @@
import React from 'react'
import { View } from '@tarojs/components'
import { TextArea } from '@nutui/nutui-react-taro'
import './index.scss'
interface TitleTextareaProps {
value: string
onChange: (value: string) => void
maxLength?: number
placeholder?: string
}
const TitleTextarea: React.FC<TitleTextareaProps> = ({
value,
onChange,
maxLength = 20,
placeholder = '好的标题更吸引人哦'
}) => {
return (
<View className='title-input-wrapper'>
<TextArea
className='title-input'
placeholder={placeholder}
value={value}
onInput={(e) => onChange(e.detail.value)}
maxlength={maxLength}
autoSize={true}
placeholderClass='title-input-placeholder'
/>
<View className='char-count'>{value.length}/{maxLength}</View>
</View>
)
}
export default TitleTextarea

View File

@@ -0,0 +1,34 @@
.title-input-wrapper {
position: relative;
width: 100%;
display: flex;
align-items: flex-start;
justify-content: space-around;
.title-input {
width: 83%;
min-height: 44px;
padding: 12px 16px;
border-radius: 8px;
font-size: 16px;
line-height: 1.4;
background: #fff;
box-sizing: border-box;
resize: none;
}
// 使用 placeholderClass 来控制 placeholder 样式
.title-input-placeholder {
color: rgba(60, 60, 67, 0.60) !important;
font-size: 16px !important;
font-weight: normal !important;
}
.char-count {
font-size: 12px;
color: #999;
pointer-events: none;
padding-top: 12px;
}
}

View File

@@ -0,0 +1 @@
export { default } from './TitleTextarea'