businessList.vue 3.07 KB
<template>
	<!-- 商务合作 -->
	<view class="page">
		<!-- 搜索 -->
		<view class="head-search">
			<u-search bg-color="#fff" placeholder="请输入关键词" v-model="query.title" :show-action="false" @search="search"></u-search>
			<u-button type="success" @click="search">搜索</u-button>
		</view>
		<view class="goods-data">
			<view class="goods-list">
				<view class="good-item" v-for="(v, i) in list" :key="i" @click="toDetail(v)">
					<view class="body">
						<view class="info">
							<view class="title">{{v.title}}</view>
							<!-- <view class="info-item">{{v.}}</view> -->
						</view>
						<image :src="v.coverImage" ></image>
					</view>
				</view>
				<u-loadmore :status="statuslist" @loadmore='loading' style="width: 100%; text-align: center;"/>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabList:[
					{ name: '全部' },
					{ name: '待提交' },
					{ name: '待审核' },
					{ name: '通过' },
					{ name: '驳回' },
					{ name: '进行中' },
					{ name: '已结束' },
				],
				current: 0,
				datalist: [],
				total: 2,
				statuslist: 'loadmore',
				query: {			
							title: '',
							pageNumber: 1,
							pageSize: 10,
						
					},
				listIn:0,
				num:0,
				list:[]
				
			};
		},
		onLoad(option) {
			// console.log(option.id);
			// this.num = option.id;
			this.statuslist = 'nomore';
		},
		mounted() {
			this.getALL()
		},
		onPullDownRefresh(e) {
			let that = this
			that.statuslist = 'loading';
			this.page = 0;
			setTimeout(() => {
				that.datalist = [{}];
				that.statuslist = that.datalist.length >= that.total ? 'nomore' : 'loadmore';
				uni.stopPullDownRefresh();
			}, 1000);
		},
		onReachBottom(e) {
			// this.loading();
		},
		methods: {
			tabsChange(val) {
				this.current = val;
			},
			search() {
				this.$http.sendRequest('/cereBusinessCooperation/queryByPage', 'POST', this.query,1).then(res => {
					this.list =res.data.data.content 
					this.query ={			
							title: '',
							pageNumber: 1,
							pageSize: 10,
						
					}
				})
			},
			getALL(){
					let pagesize = {
						pageNumber: 1,
						pageSize: 2
					}
			
			this.$http.sendRequest('/cereBusinessCooperation/queryByPage', 'POST', pagesize,1).then(res => {
				this.list =res.data.data.content 
			})
				},
			loading() {
				let that = this
				if(that.statuslist == 'nomore') return;
				that.statuslist = 'loading';
				that.query.pageNum = ++that.query.pageNum;
				setTimeout(() => {
					let data = [{}, {}];
					that.datalist = [...that.datalist, ...data];
					console.log(that.datalist);
					that.statuslist = that.datalist.length >= that.total ? 'nomore' : 'loadmore';
				}, 300)
			},
			sel(val){
				this.listIn = val
			},
			toDetail(items) {
				let msg = JSON.stringify(items)
				uni.navigateTo({
					url: `/pages/business/businessDetail/businessDetail?item=${msg}`
				})

			},
			reconciliationdetail() {
	
			},
			toAdd() {
				uni.navigateTo({
					url: '/pages/activityAdd/activityAdd'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	@import 'businessList.scss';
</style>