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

UniJSCallback.invokeAndKeepAlive回调问题 #147

Open
liujianbigboss opened this issue Jul 10, 2023 · 1 comment
Open

UniJSCallback.invokeAndKeepAlive回调问题 #147

liujianbigboss opened this issue Jul 10, 2023 · 1 comment

Comments

@liujianbigboss
Copy link

问题描述
前后端实现实时进度条功能

复现步骤
@UniJSMethod(uiThread = false)
public void test(String path, final UniJSCallback callback) {
//1、解析文件,回填进度20
callback.invokeAndKeepAlive(new JSONObject().put("progress",20));
//2、对解析内容进行业务处理,回填进度50
callback.invokeAndKeepAlive(new JSONObject().put("progress",50));
//3、保存处理结果,回填进度80
callback.invokeAndKeepAlive(new JSONObject().put("progress",50));
//4、进行后置业务处理,回填进度100
callback.invokeAndKeepAlive(new JSONObject().put("progress",100));
}

预期结果
前端能够接收后端持续回填的进度,刷新进度条的展示

实际结果
步骤1-4的处理过程中,前端未收到任何进度回调结果,等到后端接口响应成功时,前端会连续收到1-4的回调信息

系统信息:

  • 发行平台: App
  • 操作系统 :Android 10

补充信息
[可选]
[根据你的分析,出现这个问题的原因可能在哪里?]

@liujianbigboss
Copy link
Author

@zhetengbiji @fxy060608 你好,麻烦看一下这个issue

@zhetengbiji zhetengbiji transferred this issue from dcloudio/uni-app Jul 13, 2023
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

No branches or pull requests

1 participant