本地儲存動態請求的資料 阿新 • • 發佈:2018-11-07 儲存的時候要在wx.request中儲存; data: { useInfo: [] }, var that = this; wx.request({ url: ' https://way.jd.com/jisuapi/driverexamQuery?type=c1&subject=1&pagesize=20&pagenum=1&sort=normal&appkey=e7f381ade61cdf0d5a11d9740726e9b4' ;, success: function (res) { var useInfo = res.data.result.result.list; wx.setStorage({ key: 'useInfo' , data: useInfo, }) that.setData({ useInfo: res.data.result.result.list }) } }) 其他頁面獲取的時候: var that = this; wx.getStorage({ key: 'useInfo', success: function(res){ var useInfo = res.data; that.setData({ useInfo: useInfo }) } })