guoshilong
2023-10-27 2311b03aee9db1bebacdd2ced13c071efda6a011
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
<template>
    <view>
        <view>
            <Search placeholder='请输入姓名' padding='0 30rpx' v-model="query.realName" @search="search" />
        </view>
        <u-list lowerThreshold='100' @scrolltolower="scrolltolower">
            <u-list-item v-for="(item, index) in list" :key="index">
                <u-cell :title="item.realName">
                    <view @click="call(item.phone)" class="value" slot="value">
                        <view class="icon">
                            <u-icon color="#2979ff" name="phone"></u-icon>
                        </view>
                        <!--                         <view class="phone">
                            {{item.phone}}
                        </view> -->
                    </view>
                </u-cell>
            </u-list-item>
        </u-list>
        <u-loading-icon text="加载中" textSize="18" :show="loadingIcon"></u-loading-icon>
        <u-loading-page :loading="loadingPage"></u-loading-page>
    </view>
</template>
 
<script>
    import {
        getList
    } from '@/api/system/user'
    import Search from "@/components/my-components/search.vue"
    export default {
        components: {
            Search
        },
        data() {
            return {
                list: [],
                query: {
                    realName: "",
                },
                page: {
                    current: 1,
                    size: 20,
                    total: 0
                },
                loadingIcon: false,
                loadingPage: false
            }
        },
        created() {
 
        },
        mounted() {
            this.loadmore()
        },
        onLoad(option) {
 
        },
        onShow() {
 
        },
        methods: {
            search() {
                this.page.current = 1
                this.loadmore()
            },
            scrolltolower() {
                this.page.current = this.page.current + 1
                this.loadmore()
            },
            loadmore() {
 
                if (this.page.current == 1) {
                    this.loadingPage = true
                }
 
                this.loadingIcon = true
                getList(this.page.current, this.page.size, this.query, this.userInfo.dept_id).then(res => {
                    let data = res.data.records
 
                    if (this.page.current == 1) {
                        this.list = data
                    } else {
                        this.list = this.list.concat(data)
                    }
                    if (this.loadingPage) {
                        this.loadingPage = false
                    }
                    this.loadingIcon = false
                })
            },
            call(phone) {
                uni.makePhoneCall({
                    phoneNumber: phone
                });
            },
        }
    }
</script>
 
<style scoped lang="scss">
    .value {
        display: flex;
        align-items: center;
    }
</style>