hxlist.vue 5.35 KB
<template>
	<!-- 商务合作 -->
	<view class="page">
		<!-- 搜索 -->
		<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="pagesize.title" action-text="搜索" @clear="search" @search="search" @custom="search"></u-search>
		</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.createTime}}</view>
						</view>
						<image :src="imgurl+v.coverImage" ></image>
					</view>
				</view>
				<!-- <u-loadmore :status="statuslist" @loadmore='loading' style="width: 100%; text-align: center;"/> -->
			</view>
		</view>
		<view style="position: fixed;bottom: 0;left: 0;width: 100%;padding-bottom: 40rpx;padding-top: 20rpx;background: #ffff;">
			<view style="color:#fff;height:32px,;line-height:32px;border-radius:18rpx;background: #19be6b;">
				核销
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabList:[
					{ name: '全部' },
					{ name: '待提交' },
					{ name: '待审核' },
					{ name: '通过' },
					{ name: '驳回' },
					{ name: '进行中' },
					{ name: '已结束' },
				],
				current: 0,
				datalist: [],
				total: 2,
				statuslist: 'loadmore',
				pagesize: {			
							title: '',
							pageNumber: 1,
							pageSize: 10,
							status:'1',
					},
				listIn:0,
				num:0,
				list:[],
				imgurl:''
				
			};
		},
		onLoad(option) {
			this.imgurl = this.$img
			// 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() {
				console.error('=========')
				this.getAll()
			},
			getAll(){
			this.$http.sendRequest('/cereBusinessCooperation/queryByPage', 'POST', this.pagesize,1).then(res => {
				this.list =res.data.data.content 
			})
				},
			loading() {
				let that = this
				if(that.statuslist == 'nomore') return;
				that.statuslist = 'loading';
				that.pagesize.pageNum = ++that.pagesize.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">
	.page{
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		// padding: 0 40rpx;
		// background-color: #fff;
	}
	.head-search{
		// display: flex;
		// align-items: center;
		// justify-content: space-between;
		// position: relative;
		margin: 20rpx 0;
		background-color: #FFFFFF;
		border-radius: 18rpx;
		// padding: 0 10rpx;
		border: 2rpx solid #E8E8E8;
		margin: 22rpx 24rpx;
		overflow: hidden;
		.u-search {
			position: relative;
		}
		.u-btn {
			border: unset;
			border: 0px transparent;
			height: 46rpx;
			width: 88rpx;
			font-size: 24rpx;
			border-radius: 35rpx;
		}
	}
	
	.goods-data{
		width: 100%;
		.goods-list{
			width: 100%;
			.good-item {
				width: 100%;
				background-color: #FFFFFF;
				border-bottom: #eee solid 1rpx;
				padding: 18rpx 10rpx;
				.body {
					display: flex;
					width: 100%;
					height: calc(100% - 70rpx);
					padding: 15rpx 18rpx;
					justify-content: space-around;
					image {
						width: 194rpx;
						height: 144rpx;
						border-radius: 8rpx;
					}
					.info {
						// flex: 1;
						width: calc(100% - 236rpx);
						.title {
							width: 100%;
							font-size: 28rpx;
							line-height: 44rpx;
							font-weight: 700;
							// white-space: nowrap;
							// overflow : hidden;
							// text-overflow: ellipsis;
							margin-bottom: 70rpx;
						}
						.info-item {
							line-height: 30rpx;
							font-size: 26rpx;
							color: #9FABB5;
						}
					}
				}
			}
		}
	}
	.page-footer{
		position: fixed;
		left: 0;
		bottom: 0;
		width: 100%;
		height: 120rpx;
		background-color: #FFFFFF;
		padding: 20rpx 20rpx;
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
		z-index: 999;
		.footer-buy{
			display: flex;
			align-items: center;
			justify-content: space-between;
			width: 100%;
			height: 100%;
			.cart-add{
				display: flex;
				align-items: center;
				justify-content: center;
				width: 100%;
				height: 70rpx;
				background-color: #3f9b6a;
				text{
					font-size: 28rpx;
					color: #FFFFFF;
				}
			}
		}
	}
</style>