Blame view

pages/participation/participation.vue 4.44 KB
4dfe89e4   monkeyhouyi   初始化
1
  <template>
4c26c806   monkeyhouyi   活动参与,活动申请
2
  	<!-- 活动参与 -->
4dfe89e4   monkeyhouyi   初始化
3
  	<view class="page">
354e3811   杨鑫   '验收'
4
5
  		<view class="more page-box" @click="toMyAdd">
  			<u-section :bold="false" title="我的活动申请" sub-title='' :show-line="false" color="#0FBB59" >
4c26c806   monkeyhouyi   活动参与,活动申请
6
7
  				<view slot="right">
  					<u-icon name="arrow-rightward" color="#0FBB59" size="28"></u-icon>
4dfe89e4   monkeyhouyi   初始化
8
  				</view>
4c26c806   monkeyhouyi   活动参与,活动申请
9
10
11
12
  			</u-section>
  		</view>
  		<!-- 搜索 -->
  		<view class="head-search">
354e3811   杨鑫   '验收'
13
  			<u-search bg-color="#fff" placeholder="请输入关键词" v-model="query.activityName" :show-action="false" @search="search"></u-search>
4c26c806   monkeyhouyi   活动参与,活动申请
14
  			<u-button type="success" @click="search">搜索</u-button>
4dfe89e4   monkeyhouyi   初始化
15
  		</view>
4dfe89e4   monkeyhouyi   初始化
16
  		<view class="screen-list">
1b38b4ce   monkeyhouyi   商铺、广告-列表、详情
17
  			<u-dropdown menu-icon="arrow-down-fill" :title-size="24" :height="40">
00e7322c   monkeyhouyi   我的活动申请
18
19
20
  				<u-dropdown-item v-model="query.sortType" title="时间排序" :options="sortTypeOptions" @change="search"></u-dropdown-item>
  				<u-dropdown-item v-model="query.status" title="活动状态" :options="statusOptions" @change="search"></u-dropdown-item>
  			</u-dropdown>
4dfe89e4   monkeyhouyi   初始化
21
22
23
  		</view>
  		<!-- 订单列表 -->
  		<view class="goods-data">
4c26c806   monkeyhouyi   活动参与,活动申请
24
  			<u-row gutter="16" class="goods-list">
354e3811   杨鑫   '验收'
25
  				<u-col span="6" v-for="(item,index) in datalist" :key="index"  @click="toDetail(item.id, '/pages/activityDetail/activityDetail')" >
4c26c806   monkeyhouyi   活动参与,活动申请
26
  					<view class="demo-layout good-item">
354e3811   杨鑫   '验收'
27
  						<image :src="item.coverImage" style="width: 315rpx; height: 315rpx; border-radius: 10rpx;"></image>
4c26c806   monkeyhouyi   活动参与,活动申请
28
  						<view class="info">
354e3811   杨鑫   '验收'
29
30
31
  							<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>
4c26c806   monkeyhouyi   活动参与,活动申请
32
  							<u-tag text="进行中" type="success" mode="dark" />
4dfe89e4   monkeyhouyi   初始化
33
  						</view>
4dfe89e4   monkeyhouyi   初始化
34
  					</view>
4c26c806   monkeyhouyi   活动参与,活动申请
35
36
37
38
39
40
41
  				</u-col>
  				<u-loadmore :status="status" @loadmore='loading' style="width: 100%; text-align: center;"/>
  			</u-row>
  		</view>
  		<view style="height: 120rpx;"></view>
  		<view class="page-footer">
  			<u-button type="success" @click="toAdd">活动申请</u-button>
