<template>
	<view class="hlaxPage">
		<view class="hlax_bg"></view>
		<image class="hlax_bg"
			:src="toolCfg.link?.go_see?($baseUrl + 'heliaixinTool/hlax_bg3.jpg'):$baseUrl + 'heliaixinTool/hlax_bg4_1.png'"
			mode="aspectFill" />
		<image class="hlax_btn" :src="$baseUrl + 'heliaixinTool/btn_go_see2.png'" v-if="toolCfg.link?.go_see"
			@click="onTips" />
		<!-- go_see=true,有按钮，否则没有按钮 -->
	</view>
</template>

<script setup>
	import {
		ref,
		onMounted,
		getCurrentInstance,
		computed
	} from "vue";
	import md from '../../md.js';
	import {
		usePageCfgStore
	} from "@/stores/pageCfg";
	const {
		proxy
	} = getCurrentInstance();
	const $baseUrl = proxy.$baseUrl;
	const pageCfgStore = usePageCfgStore();

	const toolCfg = computed(() =>
		pageCfgStore?.toolList.find((item) => item.title == "鹤礼爱心") || {}
	);

	onMounted(() => {
		console.log('啊啊啊啊啊啊')
		if (toolCfg.value.link && toolCfg.value.link.go_see) { //已登录并且已报名
			md.sensorComponentLogTake({
				xcxComponentExposure: 'true',
				pageName: '鹤礼2.0活动详情页',
				componentName: '鹤礼2.0活动详情页-已报名用户',
				componentContent: '去查看',
			});
		} else { //未登录或者未报名
			md.sensorComponentLogTake({
				xcxComponentExposure: 'true',
				pageName: '鹤礼2.0活动详情页',
				componentName: '鹤礼2.0活动详情页-未报名用户',
				componentContent: '未报名',
			});
		}
	})

	//点击去查看按钮提示
	const onTips = () => {
		console.log("toolCfg:::", toolCfg);
		md.sensorComponentLogTake({
			xcxComponentClick: 'true',
			pageName: '鹤礼2.0活动详情页',
			componentName: '鹤礼2.0活动详情页-已报名用户',
			componentContent: '去查看',
		});
		uni.showToast({
			title: '可去' + toolCfg.value?.link?.channelName + '渠道查看',
			icon: "none"
		})
	}
</script>

<style lang="less" scoped>
	.hlax_bg {
		position: absolute;
		width: 750rpx;
		height: 1624rpx;
		top: 0rpx;
		left: 0rpx;
	}

	.hlax_btn {
		position: absolute;
		width: 465rpx;
		height: 120rpx;
		top: 1459rpx;
		left: 143rpx;
	}
</style>