同样问题,android确实不行 android貌似会缓存授权状态,楼主试下这个步骤:预留一个button去到设置页,取消授权 => 在发现页删除小程序 => 杀掉微信进程 =>重新打开微信,打开小程序
安卓手机,使用button提示授权后,删除小程序在点击button,没有提示授权在安卓手机上,第一次进入小程序,点击button提示授权,授权成功之后,删除小程序,充重新扫码进入小程序,在点击button,此时不会再提示授权,而是直接默认授权
2018-06-09@小辣椒,iphone6s ios11.3.1,pulldown阈值太低了,轻轻一拉就会触发
在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-06-07