quanwei
2026-01-17 e1e2fe5710a5b5cd9c19bd3aa99c998a1a613ca8
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<template>
    <view class="member-container" :data-theme='theme()' :class="theme() || ''">
        <!--内容-->
        <view class="member-box">
            <scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50" @scrolltolower="scrolltolowerFunc">
                <view :class="topRefresh ? 'top-refresh open' : 'top-refresh'">
                    <view class="circle" v-for="(circle, n) in 3" :key="n"></view>
                </view>
                <view class="member-list">    
                    <view class="card-item" v-for="(item, index) in listData" :key="index" @click="gotoDetail(item.user_id)">
                        <view class="card-top d-c-c">
                            <image :src="item.avatarUrl"></image>
                        </view>
                        <view class="card-bottom tc">
                            <view class="item-position" v-if="setting.show_position=='1'">{{item.position_name}}</view>
                            <view class="title text-ellipsis-2">{{item.real_name}}</view>
                        </view>
                    </view>
                </view>
                <!--列表-->
                <!-- 没有记录 -->
                <view class="none-data-box" v-if="listData.length==0 && !loading">
                    <image :src="remoteImg('no_thing')" mode="widthFix"></image>
                    <text>暂无数据</text>
                </view>
                <uni-load-more v-else :loadingType="loadingType"></uni-load-more>
            </scroll-view>
        </view>
    </view>
</template>
 
<script>
    import uniLoadMore from '@/components/uni-load-more.vue';
    export default {
        components: {
            uniLoadMore
        },
        data() {
            return {
                /*手机高度*/
                phoneHeight: 0,
                /*可滚动视图区域高度*/
                scrollviewHigh: 0,
                /*商品列表*/
                listData: [],
                status: 0,
                /*最后一页码数*/
                last_page: 0,
                /*当前页面*/
                page: 1,
                /*每页条数*/
                list_rows: 10,
                /*有没有更多*/
                no_more: false,
                /*是否正在加载*/
                loading: true,
                /*顶部刷新*/
                topRefresh: false,
                branch_id: 0,
                words: {},
                setting: {},
            };
        },
        computed: {
            /*加载中状态*/
            loadingType() {
                if (this.loading) {
                    return 1;
                } else {
                    if (this.listData.length != 0 && this.no_more) {
                        return 2;
                    } else {
                        return 0;
                    }
                }
            }
        },
        onLoad(e) {
            if (e.branch_id != undefined) {
                this.branch_id = e.branch_id;
            }
        },
        mounted() {
            this.init();
            this.getData();
        },
        onReachBottom() {},
        methods: {
            /*初始化*/
            init() {
                let _this = this;
                uni.getSystemInfo({
                    success(res) {
                        _this.scrollviewHigh  = res.windowHeight;
                    }
                });
            },
 
            /*获取活动列表*/
            getData() {
                let self = this;
                self.loading = true;
                self._get(
                    'branch.member/index', {
                        page: self.page || 1,
                        list_rows: self.list_rows,
                        branch_id: self.branch_id,
                    }, function(res) {
                        self.words = res.data.words;
                        self.setting = res.data.setting;
                        self.listData = self.listData.concat(res.data.list.data);
                        self.last_page = res.data.list.last_page;
                        if (res.data.list.last_page <= 1) {
                            self.no_more = true;
                        } else {
                            self.no_more = false;
                        }
                        /*设置标题*/
                        uni.setNavigationBarTitle({
                            title: self.words.member_list.value
                        });
                        self.loading = false;
                    }
                );
            },
            
            /*可滚动视图区域到底触发*/
            scrolltolowerFunc() {
                let self = this;
                if (self.no_more) {
                    return;
                }
                self.page++;
                if (self.page <= self.last_page) {
                    self.getData();
                } else {
                    self.no_more = true;
                }
            },
 
            /*跳转详情*/
            gotoDetail(e) {
                let url = 'pages/branch/member/detail/detail?user_id=' + e
                this.gotoPage(url);
            },
 
        }
    };
</script>
 
<style lang="scss" scoped>
    page {
        background: #f5f5f5;
    }
    .member-list {
        padding: 0 10rpx;
        box-sizing: border-box;
        .card-item {
            width: 165rpx;
            background-color: #ffffff;
            margin: 20rpx 10rpx 0;
            padding: 20rpx 0;
            border-radius: 12rpx;
            box-sizing: border-box;
            display: inline-block;
            .card-top {
                image {
                    width: 120rpx;
                    height: 120rpx;
                    border-radius: 50%;
                }
            }
            .card-bottom {
                .title{
                    font-size: 28rpx;
                    color: #333333;
                    padding-top: 10rpx;
                }
                .item-position {
                    display: inline-block;
                    font-size: 24rpx;
                    border-width: 1rpx;
                    border-style: solid;
                    @include border_color('border_color');
                    padding: 6rpx 16rpx;
                    margin-top: 10rpx;
                    border-radius: 60rpx;
                }
            }
        }
    }
 
    
</style>