<template>
	<view class="w-body">
		<w-public />
		<w-navbar left-back fixed title="学生日课程表"></w-navbar>

		<view class="w-flex w-p">
			<view style="width: 30%;"><u-input v-model="xh1" /></view>
			<view style="width: 40%;"><x-student :id="xh1"/></view>
			<view style="width: 30%;"><u-button @click="xh = xh1;">设置学号</u-button></view>
		</view>
		<view class="w-flex w-p">
			<view style="width: 50vw;" class="w-flex">{{ rq }}</view>
			<view style="width: 50vw;"><u-button @click="show = true;">设置日期</u-button></view>
		</view>

		<view class="w-p">
			<x-student-course-day :xh="xh" :rq="rq" />
		</view>

		<view class="w-p">
			<x-student-course-day style="--size:12px; --text:var(--w-main);" :xh="xh" :rq="rq" />
		</view>

		<u-datetime-picker :show="show" v-model="rq1" mode="date" @confirm="show = false"
			@cancel="show = false"></u-datetime-picker>
	</view>
</template>

<script setup>
import { onLoad, onShow, onReady } from '@dcloudio/uni-app'
import { ref, getCurrentInstance, computed } from 'vue'

const { proxy } = getCurrentInstance();

const xh = ref("2301010001");
const xh1 = ref("2301010001");

const rq = ref('2024-03-07');

const rq1 = computed({
	get() {
		return rq.value.toDate();
	},
	set(value) {
		rq.value = new Date(value).format();
	}
})

const show = ref(false);

</script>

<style lang="scss" scoped>
.w-body {
	--navbar-height: 44px;
	background-color: var(--w-bg-light);
	font-size: .9rem;
	min-height: 100vh;

	.w-p {
		padding: 1rem;
	}
}
</style>
