web123456

WeChat applet: Solve the scroll-view component to trigger the scroll event multiple times to solve the bug

setContainerHeight(){ const systemInfo = wx.getSystemInfoSync(); this.data.containerHeight = systemInfo.windowHeight - 50; }, getList() { /*Here is the original pagination information data in data*/ const data = this.data; const that = this; const pageInfo = data.pageInfo; /*The following is the processing of the set switch*/ if (data.doneLoading) { return; } data.doneLoading = true; /*Send asynchronous requests (according to the encapsulation of http requests in specific projects)*/ if(data.pageInfo.totalCount>data.cancelList.length){ CancelInfo.getCanceltList({ currentPage: data.pageInfo.currentPage }).then(res => { if (res.retCode === 200) { data.pageInfo.currentPage = res.data.paginationInfo.currentPage + 1; data.pageInfo.totalCount = res.data.paginationInfo.totalRecord; data.cancelList = data.cancelList.concat(res.data.dataInfo); } /*Request to reset the switch successfully*/ data.doneLoading = false; }).catch(err => { console.log(err); }) } },