participation.vue
4.74 KB
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
<template>
<!-- 活动参与 -->
<view class="page">
<view class="more page-box" @click="toMyAdd">
<u-section :bold="false" title="我的活动申请" sub-title='' :show-line="false" color="#0FBB59" >
<view slot="right">
<u-icon name="arrow-rightward" color="#0FBB59" size="28"></u-icon>
</view>
</u-section>
</view>
<!-- 搜索 -->
<!-- <view class="head-search">
<u-search bg-color="#fff" placeholder="请输入关键词" v-model="pageIndex.activityName" :show-action="false" @search="search"></u-search>
<u-button type="success" @click="search">搜索</u-button>
</view> -->
<view style="margin: 20rpx 0;background-color: #FFFFFF;border-radius: 18rpx;border: 2rpx solid #E8E8E8; margin: 22rpx 24rpx;overflow: hidden;" >
<u-search :action-style="{'background':'#19be6b','color':'#fff','height':'32px','line-height':'32px','border-radius':'18rpx'}" bg-color="#fff" placeholder="请输入关键词" v-model="pageIndex.activityName" action-text="搜索" @clear="search" @search="search" @custom="search"></u-search>
</view>
<view class="screen-list">
<u-dropdown menu-icon="arrow-down-fill" :title-size="24" :height="40">
<u-dropdown-item v-model="pageIndex.orderingRule" title="时间排序" :options="sortTypeOptions" @change="search"></u-dropdown-item>
<u-dropdown-item v-model="pageIndex.activeState" title="活动状态" :options="statusOptions" @change="search"></u-dropdown-item>
</u-dropdown>
</view>
<!-- 订单列表 -->
<view class="goods-data">
<u-row gutter="16" class="goods-list">
<u-col span="6" v-for="(item,index) in datalist" :key="index" @click="toDetail(item.id, '/pages/activityDetail/activityDetail')" >
<view class="demo-layout good-item" style="margin-bottom: 30rpx;">
<u-image :src="imgurl+item.coverImage" border-radius="10" mode="heightFix" height="110px" style="margin-top:8px;margin-right:8px;" ></u-image>
<view class="info">
<view class="title">{{item.activityName}}</view>
<view class="huo-card-item">活动日期:<span>{{item.startTime}}至{{item.endTime}}</span></view>
<view class="huo-card-item">参与人数:<span>{{item.maxParticipants}}</span></view>
<view style="margin-top: 5px;height:23px">
<u-tag text="进行中" type="success" mode="dark" v-if="item.activeState==1"/>
<u-tag text="未开始" type="info" mode="dark" v-if="item.activeState==0"/>
<u-tag text="已结束" type="warning" mode="dark" v-if="item.activeState==2"/>
</view>
</view>
</view>
</u-col>
</u-row>
<!-- <u-loadmore :status="status" @loadmore='loading'/> -->
</view>
<view style="height: 120rpx;"></view>
<view class="page-footer">
<u-button type="success" @click="toAdd">活动申请</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
status: 'loadmore',
datalist: [],
total: 1,
sortTypeOptions: [
{ label: '正序', value: 1 },
{ label: '倒序', value: 2 },
],
statusOptions: [
{ label: '进行中', value: 1 },
{ label: '已结束', value: 2 },
{ label: '未开始', value: 0 },
],
pageIndex :{
activityName: '', // 搜索项
orderingRule: 1, // 排序方式
activeState:null, // 活动状态
pageNumber: 1,
pageSize: 10,
auditStatus:'3',
},
imgurl:''
}
},
onLoad() {
this.status = 'nomore';
this.imgurl = this.$img
},
onPullDownRefresh(e) {
let that = this
that.status = 'loading';
this.page = 0;
setTimeout(() => {
that.list = 1;
that.status = that.list >= that.total ? 'nomore' : 'loadmore';
uni.stopPullDownRefresh();
}, 1000);
},
onReachBottom(e) {
this.loading();
},
mounted() {
this.getAll()
},
methods: {
getAll(val){
this.$http.sendRequest('/cereActivityApplication/queryByPage', 'POST',this.pageIndex,1).then(res => {
this.datalist = res.data.data.content
}).catch(err => {
console.log(err)
//请求失败
})
},
toMyAdd() {
// 跳转我的活动申请
uni.navigateTo({
url: '/pages/mycreated/mycreated'
})
},
search() {
this.getAll()
},
loading() {
let that = this
if(that.status == 'nomore') return;
that.status = 'loading';
that.page = ++that.page;
setTimeout(() => {
that.list += 10;
that.status = that.list >= that.total ? 'nomore' : 'loadmore';
}, 300)
},
join(){
uni.navigateTo({
url: '/pages/mycreated/mycreated?id=1'
})
},
toAdd() {
uni.navigateTo({
url: '/pages/activityAdd/activityAdd'
})
},
toDetail(item, path) {
uni.navigateTo({
url: `${path}?item=${item}`
})
},
}
}
</script>
<style scoped lang="scss">
@import 'participation.scss';
</style>