//list.js
var app = getApp()
var number = 1
var isLoading = false
Page({
data: {
arr_res: [],
windowHeight: "500px",
loadingHidden: true,
lodingInfo: "加载更多",
url:"../../pages/content/content"
},
onLoad: function(options) {
//使number重置为1
number = 1;
console.log(options.listId);
console.log(options.listName);
var that = this;
wx.getSystemInfo({
success: function(res) {
console.log(res.windowHeight + "px");
that.setData({
windowHeight: res.windowHeight + "px"
})
},
fail: function(e) {
console.log("获取设备信息失败" + e);
}
});
// 动态设置标题栏。。。无效
wx.setNavigationBarTitle({
title: options.listName,
fail: function() {
console.log("更改标题失败");
},
success: function() {
console.log("更改标题成功");
}
});
wx.request({
url: app.globalData.globalUrl + "list",
data: {
id: options.listId,
page: 1
},
success: function(res) {
that.setData({
arr_res: res.data.tngou
});
console.log(that.data.arr_res);
},
fail: function(error) {
console.log(error);
that.setData({
request_fail: true,
});
}
})
},
//滑到底部监听事件
lower: function(e) {
console.log(e);
var that = this;
if (number < 10 && !isLoading) {
isLoading = true;
that.setData({
loadingHidden: false
})
wx.request({
url: app.globalData.globalUrl + "list",
data: {
id: app.globalData.listId,
page: ++number
},
success: function(res) {
that.setData({
arr_res: that.data.arr_res.concat(res.data.tngou),
lodingInfo: "加载更多",
});
console.log(that.data.arr_res);
},
fail: function(error) {
number--;
console.log(error);
that.setData({
lodingInfo: "加载失败",
})
},
complete: function() {
isLoading = false;
that.setData({
loadingHidden: true,
})
}
})
}
},
//点击事件监听
// tapItem: function(event) {
// app.globalData.contentId = event.target.id;
// console.log(app.globalData.contentId);
// for (var i = 0; i < this.data.arr_res.length; i++) {
// if (this.data.arr_res[i].id == event.target.id) {
// app.globalData.contentName = this.data.arr_res[i].name;
// break;
// }
// }
// console.log(app.globalData.contentName);
// // wx.navigateTo({
// // url: "../../pages/content/content"
// // });
// }
})
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
微信小程序-菜谱推荐APP源码.zip (69个子文件)
微信小程序-菜谱推荐APP源码
res
img
qita.png 1KB
tiaoyang.png 2KB
nvxingjibing.png 927B
lodingimgfailed.png 2KB
qiguan.png 1KB
lodingimg.png 2KB
kouqiang.png 1KB
gandanpiy.png 2KB
head_login.png 1KB
meirong.png 2KB
arrow.png 280B
search.png 1KB
canshi.png 2KB
back.png 258B
chagnweixiaohua.png 1KB
favorite.png 904B
huxidao.png 2KB
shijie.png 746B
shenjingxitong.png 2KB
jiankangyangsheng.png 1KB
lastindex.png 706B
aizheng.png 1KB
head_unlogin.png 1KB
tabbar
search_selected.png 2KB
search.png 2KB
discovery_selected.png 2KB
menu_selected.png 661B
discovery.png 1KB
menu.png 639B
nextindex.png 708B
icon.jpg 6KB
jirouguge.png 2KB
yunchanpuru.png 1KB
xueguan.png 2KB
jingqi.png 1KB
jianfei.png 2KB
renqun.png 2KB
xinzang.png 1KB
nanxing.png 2KB
pifu.png 2KB
gif
demo.gif 2.72MB
app.json 1KB
pages
index
index.js 3KB
index.json 46B
index.wxss 472B
index.wxml 313B
content
content.wxml 715B
content.js 2KB
content.wxss 1KB
content.json 53B
list
list.json 41B
list.js 3KB
list.wxml 830B
list.wxss 642B
search
search.wxss 439B
search.json 47B
search.js 2KB
search.wxml 496B
discovery
discovery.js 2KB
discovery.json 43B
discovery.wxml 830B
discovery.wxss 642B
result
result.js 858B
result.json 49B
result.wxss 443B
result.wxml 416B
app.wxss 193B
app.js 1KB
utils
util.js 460B
共 69 条
- 1
资源评论
- zmd19989182018-06-12服务器不能用
- liangxuehuiian2019-05-22还没有正式使用,用过后再来追评
lipi80
- 粉丝: 126
- 资源: 22
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- video_20240425_124410_edit.mp4
- IMG_20240425_120538.jpg
- My Complete Genome_6k Base-Pairs of Phenotype SNPs_Complete Raw Data.zip
- qt 的mqtt测试demo
- 移动应用开发教程-zip.zip
- mosquitto-2.018-install-windows-x64
- FTPServer FTP 服务器,绿色免安装,单文件
- 梦畅语音点名软件,上课点名
- 利用ADNI数据集和标签,在tensorflow框架上使用tensorlayer接口,通过架构u-net实现海马体的分割
- Kutools for Word v9.0 office word 插件
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功