<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>
|