Page({
/**
* 页面的初始数据
*/
data: {
// 首页导航数据
navList: [],
currentIndex: 0,
// 滚动轮播图
swiperList: [],
// 视频列表
videoList: [],
},
// 首页导航数据获取
getNavList () {
var that = this;
wx.request({
url: 'https://mock-api.com/mnEe4VnJ.mock/navList',
data: {},
header: {'content-type':'application/json'},
method: 'GET',
dataType: 'json',
responseType: 'text',
success: (result)=>{
//console.log(result);
if(result.data.code === 0){
that.setData({
navList: result.data.data.navList
})
}
},
fail: ()=>{},
complete: ()=>{}
});
},
/* 到瀚蓝点击操作 */
activeNav (e) {
this.setData({
currentIndex: e.target.dataset.index
})
},
/*
* 滚动录播动画数据获取
*/
getSwiperList () {
var that = this;
wx.request({
url:'https://mock-api.com/mnEe4VnJ.mock/swiperList',
success: (result) => {
// console.log(result)
if(result.data.code === 0){
that.setData({
swiperList: result.data.data.swiperList
})
}
}
})
},
/* 获取视频列表数据 */
getVideoList () {
var that = this;
wx.request({
url:'https://mock-api.com/mnEe4VnJ.mock/videoList',
success: (result) => {
// console.log(result)
if(result.data.code === 0){
that.setData({
videoList: result.data.data.videoList
})
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// 1\获取首恶导航数据
this.getNavList()
this.getSwiperList()
this.getVideoList()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
没有合适的资源?快使用搜索试试~ 我知道了~
微信小程序实现b站首页和视频详情页
共31个文件
png:8个
json:7个
js:6个
需积分: 44 20 下载量 140 浏览量
2020-05-17
23:07:49
上传
评论 4
收藏 24KB RAR 举报
温馨提示
通过微信小程序实现b站手机版首页和点击指定视频跳转到视频详情的页面。首页主要包含搜索顶部,页面导航栏,推荐视频板块;视频详情包含视频播放,简介、视频相关推荐和用户评论模块
资源推荐
资源详情
资源评论
收起资源包目录
bilibili-demo.rar (31个子文件)
bilibili-demo
project.config.json 989B
pages
index
index.wxss 679B
index.json 182B
index.wxml 880B
index.js 3KB
detail
detail.wxml 3KB
detail.json 121B
detail.js 2KB
detail.wxss 3KB
utils
util.js 472B
images
comment2.png 394B
up.png 296B
comment.png 332B
detail-info.png 248B
play.png 296B
search.png 337B
logo.png 3KB
user.jpg 18KB
play2.png 346B
components
VideoItem
VideoItem.js 263B
VideoItem.json 48B
VideoItem.wxss 885B
VideoItem.wxml 776B
Header
Header.wxss 957B
Header.wxml 536B
Header.js 850B
Header.json 27B
app.js 564B
sitemap.json 191B
app.json 372B
app.wxss 102B
共 31 条
- 1
资源评论
gw依旧爱学习
- 粉丝: 25
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- tensorflow-rocm-2.12.0.560-cp311-cp311-manylinux2014-x86-64.whl
- Windows操作系统中的CMD(命令提示符).md
- tensorflow-rocm-2.12.0.560-cp39-cp39-manylinux2014-x86-64.whl
- mmexport1713512496118.jpg
- 基于VB的俄罗斯方块系统设计与实现(源代码+参考文献).zip
- 软件测试开发工具大全资源包之Linux虚拟机
- python毕设-图片批量处理器
- 基于VB的教材管理系统设计(源代码+系统+报告+PPT).zip
- Lock接口与synchronized关键字
- 基于Java的图书馆自习室座位预约系统设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功