1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
| <template>
| <view class="content">
| <view class="cell">
| <view class="cell-item" v-for="(item,index) of list" :key="index">
| <view class="cell-item-info">
| <view class="cell-item-info-text">饮水{{item.ml}}ml</view>
| </view>
| <view class="cell-item-num">{{item.createDate | getTime}}</view>
| </view>
| </view>
| <view class="nomore" v-if="!loading.page && !list.length">
| <u-loadmore status="nomore" />
| </view>
| <u-loading-page :loading="loading.page"></u-loading-page>
| </view>
| </template>
|
| <script>
| export default {
| data() {
| return {
| loading:{
| page:true
| },
| id:0,
| page:1,
| list:[]
| };
| },
| onLoad(o) {
| if(o.id){
| this.id = o.id
| this.init()
| }
| },
| onPullDownRefresh() {
| this.page = 1
| this.init()
| },
| onReachBottom() {
| this.page ++
| this.init()
| },
| methods: {
| init(){
| this.$apis.user.getYsList({id:this.id,pageNum:this.page,pageSize:20}).then(res=>{
| if(this.page == 1){
| this.list = res.data
| }else{
| this.list = [...this.list,...res.data]
| }
| this.loading.page = false
| })
| }
| }
| }
| </script>
|
| <style lang="scss">
| .content{
| padding: 0 28rpx;
| .cell{
| .cell-item{
| height: 128rpx;
| display: flex;
| align-items: center;
| border-bottom: 2rpx solid rgba(217, 217, 217, 0.4);
| .cell-item-info{
| flex: 1;
| .cell-item-info-text{
| font-size: 31rpx;
| color: #000000;
| line-height: 42rpx;
| }
| }
| .cell-item-num{
| font-size: 27rpx;
| color: rgba(0, 0, 0, .4);
| line-height: 38rpx;
| }
| }
| }
| }
| </style>
|
|