<template>
	<view class="content">
		<view style="height: var(--status-bar-height)"></view>

		<view class="" style="display: flex;align-items: center;font-size: 33.29rpx;margin-bottom: 20rpx;">
			<u--image @tap="backFn" src="/static/img/FH.png" width="50.82rpx" height="50.82rpx" alt=""></u--image>
			<text>商品溯源</text>
		</view>
		<view class="head-img">
			<view class="">
				<u--image src="/static/img/SCBJ.jpg" width="693.93rpx" height=" 394.28rpx" alt=""></u--image>
			</view>
			<!-- <u--image :showLoading="true" :src="src" width="80px" height="80px" @click="click"></u--image> -->
			<!-- <view class="poisition">
				<view style="display: flex;">
					<u--image src="/static/img/dw.png" style="margin: 0 5rpx;" width="35.05rpx"
						height="35.05rpx"></u--image>
					江阳区通滩镇1队123号
				</view>
			</view> -->
		</view>

		<view class="bad-info" v-for="(item,index) in data" :key="index">
			<view class="tit">
				{{item.tit}}
			</view>
			<view class="bad-info-cont">

				<view class="" v-if="item.step">
					<u-steps current="3" direction="column" activeColor="#3DD395">
						<u-steps-item :title="item.des1" :desc="item.time1">
						</u-steps-item>
						<u-steps-item :title="item.des2" :desc="item.time2">
						</u-steps-item>
						<u-steps-item :title="item.des3" :desc="item.time3">
						</u-steps-item>
					</u-steps>
				</view>

				<view class="" style="	display: flex;" v-else>
					<view class="">
						<view class="bad-info-cont-li">
							{{item.spmc}}：
						</view>
						<view class="bad-info-cont-li">
							{{item.scdz}}：
						</view>
						<view class="bad-info-cont-li" v-show="item.scq">
							{{item.scq}}：
						</view>
					</view>
					<view class="">
						<view class="bad-info-cont-li">
							{{item.spmc1}}
						</view>
						<view class="bad-info-cont-li">
							{{item.scdz1}}
						</view>
						<view class="bad-info-cont-li" v-show="!item.scq1.includes('static')">
							{{item.scq1}}
						</view>
					</view>
				</view>

				<view class="" v-if='item.img'>
					<u--image :src="item.scq1" width="646.61rpx" height="529.21rpx" alt=""></u--image>
				</view>
			</view>



		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				data: [{
						tit: "品类信息",
						spmc: "商品名称",
						scdz: "生产地址",
						scq: "生长期",
						img: false,
						spmc1: "白菜",
						scdz1: "于江阳区水中坝北352米",
						scq1: "82天",
					}, {
						tit: "施肥",
						des1: "史丹利复合肥2kg 施肥人:刘扬",
						des2: "绿盼有机肥1.5kg 施肥人:周立明",
						des3: "美乐棵营养土2.7kg 施肥人:马挑",
						time1: "2023-8-15",
						time2: "2023-9-1",
						time3: "2023-9-15",
						step: true,
					}, {
						tit: "打药",
						des1: "先正达杀虫剂2L 打药人:张龙",
						des2: "红太阳抑霉唑1.5kg 打药人:李俊杰",
						des3: "扬农氯碱2.7kg 打药人:徐坤",
						time1: "2023-8-30",
						time2: "2023-9-15",
						time3: "2023-9-29",
						step: true,
						spmc: "农药名称",
						scdz: "农药用量",
						scq: "打药人",
						img: false,
						spmc1: "宝卓 30%乙唑螨腈",
						scdz1: "2kg",
						scq1: "李*",
						step: true
					}, {
						tit: "采摘",
						spmc: "采摘时间",
						scdz: "采摘人",
						scq: "蔬菜图片",
						img: true,
						spmc1: "2023-10-10",
						scdz1: "陈能",
						scq1: "/static/img/SC.jpg",
					}

				]

			}
		},
		onLoad() {

		},
		methods: {
			urlFn(name) {
				return `/static/img/${name}.png`
			},
			img(w, h, m) {
				return `width:${w}rpx;height:${h};margin:0 ${m}rpx `
			},
			backFn() {
				uni.navigateBack()
			},
			navto() {
				uni.navigateTo({
					url: '/pages/index2/index'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		padding: 30rpx;
		// background-color: grey;
		background-image: url("/static/img/bgc.png");
		background-size: cover;
	}

	.head-img {
		border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
		margin: 0 auto;
		position: relative;

		.poisition {
			opacity: 0.7;
			position: absolute;
			width: 380.26rpx;
			height: 71rpx;
			background-color: #FFFFFF;
			left: 43rpx;
			bottom: 36rpx;
			border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
			display: flex;
			align-items: center;
			font-size: 29.79rpx;

			.dw-cls {

				margin: 0 5rpx;
			}
		}
	}

	.bad-info {
		margin: 20rpx 0;
		width: 693.93rpx;

		.tit {
			margin: 20rpx 0;


		}



		.bad-info-cont {
			padding: 20rpx;
			// padding-bottom: 0;
			background-color: white;
			// width: 693.93rpx;

			// height: 140.19rpx;
			border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
			// align-items: center;


		}

		.bad-info-cont-li {
			margin-bottom: 30rpx;
		}
	}
</style>