- wxs怎样调试?添加debugger会报错,只能使用console.log吗?
wxs调试不方便,有什么方法吗?
2020-05-28 - scroll-view 或者 view同层渲染后,能显示,但bindtap事件不响应?
<scroll-view class="messageList" id="messageList" style="height:{{msgHeight}}" scroll-y="true" scroll-top="{{messageScrollTop}}" bindtap="testTap">列表</scroll-view> <live-player wx:if="{{isFlv}}" class="video-livePlayer" id="video-livePlayer" mode="live" orientation="{{orientation}}" :muted="false" object-fit="{{objectFit}}" min-cache="1" max-cache="3" src="{{playUrl}}" bindstatechange="onPlayEvent" bindfullscreenchange="onFullScreenChange" picture-in-picture-mode="pop" > </live-player> scroll-view 能显示出来,但bindtap无响应,也无法手动滑动 .messageList { position: absolute; z-index: 100; overflow-y: scroll; } .video-livePlayer { position: absolute; z-index: 10; }
2020-05-25 - iphone7手机,cover-view内嵌套 input时,背景色导致input不显示?
<cover-view class="activekeyBorBox"> <cover-view class="inputMsgBox"> <input type="text" focus="{{focusMessage}}" value='{{sendMsgValue}}' cursor-spacing="8" placeholder="有爱互动,分享快乐~" class="inputSendMessage" confirm-type="send" bindinput="inputMessage" hold-keyboard="true" bindkeyboardheightchange="keyboardheightchange" bindconfirm="submitSendMsg" /> </cover-view> </cover-view> activekeyBorBox 或者 inputMsgBox设置背景色 background:#fff后,input输入文字,显示不出来。 去掉cover-view背景色,才能显示。 有白色背景时,机型iphone7不显示。 但iphoneXR,iphone6Plus能显示出来。
2020-05-22 - 删除列表部分数据后,使用setData渲染,触发了列表的整体渲染,影响性能?
场景,直播间消息展示,平均每秒收到几条消息。 直播列表超过80条后,截取最新的8条数据,保证最多只显示80条。 if (pageMsgLength> 80){ pageMessageList.splice(0,pageMsgLength -8) this.setData({ pageMessageList: pageMessageList }) } 有人说,可以使用 this.setData({['obj.isShow']: {}}) 类似这种局部更新的方法。 但是 这样长列表会越来越长。 第一次到80条时,可以循环数据,把前72条循环遍历赋值为{}. 但随着列表越来越长,后面每次新增60条数据后,需要把倒数第8条前面的都设置为 {},越来越难操作。 这个问题主要是想解决,pageMessageList.splice(0,pageMsgLength -8) ,再setData的性能问题。有好的办法吗?
2020-04-27 - setData回调中报渲染错误?
var that = this; this.setData({ addNum: addNum, pageMessageList: pageMessageList },()=>{ var msgLength = that.data.pageMessageList.length; if(msgLength && (msgLength >8 )){ that.setScrollBottom(); } }) setData回调中,if判断那儿报 渲染层错误,如果不写if,只写 that.setScrollBottom();则不报错。这是怎么回事啊?
2020-04-26 - 使用setData删除列表中的数组,怎么实现局部更新?
pageMessageList.splice(0,pageMsgLength -8) this.setData({ pageMessageList: pageMessageList }) 删除部分数据,发现列表整体重新渲染了。怎样实现列表不重新渲染,只是删除了部分?
2020-04-23 - worker中使用了定时器,setInterval,主线程只有第一次createWorker成功?
主线程与子线程只有第一次是成功的,退出该页面重新进入,就收不到消息了 主线程.worker.terminate(),需要关闭子线程中的定时器吗?怎么关闭? onReady: function () { storMessageList = []; // 创建worker if( this.data.worker){ this.data.worker.terminate(); this.data.worker = null; } this.data.worker = wx.createWorker('workers/request/index.js'); }, onUnload: function(){ console.log('返回按钮') if( this.data.worker){ this.data.worker.terminate(); this.data.worker = null; } }, 子线程 worker.onMessage((data) => { // console.log(data); // 接收区一直接收 storMessageList = storMessageList.concat(data.msg); }) setInterval(()=>{ //处理过程。。。 worker.postMessage({ msg: sendMainMsg, }) })
2020-04-20 - 新注册的小程序没有直播菜单,但可以开通实时播放音视频流接口权限,可以开发直播吗?
新注册的小程序,在小程序后台接口设置,开通了播放音视频流 和 实时录制音视频流权限,但是菜单栏中没有直播菜单,是怎么回事呢? 可以正常开发小程序直播吗?
2020-03-12