From fd1c75bcdfd33d2823e0760d63cf651a816b01d6 Mon Sep 17 00:00:00 2001 From: xiaoyatong Date: Tue, 23 Jul 2024 14:00:01 +0800 Subject: [PATCH] fix: change view --- src/packages/timedetail/timedetail.taro.tsx | 9 +++-- src/packages/timeselect/demo.taro.tsx | 13 +++--- src/packages/timeselect/timeselect.taro.tsx | 17 ++++---- src/packages/toast/demo.taro.tsx | 16 ++++---- src/packages/uploader/preview.taro.tsx | 44 ++++++++++----------- 5 files changed, 51 insertions(+), 48 deletions(-) diff --git a/src/packages/timedetail/timedetail.taro.tsx b/src/packages/timedetail/timedetail.taro.tsx index af8be2f105..afec88e42c 100644 --- a/src/packages/timedetail/timedetail.taro.tsx +++ b/src/packages/timedetail/timedetail.taro.tsx @@ -1,5 +1,6 @@ import React, { FunctionComponent, useCallback, useMemo } from 'react' import classNames from 'classnames' +import { View } from '@tarojs/components' import { BasicComponent, ComponentDefaults } from '@/utils/typings' import { TimeType, @@ -60,9 +61,9 @@ export const TimeDetail: FunctionComponent< [activeTime, optionKey, activeDate] ) return ( -
+ {timeList[optionKey.childrenKey].map((item: TimeType) => ( - onSelect(item)} > {item[optionKey.textKey]} - + ))} -
+ ) } diff --git a/src/packages/timeselect/demo.taro.tsx b/src/packages/timeselect/demo.taro.tsx index c82b4bb155..309e5bcaee 100644 --- a/src/packages/timeselect/demo.taro.tsx +++ b/src/packages/timeselect/demo.taro.tsx @@ -1,5 +1,6 @@ import React from 'react' import Taro from '@tarojs/taro' +import { ScrollView, View } from '@tarojs/components' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' import Demo1 from './demos/taro/demo1' @@ -32,16 +33,16 @@ const TimeSelectDemo = () => { return ( <>
-
-

{translated.basic}

+ + {translated.basic} -

{translated.optionKey}

+ {translated.optionKey} -

{translated.multiple}

+ {translated.multiple} -

{translated.custom}

+ {translated.custom} -
+ ) } diff --git a/src/packages/timeselect/timeselect.taro.tsx b/src/packages/timeselect/timeselect.taro.tsx index f3bfe88d37..25724c3964 100644 --- a/src/packages/timeselect/timeselect.taro.tsx +++ b/src/packages/timeselect/timeselect.taro.tsx @@ -1,5 +1,6 @@ import React, { FunctionComponent, ReactNode, useState } from 'react' import classNames from 'classnames' +import { View } from '@tarojs/components' import Popup from '@/packages/popup/index.taro' import TimeDetail from '@/packages/timedetail/index.taro' import { BasicComponent, ComponentDefaults } from '@/utils/typings' @@ -152,11 +153,11 @@ export const TimeSelect: FunctionComponent> = ( onClose={closeFun} {...rest} > -
-
-
+ + + {options.map((item: DateType) => ( -
> = ( onClick={() => handleChange(item)} > {item[optionKey.textKey]} -
+
))} -
+ > = ( activeTime={activeTime} onSelect={handleSelectTime} /> -
-
+ + ) } diff --git a/src/packages/toast/demo.taro.tsx b/src/packages/toast/demo.taro.tsx index 2536a579cb..d037fe8650 100644 --- a/src/packages/toast/demo.taro.tsx +++ b/src/packages/toast/demo.taro.tsx @@ -1,5 +1,6 @@ import React from 'react' import { Toast } from '@nutui/nutui-react-taro' +import { ScrollView, View } from '@tarojs/components' import Header from '@/sites/components/header' import { useTranslate } from '@/sites/assets/locale/taro' import Demo1 from './demos/taro/demo1' @@ -44,20 +45,19 @@ const ToastDemo = () => { return ( <>
-
-

{translated.basic}

+ + {translated.basic} -

{translated.toastFunction}

+ {translated.toastFunction} - -

{translated.toastDuration}

+ {translated.toastDuration} -

{translated.toastCustomIcon}

+ {translated.toastCustomIcon} -

{translated.toastWordBreak}

+ {translated.toastWordBreak} -
+ ) } diff --git a/src/packages/uploader/preview.taro.tsx b/src/packages/uploader/preview.taro.tsx index 1e79b66be9..6f9a39f7f5 100644 --- a/src/packages/uploader/preview.taro.tsx +++ b/src/packages/uploader/preview.taro.tsx @@ -5,7 +5,7 @@ import { Link as LinkIcon, Loading, } from '@nutui/icons-react-taro' -import { Image } from '@tarojs/components' +import { Image, View } from '@tarojs/components' import Progress from '@/packages/progress/index.taro' import { FileItem } from '@/packages/uploader/file-item.taro' import { ERROR } from '@/packages/uploader/utils' @@ -32,7 +32,7 @@ export const Preview: React.FunctionComponent = ({ {fileList.length !== 0 && fileList.map((item: any, index: number) => { return ( -
@@ -44,21 +44,21 @@ export const Preview: React.FunctionComponent = ({ /> )} {previewType === 'picture' && !children && ( -
+ {item.status === 'ready' ? ( -
-
+ + {item.message} -
-
+
+ ) : ( item.status !== 'success' && ( -
+ {renderIcon(item)} -
+ {item.message} -
-
+ + ) )} {item.type?.includes('image') ? ( @@ -83,33 +83,33 @@ export const Preview: React.FunctionComponent = ({ onClick={() => handleItemClick(item, index)} /> ) : ( -
-
+ handleItemClick(item, index)} className="nut-uploader-preview-img-file-name" >  {item.name} -
-
+ + )} )} {item.status === 'success' ? ( -
{item.name}
+ {item.name} ) : null} -
+ )} {previewType === 'list' && ( -
-
+ handleItemClick(item, index)} >  {item.name} -
+ {deletable && ( = ({ showText={false} /> )} -
+ )} -
+ ) })}