<template>
	<view>
		<view class="list" @click="togeneral(item.id)" v-for="(item,index) in activityget_list" :key="item.id">
			<view class="u-flex">
				<image style="width: 92rpx;height: 92rpx;" :src="item.school.logo" mode=""></image>
				<view class="" style="margin-left: 20rpx;">
					<text class="fontsty">{{item.title}}</text>
					<view class="font">
						<text>活动时间：</text>
						<text>{{item.start_time.replaceAll('-','.')}}-{{item.end_time.replaceAll('-','.').slice(-5)}}</text>
					</view>
				</view>
			</view>
			<view class="border">
				<button  class="btn">查看活动</button>    
			</view>
		</view>
	</view>
</template>

<script  >
	import {activityget_list} from "@/units/inquire.js"
	export default {
		onReachBottom() {
			if (this.activityget_list.length != this.total) {
				this.page++
				this.activitygetlist()
			}
		},
		data() {
			return {
				page:1,
				activityget_list:[],
			}
		},
		mounted(){
			console.log(111);
			this.activitygetlist()
		},
		props:{
			search:""
		},
		methods: {
			togeneral(id){
				uni.navigateTo({
					url:"/pagesB/general?id="+id
				})
			},
			activitygetlist(){
				console.log(111);
				activityget_list({
					page:this.page,
					search:this.search
				}).then(res=>{
					console.log(res);
					if(this.page == 1){
						this.activityget_list = res.data.data
					}else{
						this.activityget_list = this.activityget_list.concat(res.data.data)
					}
				})
			}
			
		}
	}
</script>


<style lang="scss" scoped>
	.list{
		padding: 32rpx 20rpx 24rpx 28rpx;
		background: #fff;
		border-radius: 16rpx;
		margin-top: 20rpx;
		
		.fontsty{
			font-size: 32rpx;
			font-family: SFPro-Medium, SFPro;
			font-weight: 500;
			color: #222222;
		}
		
		.font{
			font-size: 24rpx;
			font-family: SFPro-Regular, SFPro;
			font-weight: 400;
			color: #555555;
			margin-top: 14rpx;
		}
		
		
		.border{
			margin-top: 28rpx;
			border-top: 2rpx solid #F3F3F3;
		}
		
		
		
		.btn{
			width: 164rpx;
			height: 68rpx;
			line-height: 68rpx;
			margin-top: 22rpx;
			background: #0C66C2;
			border-radius: 10rpx;
			font-size: 28rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #FFFFFF;
			margin-right: 0 !important;
		}
	}
</style>