还是无法弹回,要再点一下后才能弹回。
stopPullDownRefresh无法回弹大神们: 我看到有人提这样的问题,有人提出和setTimeout和关闭wx.showLoading({ 无法解决, 既然我已经把 wx.stopPullDownRefresh放入 success: function (res) { //停止PullDown }中间 ; 就表示调用成功后才stopPullDownRefresh, 比如说在Jquery中我在成功执行请求后应该没有问题,为什么还要延时执行。 jquery在获取data后执行,完全是没问题。 [代码]$.post( [代码][代码]"InsertDefcode" [代码][代码],$( [代码][代码]"form#DefForm" [代码][代码]).serialize(), [代码][代码]function [代码][代码](data) { [代码][代码] [代码] [代码] [代码][代码]if [代码][代码](data== [代码][代码]"ok" [代码][代码]){[代码][代码] [代码] [代码] [代码][代码]toastr.success( [代码][代码]"缺陷添加成功!" [代码][代码], [代码][代码]"Hi" [代码][代码])[代码][代码] [代码] [代码] [代码] [代码] [代码][代码]} [代码][代码]else [代码][代码]if [代码][代码](data== [代码][代码]"ex" [代码][代码]){[代码][代码] [代码][代码]location.href = [代码][代码]"login.html" [代码][代码];[代码][代码] [代码] [代码] [代码][代码]} [代码][代码]else [代码][代码]{[代码][代码] [代码][代码]toastr.warning( [代码][代码]"缺陷/方案添加失败!" [代码][代码], [代码][代码]"Hi" [代码][代码])[代码][代码] [代码][代码]} [代码][代码] [代码][代码]Showlist(); [代码][代码] [代码] [代码] [代码][代码]}, [代码][代码]"text" [代码][代码]).error( [代码][代码]function [代码][代码]() {toastr.warning( [代码][代码]"添加失败!" [代码][代码], [代码][代码]"Hi" [代码][代码]) }); [代码] 下面小程序代码 [代码]onPullDownRefresh: [代码][代码]function [代码][代码]() {[代码][代码] [代码][代码]wx.showNavigationBarLoading()[代码][代码] [代码]wx.showLoading({ [代码] [代码][代码]title: [代码][代码]'加载中' [代码][代码],[代码][代码] [代码][代码]})[代码][代码] [代码][代码]var [代码][代码]that = [代码][代码]this[代码][代码] [代码][代码]var [代码][代码]that1 = [代码][代码]this[代码][代码] [代码][代码]wx.request({[代码][代码] [代码][代码]url: [代码][代码]'https://xxxxxxxxxxxxxx' [代码][代码], //仅为示例,并非真实的接口地址[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]loc: [代码][代码]'room2'[代码][代码] [代码][代码]},[代码][代码] [代码][代码]header: {[代码][代码] [代码][代码]'content-type' [代码][代码]: [代码][代码]'application/json' [代码][代码]// 默认值[代码][代码] [代码][代码]},[代码][代码] [代码][代码]success: [代码][代码]function [代码][代码](res) {[代码][代码] [代码] [代码] [代码][代码]console.log(res.data[0].update)[代码][代码] [代码][代码]wx.hideLoading();[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]msg: res.data[0].update[代码][代码] [代码][代码]});[代码][代码] [代码][代码]that.ecComponent = that.selectComponent( [代码][代码]'#mychart-dom-bar' [代码][代码]);[代码][代码] [代码][代码]that.ecComponent.init((canvas, width, height) => {[代码][代码] [代码][代码]// 获取组件的 canvas、width、height 后的回调函数[代码][代码] [代码][代码]// 在这里初始化图表[代码][代码] [代码][代码]const chart = echarts.init(canvas, [代码][代码]null [代码][代码], {[代码][代码] [代码][代码]width: width,[代码][代码] [代码][代码]height: height[代码][代码] [代码][代码]});[代码][代码] [代码][代码]setOption(chart, res.data[0].tem, [代码][代码]'温度' [代码][代码], [代码][代码]'°C' [代码][代码]);[代码] [代码] [代码][代码]// 将图表实例绑定到 this 上,可以在其他成员函数(如 dispose)中访问[代码][代码] [代码][代码]that.chart = chart;[代码] [代码] [代码][代码]// 注意这里一定要返回 chart 实例,否则会影响事件处理等[代码][代码] [代码][代码]return [代码][代码]chart;[代码][代码] [代码][代码]});[代码] [代码] [代码][代码]// 获取组件[代码][代码] [代码][代码]that1.ecComponent = that1.selectComponent( [代码][代码]'#mychart-dom-bar1' [代码][代码]);[代码][代码] [代码][代码]that1.ecComponent.init((canvas, width, height) => {[代码][代码] [代码][代码]// 获取组件的 canvas、width、height 后的回调函数[代码][代码] [代码][代码]// 在这里初始化图表[代码][代码] [代码][代码]const chart1 = echarts.init(canvas, [代码][代码]null [代码][代码], {[代码][代码] [代码][代码]width: width,[代码][代码] [代码][代码]height: height[代码][代码] [代码][代码]});[代码][代码] [代码][代码]setOption(chart1, res.data[0].hum, [代码][代码]'湿度' [代码][代码], [代码][代码]'%' [代码][代码]);[代码] [代码] [代码][代码]// 将图表实例绑定到 this 上,可以在其他成员函数(如 dispose)中访问[代码][代码] [代码][代码]that1.chart1 = chart1;[代码] [代码] [代码][代码]// 注意这里一定要返回 chart 实例,否则会影响事件处理等[代码][代码] [代码][代码]return [代码][代码]chart1;[代码] [代码] [代码][代码]});[代码][代码] [代码][代码]// setTimeout(()=>{[代码][代码] [代码][代码]// wx.stopPullDownRefresh;[代码][代码] [代码][代码]// wx.hideNavigationBarLoading()[代码] [代码] [代码][代码]// },500)[代码][代码] [代码][代码]wx.stopPullDownRefresh;[代码][代码] [代码][代码]wx.hideNavigationBarLoading()[代码] [代码] [代码][代码]}[代码][代码] [代码][代码]})[代码] [代码] [代码][代码]console.log( [代码][代码]"n11111111111111g" [代码][代码]);[代码] [代码] [代码][代码]}[代码] 无法回弹,我的手机是OPPO R11+ ,但是可以在点一下页面后马上回弹。
2018-07-29我也碰到同样的问题,下拉后不弹回,我觉得用 setTimeout不是解决问题的办法,而且我试了也不行,既然我已经把 wx.stopPullDownRefresh放入 success: function (res) { //停止PullDown }中间 ; 就表示调用成功后才stopPullDownRefresh, 在Jquery中我在成功执行请求后应该没有问题,为什么还要延时执行。 jquery在获取data后执行,完全是没问题。 [代码]$.post([代码][代码]"InsertDefcode"[代码][代码],$([代码][代码]"form#DefForm"[代码][代码]).serialize(), [代码][代码]function[代码][代码](data) { [代码][代码] [代码] [代码] [代码][代码]if[代码][代码](data==[代码][代码]"ok"[代码][代码]){[代码][代码] [代码] [代码] [代码][代码]toastr.success([代码][代码]"缺陷添加成功!"[代码][代码],[代码][代码]"Hi"[代码][代码])[代码][代码] [代码] [代码] [代码] [代码] [代码][代码]}[代码][代码]else[代码] [代码]if[代码][代码](data==[代码][代码]"ex"[代码][代码]){[代码][代码] [代码][代码]location.href = [代码][代码]"login.html"[代码][代码];[代码][代码] [代码] [代码] [代码][代码]}[代码][代码]else[代码][代码]{[代码][代码] [代码][代码]toastr.warning([代码][代码]"缺陷/方案添加失败!"[代码][代码],[代码][代码]"Hi"[代码][代码])[代码][代码] [代码][代码]} [代码][代码] [代码][代码]Showlist(); [代码][代码] [代码] [代码] [代码][代码]},[代码][代码]"text"[代码][代码]).error([代码][代码]function[代码][代码]() {toastr.warning([代码][代码]"添加失败!"[代码][代码],[代码][代码]"Hi"[代码][代码]) }); [代码] 下面小程序代码 [代码]onPullDownRefresh: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]wx.showNavigationBarLoading()[代码][代码] [代码][代码]wx.showLoading({[代码][代码] [代码][代码]title: [代码][代码]'加载中'[代码][代码],[代码][代码] [代码][代码]})[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码] [代码][代码]var[代码] [代码]that1 = [代码][代码]this[代码][代码] [代码][代码]wx.request({[代码][代码] [代码][代码]url: [代码][代码]'https://xxxxxxxxxxxxxx'[代码][代码], //仅为示例,并非真实的接口地址[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]loc: [代码][代码]'room2'[代码][代码] [代码][代码]},[代码][代码] [代码][代码]header: {[代码][代码] [代码][代码]'content-type'[代码][代码]: [代码][代码]'application/json'[代码] [代码]// 默认值[代码][代码] [代码][代码]},[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码] [代码] [代码][代码]console.log(res.data[0].update)[代码][代码] [代码][代码]wx.hideLoading();[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]msg: res.data[0].update[代码][代码] [代码][代码]});[代码][代码] [代码][代码]that.ecComponent = that.selectComponent([代码][代码]'#mychart-dom-bar'[代码][代码]);[代码][代码] [代码][代码]that.ecComponent.init((canvas, width, height) => {[代码][代码] [代码][代码]// 获取组件的 canvas、width、height 后的回调函数[代码][代码] [代码][代码]// 在这里初始化图表[代码][代码] [代码][代码]const chart = echarts.init(canvas, [代码][代码]null[代码][代码], {[代码][代码] [代码][代码]width: width,[代码][代码] [代码][代码]height: height[代码][代码] [代码][代码]});[代码][代码] [代码][代码]setOption(chart, res.data[0].tem, [代码][代码]'温度'[代码][代码], [代码][代码]'°C'[代码][代码]);[代码] [代码] [代码][代码]// 将图表实例绑定到 this 上,可以在其他成员函数(如 dispose)中访问[代码][代码] [代码][代码]that.chart = chart;[代码] [代码] [代码][代码]// 注意这里一定要返回 chart 实例,否则会影响事件处理等[代码][代码] [代码][代码]return[代码] [代码]chart;[代码][代码] [代码][代码]});[代码] [代码] [代码][代码]// 获取组件[代码][代码] [代码][代码]that1.ecComponent = that1.selectComponent([代码][代码]'#mychart-dom-bar1'[代码][代码]);[代码][代码] [代码][代码]that1.ecComponent.init((canvas, width, height) => {[代码][代码] [代码][代码]// 获取组件的 canvas、width、height 后的回调函数[代码][代码] [代码][代码]// 在这里初始化图表[代码][代码] [代码][代码]const chart1 = echarts.init(canvas, [代码][代码]null[代码][代码], {[代码][代码] [代码][代码]width: width,[代码][代码] [代码][代码]height: height[代码][代码] [代码][代码]});[代码][代码] [代码][代码]setOption(chart1, res.data[0].hum, [代码][代码]'湿度'[代码][代码], [代码][代码]'%'[代码][代码]);[代码] [代码] [代码][代码]// 将图表实例绑定到 this 上,可以在其他成员函数(如 dispose)中访问[代码][代码] [代码][代码]that1.chart1 = chart1;[代码] [代码] [代码][代码]// 注意这里一定要返回 chart 实例,否则会影响事件处理等[代码][代码] [代码][代码]return[代码] [代码]chart1;[代码] [代码] [代码][代码]});[代码][代码] [代码][代码]// setTimeout(()=>{[代码][代码] [代码][代码]// wx.stopPullDownRefresh;[代码][代码] [代码][代码]// wx.hideNavigationBarLoading()[代码] [代码] [代码][代码]// },500)[代码][代码] [代码][代码]wx.stopPullDownRefresh;[代码][代码] [代码][代码]wx.hideNavigationBarLoading()[代码] [代码] [代码][代码]}[代码][代码] [代码][代码]})[代码] [代码] [代码][代码]console.log([代码][代码]"n11111111111111g"[代码][代码]);[代码] [代码] [代码][代码]}[代码] 无法回弹,我的手机是OPPO R11+ ,但是可以在点一下页面后马上回弹。
使用官方刷新组件,苹果无法反弹stopPullDownRefresh苹果手机下拉刷新后,出现了顶部回弹问题,安卓不会,如何解决??? [图片] [代码]self.dataLayer([代码][代码]function[代码] [代码](isData) {[代码][代码] [代码][代码]console.log([代码][代码]"返回的数据 isData=>"[代码][代码], isData);[代码][代码] [代码][代码]wx.hideNavigationBarLoading() [代码][代码]//完成停止加载[代码][代码] [代码][代码]wx.stopPullDownRefresh() [代码][代码]//停止下拉刷新[代码] [代码] [代码][代码]if[代码] [代码](isData) {[代码][代码] [代码][代码]++(self.data.page);[代码][代码] [代码][代码]self.setData({[代码][代码] [代码][代码]page: page[代码][代码] [代码][代码]});[代码][代码] [代码][代码]}[代码][代码] [代码][代码]});[代码]
2018-07-28