// pages/t-mail/t-mail.js var myRequest = require("../../utils/api.js"); Page({ data: { list: [], barHeight: null, }, onLoad(options) { var projectId = wx.getStorageSync('projectId'); this.setData({ projectId: projectId }) this.getBookData() }, getBookData() { var that = this; myRequest.myRequest('addressBook/book?projectId=14', {projectId:that.data.projectId}, 'get').then(function(res){ that.setData({ list: res.data.data, }); }).catch(function(res){ console.log(res); }) }, onReady() { }, onShow() {}, });