- 场景值覆盖不全面
https://developers.weixin.qq.com/miniprogram/dev/reference/scene-list.html 我们业务对场景值进行了上报,但是出现了一些不在上诉表格中的场景值,分别是: 1003、70、98、85、1123、1018、89、1223 请问下这些值分别是什么场景来的呢? 编码思路就是在onLaunch事件里面获取options,再取options.scene
2022-07-27 - createIntersectionObserver在动态id选择器的时候,监听不了?
在使用wx.createIntersectionObserver去监听长列表的时候,id是动态的,每次加载一页之后,渲染完了就去添加监听器,等到出现在视口之内,就加浏览量。但是有问题,下面是代码片段 //index.js //获取应用实例 const app = getApp() Page({ data: { appear: false, list: [0] }, onLoad() { }, onReady(){ let that = this // setTimeout(function(){ console.log(',.....'newDate().getTime()) that.setData({ list: [0,1,2] },function(){ console.log(',.....1111111111111'newDate().getTime()) setTimeout(function(){ console.log(',.....22222222'newDate().getTime()) that._observer = wx.createIntersectionObserver(that) that._observer .relativeToViewport() .observe('#1', (res) => { console.log(res); // that.setData({ // appear: res.intersectionRatio > // }) }) },1100); }) // },2000); }, onUnload() { if (this._observer) this._observer.disconnect() } }) //index.wxml <viewclass="container"> <viewclass="page-body"> <viewclass="page-section message"> <text wx:if"{{appear}}"> 小球出现 </text> <text wx:else> 小球消失 </text> </view> <viewclass="page-section"> <scroll-view scroll-y > <view wx:for"{{list}}" class="scroll-area"style"{{appear ? 'background: #ccc' : ''}}" id="{{index}}"> <textclass="notice">向下滚动让小球出现</text> <viewclass="filling"></view> <viewclass="ball"></view> </view> </scroll-view> </view> </view> </view> //index.wxss .scroll-view { height: 400rpx; background: #fff; border: px solid #ccc; box-sizing: borderbox; } .scroll-area { height: 1300rpx; display: flex; flex-direction: column; align-items: center; transition: .5s; } .notice { margin-top: 150rpx; } .ball { width: 200rpx; height: 200rpx; background: #AAD19; borderradius: 50; } .filling { height: 400rpx; } .message { width: 100; display: flex; justify-content: center; } .message text { font-size: 40rpx; font-family: -apple-systemfont, Helvetica Neue,Helvetica,sans-serif; }
2019-12-27