<template>
|
<view class="activity-user-box" :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">
|
<span class="icon iconfont icon-sousuo"></span>
|
<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==0?'item active':'item'" @click="tabTypeFunc(0)">
|
<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==2?'item active':'item'" @click="tabTypeFunc(2)">
|
<view class="box">已缺席</view>
|
</view>
|
</view>
|
</view>
|
<view class="list-wrap">
|
<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="list-box p-0-20">
|
<view class="item bg-white radius24 mt20" v-for="(item,index) in listData" :key="index" @click="gotoDetail(item.order_id)">
|
<view class="d-b-c">
|
<view class="f30 fb">{{item.activity.branch.name}}</view>
|
<view class="f28">
|
<text class="theme-price" v-if="item.is_verify==0">待签到</text>
|
<text class="gray9" v-else-if="item.is_verify==1">已签到</text>
|
<text class="gray" v-else>已缺席</text>
|
</view>
|
</view>
|
<view class="item-info-box pt20">
|
<view class="pr20">
|
<image :src="item.activity.image.file_path" mode="aspectFill"></image>
|
</view>
|
<view class="item-info d-c pl20">
|
<view class="gray3 f28 text-ellipsis-2">{{item.activity.name}}</view>
|
<view class="d-b-c">
|
<view class="gray6">活动开始时间:{{item.activity.status_text.act_start_time}}</view>
|
</view>
|
</view>
|
</view>
|
<view class="friend-info d-b-c mt20 p20 radius12" v-if="item.is_friend">
|
<view class="d-s-c">
|
<text class="iconfont icon-gantanhao mr10"></text>
|
<text>帮朋友报名:</text>
|
</view>
|
<view>{{item.real_name}}({{item.mobile}})</view>
|
</view>
|
<!-- <view class="item-operation d-e-c pt30">
|
<view class="item-btn" @click="gotoDetail(item.order_id)">查看核销码</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 utils from "@/common/utils.js";
|
import uniLoadMore from "@/components/uni-load-more.vue";
|
export default {
|
components: {
|
uniLoadMore
|
},
|
data() {
|
return {
|
/*手机高度*/
|
phoneHeight: 0,
|
/*可滚动视图区域高度*/
|
scrollviewHigh: 0,
|
/*顶部刷新*/
|
topRefresh: false,
|
/*底部加载*/
|
loading: true,
|
/*没有更多*/
|
no_more: false,
|
/*类别选中*/
|
type_active: -1,
|
/*报名列表*/
|
listData: [],
|
/*当前页面*/
|
page: 1,
|
keyword: '', // 搜索关键词
|
list_rows: 10,
|
last_page: 0,
|
};
|
},
|
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.keyword) {
|
this.keyword = e.keyword;
|
}
|
},
|
mounted() {
|
this.init();
|
/*获取列表*/
|
this.getData();
|
},
|
onPullDownRefresh() {
|
/*下拉到顶,页面值还原初始化*/
|
this.restoreData();
|
this.getData();
|
},
|
methods: {
|
searchFunc() {
|
this.listData = [];
|
this.page = 1;
|
/*获取列表*/
|
this.getData();
|
},
|
/*初始化*/
|
init() {
|
let _this = this;
|
uni.getSystemInfo({
|
success(res) {
|
_this.phoneHeight = res.windowHeight;
|
// 计算组件的高度
|
let view = uni.createSelectorQuery().select('.top-box');
|
view.boundingClientRect(data => {
|
let h = _this.phoneHeight - data.height;
|
_this.scrollviewHigh = h;
|
}).exec();
|
}
|
});
|
},
|
|
/*还原初始化*/
|
restoreData() {
|
this.listData = [];
|
this.keyword = '';
|
},
|
|
/*类别切换*/
|
tabTypeFunc(e) {
|
let self = this;
|
self.listData = [];
|
self.page = 1;
|
self.no_more = false;
|
self.loading = true;
|
self.type_active = e;
|
self.getData();
|
},
|
|
/*获取数据*/
|
getData() {
|
let self = this;
|
let params = {
|
page: self.page,
|
list_rows: self.list_rows,
|
keyword: self.keyword,
|
verify_status: self.type_active
|
};
|
self.loading = true;
|
self._get('branch.activityUser/listsForUser', params, function(res) {
|
self.loading = false;
|
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;
|
}
|
});
|
},
|
|
/*跳转详情*/
|
gotoDetail(e) {
|
let url = 'pages/user/my_activity/detail?id=' + e
|
this.gotoPage(url);
|
},
|
|
/*可滚动视图区域到底触发*/
|
scrolltolowerFunc() {
|
let self = this;
|
self.bottomRefresh = true;
|
self.page++;
|
self.loading = true;
|
if (self.page > self.last_page) {
|
self.loading = false;
|
self.no_more = true;
|
return;
|
}
|
self.getData();
|
},
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.activity-user-box {
|
.top-box {
|
.inner-tab {
|
position: relative;
|
height: 80rpx;
|
display: flex;
|
justify-content: space-around;
|
align-items: center;
|
background: #ffffff;
|
z-index: 9;
|
.item {
|
flex: 1;
|
height: 100%;
|
line-height: 80rpx;
|
position: relative;
|
color: #999;
|
font-size: 32rpx;
|
&.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;
|
}
|
}
|
}
|
}
|
.list-wrap {
|
|
.list-box {
|
|
.item{
|
padding: 20rpx;
|
|
.item-info-box {
|
display: flex;
|
|
image {
|
width: 230rpx;
|
height: 120rpx;
|
border-radius: 12rpx;
|
background-color: rgba(0, 0, 0, 0.1);
|
}
|
|
.item-info {
|
display: flex;
|
justify-content: space-between;
|
}
|
}
|
|
.item-operation {
|
|
.item-btn {
|
font-size: 26rpx;
|
color: #333333;
|
border: 1rpx solid #cccccc;
|
border-radius: 60rpx;
|
padding: 14rpx 30rpx;
|
}
|
}
|
|
.friend-info {
|
background: #FCF8ED;
|
}
|
}
|
}
|
}
|
}
|
|
</style>
|