//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"
// // });
// }
})
没有合适的资源?快使用搜索试试~ 我知道了~
(哇小侠)微信小程序源码demoCaipu.zip
共73个文件
png:39个
js:8个
wxss:7个
需积分: 5 0 下载量 24 浏览量
2022-03-13
05:47:46
上传
评论
收藏 2.8MB ZIP 举报
温馨提示
(哇小侠)微信小程序源码demoCaipu.zip
资源推荐
资源详情
资源评论
收起资源包目录
(哇小侠)微信小程序源码demoCaipu.zip (73个子文件)
UI设计交流平台图翼tuyiyi.com.url 121B
视频教程下载uihuo.com.url 120B
小程序开发平台.url 120B
Caipu
pages
index
index.wxml 313B
index.js 3KB
index.json 46B
index.wxss 472B
list
list.json 41B
list.wxss 642B
list.js 3KB
list.wxml 830B
search
search.json 47B
search.wxss 439B
search.js 2KB
search.wxml 496B
discovery
discovery.json 43B
discovery.wxss 642B
discovery.js 2KB
discovery.wxml 830B
content
content.wxss 1KB
content.wxml 715B
content.json 53B
content.js 2KB
result
result.wxss 443B
result.wxml 416B
result.js 858B
result.json 49B
app.json 1KB
app.js 1KB
utils
util.js 460B
res
gif
demo.gif 2.72MB
img
renqun.png 2KB
yunchanpuru.png 1KB
nvxingjibing.png 927B
lastindex.png 706B
lodingimgfailed.png 2KB
qita.png 1KB
shijie.png 746B
jiankangyangsheng.png 1KB
arrow.png 280B
gandanpiy.png 2KB
tiaoyang.png 2KB
favorite.png 904B
kouqiang.png 1KB
meirong.png 2KB
huxidao.png 2KB
nanxing.png 2KB
aizheng.png 1KB
search.png 1KB
icon.jpg 6KB
lodingimg.png 2KB
xinzang.png 1KB
jianfei.png 2KB
head_unlogin.png 1KB
back.png 258B
chagnweixiaohua.png 1KB
head_login.png 1KB
jirouguge.png 2KB
canshi.png 2KB
nextindex.png 708B
shenjingxitong.png 2KB
pifu.png 2KB
tabbar
search_selected.png 2KB
discovery.png 1KB
menu.png 639B
search.png 2KB
menu_selected.png 661B
discovery_selected.png 2KB
xueguan.png 2KB
qiguan.png 1KB
jingqi.png 1KB
app.wxss 193B
免费领取100G精品素材干货.jpg 44KB
共 73 条
- 1
资源评论
哇小侠
- 粉丝: 326
- 资源: 159
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功