<template>
	<view class="charts-box">

		<view class="top" style="margin-top: 15px;">
			<text>企业名称：</text>
			<text>{{queryParams.businessName}}</text>
		</view>
		<view class="top">
			<text>核查日期：</text>
			<text>{{queryParams.executionTime}}</text>
		</view>
		<view class="top">
			<text>核查结果：</text>
			<text>{{result}}</text>
		</view>

		<view v-show="isShow">

			<view class="top">
				<text>异常信息详情：</text>
			</view>

			<block wx:for="{{list}}" wx:key="index">

				<!-- 包裹图片+两行文字 id="{{index}}"是给按下了那个item记录-->

				<view class="view_tupian_wenzi" @click="click" id="{{index}}">

					<!-- 包裹两行文字 -->
					<view class="view_wenzi2">
						<view class="top2">
							<text>列入日期：</text>
							<text>{{item.addDate}}</text>
						</view>
						<view class="top2">
							<text>列入经营异常名录原因：</text>
							<text>{{item.addReason}}</text>
						</view>
						<view class="top2">
							<text>作出决定机关：</text>
							<text>{{item.decisionOffice}}</text>
						</view>
						<view class="top2">
							<text>移出日期：</text>
							<text>{{item.removeDate}}</text>
						</view>
						<view class="top2">
							<text>移出经营异常名录原因：</text>
							<text>{{item.romoveReason}}</text>
						</view>
						<view class="top2">
							<text>移出决定机关：</text>
							<text>{{item.removeDecisionOffice}}</text>
						</view>

					</view>

				</view>

			</block>


		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: "",
				result: "",
				isShow: false,
				queryParams: {
					businessName: "",
					executionTime: ""
				},
				list: [],
			};
		},
		onLoad(option) {

			// this.queryParams = JSON.stringify(option)

			// console.log('App onLoad', JSON.stringify(option))
			this.title = JSON.stringify(option)
			// wx.showToast({
			// 	title: 'onLoad成功>>>>>' + JSON.stringify(option),
			// 	icon: 'none',
			// 	duration: 5000 //持续的时间
			// })

		},

		created() {
			this.getData()
		},

		methods: {
			getData() {
				var _this = this
				this.$api.selectBusinessRiskInfo(_this.queryParams).then((resp) => {
					console.log('1111>>>>>>', resp)
					this.list = resp
					console.log('2222>>>>>>', this.list.length)
					this.result = this.list.length == 0 ? "无异常信息" : "共有" + this.list.length + "条异常信息"
					this.isShow = this.list.length == 0 ? false : true

				}).catch(e => {
					console.log('eeeee', e)
				})
			},
			click(e) {
				console.log("按了：", e.currentTarget.id)
			}


		},

	};
</script>

<style lang="scss">
	.top {
		margin-left: 25px;
		margin-top: 5px;
	}

	/* 包裹图片和两行文字 */

	.view_tupian_wenzi {
		display: flex;
		flex-direction: row;
		align-items: center;

		/* 圆角 */
		border-radius: 20rpx;

		/* 边 */
		border: 3rpx solid #E0E3DA;
		box-shadow: 5rpx 5rpx 5rpx 5rpx #E0E3DA;

		background-color: #ffffff;
		margin: 30rpx;

		/* padding使得文字和图片不至于贴着边框 */
		padding: 30rpx;

	}

	/* 图片 */

	.image_1 {
		width: 100rpx;
		height: 100rpx;
	}

	/* 包裹两行文字 */

	.view_wenzi2 {

		width: 100%;
		margin-left: 25rpx;
		display: flex;
		flex-direction: column;

		.top2 {
			margin-top: 5px;
		}

		.text1 {
			font-size: 15px;
			overflow: hidden;
			text-overflow: ellipsis;
			display: -webkit-box;
			-webkit-line-clamp: 1;
			-webkit-box-orient: vertical;
		}

		.text2 {
			flex: 1;
			margin-top: 5px;
			font-size: 12px;
		}


	}

	/* 小字 */

	.text_small {
		font-size: 30rpx;
		word-break: break-all;
		color: #7a7878;
		margin-top: 10rpx
	}

	.text_small2 {
		font-size: 25rpx;
		color: #f00;
		margin-top: 10rpx
	}
</style>