- 小程序后台错误查询显示NAN是什么错误?
- 当前 Bug 的表现(可附上截图) [图片] - 预期表现 次数占比 以及 错误内容展示正常。
2019-10-21 - 线上分包页面突然报错,无法显示内容?
[图片] 不知啥问题,开发工具正常访问,、正式版的分包页面点击进去后内容没有显示,,,官方是不是弄出啥问题了,求解释!!!!
2019-10-18 - 如何控制页面滚动速度?
在做一些长列表的时候,由于页面滚动过快渲染不及时导致页面出现空白,想请教下有没有方法控制页面的滚动速度,要是官方能开个API设置页面的滚动速度就好了 ^ v ^
2019-10-16 - 求教if判断 true && true 不是true?
[图片] ``` // template/authorize/authorize.js /**授权组件 */ const appinit = getApp(); import request from '../../utils/network.js'; var postNumber = 20; var issquan = true; Component({ //组件的属性列表 properties: { pageCode: String, isshow: { type: Boolean, value: false }, }, //组件的初始数据 data: { imgshow: false }, //组件的方法列表 methods: { //体验 nologin: function() { appinit.appData.isty = true; this.setData({ isshow: false }) if (wx.showTabBar) { wx.showTabBar({}) } }, //判断是否授权 getauthorizestatus() { var than = this; var flg = false; //逻辑处理 wx.getSetting({ success(res) { // console.log('授权信息',res) if (!res.authSetting['scope.userInfo']) { var imgshow = false; if (wx.hideTabBar) { wx.hideTabBar({}); imgshow = true; } than.setData({ isshow: true, imgshow: imgshow }); } else { console.log('已授权,查询是否存在opendId'); //已授权,查询是否存在opendId var openId = wx.getStorageSync("openId"); if (openId && openId != '') { //判断是否存在用户信息缓存 var userInfoSession = wx.getStorageSync("userInfoSession"); if (userInfoSession && userInfoSession.id){ appinit.appData.userInfoStatus = true; appinit.appData.userInfo = userInfoSession; if (userInfoSession.orderInfo){ appinit.appData.orderInfo = userInfoSession.orderInfo; } appinit.appData.openId = userInfoSession.openId; appinit.appData.openIdStatus = true; appinit.appData.loginStatus = true; }else{ //重新获取用户信息 appinit.getAppUserInfo(openId, than); } } else { //,未存在,从新走登录 console.log('openId本地缓存不存在,重新登录'); than.login(postNumber); } } }, fail(err) { console.log('出错', err) } }) }, //用户信息授权回调 getuserinfo: function(options) { //授权点击 issquan = true; console.log("用户信息授权回调", options); if (options.detail.errMsg == "getUserInfo:fail auth deny") { wx.showModal({ title: '温馨提示', content: '您点击了拒绝授权,将使无法使用小程序,点击确定重新获取授权。', success: function(res) { if (res.confirm) { wx.openSetting({ success: (res) => { if (res.authSetting["scope.getUserInfo"]) { //如果用户重新同意了授权登录 this.getuserinfo(); } }, fail: function(res) { } }) } } }) } else { console.log('已授权'); //登录 this.login(postNumber); } }, login: function(num) { var than = this; console.log('已授权'); if (num > 0) { num--; postNumber = num; wx.login({ success(res) { if (res.code) { console.log('微信登录成功', res); //登录成功,获取微信用户信息 var rescode = res.code; wx.getUserInfo({ success: function(res) { console.log('获取微信用户信息成功', res); var userInfo = res.userInfo var nickName = userInfo.nickName; //昵称 var avatarUrl = userInfo.avatarUrl; //头像 if (userInfo && !userInfo.avatarUrl){ avatarUrl = 'http://w.taojianlou.com/image/default/head.jpg'; } //生成平台账号,并返回用户信息 var obj = { nickname: nickName, headimg: avatarUrl, code: rescode, } if (appinit.appData.oneShareAgentId || (appinit.appData.shareInfo && appinit.appData.shareInfo.shareAgentId)) { obj.agent = appinit.appData.oneShareAgentId || appinit.appData.shareInfo.shareAgentId; } than.getOpendId(obj); }, fail: function(userError) { console.log('获取微信用户信息失败', res); }, }) } else { setTimeout(() => { console.log('微信登录失败,2秒后重新请求!剩余请求次数' + num, err); than.login(postNumber); }, 2000) } }, fail(err) { setTimeout(() => { console.log('微信登录失败,2秒后重新请求!剩余请求次数' + num, err); than.login(postNumber); }, 2000) } }) } else { wx.showToast({ title: '登录超时', icon: 'none', mask: true, duration: 3000 }) } }, //获取openId getOpendId: function(obj) { var than = this; request({ url: appinit.appData.port.queryopenid, method: 'post', data: obj, log: true, // isshow:true, }).then(res => { //成功 if (res.data.result && res.data.result.success && res.data.info) { if (appinit.appData.shareInfo && appinit.appData.shareInfo.channelType && res.data.info.newUser){ //用户记录-分享新用户 appinit.actionlog({ userAccountId: appinit.appData.shareInfo.shareAgentId,//'用户标识', actionType: 5,//'动作类型 1-点击 2-收藏 3-付款 4-分享 5-分享新用户', goodsId: appinit.appData.shareInfo.shareGoodsId ? appinit.appData.shareInfo.shareGoodsId : '',//'商品标识', status: 1,//'1-非取消动作取1 -1-类似取消这种动作用-1' shopUri: appinit.appData.shareInfo.shareShopUri ? appinit.appData.shareInfo.shareShopUri : '',// '店铺ID', channelType: appinit.appData.shareInfo.channelType }) } appinit.appData.isty = false; //用戶生成成功存儲openId wx.setStorageSync("openId", res.data.info.openId) appinit.appData.loginStatus = true; appinit.appData.userInfoStatus = true; //用户信息获取状态 appinit.appData.openIdStatus = true; appinit.appData.userInfo = res.data.info; appinit.appData.openId = res.data.info.openId; appinit.appData.orderInfo = res.data.orderInfo; appinit.appData.userInfo.gdheadimg = res.data.info.headimg; //用于用户头像修改 if (res.data.info.shopUri) { //为商家 appinit.appData.userInfo.goodsManagerNum = res.data.supplierInfo.goodsManagerNum; appinit.appData.userInfo.fansNum = res.data.supplierInfo.fansNum; appinit.appData.userInfo.exclusiveNum = res.data.supplierInfo.exclusiveNum; appinit.appData.userInfo.qrcode = res.data.supplierInfo.qrcode; appinit.appData.userInfo.supplierScore = res.data.supplierInfo.supplierScore; appinit.appData.userInfo.supplierLevel = res.data.supplierInfo.supplierLevel; } wx.setStorageSync("userInfoSession", appinit.appData.userInfo); if (wx.showTabBar) { wx.showTabBar({}); } than.setData({ isshow: false }); var shareInfo = appinit.appData.shareInfo; var url = ''; console.log("than.data.pageCode == 'merchantApplymessage'-----", than.data.pageCode == 'merchantApplymessage', issquan) if (than.data.pageCode == 'index' && issquan) { wx.reLaunch({ url: '/pages/indexTwo/index', }) } else if (than.data.pageCode == 'personal') { wx.reLaunch({ url: '/pages/personal/personal/personal', }) } else if (than.data.pageCode == 'productdetail' && issquan) { if (shareInfo) { url = '/pages/products/productdetail/productdetail?sharePage=productdetail&shareGoodsId=' + shareInfo.shareGoodsId + '&shareShopUri=' + shareInfo.shareShopUri + '&shareAgentId=' + shareInfo.shareAgentId } else { url = '/pages/personal/personal/personal'; } if (url != '') { wx.reLaunch({ url: url, }) } } else if (than.data.pageCode == 'merchantindex' && issquan) { if (shareInfo) { if (shareInfo.sharePage2 == 'productdetail') { url = '/pages/products/productdetail/productdetail?sharePage=merchantIndex&sharePage2=productdetail&shareGoodsId=' + shareInfo.shareGoodsId + '&shareShopUri=' + shareInfo.shareShopUri + '&shareAgentId=' + shareInfo.shareAgentId; } else if (shareInfo.sharePage2 == 'index') { url = '/pages/merchant/index/index?sharePage=merchantIndex&sharePage2=index&shopUri=' + shareInfo.shopUri + '&shareAgentId=' + shareInfo.shareAgentId; } } else { url = '/pages/personal/personal/personal'; } if (url != '') { wx.reLaunch({ url: url, }) } } else if (than.data.pageCode == 'lotteryDetail' && issquan) { if (shareInfo) { url = '/pages/package/activity/lotteryDetail/lotteryDetail?sharePage=lotteryDetail&&id=' + shareInfo.id + '&shopUri=' + shareInfo.shopUri + '&goodsId=' + shareInfo.goodsId + '&shareAgentId=' + shareInfo.shareAgentId; } else { url = '/pages/personal/personal/personal'; } if (url != '') { wx.reLaunch({ url: url, }) } } else if (than.data.pageCode == 'lottery' && issquan) { if (shareInfo) { url = '/pages/lottery/lottery?sharePage=lottery&shareAgentId=' + shareInfo.shareAgentId; wx.switchTab({ url: url }) } else { url = '/pages/personal/personal/personal'; if (url != '') { wx.reLaunch({ url: url, }) } } } else if (than.data.pageCode == 'shopping' && issquan) { if (shareInfo) { url = '/pages/shopping/shopping?sharePage=shopping&shareAgentId=' + shareInfo.shareAgentId; wx.switchTab({ url: url }) } else { url = '/pages/personal/personal/personal'; if (url != '') { wx.reLaunch({ url: url, }) } } } else if (than.data.pageCode == 'popularity' && issquan) { if (shareInfo) { url = '/pages/package/activity/popularity/popularity?sharePage=popularity&shareAgentId=' + shareInfo.shareAgentId; wx.reLaunch({ url: url }) } else { url = '/pages/personal/personal/personal'; if (url != '') { wx.reLaunch({ url: url, }) } } } } else if (than.data.pageCode == 'good' && issquan) { if (shareInfo) { url = '/pages/package/activity/good/good?sharePage=good&shareAgentId=' + shareInfo.shareAgentId; wx.reLaunch({ url: url }) } else { url = '/pages/personal/personal/personal'; if (url != '') { wx.reLaunch({ url: url, }) } } } else if (than.data.pageCode == 'orderdetailmessage' && issquan) { var options = wx.getStorageSync("messageOrderdetail"); if (options && options.orderId){ wx.removeStorageSync("messageOrderdetail"); wx.reLaunch({ url: '/pages/orders/orderdetail/orderdetail?orderId=' + options.orderId + '&looktype=' + options.looktype }) } } else if (than.data.pageCode == 'merchantApplymessage' && issquan) { console.log('2222222222222') wx.reLaunch({ url: '/pages/merchantApply/merchantApply' }) } else { if (res.data.result && res.data.result.message.indexOf('可能包含')!=-1){ wx.showToast({ title: '您的微信昵称可能包含特殊字符', icon:'none', duration:2000 }) }else{ setTimeout(() => { console.log('1用户信息不存在,重新走登录流程,剩余次数' + postNumber, res); than.login(postNumber); }, 2000) } } }).catch(err => { //失败 setTimeout(() => { console.log('2用户信息不存在,重新走登录流程,剩余次数' + postNumber, err); than.login(postNumber); }, 2000) }) }, }, //组件生命周期函数-在组件实例进入页面节点树时执行) attached: function(e) { if (this.data.pageCode != 'personal' && !appinit.appData.isty && !appinit.appData.userInfoStatus) { this.getauthorizestatus(); } }, }) ```
2019-10-14 - recycle-view 滚动过程列表内容会变化,是bug还是我使用的不对,求指教?
[视频] 代码片段 不知道长列表组件是不是不支持一行两列的商品列表展示,recycle-view 在滚动过程中并没有发现滚动位置的变化,而列表内容却发现改变
2019-10-12 - 自定义组件图片引用相对路径开发工具可以显示,真机显示不了?
[图片] [图片] 问题如图,,,,代码片段已给出,求路过大神、官方解答下是不是bug啊
2019-10-11 - 小米9 透明版 真机调试黑屏是什么情况?
[图片] 小米手机真机调试直接黑屏卡死,然后连体验版、正式版都进不了,官方来人解释下什么原因啊!
2019-10-10 - recycle-view 列表滚动过程中item,无故发生变化?
代码片段[图片] 我想用recycle-view做一个瀑布流长列表,在滚动过程中发现item的高度位置发生了变动,这是什么原因??
2019-10-07 - wx.pageScrollTo 返回顶部滚动位置有时大于0
bug 我在开发工具上看的,苹果X真机也会出现, 除非 duration 设为0 ,不然一直会出现 [图片]
2019-09-26 - 大数据图片列表,使用了懒加载,提示setData频繁,不使用又提示同一时间请求过多图片?
有没有大神有啥比较好的解决方案或者思路没
2019-09-21