微信小程序开发-4【页面查询数据及遍历】
微信小程序开发-4【页面查询数据的遍历】;1. 在.js文件里面封装一个方法:;loadMove:function(){
;;;;var;page=this;
;;;;wx.request({
;;;;;;url:;'http://api.douban.com/v2/',
;;;;;;header:;{
;;;;;;;;"Content-Type":;"json"
;;;;;;},
;;;;;;success:function(res){
;;;;;;;;
;;;;;;;;var;subjects;=;res.data.subjects;
;;;;;;;;console.log(subjects);
;;;;;;;;page.processSubjects(subjects);
;;;;;;;;page.setData({;moves:;subjects,hidden:true});
;;;;;;}
;;;;})
;;}2.在.js文件