<template>
	<view class="bg">
		<image v-if="headImg" :src="showImg(headImg)" class="topImg" mode="widthFix"></image>
		
		<view class="main-container">
			<view class="common-box" style="padding-bottom: 82rpx;">
				<view class="title">客户领取路径</view>
				<view style="text-align: center;margin: 34rpx 0 70rpx;">微信或农行掌银APP扫码领取优惠</view>
				<image style="display:block;width: 266.67rpx;height: 266.67rpx;margin: 0 auto;" mode="aspectFill"
					:src="codeImg" :show-menu-by-longpress="true"></image>
			</view>
			
			<view class="common-box" style="line-height: 40rpx;" v-html="formateRichText(ruleContent)"></view>
			
			<view class="common-box" style="padding-bottom: 120rpx;">
				<view class="title" style="margin-bottom: 50rpx;">活动流程</view>
				<image style="width: 100%;" mode="widthFix" :src="ruleImg"></image>
			</view>
			
			<!-- <view class="btn" @click="goBack()">返回活动页</view> -->
			
			<image class="bottom-img" src="https://static.ticket.sz-trip.com/uploads/20250815/877b45bf01e0181fd489f0e1086c62fd.png"></image>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				headImg: '',
				codeImg: "",
				ruleImg: "",
				ruleContent: "",
				
			}
		},
		onLoad(option) {
			
		},
		onReady() {
			this.getHeadImg()
		},
		methods: {
			goBack () {
				let pages = getCurrentPages()
				let prePage = null
				// 看上个页面
				if (pages.length>=2) {
					prePage = pages[pages.length - 2];
				} else {
					uni.redirectTo({
						url: "/subPackages/activity/agriculturalProd"
					})
					return
				}
				// 有问题
				if (prePage.$page.fullPath.indexOf('agriculturalProd')>=0) {
					uni.navigateBack()
				} else {
					uni.redirectTo({
						url: "/subPackages/activity/agriculturalProd"
					})
				}
			},
			
			getHeadImg (id) {
				this.Post({id:2385},'/api/multimedia/detail').then(res => {
					this.headImg = res.data.head_img
					uni.setNavigationBarTitle({
						title:res.data.title
					})
				});	
				this.Post({id:2386},'/api/multimedia/detail').then(res => {
					this.codeImg = res.data.head_img
				});	
				this.Post({id:2387},'/api/multimedia/detail').then(res => {
					this.ruleImg = res.data.head_img
				});	
				this.Post({id: 2},"/api/sweepstakes/sweepstakes_act/getActInfo").then(res => {
					this.ruleContent = res.data.rule_desc
				})
			},
			
			
			
			
		},
		
	}
</script>

<style lang="scss" scoped>
	.bg {
		width: 750rpx;
		min-height: 100vh;
		background: #FCE1B6;
		padding-bottom: 60rpx;
	}
	
	.topImg {
		width: 100%;
	}
	.main-container{
		width: 100%;
		margin-top: -84rpx;
		padding: 0 26rpx 60rpx;
		position: relative;
		z-index: 10;
		
	}
	.btn{
		width: 227rpx;
		height: 60rpx;
		background: #FFFFFF;
		border-radius: 30rpx;
		margin: 52rpx auto 0;
		font-weight: 500;
		font-size: 25rpx;
		color: #333333;
		text-align: center;
		line-height: 60rpx;
	}
	.common-box{
		width: 100%;
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(248,118,35,0.19);
		border-radius: 20rpx;
		padding: 38rpx 26rpx;
		font-weight: 500;
		font-size: 25rpx;
		color: #333333;
		margin-bottom: 22rpx;
		.title{
			font-weight: bold;
			font-size: 37rpx;
			color: #4C9BB4;
			text-align: center;
		}
	}
	.bottom-img{
		width: 174.67rpx;
		height: 78rpx;
		margin: 74rpx auto 0;
		display: block;
	}
</style>