修改弹窗
This commit is contained in:
@@ -25,6 +25,7 @@ const AiImportPopup: React.FC<AiImportPopupProps> = ({
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [uploadLoading, setUploadLoading] = useState(false)
|
||||
const maxFailCount = 3
|
||||
const isCharCountExceeded = text.length > 100
|
||||
|
||||
// 获取 actions(在组件顶层调用 Hook)
|
||||
const { setPublishData } = usePublishBallActions()
|
||||
@@ -56,6 +57,7 @@ const AiImportPopup: React.FC<AiImportPopupProps> = ({
|
||||
}
|
||||
const handlePasteAndRecognize = async () => {
|
||||
if (text) {
|
||||
if (text.length > 100) return;
|
||||
textIdentification(text)
|
||||
} else {
|
||||
getClipboardData()
|
||||
@@ -71,6 +73,7 @@ const AiImportPopup: React.FC<AiImportPopupProps> = ({
|
||||
duration: 2,
|
||||
wordBreak:'break-word'
|
||||
})
|
||||
if (res.data.length > 100) return;
|
||||
textIdentification(res.data)
|
||||
// Taro.showToast({
|
||||
// title: '已读取你的剪切板信息',
|
||||
@@ -220,7 +223,7 @@ const AiImportPopup: React.FC<AiImportPopupProps> = ({
|
||||
onFocus={() => {}}
|
||||
onBlur={() => {}}
|
||||
placeholder="在此「粘贴识别」或输入文本,智能拆分球局时间、费用、地点和其他信息,并帮你智能生成球局标题"
|
||||
maxlength={100}
|
||||
maxlength={-1}
|
||||
showConfirmBar={false}
|
||||
placeholderClass={styles.textArea_placeholder}
|
||||
autoHeight
|
||||
@@ -228,7 +231,9 @@ const AiImportPopup: React.FC<AiImportPopupProps> = ({
|
||||
adjustPosition={false}
|
||||
/>
|
||||
<View className={styles.charCount}>
|
||||
<Text className={styles.charCountText}>{text.length}/100</Text>
|
||||
<Text className={`${styles.charCountText} ${isCharCountExceeded ? styles.charCountTextExceeded : ''}`}>
|
||||
{text.length}/100
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user