- WAServiceMainContext 请求超时 是报的什么?
Error: 请求超时 at ? (/subpages/native/app-service.js:5341:568234) at Map.forEach(<anonymous>) at ba.value(/subpages/native/app-service.js:5341:567966) at ba.value(/subpages/native/app-service.js:5341:567823) at Ma.value(/subpages/native/app-service.js:5341:577537) at Oc.value(/subpages/native/app-service.js:5341:785027) at f(/WASubContext.js:1:150361) at ? (/WASubContext.js:1:150804) at Function.<anonymous>(/WASubContext.js:1:115728) at Function.<anonymous>(/WASubContext.js:1:145693) at p(/WAServiceMainContext.js:1:156649) at ? (/WAServiceMainContext.js:1:157092) at ? (/WAServiceMainContext.js:1:147984) at Timeout._onTimeout(<anonymous>:361:55982) at listOnTimeout(node:internal/timers:568:17) at process.processTimers(node:internal/timers:511:7) 只有这个报错信息,都没办法排查,在开发者工具好像能复现,超时 code 是2801,也不知道是不是这个请求超时的报错
05-27 - 为什么有右上角胶囊位置变化的事件,没有打开胶囊面板的事件?
在小程序开发中,如果你想监听右上角胶囊面板(即菜单按钮)的相关事件,可以使用[代码]wx.onMenuButtonBoundingClientRectWeightChange[代码]函数。这个函数可以用来监听菜单按钮的布局位置信息变化事件。 具体来说,当菜单按钮的布局位置发生变化时,会触发你设置的监听函数,并返回一个包含按钮位置信息的对象。这个对象包含了按钮的宽度、高度以及上、右、下、左边界坐标等信息,你可以利用这些信息来调整你的小程序界面,以适应按钮位置的变化。 以下是一个简单的示例代码,展示了如何使用这个函数: const callback = res => console.log('menuButtonBoundingClientRectWeightChange', res); wx.onMenuButtonBoundingClientRectWeightChange(callback); 我想知道这个时间的用处是什么?使用场景是什么? 我们想统计一下用户打开胶囊面板的数据,能加一个打开胶囊面板的事件吗?或者有没有什么方式能够统计到,求指教
05-21 - 鸿蒙微信小程序,swiper加 live-player 使用是不是有问题啊?
index.wxml <swiper vertical circular class="swiper" easing-function="linear" current="{{rootIndex}}" bindchange="onSwiperChange" data-time="{{lastTapTime}}" bindtap="doubleClick" duration="{{300}}" > <swiper-item wx:for="{{lives}}" wx:key="liveId" class="swiper-item" > <live-player-wrapper live="{{item}}" initialized="{{initialized}}" isActive="{{rootIndex === index}}" definition="{{definition}}" videoQualityInfo="{{videoQualityInfo}}" protocols="{{protocols}}" definitions="{{u.getDefinitions(lives, rootIndex, protocols)}}" bind:onDefinitionItemClick="onDefinitionItemClick" /> </swiper-item> </swiper> live-player-wrapper.wxml <live-player wx:if="{{isActive}}" muted='{{false}}' object-fit='fillCrop' src='{{playerSource}}' mode='live' class="full-screen" autoplay picture-in-picture-mode="{{['push']}}" bindstatechange="onStateChange" binderror="onError" /> 就这个简单的代码,判断 rootIndex === index 展示live-player,我打印rootIndex, index都没问题, 就是滑动切换的时候,上一个live-player 也不会被销毁,一直切换,一直都不销毁,就鸿蒙小程序是这样,这很简单的代码, 还有就是,有live-player容器,如果swiper-item 或者父容器有点击事件,鸿蒙小程序点击事件也会失效,问题太多了
04-07 - live-player 报错?天天告警很多,帮忙高优看下
<live-player muted='{{false}}' object-fit='fillCrop' src='{{playerSource}}' mode='live' class="full-screen" autoplay picture-in-picture-mode="{{['push']}}" bindstatechange="onStateChange" binderror="onError" /> error 信息:① {"type":"error","timeStamp":1802,"target":{"id":"","offsetLeft":0,"offsetTop":0,"dataset":{}},"currentTarget":{"id":"","offsetLeft":0,"offsetTop":0,"dataset":{}},"mark":{},"detail":{"errMsg":"fail error playerId","errno":4},"mut":false,"_userTap":false,"__evName":"error"} ②{"type":"error","timeStamp":11484,"target":{"id":"","offsetLeft":0,"offsetTop":0,"dataset":{}},"currentTarget":{"id":"","offsetLeft":0,"offsetTop":0,"dataset":{}},"mark":{},"detail":{"errMsg":"insertLivePlayer:fail voip is calling","errno":1107001},"mut":false,"_userTap":false,"__evName":"error"} 加了 binderror 之后,都是这两个报错,辛苦帮忙看下,最近发现小程序在电脑版播放一会儿,直播流会卡住,直播声音还有,就是画面不动了,直播间中的点击功能也是正常的
2024-11-18 - live-player直播在pc小程序中,进入新页面再返回直播页面会卡死,切换不同直播间就好了?
在pc版小程序中,live-player直播,进入新页面再返回直播页面会卡死,切换不同直播间就好了(有多个直播间,直播间是个swiper)。有没有遇到过这种问题的大佬呀?怎么解决的
2024-05-27 - live-player 设置的静音,切换底部tab的时候,播放的歌曲会暂停一下播放 ?
<live-player wx:if="{{isActive}}" muted='{{true}}' object-fit='fillCrop' src='{{playerSource}}' mode='live' class="live-player full-content {{feedStyle}}" autoplay bindstatechange="onStateChange" /> 首页有一个已经设置了静音的直播小窗,从首页切换到分类、我的、购物车等,都会让音乐暂停一下,按理说静音之后,不会影响到音频才对吧, 还需要怎设置一下吗 [图片]
2024-01-29 - scroll-into-view-alignment="center" 不生效?
<scroll-view scroll-y show-scrollbar="{{false}}" scroll-into-view="{{calculateId}}" scroll-with-animation class="calculateScroll scroll-wrap-class" scroll-into-view-alignment="center" scroll-into-view-offset="{{100}}" using-sticky="{{true}}" enable-passive > </scroll-view> scroll-into-view-alignment="center" scroll-into-view-offset="{{100}}" 这两个属性都不生效吗?没人遇到吗?
2023-11-27 - this.animation 有没有什么高级用法?
最近有个需求,是想实现类似抖音直播送礼的功能,大致逻辑是:礼物从左侧先出来,然后数量放大缩小,两秒后隐藏。如果某个人送相同礼物,数量会累加。想用微信新的api,this.animation实现,第一次做小程序的需求,不知道有没有什么高阶的用法呢?贴一下我自己的小白代码,感觉这样写太臃肿,又不太好读,而且会有很多边界问题。如: 目前送礼连续点击,动画效果很不美观,还会有频闪问题,想问下有没有动画大佬帮忙解答一下,谢谢 [图片][图片] if (Math.random() > 0.5) { // 这里这个只是目前随机上面出来还是下面出来,感觉也很傻 useAnimation( // 自己封装了一下,其实和文档的 this.animation一摸一样的,只是自己加了个无限循环的动画函数 this, '.giveGiftAnimation1', [ { opacity: 1, translateX: '-400rpx' }, { opacity: 1, translateX: 0 }, ], 250, // 右移出来 ) setTimeout(() => { useAnimation( this, '.giveGiftCountAnimation1', [{ scale: [1, 1] }, { scale: [1.25, 1.25] }, { scale: [1, 1] }], 150, ) }, 250) // 一个定时器,让文字放大缩小 setTimeout(() => { useAnimation( this, '.giveGiftAnimation1', [ { opacity: 1, translateX: 0 }, { opacity: 0, translateX: 0 }, ], 250, ) }, 2400) // 又一个定时器,就是动画的两秒后,再隐藏掉元素 setTimeout(() => { // 这个定时器是让下面的元素延时一点进行动画,看起来美观一点,但是点的快了,根本没动画了 useAnimation( this, '.giveGiftAnimation2', [ { opacity: 1, translateX: '-400rpx' }, { opacity: 1, translateX: 0 }, ], 250, ) // 同上 setTimeout(() => { useAnimation( this, '.giveGiftCountAnimation2', [{ scale: [1, 1] }, { scale: [1.25, 1.25] }, { scale: [1, 1] }], 150, ) }, 250) // 定时器同上 setTimeout(() => { useAnimation( this, '.giveGiftAnimation2', [ { opacity: 1, translateX: 0 }, { opacity: 0, translateX: 0 }, ], 250, ) }, 2400) // 定时器同上 }, 1000) } else { // 这个else 就是先让下面的元素进行动画,总之目前问题挺多的,希望大佬能给些建议或者优化~ useAnimation( this, '.giveGiftAnimation2', [ { opacity: 1, translateX: '-400rpx' }, { opacity: 1, translateX: 0 }, ], 250, ) setTimeout(() => { useAnimation( this, '.giveGiftCountAnimation2', [{ scale: [1, 1] }, { scale: [1.25, 1.25] }, { scale: [1, 1] }], 150, ) }, 250) setTimeout(() => { useAnimation( this, '.giveGiftAnimation2', [ { opacity: 1, translateX: 0 }, { opacity: 0, translateX: 0 }, ], 250, ) }, 2400) setTimeout(() => { useAnimation( this, '.giveGiftAnimation1', [ { opacity: 1, translateX: '-400rpx' }, { opacity: 1, translateX: 0 }, ], 250, ) setTimeout(() => { useAnimation( this, '.giveGiftCountAnimation1', [{ scale: [1, 1] }, { scale: [1.25, 1.25] }, { scale: [1, 1] }], 150, ) }, 250) setTimeout(() => { useAnimation( this, '.giveGiftAnimation1', [ { opacity: 1, translateX: 0 }, { opacity: 0, translateX: 0 }, ], 250, ) }, 2400) }, 1000) }
2023-08-09 - wx.navigateBack场景问题,不知道有没有相同场景的同学,想借鉴一下?
目前的场景是,我再A页面跳转B页面,B页面会有params,然后B页面跳转C页面,C页面有输入等一系列操作,点击确认后请求会返回一个新的 id,我需要用这个新的 id在返回到B页面,B页面再用params上的参数去做请求, A跳B和C跳B的params是不同的。这个时候,使用 navigateTo的话,会返回到C页面(操作页面,肯定不对),用redirectTo,路由里就会有两个B页面,用户需要返回两次才能回到A页面,这个肯定也不太好,想知道有什么好的方法吗?C跳到B,B返回操作直接到A,目前我用了很hack的方式,就是先调用一下 navigateBack,然后再调用redirectTo,这样是可以实现的,但是会有一个跳转闪烁的问题,对用户不太友好,想问下还有什么好的解决办法吗?我没想到的,(或者navigateBack可以修改参数吗?这个可能有点难)
2023-07-19