Browse Source

no message

feature/v1.1.0
xpz2018 7 years ago
parent
commit
0812b2ea63
3 changed files with 29 additions and 4 deletions
  1. 10
      pages/activity_list/activity_list.js
  2. 7
      pages/activity_list/activity_list.wxml
  3. 16
      pages/activity_list/activity_list.wxss

10
pages/activity_list/activity_list.js

@ -6,6 +6,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
loading: true,
repos: [], repos: [],
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
@ -54,12 +55,14 @@ Page({
//最后一页数据添加 //最后一页数据添加
that.setData({ that.setData({
repos: lists.concat(respList), repos: lists.concat(respList),
loading: false,
hasMoreData: false hasMoreData: false
}); });
} else { } else {
that.setData({ that.setData({
repos: lists.concat(respList), repos: lists.concat(respList),
hasMoreData: true, hasMoreData: true,
loading: false,
pageNum: that.data.pageNum + 1 pageNum: that.data.pageNum + 1
}); });
} }
@ -69,6 +72,9 @@ Page({
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}); });
that.setData({
loading: false,
});
} }
}, },
fail: function (e) { fail: function (e) {
@ -78,9 +84,13 @@ Page({
icon: 'none', icon: 'none',
duration: 1000 duration: 1000
}); });
that.setData({
loading: false,
});
}, },
complete: function (res) { complete: function (res) {
// complete // complete
that.data.loading = false
wx.hideNavigationBarLoading() //完成停止加载 wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新 wx.stopPullDownRefresh() //停止下拉刷新
}, },

7
pages/activity_list/activity_list.wxml

@ -1,6 +1,6 @@
<!--pages/activity_list/activity_list.wxml--> <!--pages/activity_list/activity_list.wxml-->
<view wx:if="{{repos.length > 0}}"> <view wx:if="{{repos.length > 0}}">
<view wx:for="{{repos}}" wx:key=""> <view wx:for="{{repos}}" wx:key="">
<view class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active" bindtap="itemClick" data-activityNo="{{item.activityNo}}" data-groupNo="{{item.groupNo}}"> <view class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active" bindtap="itemClick" data-activityNo="{{item.activityNo}}" data-groupNo="{{item.groupNo}}">
@ -29,8 +29,9 @@
</view> </view>
</view> </view>
<view wx:else>
<view wx:if="{{repos.length <= 0 && !loading}}">
<view class="empty-layout"> <view class="empty-layout">
<text>亲,您还没有参加任何活动!</text>
<image class="icon-empty" src="../../images/空.png" />
<text class="text-empty">亲,您还没有参加任何活动!</text>
</view> </view>
</view> </view>

16
pages/activity_list/activity_list.wxss

@ -87,6 +87,8 @@
vertical-align: top; vertical-align: top;
} }
.weui-media-box__type{ .weui-media-box__type{
width: 90rpx; width: 90rpx;
height: 40rpx; height: 40rpx;
@ -136,9 +138,21 @@
.empty-layout { .empty-layout {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding-top: 65%;
padding-top: 50%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.icon-empty {
width: 80px;
height: 80px;
vertical-align: top;
margin-bottom: 40px;
}
.text-empty {
font-size: 15px;
float: left;
}
Loading…
Cancel
Save