- 在app.js中使用wx.login获取code有时获取不到呢?
wx.login是异步,怎么能让它在进如index.js之前就获取到code呢
2019-10-17 - 在onshow()中使用setdata不生效呢?
onShow: function () { let pages = getCurrentPages(), currPage = pages[pages.length - 1]; console.log(currPage.data) if(currPage.data.uid !== undefined){ console.log('uid') this.setData({ clickNumber: 0 }); console.log(this.data.clickNumber) } else if (currPage.data.type === "2"){ var shsh = new Array(); shsh['name'] = currPage.data.name shsh['mobile'] = currPage.data.mobile shsh['address'] = currPage.data.address shsh['city'] = currPage.data.city shsh['county'] = currPage.data.county shsh['province'] = currPage.data.province console.log('收货') console.log(currPage.data.mobile) this.setData({ clickNumber: 0, shsh: shsh }) console.log(shsh); }else{ console.log('其他') this.setData({ clickNumber: 0, }) } },
2019-10-16