Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信小程序nutui-react-taro 2.6.16-2.6.20的Uploader组件,随机出现选择图片以及上传完成后不显示 #2622

Open
fifthday opened this issue Sep 27, 2024 · 1 comment · May be fixed by #2660

Comments

@fifthday
Copy link

fifthday commented Sep 27, 2024

NutUI React 包名

@nutui/nutui-react-taro

NutUI React 版本号

2.6.16

平台

weapp

重现链接

重现步骤

正常使用Uploader,autoUpload=true,单个图片模式

<Uploader
  uploadLabel={props.title}
  name={props.fileKey}
  url={Http.getUploadUrl()}
  data={{ order_id: props.orderId }}
  timeout={3e4}
  onStart={onStart}
  maxFileSize={maxFileSize}
  onOversize={onOversize}
  onFailure={onFailure}
  onSuccess={onSuccess}
/>

期望的结果是什么?

选择图后能正常预览

实际的结果是什么?

可以正常上传,但有时无法预览,选择以及上传成功后,预览处没有变化
试了更新到2.6.20还是一样

环境信息

👽 Taro v4.0.4

Taro CLI 4.0.4 environment info:
System:
OS: Windows 11 10.0.22631
Binaries:
Node: 20.16.0 - D:\Scoop\apps\nvs\current\nodejs\default\node.EXE
Yarn: 1.22.22 - D:\Scoop\apps\nvs\current\nodejs\default\yarn.CMD
npm: 10.8.1 - D:\Scoop\apps\nvs\current\nodejs\default\npm.CMD
npmPackages:
@tarojs/cli: 4.0.4 => 4.0.4
@tarojs/components: 4.0.4 => 4.0.4
@tarojs/helper: 4.0.4 => 4.0.4
@tarojs/plugin-framework-react: 4.0.4 => 4.0.4
@tarojs/plugin-html: ^4.0.4 => 4.0.4
@tarojs/plugin-platform-alipay: 4.0.4 => 4.0.4
@tarojs/plugin-platform-h5: 4.0.4 => 4.0.4
@tarojs/plugin-platform-harmony-hybrid: 4.0.4 => 4.0.4
@tarojs/plugin-platform-jd: 4.0.4 => 4.0.4
@tarojs/plugin-platform-qq: 4.0.4 => 4.0.4
@tarojs/plugin-platform-swan: 4.0.4 => 4.0.4
@tarojs/plugin-platform-tt: 4.0.4 => 4.0.4
@tarojs/plugin-platform-weapp: 4.0.4 => 4.0.4
@tarojs/react: 4.0.4 => 4.0.4
@tarojs/runtime: 4.0.4 => 4.0.4
@tarojs/shared: 4.0.4 => 4.0.4
@tarojs/taro: 4.0.4 => 4.0.4
@tarojs/taro-loader: 4.0.4 => 4.0.4
@tarojs/webpack5-runner: 4.0.4 => 4.0.4
babel-preset-taro: 4.0.4 => 4.0.4
eslint-config-taro: 4.0.4 => 4.0.4
react: ^18.0.0 => 18.3.1

其他补充信息

我看了看源码分析如下:

src/packages/uploader/uploader.tsx文件中,
image
这里useEffect是异步运行的,根据调用堆栈可知
image

image
多处有读取effect异步修改的fileListRef值然后重新设置,这里可能会导致fileList的值版本错误
我在使用时有时会发生选择图后,上传已经成功了,但是预览没变化,看不到图的情况
后来只好暂时用beforeXhrUpload,手动上传解决

@fifthday fifthday changed the title 微信小程序nutui-react-taro 2.6.16-2.6.21的Uploader组件,随机出现选择图片以及上传完成后不显示 微信小程序nutui-react-taro 2.6.16-2.6.20的Uploader组件,随机出现选择图片以及上传完成后不显示 Sep 27, 2024
@Coder-Li
Copy link

我也遇到这个问题了,这么明显的问题没想到还没修复

@Alex-huxiyang Alex-huxiyang linked a pull request Nov 6, 2024 that will close this issue
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants