<template>
	<view style="height: 100%;">
		<rich-text style="flex: 1" :nodes="richText" />
	</view>
</template>
<script setup lang='ts'>
	import {
		ref
	} from 'vue';
	import {
		requestNew
	} from "@/utils/network/request.js";
	import {
		onLoad
	} from '@dcloudio/uni-app'
import { singleEquityDetail } from "@/utils/network/api.js";
	let richText = ref('')
	let singleEquityId = ref('')
	let couponAgencyType = ref('')
	let couponId = ref('')

	onLoad((options) => {
		console.log("参数",options)
		singleEquityId.value = options.singleEquityId
		couponAgencyType.value = options.couponAgencyType
		//卡券渠道类型获取单项权益列表
		requestNew(singleEquityDetail, {
			type: 2,
			data: {
				singleEquityId: singleEquityId.value
			},
			method: "POST",
			showLoading: true,
		}).then((item) => {
			let res = item
			console.log(res, '=========');
			richText.value = res.productIntro
			couponId.value = res.couponId
		})
	})

	function onClick() {
		uni.navigateTo({
			url: '/subpackage/service/equity/equity?singleEquityId=' + singleEquityId.value +
				"&couponAgencyType=" + couponAgencyType.value + "&couponId=" + couponId.value,
		})
	}
</script>
<style lang='scss' scoped>
	.copy-btn {
		background-color: #4caf50;
		color: #fff;
		border: none;
		width: 100%;
		padding: 10rpx 0;
		border-radius: 10rpx;
		font-size: 24rpx;
		box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.2);
	}
</style>