<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="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/logo.png" mode="aspectFit" />
				</u-col>
				<u-col span="4">
					<image class="commodity-img" src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/commodity.png" mode="aspectFit" />
				</u-col>
				<u-col span="4">
					 <image class="logo-rules" @click="openDetail" src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/rules.png"  />
				</u-col>
			</u-row>
		</view>

		<view class="topImg">
			 <image class="img_1" src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/topImg.png" mode="heightFix" />
		</view>
		<view class="topImg">
			 <image class="img_2" src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/topImg_2.png" mode="heightFix" />
		</view>
		<view class="content">
			<view class="title-1">
        <view class="content_imgView">
          <image style="height: 276rpx" src="https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/tongjichanpin.png"
                 mode="heightFix" />
        </view>
			</view>

			<view class="detail">
				<view class="text-detail">
          您所查询的是超吉炫新型低纤槟榔胶果，是正牌产品，感谢您的购买!
				</view>
				<view class="text-one">
					此二维码已参与过活动!
				</view>
				<view class="text-one">
					首次扫码者: {{scanUserData.openid}}
				</view>
				<view class="text-one">
					首次扫码时间: {{scanUserData.scan_time}}
				</view>
				<view class="text-one" style="color: red; font-weight: 600;font-size: 36rpx;">
					获得奖励: {{prizeJson.prize_type == 0 ? '谢谢惠顾' : prizeJson.prize_type == 1 ? prizeJson.money/100 + '元现金红包' : prizeJson.prize_type == 4 ? "积分奖励":"加"+prizeJson.price+"元,"+prizeJson.title+""+prizeJson.prize_name  }}
				</view>
			</view>
		</view>
		<CustomTabbar />

	</view>
</template>

<script>
	import CustomTabbar from '@/components/tabbar_common.vue';
	export default {
		components: {
			CustomTabbar
		},
		data() {
			return {
				scanUserData:{},
				prizeJson:{}
			}
		},
		onLoad() {
		  let scanDetail = uni.getStorageSync('scanDetail');
		  this.scanUserData = scanDetail.result.scanInfo;
		  this.prizeJson = scanDetail.prizeJson;
		  console.log(scanDetail);

		},
		methods: {
			goBack() {
				uni.navigateBack();
			},
			openDetail(){
				uni.navigateTo({
					url: '/pages/cjx/index/rules'
				});
			}

		}
	}
</script>

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

	.row-class {
		height: 80rpx;
	}

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

		.textImage {
			height: 80rpx;
			width: 400rpx;
		}
	}
	.title-1{
		text-align: center;
		color: #A7001C;
		font-size: 18px;
		letter-spacing: 4px;
		font-weight: 600;
	}

    .winning-picture{
		height: 460rpx;
		background-image: url(https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/guzhenganzi/bgiZj.png);
		background-size: contain;
		background-position: center;
		background-repeat: no-repeat;
		display: flex;
		justify-content: center; /* 水平居中 */
		// align-items: center;     /* 垂直居中 */
	}
	.detail{
		margin: 20rpx 40rpx;
		border-radius: 10rpx;
		padding: 10rpx;
		margin-top: 10vh;
		background-image:
			url("https://hyscancode.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/cjx/cardBgi.png");
		background-size: cover;
		background-position: center;
		background-repeat: no-repeat;
	}
	.text-detail{
		font-weight: 600;
		font-size: 30rpx;
		color: #F6F6F9;
		margin-bottom: 10rpx;
	}

	.text-one{
		font-weight: 400;
		font-size: 28rpx;
		color: #FF31C2 ;
		margin-bottom: 10rpx;

	}
	.detail-btn{
		text-align: center;
	    color: #F9D395;
	    height: 60rpx;
	    line-height: 60rpx;
	    margin-right: 20rpx;
	    font-size: 13px;
	    background-color: #901710;
	    padding: 3px;
	    border-radius: 5px;

	}
	.center-image {
		height: 280rpx;
	    object-fit: contain;     /* 保持图片的宽高比，确保不会被拉伸或裁切 */
	}
	::v-deep .detail-btn span {
	    background-color: #8E1813;
	    padding: 4rpx;
	    border-radius: 8rpx;
	    font-weight: 400;
	    font-size: 26rpx;
	}
</style>
