<template>
	<view class="intro-page common">
		<view class="top-class"></view>
		<view class="title">
			活动规则
		</view>
		<view class="head">
			<u-row class="row-class">
				<u-col span="4">
					<image class="logo-img" src="/static/images/common/logo.png" mode="aspectFit" />
				</u-col>
				<u-col span="4">
					<image class="commodity-img" src="/static/images/common/commodity.png" mode="aspectFit" />
				</u-col>
				<u-col span="4">

				</u-col>
			</u-row>
		</view>

		<view class="theme-text">
			<image src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/text.png"
				class="textImage"></image>
		</view>
		<!-- 公司简介内容卡片 -->
		<view class="intro-card">

			<view class="intro-view">
				<view class="intro-label">
					<view class="label-title">
						规则信息
					</view>
				</view>
				<view class="intro-content">
					<view class="rule-text">
						凡购买我司产品，扫描外包装背后二维码，即有机会参与优惠活动，赢取优惠或实物礼品。凡购买我司产品，扫描外包装背后二维码，即有机会参与优惠活动，赢取优惠或实物礼品。凡购买我司产品，扫描外包装背后二维码，即有机会参与优惠活动，赢取优惠或实物礼品.
					</view>
				</view>
			</view>
			<view class="intro-view">
				<view class="intro-label" style="right: 20px;">
					<view class="label-title">
						活动奖励
					</view>
				</view>
				<view class="intro-content">
					<u-row class="row-class" customStyle="margin-bottom: 5px" v-for="(item, index) in planDetails">
						<u-col span="4">
							<view class="item-left item-text">{{item.prize_name}}</view>
						</u-col>
						<u-col span="8">
							<view class="item-text">{{item.prize_desc}}</view>
						</u-col>
					</u-row>
				
					
				</view>
			</view>
			
		</view>

		<!-- 返回按钮 -->
		<view class="footer-btn">
			<view  @click="goBack" class="return-button">返回</view>
		</view>
	</view>
</template>

<script>
	import {
		getRule
	} from '@/api/scan'
	export default {
		data() {
			return {
				scanCode:'',
				planDetails:[]
			}
		},
		onLoad() {
			this.scanCode = uni.getStorageSync('scanCode');
			this.initRuleData();

		},
		methods: {
			goBack() {
				uni.navigateBack();
			},
			initRuleData(){
				getRule(this.scanCode).then(res => {
					console.log(res)
					if (res.code == 0) {
						this.planDetails = res.data.planDetails;
					}
				})
			}
			
		}
	}
</script>

<style lang="scss" scoped>
	@import url('../../../static/scss/common.css');

	.row-class {
		height: 80rpx;
	}

	.logo-img {
		background-size: cover;
		/* 确保背景图片自适应填充整个容器 */
		background-position: center;
		/* 背景图片居中显示 */
		background-repeat: no-repeat;
		/* 防止背景图重复 */
		height: 42rpx;
		width: 62%;
	}

	.commodity-img {
		background-size: cover;
		/* 确保背景图片自适应填充整个容器 */
		background-position: center;
		/* 背景图片居中显示 */
		background-repeat: no-repeat;
		/* 防止背景图重复 */
		height: 35rpx;
		width: 100%;
	}

	.theme-text {
		height: 10vh;
		text-align: center;
		line-height: 11vh;

		.textImage {
			height: 80rpx;
			width: 400rpx;
		}
	}

	.intro-card {
		margin: 0 32rpx;
		background: rgba(131, 100, 71, 0.5);
		border-radius: 10rpx;
		height: 65vh;

		.intro-view {
			border: 2rpx solid #341B10;
			padding: 20rpx;
			margin: 20rpx;
			position: relative;
			margin-bottom: 60rpx;

			.intro-label {
				background-image:
					url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/label.png");
				/* 使用绝对路径 */
				background-size: contain;
				background-repeat: no-repeat;
				width: 220rpx;
				height: 120rpx;
				position: absolute;
				margin-top: -70rpx;
				align-content: center;
				margin-left: -28rpx;

				.label-title {
					font-weight: bold;
					font-size: 30rpx;
					color: #341B10;
					text-align: center;
					margin-left: 10px;
					height: 120rpx;
					line-height: 110rpx;
				}
			}

			.intro-content {
				font-size: 28rpx;
				color: #5c4322;
				line-height: 1.8;
				margin-top: 20rpx;
				text-align: justify;
			}


		}

	}
	.image-display{
		text-align: center;
		.company-img {
			width: 80%;
			height: 240rpx;
			border-radius: 12rpx;
			object-fit: cover;
			margin-top: 10rpx;
			background: #eee;
		}
	}

	.item-text{
		font-weight: 500;
		font-size: 30rpx;
		color: #FFFFFF;
	}
	.rule-text{
		font-weight: 500;
		font-size: 24rpx;
		color: #FFFFFF;
	}
	
	::v-deep .item-left{
		background: #442812;
		border-radius: 6rpx !important;
		text-align: center;
		width: 160rpx !important;
	}

</style>