<template>
	<view style="height: 100%">
		<custom-header :back="false" title="权益简介"></custom-header>
		<view class="product-content">
			<scroll-view scroll-y="true" style="height: 100%">
				<u-parse
					:html="cusQdOrderVal.productIntro"
					style="padding-left: 10rpx"
				></u-parse>
			</scroll-view>
		</view>
		<!-- 		<view class="empty-con" v-else>
			<u-empty text="暂未选择权益" mode="data"></u-empty>
		</view> -->
		<view class="bottom-btn">
			<button type="success" class="btn-txt btn" @click="handleConfirm">
				确认申办该权益产品
			</button>
		</view>
	</view>
</template>
<script setup lang="ts">
import { unifyTemplate } from '@/hooks/unifyTemplate';
import { nextTick, ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
// import handleAmount from '@/utils/handleAmount.js';
// import { request } from '@/utils/network/request';
let config = ref<any>({
	submitName: '下一步',
	titleWidth: 160
});
const {
	CustomHeader, //头部组件
	initData, //初始化数据
	qdOrderVal, //qdOrder中数据 ref
	cusQdOrderVal
} = unifyTemplate(); //初始化数据
let show = ref(false);
let productIntro = ref('');
let equityId = ref('');
//获取页面配置
onLoad((opin) => {
	initData(opin, -2).then((data) => {
		console.log(data);
		if (opin && opin.equityId) {
			// if (opin.productIntro) {
			// 	productIntro.value = opin.productIntro;
			// }
			equityId.value = opin.equityId;
		}
		if (!cusQdOrderVal.value.promoteId) {
			uni.showModal({
				title: '提示',
				content: '请勿刷新页面，即将返回选择产品页...',
				success: () => {
					uni.navigateTo({
						url: '/pages/productSelection/productSelection',
						animationType: 'pop-in',
						animationDuration: 500
					});
				}
			});
			return;
		}
		// isShow.value = true
		delete data.config.tableConfig;
		config.value = Object.assign(data.config, config.value);
	});
});

function handleConfirm() {
	cusQdOrderVal.value.equityId = equityId.value;
	let { jumpPage } = config.value;
	uni.navigateTo({
		url: '/' + jumpPage,
		animationType: 'pop-in',
		animationDuration: 500
	});
}
</script>
<style lang="scss" scoped>
.product-content {
	height: calc(100% - 45px);
	font-size: 32rpx;
	color: #666;
	padding: 20rpx;
	padding-bottom: 140rpx;
}
.content-title {
	font-size: 50rpx;
	font-weight: bold;
	color: #222;
}
.content-price {
	font-size: 36rpx;
	padding-top: 20rpx;
}
.content-desc {
	font-size: 36rpx;
	padding: 20rpx 0;
}
.bottom-btn {
	position: fixed;
	bottom: 0;
	width: 100%;
	display: flex;
	justify-content: space-around;
	align-items: center;
	padding: 20rpx 20rpx 40rpx;
	background-color: #fff;
}
.popup-content {
	height: calc(100% - 80rpx);
	padding-bottom: 30rpx;
	.noClick {
		background-color: #eee !important;
		color: #ccc;
	}
}
.empty-con {
	text-align: center;
	margin-top: 40rpx;
}
</style>
