From 52c796b35f5fd4d5c40e7bcab3733280b8191712 Mon Sep 17 00:00:00 2001 From: Liuhongxiang <997903109@qq.com> Date: Sun, 19 Nov 2017 12:16:09 +0800 Subject: [PATCH] =?UTF-8?q?#3=20#27=20=E7=AC=AC3=E6=AC=A1=E5=AE=9E?= =?UTF-8?q?=E9=AA=8C=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1514080901119/pages/scrollView/scrollView.js | 133 ++++++++++++++++++ .../pages/scrollView/scrollView.json | 1 + .../pages/scrollView/scrollView.wxml | 30 ++++ .../pages/scrollView/scrollView.wxss | 1 + 4 files changed, 165 insertions(+) create mode 100644 1514080901119/pages/scrollView/scrollView.js create mode 100644 1514080901119/pages/scrollView/scrollView.json create mode 100644 1514080901119/pages/scrollView/scrollView.wxml create mode 100644 1514080901119/pages/scrollView/scrollView.wxss diff --git a/1514080901119/pages/scrollView/scrollView.js b/1514080901119/pages/scrollView/scrollView.js new file mode 100644 index 00000000..968903e9 --- /dev/null +++ b/1514080901119/pages/scrollView/scrollView.js @@ -0,0 +1,133 @@ +// pages/demo/scrollView.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + session: [] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var that = this + // 设置窗口大小 + wx.getSystemInfo({ + success: (res) => { + that.setData({ + windowHeight: res.windowHeight - 5, + windowWidth: res.windowWidth + }) + //console.dir(that.data.windowHeight) + } + }) + that.setData({ + sessions: [{ + name: "书签", + icon: "a.png", + msg : " 共12条" + }, { + name: "书讯", + icon: "a.png", + msg: "共8条" + }, { + name: "读书计划", + icon: "a.png", + msg: "数量。" + }, { + name: "家有藏书", + icon: "b.png", + msg: "数量" + }, { + name: "关注书本", + icon: "a.png", + msg: "数量。" + }, { + name: "添加书本", + icon: "b.png", + msg: "数量" + }, { + name: "Tom", + icon: "a.png", + msg: "您好。" + }, { + name: "John", + icon: "b.png", + msg: "在吗?" + }] + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + + onEnd : function(e) { + console.dir(e) + var that = this; + that.setData({ + //isLower: true, + sessions: that.data.sessions.concat([{ + name: "书签", + icon: "a.png", + msg: "共12条" + }, { + name: "添加书本", + icon: "b.png", + msg: "数量" + }]) + }) + + }, + + onScroll: function() { + console.dir("onScroll"); + } +}) \ No newline at end of file diff --git a/1514080901119/pages/scrollView/scrollView.json b/1514080901119/pages/scrollView/scrollView.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/1514080901119/pages/scrollView/scrollView.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/1514080901119/pages/scrollView/scrollView.wxml b/1514080901119/pages/scrollView/scrollView.wxml new file mode 100644 index 00000000..57eb9ae1 --- /dev/null +++ b/1514080901119/pages/scrollView/scrollView.wxml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + ({{index+1}}) {{item.name}} + {{item.msg}} + + + + + + + 正在加载 + + + 暂无数据 + + + diff --git a/1514080901119/pages/scrollView/scrollView.wxss b/1514080901119/pages/scrollView/scrollView.wxss new file mode 100644 index 00000000..49fe14de --- /dev/null +++ b/1514080901119/pages/scrollView/scrollView.wxss @@ -0,0 +1 @@ +/* pages/demo/scrollView.wxss */ \ No newline at end of file