fix
Helius
2021-02-20 45fb4b11ad51bb38306765b11a6747402e382cee
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<template>
    <view class="container">
        <view class="list-item" v-for="item in list">
            <navigator :url="'./skinDetectionDetail?id='+item.id+'&title='+(item.title?item.title:'')" hover-class="" >
                <view class="list-header">
                    <text class="name">{{item.title || '-'}}</text>
                    <text class="gray">{{item.checkTime}}</text>
                </view>
                <view class="list-content">
                    <view class="flex justify-between">
                        <text>检测师</text>
                        <text class="gray">{{item.checkUserName}}</text>
                    </view>
                    <view class="flex justify-between">
                        <text>检测门店</text>
                        <text class="gray">{{item.shopName}}</text>
                    </view>
                </view>
            </navigator>
        </view>
        <no-record :isShow="!list.length" txt="暂无检测报告"></no-record>
        <view v-if="list.length">
            <uni-load-more :status="loadStatus" color="#a5abaf"></uni-load-more>
        </view>
    </view>
</template>
 
<script>
    import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
    export default{
        components: {
            uniLoadMore
        },
        data(){
            return {
                id: '',
                list: [],
                loadStatus: 'more',
                pageNum: 1
            }
        },
        onLoad(options) {
            this.id = options.id;
            this.loadList()
        },
        onPullDownRefresh(){
            this.reloadData();
            let timer = setTimeout(function () {
                uni.stopPullDownRefresh();
                clearTimeout(timer);
                timer = null;
            }, 800);
        },
        onReachBottom(){
            this.loadList()
        },
        methods:{
            reloadData(){
                this.list = [];
                this.pageNum = 1;
                this.loadStatus = 'more';
                this.loadList();
            },
            loadList(){
                if(this.loadStatus!=='more'){
                    return;
                }
                this.$httpUtils.request('/api/skinCheck/findSkinCheckList', {
                    pageNum: this.pageNum,
                    pageSize: 10,
                    vipId: this.id
                }, 'POST').then((res) => {
                    if(res.status == 200){
                        let result = res.rows;
                        if(result.length < 10){
                            this.loadStatus = 'noMore';
                        } else {
                            this.pageNum ++ ;
                            this.loadStatus = 'more';
                        }
                        this.list = this.list.concat(result);
                    }
                })
            }
        }
    }
</script>
 
<style>
    page{
        background: #F6F6F8;
    }
    .container{
        padding: 15px 10px;
    }
    .list-item{
        background: #FFFFFF;
        color: #3a3f3f;
        font-size: 14px;
        padding: 12px 15px;
        border-radius: 4px;
        margin-bottom: 10px;
    }
    .list-header{
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .list-header .name{
        font-size: 15px;
        font-weight: bold;
    }
    .list-content{
        padding-top: 10px;
        line-height: 26px;
    }
</style>