10 回复
用wx.getStorageSync,这个api是没有回调函数的,直接
try { var value = wx.getStorageSync('key') if (value) { // Do something with return value
}
} catch (e) { // Do something when catch error}
楼上的小伙伴帮我找到了解决方法:
login: function (back) { wx.getStorage({ key: 'user_info' , success: function (res) { back(1) }, fail: function (res) { back(1) } }) }, ---------------------------------------------------- set_text: function (e) { var that = this ; if (e.currentTarget.id == 'phone_input' ) { that.setData({ mobile: e.detail.value }) } else { that.setData({ login_pwd: e.detail.value }) } // console.log(that.data) }, ------------------------------------------------------------- 就是管理员回答的那样,现在才明白。 |