<template>
	<view class="main">
		<view :style="{height:iSMT+'px'}"></view>
		<view class="theme">
			<view class="left">
				<image class="img-theme" src="/static/my/whiteTheme.png" mode="widthFix" />
				<radio value="0" class="radio-btn" activeBackgroundColor="red" :checked="selectedIndex === 0"
					@click="selectFont(0)" />
			</view>
			<view class="left">
				<image class="img-theme" src="/static/my/blackTheme.png" mode="widthFix" />
				<radio value="1" class="radio-btn" activeBackgroundColor="red" :checked="selectedIndex === 1"
					@click="selectFont(1)" />
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		onMounted
	} from 'vue'
	const iSMT = ref(0)
	const selectedIndex = ref(0)

	const selectFont = (index) => {
		selectedIndex.value = index
		console.log('看看选中状态', selectedIndex.value)
	}
	onMounted(() => {
		// 状态栏高度
		iSMT.value = uni.getSystemInfoSync().statusBarHeight;
		console.log('看看高度', iSMT.value)
	})
</script>

<style>
	.theme {
		margin-top: 1.5vh;
		height: 34vh;
		background-color: white;
		display: flex;
		justify-content: space-around;
	}

	.img-theme {
		width: 316rpx;
		height: 362rpx;
	}

	.left {
		width: 350rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.radio-btn {
		margin-top: 36rpx;
		transform: scale(0.8);
	}
</style>