解决了吗?我的只会在苹果6p出现
求教:下拉刷新 fixed问题在使用onPullDownRefresh下拉刷新的时候,顶部自定义导航栏(fixed定位)掉下来了,看了社区好多帖子没有找到合适的解决办法,请问那位大神有比较好的解决方案吗?
2019-01-24[代码]<[代码][代码]button[代码] [代码]bindtap[代码][代码]=[代码][代码]"openSetting"[代码] [代码]wx:if[代码][代码]=[代码][代码]"{{ver}}"[代码][代码]>高版本授权流程</[代码][代码]button[代码][代码]>[代码][代码]<[代码][代码]button[代码] [代码]open-type[代码][代码]=[代码][代码]"openSetting"[代码] [代码]bindopensetting[代码][代码]=[代码][代码]"openSetting2"[代码] [代码]wx:else>低版本授权</[代码][代码]button[代码][代码]>[代码]已解决,通过判断版本,高版本继续保持原来的授权方式,第二次授权点击按钮后仍然弹出框提示,确认授权后,跳转到授权按钮; 低版本采用第一次提示授权,后面不提示授权,直接跳转到授权按钮
兼容低于基础库2.3.2的地理位置授权[代码]<[代码][代码]button[代码] [代码]bindtap[代码][代码]=[代码][代码]"openSetting"[代码][代码]>授权流程</[代码][代码]button[代码][代码]>[代码]在基础库低于2.3.2时候,采用该方法报错 openSetting:fail can only be invoked by user TAP gesture. 在基础库2.0.9时候,采用该方法报错 openSetting:fail 此接口已废弃,请使用 OpenSetting 组件 index.js [代码]openSetting() {[代码][代码] [代码][代码]app.getPermission();[代码][代码]}[代码]app.js [代码]getPermission: [代码][代码]function[代码][代码](fn) {[代码][代码] [代码][代码]let _this = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]let customTip = [代码][代码]false[代码][代码];[代码][代码] [代码][代码]wx.getStorage({[代码][代码] [代码][代码]key: [代码][代码]'customTip'[代码][代码],[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]customTip = [代码][代码]true[代码][代码];[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail() {[代码][代码] [代码][代码]wx.setStorageSync([代码][代码]'customTip'[代码][代码], customTip);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]});[代码][代码] [代码][代码]wx.getLocation({[代码][代码] [代码][代码]type: [代码][代码]'wgs84'[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]"成功时候调用"[代码][代码])[代码][代码] [代码][代码]if[代码] [代码]([代码][代码]typeof[代码] [代码]fn == [代码][代码]"function"[代码][代码]) fn();[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: [代码][代码]function[代码][代码]() {[代码][代码] [代码][代码]if[代码] [代码]([代码][代码]typeof[代码] [代码]fn == [代码][代码]"function"[代码][代码]) fn();[代码][代码] [代码][代码]wx.getSetting({[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]console.log(res)[代码][代码] [代码][代码]if[代码] [代码](customTip) {[代码][代码] [代码][代码]if[代码] [代码](!res.authSetting[[代码][代码]'scope.userLocation'[代码][代码]]) {[代码][代码] [代码][代码]wx.showModal({[代码][代码] [代码][代码]title: [代码][代码]"地理位置未授权"[代码][代码],[代码][代码] [代码][代码]content: [代码][代码]"如需使用,请开启您手机中的定位授权,开启后重新打开小程序。"[代码][代码],[代码][代码] [代码][代码]success(tip) {[代码][代码] [代码][代码]if[代码] [代码](tip.confirm) {[代码][代码] [代码][代码]wx.openSetting({[代码][代码] [代码][代码]success(data) {[代码][代码] [代码][代码]console.log([代码][代码]"重新加载"[代码][代码])[代码][代码] [代码][代码]console.log(data)[代码][代码] [代码][代码]console.log(data.authSetting[[代码][代码]'scope.userLocation'[代码][代码]])[代码][代码] [代码][代码]if[代码] [代码](data.authSetting[[代码][代码]'scope.userLocation'[代码][代码]]) {[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'授权成功'[代码][代码],[代码][代码] [代码][代码]icon: [代码][代码]'success'[代码][代码],[代码][代码] [代码][代码]duration: 1000[代码][代码] [代码][代码]});[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'授权失败'[代码][代码],[代码][代码] [代码][代码]icon: [代码][代码]'none'[代码][代码],[代码][代码] [代码][代码]duration: 1000[代码][代码] [代码][代码]});[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail(errset) {[代码][代码] [代码][代码]console.log([代码][代码]"重新加载"[代码][代码])[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'调用设置窗口失败'[代码][代码],[代码][代码] [代码][代码]icon: [代码][代码]'none'[代码][代码],[代码][代码] [代码][代码]duration: 1000[代码][代码] [代码][代码]});[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]console.log([代码][代码]"取消了地理位置授权"[代码][代码])[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]customTip = [代码][代码]true[代码][代码];[代码][代码] [代码][代码]wx.setStorageSync([代码][代码]'customTip'[代码][代码], customTip);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail(err) {[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'调用授权窗口失败'[代码][代码],[代码][代码] [代码][代码]icon: [代码][代码]'none'[代码][代码],[代码][代码] [代码][代码]duration: 1000[代码][代码] [代码][代码]});[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码]
2019-01-02