4dfe89e4   monkeyhouyi   初始化
42
43
44
45
46
47
48
49
  		</view>
  	</view>
  </template>
  
  <script>
  	export default {
  		data() {
  			return {
4c26c806   monkeyhouyi   活动参与,活动申请
50
  				status: 'loadmore',
354e3811   杨鑫   '验收'
51
  				datalist: [],
4c26c806   monkeyhouyi   活动参与,活动申请
52
  				total: 1,
00e7322c   monkeyhouyi   我的活动申请
53
  				query: {
354e3811   杨鑫   '验收'
54
  					activityName: '', // 搜索项
00e7322c   monkeyhouyi   我的活动申请
55
56
  					sortType: '', // 排序方式
  					status: '', // 活动状态
354e3811   杨鑫   '验收'
57
  					pageNumber: 1,
00e7322c   monkeyhouyi   我的活动申请
58
59
60
61
62
63
64
65
66
67
68
69
  					pageSize: 10,
  				},
  				sortTypeOptions: [
  					{ label: '默认排序', value: 1 },
  					{ label: '正序', value: 2 },
  					{ label: '倒序', value: 3 },
  				],
  				statusOptions: [
  					{ label: '进行中', value: 1 },
  					{ label: '已结束', value: 2 },
  					{ label: '未开始', value: 3 },
  				],
354e3811   杨鑫   '验收'
70
71
72
73
74
  				pageIndex :{
  					pageNumber: 1,
  					pageSize: 10,
  				}
  			}
4dfe89e4   monkeyhouyi   初始化
75
  		},
4c26c806   monkeyhouyi   活动参与,活动申请
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
  		onLoad() {
  			this.status = 'nomore';
  		},
  		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();
  		},
354e3811   杨鑫   '验收'
92
93
94
  		mounted() {
  			this.getAll()
  		},
4dfe89e4   monkeyhouyi   初始化
95
  		methods: {
354e3811   杨鑫   '验收'
96
97
98
99
100
101
102
103
104
  			getAll(val){
  				this.pageIndex.createUser  =uni.getStorageSync('shopId')
  				this.$http.sendRequest('/cereActivityApplication/queryByPage', 'POST',this.pageIndex,1).then(res => {
  				   this.datalist = res.data.data.content
  				}).catch(err => {
  					console.log(err)
  					//请求失败
  				})
  			},
4c26c806   monkeyhouyi   活动参与,活动申请
105
106
  			toMyAdd() {
  				// 跳转我的活动申请
00e7322c   monkeyhouyi   我的活动申请
107
108
109
  				uni.navigateTo({
  					url: '/pages/mycreated/mycreated'
  				})
4c26c806   monkeyhouyi   活动参与,活动申请
110
111
  			},
  			search() {
354e3811   杨鑫   '验收'
112
113
114
115
116
117
118
119
120
121
122
123
  				this.query.createUser  =uni.getStorageSync('shopId')
  				this.$http.sendRequest('/cereActivityApplication/queryByPage', 'POST',this.query,1).then(res => {
  				   this.datalist = res.data.data.content
  				   this.query ={
  					   	activityName: '', // 搜索项
  					   	sortType: '', // 排序方式
  					   	status: '', // 活动状态
  					   	pageNumber: 1,
  					   	pageSize: 10,
  					   
  				   }
  				})
4c26c806   monkeyhouyi   活动参与,活动申请
124
125
126
127
128
129
130
131
132
133
134
  			},
  			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)
  			},
c62ab6f2   杨鑫   1
135
136
137
138
  			join(){
  				uni.navigateTo({
  					url: '/pages/mycreated/mycreated?id=1'
  				})
4c26c806   monkeyhouyi   活动参与,活动申请
139
140
  			},
  			toAdd() {
354e3811   杨鑫   '验收'
141
  				uni.navigateTo({	
4c26c806   monkeyhouyi   活动参与,活动申请
142
143
  					url: '/pages/activityAdd/activityAdd'
  				})
354e3811   杨鑫   '验收'
144
145
146
147
148
149
150
151
  			},
  			toDetail(item, path) {
  				
  				uni.navigateTo({
  					url: `${path}?item=${item}`
  				})
  				
  			},
4dfe89e4   monkeyhouyi   初始化
152
153
154
155
156
157
158
  		}
  	}
  </script>
  
  <style scoped lang="scss">
  	@import 'participation.scss';
  </style>