// pages/camera/camera.js const request = require('../../utils/http') Page({ /** * 页面的初始数据 */ data: { result: {} }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { this.getTags() }, // 获取 电影标签数据 async getTags() { wx.showLoading({ title: '加载中...', }) let res = await request({ url: 'http://v.juhe.cn/toutiao/index?type=top&key=acf8f2ff52da5cb4aa65eb8b7c51583d', }) console.log(res) setTimeout(() => { wx.hideLoading() }, 300) if(res.error_code === 0){ this.setData({result: res.result}) } } })