<style>
	.procurementList{
		background-color: #F3F5F7;
		padding:15px;
	}
	.procureList{
		background-color: #fff;
		padding:15px 15px 20px 15px;
	}
	.procure_Top{
		display: flex;
		justify-content: space-between;
	}
	.proriTitle{
		color:#111111;
		font-size:14px;
		font-weight: bold;
	}
	.procureCompany{
		padding:15px;
		background-color: #F7F7F7;
		margin-top:15px;
	}
	.procure_Info{
		display: flex;
		justify-content: space-between;
		color:#111111;
		font-size: 13px;
		margin-bottom: 15px;
	}
	.procure_Info:last-child{
		margin-bottom:0;
	}
</style>
<template>
	<view class="procurementList" style="height:100vh;">
		<u-empty v-if="dataList.length==0" text="暂无数据" mode="data"></u-empty>
		<scroll-view v-else :scroll-y="true" :enable-back-to-top="true" :enable-flex="true"
		 @scrolltolower="lower" :style="{ 'height': `calc(100%)`}">
			<view>
				<view class="procureList" v-for="(item,index) in dataList" :key="index" @click="goDetail(item)">
					<view class="procure_Top">
						<view class="proriTitle">{{item.GoodsCategory}}</view>
						<view>
							<image style="width:20px;height:20px;" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/arrow_right.png" mode=""></image>
						</view>
					</view>
					<view class="procureCompany">
						<view class="procure_Info">
							<view>公司名称</view>
							<view>{{item.CompanyName}}</view>
						</view>
						<view class="procure_Info">
							<view>采购数量</view>
							<view>{{item.ImportNum}}</view>
						</view>
						<view class="procure_Info">
							<view>联系电话</view>
							<view>{{item.Mobile}}</view>
						</view>
						<view class="procure_Info">
							<view>邮箱地址</view>
							<view>{{item.EMail}}</view>
						</view>
						<view class="procure_Info">
							<view>行业</view>
							<view>{{item.Industry}}</view>
						</view>
						<view class="procure_Info">
							<view>年销售(万元)</view>
							<view>{{item.AnnualSales}}</view>
						</view>
						<view class="procure_Info">
							<view>年进口额</view>
							<view>{{item.AnnualImport}}</view>
						</view>
					</view>
				</view>
			</view>
			<view style="padding:10px 0;">
				<u-loadmore :status="status" :load-text="loadText" bg-color="#F3F5F7" :font-size="24" :margin-top="0" :margin-bottom="0" />
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageTitle: "采购列表",
				msg:{
					pageIndex: 1,
					pageSize: 10,
					Type:1
				},
				pageCount: 1,
				dataList:[],
				loadText: {
					loadmore: "轻轻上拉，加载更多",
					loading: "努力加载中",
					nomore: "没有更多了",
				},
				status:'',
			}
		},
		mounted(){
			uni.setNavigationBarTitle({
				title: this.pageTitle,
			});
			this.getList(1);
		},
		methods: {
			//获取数据
			getList(num) {
				if (num == 1) {
					this.dataList = [];
				}
				uni.showLoading({
					title: '加载中'
				});
				this.request2({
						url: "/api/AppletTrade/GetInvestmentProcurementPage",
						data: this.msg,
					},
					(res) => {
						uni.hideLoading();
						if (res.resultCode == 1) {
							console.log(res,'数据类了');
							this.dataList = this.dataList.concat(res.data.pageData);
							this.pageCount = res.data.pageCount;
						}
					}
				);
			},
			//滚动加载
			lower(e) {
				if (this.msg.pageIndex < this.pageCount) {
					this.msg.pageIndex++;
					this.status = "loading";
					this.getList();
				} else {
					this.status = "nomore";
				}
			},
			//跳转详情
			goDetail(item){
				uni.navigateTo({
					url: '/pages/kotra/procurementDetail?Id=' + item.Id
				});
			}
		}
	}
</script>
