1.代码 wx.request({ url: '接口地址', // 请求方式:GET method:'GET', // 数据类型:json dataType:'json', // 将数据给到data用来动态渲染页面 success:res=>{ console.log(res) this.setData({ name:res.data }) // 输出测试一下 console.log(this.data) } })