<template>
	<view class="container-main">
		<view class="list">
			<view class="list-item"  @click="getInfo()">
				<view class="item-state" :class="'state1'">
             "处理中"
				</view>
				<view class="item-data">
					<view class="data-main">
						<view class="data-title">232</view>
						<view class="data-lable-value">
							<view class="row-item">
								<view class="item-lable">
									<view class="lable-icon">
										<image :src="baseImgUrl + 'liao-ning/icon_faburen.png'" mode=""></image>
									</view>
									<view class="lable-text">事故类型:</view>
								</view>
								<view class="item-value">2323</view>
							</view>
							<view class="row-item">
								<view class="item-lable">
									<view class="lable-icon">
										<image :src="baseImgUrl + 'liao-ning/icon_shijian.png'" mode=""></image>
									</view>
									<view class="lable-text">申请时间:</view>
								</view>
								<view class="item-value">23</view>
							</view>
							<view class="row-item" >
								<view class="item-lable">
									<view class="lable-icon">
										<image :src="baseImgUrl + 'liao-ning/icon_danwei.png'" mode=""></image>
									</view>
									<view class="lable-text">理赔金额:</view>
								</view>
								<view class="item-value" style="color: #3976f1; font-weight: 520">1232
								</view>
							</view>
						</view>
					</view>
					<!-- <view class="data-btn" v-if="item.state == 0" @click="goForm()">
						我要填写
					</view> -->
				</view>
			</view>
			<u-loadmore :status="status" :load-text="loadText" />
		</view>
		<fixedButton title="在线理赔" @click="clickSub" v-if="show == 2" />
	</view>
</template>
<script>

	export default {

		data() {
			return {
				baseImgUrl: getApp().globalData.config.iamgeBaseUrl,
				status: "nomore",
				loadText: {
					loading: "努力加载中",
					nomore: "已经到底了~",
				},
				show: 1,
				list: [],
				typeState: [{
					lable: "食物中毒",
					value: 0,
				}, ],
				total: 0,
				loading: false,
				queryParams: {
					code: undefined,
					identification: "",
					pageNum: 1,
					pageSize: 10,
				},
				data: {},
			};
		},
		onLoad(option) {
			let _this = this;
			this.show = option.showBtn;
			if (this.show == 2) {
				this.httpThreeGet()
			} else {
			}
			this.getList();

		},
		onReachBottom(e) {
			if (this.queryParams.pageNum < this.total) {
				if (this.loading == true) {
					this.status = "nomore";
					return;
				}
				this.queryParams.pageNum = this.queryParams.pageNum + 1;
				this.getList();
			}
		},
		methods: {
			// 重置
			reset() {
				this.list = [];
				this.total = 0;
				this.loading = false;
				this.queryParams = {
					pageNum: 1,
					pageSize: 10,
				};
			},
			getList() {
					this.list = [];
					this.total =  1;
					this.status = "nomore";
					this.loading = false;
				// });
			},
			// 翻译
			filerDict(value) {
				if (value == undefined) return;
				let name = this.typeState.filter((item) => item.value == value);
				if (name.length == 0) return;
				return name[0].lable;
			},
			getInfo() {
				uni.navigateTo({
					url: `/sub-public/lipei-info/lipei-info`,
				});
			},
			goForm() {
				uni.navigateTo({
					url: "/sub-public/survey-form/survey-form",
				});
			},
			clickSub() {

			
			},
		},
	};
</script>

<style lang="scss" scoped>
	uni-page-body,
	page {
		background: rgba(245, 247, 250, 1);
	}

	.container-main {
		box-sizing: border-box;
	}

	.list {
		padding: 30rpx 20rpx;

		.list-item {
			margin-bottom: 100rpx;
			position: relative;
		}

		.item-state {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 66rpx;
			line-height: 66rpx;
			box-sizing: border-box;
			padding-left: 30rpx;
			border-radius: 16rpx 16rpx 0 0;
			font-size: 28rpx;
			font-family: "PingFang SC-中黑体";
			font-weight: 500;
		}

		.state0 {
			background: linear-gradient(180deg,
					#ffe7ac 0%,
					rgba(255, 231, 173, 0) 100%);
			color: #f5b923;
		}

		.state1 {
			background: linear-gradient(180deg,
					#bcd2ff 0%,
					rgba(206, 222, 255, 0) 100%);
			color: #3976f1;
		}

		.statenull {
			background: linear-gradient(180deg,
					#f56c6c 0%,
					rgba(206, 222, 255, 0) 100%);
			color: #ff4949;
		}

		.state2 {
			background: linear-gradient(180deg,
					#f56c6c 0%,
					rgba(206, 222, 255, 0) 100%);
			color: #ff4949;
		}

		.item-data {
			position: relative;
			left: 0;
			top: 60rpx;
			z-index: 10;
			width: 100%;
			min-height: 100rpx;
			background: #fff;
			border-radius: 16rpx;

			.data-main {
				box-sizing: border-box;
				padding: 30rpx 37rpx;

				.data-title {
					font-size: 34rpx;
					font-weight: 600;
					color: #34373b;
					margin-bottom: 30rpx;
				}
			}

			.row-item {
				margin-bottom: 20rpx;
				display: flex;
				align-items: center;

				.item-lable {
					display: flex;
					align-items: center;
					min-width: 170rpx;

					.lable-icon {
						height: 26rpx;
						width: 26rpx;

						image {
							height: 100%;
							width: 100%;
							display: block;
						}
					}

					.lable-text {
						margin-left: 10rpx;
						font-size: 28rpx;
						font-weight: 400;
						color: #9da2ab;
					}
				}

				.item-value {
					flex: 1;
					font-size: 28rpx;
					font-weight: 400;
					color: #34373b;
				}
			}

			.data-lable-value {
				&>view:last-child {
					margin: 0;
				}
			}
		}

		.data-btn {
			border-top: 1px solid rgba(220, 227, 236, 1);
			height: 80rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 28rpx;
			font-weight: 500;
			color: #3976f1;
		}
	}
</style>