// pages/home/home.js
// 导入axios
import axios from "../../utils/http"
Page({
/**
* 页面的初始数据
*/
data: {
slides : null,
categories : null
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// 加载轮播图数据
this.loadSlides();
// 加载九宫图数据
this.loadCategories();
},
loadSlides() {
console.log(this);
/*
wx.request({
url: 'https://locally.uieee.com/slides',
success : res => {
console.log(res.data);
this.setData ({
slides : res.data
})
}
}) */
axios.get("slides").then(res => {
console.log(res);
this.setData ({
slides : res.data
})
})
},
loadCategories() {
/*
wx.request({
url: 'https://locally.uieee.com/categories',
success : res => {
console.log(res.data);
this.setData ({
categories : res.data
})
}
}) */
axios.get("categories").then(res => {
console.log(res);
this.setData ({
categories : res.data
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
project_local-life.rar (43个子文件)
project_local-life
sitemap.json 191B
pages
message
message.wxss 32B
message.js 847B
message.json 27B
message.wxml 74B
profile
profile.wxml 74B
profile.wxss 32B
profile.js 847B
profile.json 27B
index
index.wxml 512B
index.js 1KB
index.json 27B
index.wxss 268B
list
list.json 82B
list.wxss 26B
list.js 1KB
list.wxml 62B
home
home.wxml 787B
home.json 27B
home.wxss 223B
weui-grid.wxss 4KB
home.js 2KB
logs
logs.json 77B
logs.js 251B
logs.wxml 173B
logs.wxss 106B
app.json 1021B
project.config.json 2KB
assets
message.png 2KB
message-active.png 2KB
link-01.png 11KB
profile-active.png 2KB
home.png 2KB
contact.png 2KB
profile.png 2KB
avatar.png 6KB
home-active.png 1KB
contact-active.png 2KB
link-02.png 15KB
app.js 1KB
utils
util.js 460B
http.js 401B
app.wxss 194B
共 43 条
- 1
资源评论
前端御书房
- 粉丝: 8389
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功