<template>
|
<view class="activity-container" :data-theme='theme()' :class="theme() || ''">
|
<view class="top-box">
|
<view class="index-search-box index-search-box_re d-b-c" id="searchBox">
|
<view class="index-search index-search_re t-c flex-1">
|
<text class="icon iconfont icon-sousuo"></text>
|
<input type="text" v-model="keyword" class="flex-1 ml10 f26 gray3" value="" placeholder-class="f26 gray9"
|
placeholder="输入用户昵称/姓名/手机号进行搜索" confirm-type="search" @confirm="searchFunc()" />
|
</view>
|
</view>
|
<view class="inner-tab">
|
<view :class="type_active==-1?'item active':'item'" @click="tabTypeFunc(-1)">
|
<view class="box">全部</view>
|
</view>
|
<view :class="type_active==1?'item active':'item'" @click="tabTypeFunc(1)">
|
<view class="box">已签到</view>
|
</view>
|
<view :class="type_active==0?'item active':'item'" @click="tabTypeFunc(0)">
|
<view class="box">未签到</view>
|
</view>
|
</view>
|
</view>
|
<!--列表-->
|
<scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50"
|
@scrolltolower="scrolltolowerFunc">
|
<view class="user-box p-0-20">
|
<view class="item bg-white radius24 mt20" v-for="(item,index) in listData" :key="index">
|
<view class="d-b-c">
|
<view class="avatar">
|
<image :src="item.avatarUrl" mode="aspectFill"></image>
|
</view>
|
<view class="flex-1 ml20 f24">
|
<view class="d-b-c mb16 f28 gray3">{{ item.nickName }}</view>
|
<view class="d-b-c mb16 f28 gray3">姓名:{{ item.real_name }}</view>
|
<view class="d-b-c mb16 f28 gray3">手机号:{{ item.mobile }}</view>
|
<view class="d-b-c mb16 f28 gray3">邀请人:{{ item.recommend_name }}</view>
|
<view class="d-b-c mb16 f28 gray3">所属分会:{{ item.branch.name }}</view>
|
<view class="gray9">报名时间:{{ item.create_time }}</view>
|
</view>
|
<view class="f26">
|
<text class="gray3" v-if="item.is_verify==1">已签到</text>
|
<text class="red" v-else>未签到</text>
|
</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>
|
</view>
|
</scroll-view>
|
|
</view>
|
</template>
|
|
<script>
|
import uniLoadMore from "@/components/uni-load-more.vue";
|
export default {
|
components: {
|
uniLoadMore
|
},
|
data() {
|
return {
|
/*手机高度*/
|
phoneHeight: 0,
|
/*可滚动视图区域高度*/
|
scrollviewHigh: 0,
|
/*状态选中*/
|
type_active: -1,
|
/*数据列表*/
|
listData: [],
|
page: 1,
|
no_more: false,
|
list_rows: 15,
|
loading: true,
|
activity_id: '',
|
keyword: '', // 搜索关键词
|
}
|
},
|
computed: {
|
/*加载中状态*/
|
loadingType() {
|
if (this.loading) {
|
return 1;
|
} else {
|
if (this.listData.length != 0 && this.no_more) {
|
return 2;
|
} else {
|
return 0;
|
}
|
}
|
}
|
},
|
onLoad(e) {
|
this.activity_id = e.activity_id;
|
},
|
mounted() {
|
/*初始化*/
|
this.init();
|
/*获取数据*/
|
this.getData();
|
},
|
methods: {
|
/*初始化*/
|
init() {
|
let self = this;
|
uni.getSystemInfo({
|
success(res) {
|
self.phoneHeight = res.windowHeight;
|
// 计算组件的高度
|
let view = uni.createSelectorQuery().select('.top-box');
|
view.boundingClientRect(data => {
|
let h = self.phoneHeight - data.height;
|
self.scrollviewHigh = h;
|
}).exec();
|
}
|
});
|
},
|
|
/*获取数据*/
|
getData() {
|
let self = this;
|
uni.showLoading({
|
title: '加载中'
|
});
|
let params = {
|
activity_id: self.activity_id,
|
verify_status: self.type_active,
|
keyword: self.keyword,
|
list_rows: self.list_rows,
|
page: self.page
|
};
|
self.loading = true;
|
self._get('branch.admin.activityUser/lists', params, function(res) {
|
self.listData = self.listData.concat(res.data.list.data);
|
self.last_page = res.data.list.last_page;
|
if (self.last_page <= 1) {
|
self.no_more = true;
|
}
|
uni.hideLoading();
|
self.loading = false;
|
});
|
},
|
|
searchFunc() {
|
this.listData = [];
|
this.page = 1;
|
/*获取列表*/
|
this.getData();
|
},
|
|
/*类别切换*/
|
tabTypeFunc(e) {
|
let self = this;
|
self.listData = [];
|
self.page = 1;
|
self.no_more = false;
|
self.loading = true;
|
self.type_active = e;
|
self.getData();
|
},
|
|
/*可滚动视图区域到底触发*/
|
scrolltolowerFunc() {
|
let self = this;
|
if (self.no_more) {
|
return;
|
}
|
self.page++;
|
if (self.page <= self.last_page) {
|
self.getData();
|
} else {
|
self.no_more = true;
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.top-box {
|
.inner-tab {
|
position: relative;
|
height: 70rpx;
|
display: flex;
|
justify-content: space-around;
|
align-items: center;
|
background: #ffffff;
|
z-index: 9;
|
.item {
|
flex: 1;
|
height: 100%;
|
line-height: 70rpx;
|
position: relative;
|
color: #999;
|
font-size: 28rpx;
|
&.active {
|
color: #333333;
|
font-weight: bold;
|
&::after {
|
content: '';
|
width: 72rpx;
|
height: 4rpx;
|
background: #EE1414;
|
border-radius: 2rpx;
|
position: absolute;
|
bottom: 14rpx;
|
left: 0;
|
right: 0;
|
margin: auto;
|
}
|
}
|
.box {
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
flex-direction: row;
|
}
|
}
|
}
|
.top-add {
|
@include background_color('background_color');
|
height: 60rpx;
|
border-radius: 80rpx;
|
color: #ffffff;
|
padding: 0 20rpx;
|
margin-left: 30rpx;
|
|
.iconfont {
|
color: #ffffff;
|
}
|
}
|
}
|
|
.user-box {
|
|
.item {
|
padding: 20rpx;
|
}
|
.avatar {
|
|
image {
|
width: 80rpx;
|
height: 80rpx;
|
border-radius: 80rpx;
|
}
|
}
|
}
|
</style>
|