wx.startPullDownRefresh()这个方法是主动去调用onPullDownRefresh这个生命周期函数的方法,也就是在你不用下拉操作就可以完成下拉刷新的一个API。那么你这样写肯定是成为一个无限循环了的。
在win微信开发工具上 下拉刷新会连续触发[代码]var[代码] [代码]Service = require([代码][代码]'../../utils/Service.js'[代码][代码]);[代码] [代码]var[代码] [代码]util = require([代码][代码]'../../utils/util.js'[代码][代码]);[代码] [代码]Page({[代码] [代码]/**[代码] [代码] [代码][代码]* 页面的初始数据[代码] [代码] [代码][代码]*/[代码] [代码]data: {[代码] [代码]getDataState: [代码][代码]true[代码][代码],[代码] [代码]globalLoading: [代码][代码]true[代码][代码],[代码] [代码]animationBeingLoaded: {},[代码] [代码]BeingLoadedState: {[代码] [代码]text: [代码][代码]'没有更多数据'[代码][代码],[代码] [代码]show: [代码][代码]false[代码][代码],[代码] [代码]icon: [代码][代码]false[代码] [代码]},[代码] [代码]movieData: [代码][代码]null[代码][代码],[代码] [代码]FilmStars: {}[代码] [代码]},[代码] [代码]/**[代码] [代码] [代码][代码]* 生命周期函数--监听页面加载[代码] [代码] [代码][代码]*/[代码] [代码]onLoad: [代码][代码]function[代码] [代码](options) {[代码] [代码]wx.setNavigationBarTitle({[代码] [代码]title: [代码][代码]'豆瓣电影 新片榜'[代码] [代码]});[代码] [代码]this[代码][代码].getData();[代码] [代码]},[代码] [代码]/**[代码] [代码] [代码][代码]* 生命周期函数--监听页面初次渲染完成[代码] [代码] [代码][代码]*/[代码] [代码]onReady: [代码][代码]function[代码] [代码]() {[代码] [代码]},[代码] [代码]/**[代码] [代码] [代码][代码]* 生命周期函数--监听页面显示[代码] [代码] [代码][代码]*/[代码] [代码]onShow: [代码][代码]function[代码] [代码]() {[代码] [代码]},[代码] [代码]/**[代码] [代码] [代码][代码]* 生命周期函数--监听页面隐藏[代码] [代码] [代码][代码]*/[代码] [代码]onHide: [代码][代码]function[代码] [代码]() {[代码] [代码]},[代码] [代码]/**[代码] [代码] [代码][代码]* 生命周期函数--监听页面卸载[代码] [代码] [代码][代码]*/[代码] [代码]onUnload: [代码][代码]function[代码] [代码]() {[代码] [代码]},[代码] [代码]onPullDownRefresh: [代码][代码]function[代码] [代码]() {[代码] [代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码] [代码]wx.startPullDownRefresh();[代码] [代码]if[代码][代码](that.data.getDataState){[代码] [代码]that.getData();[代码] [代码]}[代码][代码]else[代码][代码]{[代码] [代码]console.log([代码][代码]"操作频繁"[代码][代码]);[代码] [代码]}[代码] [代码]},[代码] [代码]/**[代码] [代码] [代码][代码]* 自定义函数[代码] [代码] [代码][代码]*/[代码] [代码]// 请求数据[代码] [代码]getData: [代码][代码]function[代码] [代码]() {[代码] [代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码] [代码]that.setData({[代码] [代码]getDataState: [代码][代码]false[代码] [代码]});[代码] [代码]wx.request({[代码] [代码]url: Service.DoubanApi.new_movies,[代码] [代码]method: [代码][代码]'GET'[代码][代码],[代码] [代码]data: {},[代码] [代码]header: {[代码] [代码]'content-type'[代码][代码]: [代码][代码]'json'[代码] [代码]},[代码] [代码]success: [代码][代码]function[代码] [代码](res) {[代码] [代码]console.log(res);[代码] [代码]that.setData({[代码] [代码]getDataState: [代码][代码]true[代码] [代码]});[代码] [代码]if[代码] [代码](res.statusCode == 200) {[代码] [代码]var[代码] [代码]ToastText = [代码][代码]''[代码][代码];[代码] [代码]if[代码][代码](that.data.movieData != [代码][代码]null[代码][代码]){[代码] [代码]wx.showToast({[代码] [代码]title: [代码][代码]'刷新成功'[代码][代码],[代码] [代码]icon: [代码][代码]'success'[代码][代码],[代码] [代码]duration: 1000[代码] [代码]})[代码] [代码]}[代码] [代码]that.FilmStars(res.data.subjects);[代码] [代码]that.setData({[代码] [代码]globalLoading: [代码][代码]false[代码][代码],[代码] [代码]movieData: res.data.subjects,[代码] [代码]BeingLoadedState: {[代码] [代码]text: [代码][代码]'没有更多数据'[代码][代码],[代码] [代码]show: [代码][代码]true[代码][代码],[代码] [代码]icon: [代码][代码]false[代码] [代码]}[代码] [代码]});[代码] [代码]} [代码][代码]else[代码] [代码]{[代码] [代码]wx.showToast({[代码] [代码]title: Service.CodeCallback(res.statusCode),[代码] [代码]icon: [代码][代码]'none'[代码] [代码]})[代码] [代码]}[代码] [代码]},[代码] [代码]fail: [代码][代码]function[代码] [代码](err){[代码] [代码]wx.showToast({[代码] [代码]title: [代码][代码]"加载失败"[代码][代码],[代码] [代码]icon: [代码][代码]'none'[代码] [代码]})[代码] [代码]},[代码] [代码]complete: [代码][代码]function[代码] [代码](con) {[代码] [代码]wx.stopPullDownRefresh();[代码] [代码]}[代码] [代码]})[代码] [代码]},[代码] [代码]// 影片星星[代码] [代码]FilmStars: [代码][代码]function[代码][代码](subjects){[代码] [代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码] [代码]var[代码] [代码]images = that.data.FilmStars;[代码] [代码]for[代码][代码]([代码][代码]var[代码] [代码]i=0; i<subjects.length; i++){[代码] [代码]images[i] = util.fiveStar_rating(subjects[i].rating.max,subjects[i].rating.min,subjects[i].rating.average)[代码] [代码]}[代码] [代码]that.setData({[代码] [代码]FilmStars: images[代码] [代码]});[代码] [代码]}[代码] [代码]})[代码][图片] [图片]
2018-09-03还没有修复好吗
input placeholder问题给input的placeholder设置文字右对齐,在开发工具上看起来是完全正常的。但是放到手机上右边就被吃掉一部分,大概3个半汉字。当聚焦到input时又会显示正常,也就是跳回来,失焦后又会跳回去。
2018-07-02请问,这个问题有解决方案了吗
camera组件在iphoneX上有黑边camera组件设置全屏,在iphoneX上下有黑边,iphone6上正常[图片]
2018-06-11