帖子
帖子
用户
博客
课程
显示全部楼层
286
帖子
2
勋章
7万+
Y币

[开发工具] UILoading模块在avm 中存在卡顿的问题

[复制链接]
发表于 2021-12-24 12:16:05
描述: avm页面在切换的时候,进行接口请求,调用   UILoading 模块, 这个时候页面没有完全切换完成,就会导致切换的时候页面出现卡顿,非常明显
测试平台为安卓 , 7.1.2, 安卓11    手机厂商为 vivo, 荣耀    ,  机型   x9i, x20

这里是demo页面,代码里面的 settimeOut 为 模拟接口请求操作


  1. <template>
  2.         <view class="list-box-1">
  3.                 <button @click="openB">打开B页面,发送事件,刷新第3项</button>
  4.                 <list-view id="list" class="page">
  5.                         <cell>
  6.                                 <text>{item}</text>
  7.                         </cell>
  8.                 </list-view>
  9.                 <button @click="update">本地页面刷新第一项</button>
  10.         </view>
  11. </template>
  12. <script>
  13. export default {
  14.         name: "test",
  15.         apiready() {
  16.                 setTimeout(() => {
  17.                         let arr = []
  18.                         let json = {}
  19.                         for (let i = 1; i <= 102; i++) {
  20.                                 let json = {
  21.                                         frame: "widget://image/loading/" + i + ".png",
  22.                                 }
  23.                                 arr.push(json)
  24.                         }
  25.                         let activity = api.require("UILoading")
  26.                         activity.keyFrame({
  27.                                 rect: {
  28.                                         w: 80,
  29.                                         h: 80,
  30.                                 },
  31.                                 styles: {
  32.                                         bg: "rgba(0,0,0,0.5)",
  33.                                         corner: 5,
  34.                                         interval: 20,
  35.                                         frame: {
  36.                                                 w: 60,
  37.                                                 h: 60,
  38.                                         },
  39.                                 },
  40.                                 content: arr,
  41.                                 mask: "rgba(0,0,0,0)",
  42.                         })
  43.                 }, 100)
  44.         },
  45.         data() {
  46.                 return {
  47.                         lists: [],
  48.                 }
  49.         },
  50.         methods: {},
  51. }
  52. </script>

  53. <style>
  54. .page {
  55.         width: 100%;
  56.         height: 100%;
  57. }
  58. .bug-style {
  59.         display: flex;
  60.         flex-flow: row;
  61. }
  62. .list-box-1 {
  63.         width: 100%;
  64.         margin-top: 30px;
  65.         height: 400px;
  66. }
  67. </style>
复制代码




380
帖子
4
勋章
6
Y币
切换的时候关掉loading 模块
286
帖子
2
勋章
7万+
Y币
那怎么判断什么时候切换完成?什么时候开始切换
技术支持-F · 2021-12-24 14:17切换的时候关掉loading 模块
286
帖子
2
勋章
7万+
Y币
似乎是我的描述问题,我的意思是从A切换切换至B页面的时候,B页面进行接口请求,请求之前会打开UILoading,然后,打开UILoading的时候,页面还没有完整的从A切换至B页面,这个时候就会引起卡顿
技术支持-F · 2021-12-24 14:17切换的时候关掉loading 模块

176
帖子
4
勋章
3万+
Y币
目前的情况是,在win中打开frame会卡卡的,这种在2中的常规操作,在avm中怎么就卡了呢
技术支持-F · 2021-12-24 14:17切换的时候关掉loading 模块
380
帖子
4
勋章
6
Y币
录视频看看。 提供个测试demo, 去掉无关代码。
blacky · 2021-12-24 15:30目前的情况是,在win中打开frame会卡卡的,这种在2中的常规操作,在avm中怎么就卡了呢
380
帖子
4
勋章
6
Y币
我们测试看看 。
忽上忽下 · 2021-12-24 14:32似乎是我的描述问题,我的意思是从A切换切换至B页面的时候,B页面进行接口请求,请求之前会打开UILoading,然后,打开UILoading的时候,页面还没有完整的从A切换至B页面,这个时候就会引起卡顿

...
286
帖子
2
勋章
7万+
Y币
demo.zip 下载附件
2021-12-24 16:03上传769.79 KB下载次数: 577
您需要登录后才可以回帖 登录

本版积分规则