Skip to content

Commit

Permalink
Merge pull request #385 from hongxiangliu/master
Browse files Browse the repository at this point in the history
#3 #27 第3次实验代码
  • Loading branch information
zengsn authored Nov 20, 2017
2 parents 73457b5 + 52c796b commit 47307b2
Show file tree
Hide file tree
Showing 4 changed files with 165 additions and 0 deletions.
133 changes: 133 additions & 0 deletions 1514080901119/pages/scrollView/scrollView.js
Original file line number Diff line number Diff line change
@@ -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");
}
})
1 change: 1 addition & 0 deletions 1514080901119/pages/scrollView/scrollView.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
30 changes: 30 additions & 0 deletions 1514080901119/pages/scrollView/scrollView.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!--pages/demo/scrollView.wxml-->
<scroll-view class="page" scroll-y="true" style="height:{{windowHeight}}px;" bindscrolltolower="onEnd" bindscroll="onScroll">
<view class="page__hd">
<view class="page__title"></view>
<view class="page__desc"></view>
</view>
<view class="page__bd">
<view class="weui-panel weui-panel_access">
<view class="weui-panel__hd"></view>
<view class="weui-panel__bd">
<navigator url="" wx:for="{{sessions}}" wx:key="name" class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active">
<view class="weui-media-box__hd weui-media-box__hd_in-appmsg">
<image class="weui-media-box__thumb" src="../example/images/a.png" />
</view>
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
<view class="weui-media-box__title">({{index+1}}) {{item.name}}</view>
<view class="weui-media-box__desc">{{item.msg}}</view>
</view>
</navigator>
</view>
</view>
<view class="weui-loadmore" wx:if="{{isLower}}">
<view class="weui-loading"></view>
<view class="weui-loadmore__tips">正在加载</view>
</view>
<view class="weui-loadmore weui-loadmore_line" wx:if="{{isEnd}}">
<view class="weui-loadmore__tips weui-loadmore__tips_in-line">暂无数据</view>
</view>
</view>
</scroll-view>
1 change: 1 addition & 0 deletions 1514080901119/pages/scrollView/scrollView.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* pages/demo/scrollView.wxss */

0 comments on commit 47307b2

Please sign in to comment.