<template>
	<view class="content">
		<!-- 背景图 -->
		<view class="index_bg">
			<view class="welcome"><image class="welcome_img" src="../../static/index/welcome.png"></image></view>
		</view>
		<!-- 第一层标题 -->
		<view class="touming_bg">
			<view class="touming_title">墨轩湖姬子公寓（南昌交通学院）</view>
			<view class="touming_txt">尊敬的老师，您辛苦了，欢迎入住！</view>
		</view>
		<!-- 第二层表单 -->
		<view class="two_all">
			<view class="select-time" @click="openCalendar">
				<view class="select-time-one">
				  <text class="select-list">周四入住</text>
				  <text class="select-list-time">07月21日</text>
				</view>
				<view class="select-center">
					<view class="select-line1"></view>
					<view class="select-circle">1晚</view>
					<view class="select-line2"></view>
				</view>
				<view class="select-time-one">
				  <text class="select-list">周五离店</text>
				  <text class="select-list-time">07月22日</text>
				</view>
				<uni-calendar ref="calendar" class="uni-calendar--hook" :clear-date="true" :date="info.date" :insert="info.insert" :lunar="info.lunar" :startDate="info.startDate"
				:endDate="info.endDate" :range="info.range" @confirm="confirm" @close="close"/>
			</view>
			<view class="form_bg">
				<view class="form_title">01户型</view>
				<!-- 自定义表单 -->
				<view class="form-name">李希</view>
				<view class="form-line"></view>
				<view class="form-phone">13548790024</view>
				<view class="form-line" style="margin-top: 389rpx;"></view>
				<view class="uni-list-cell-db">
					<picker @change="bindPickerChange" :value="index" :range="array">
						<view class="uni-input">{{array[index]}}</view>
						<text class="jiantou">〉</text>
					</picker>
				</view>
				<view class="form-line" style="margin-top: 477rpx;"></view>
				<view class="uni-textarea">
					<textarea @blur="bindTextAreaBlur" placeholder="在此填写您的要求" maxlength="50" auto-height /><text class="textsrea-txt">{{textNum}}/50</text>
				</view>
			</view>
		</view>
		<!-- 第三层表单 -->
		<view class="three_all">
			<view class="three-title">您是【教师】</view>
			<view class="three-mark">本人可以免费入住，需要预交费<text style="color: rgba(255, 87, 51, 1);">20.00</text>元，即可享受权益</view>
			<view class="three-zhu">注：水费为0.62元/吨，电费为1.1元/度；补助吨数为3吨，补助度数
         为10度，超出标准需在预付款中扣除，未超出原路返回预付款</view>
		</view>
		<!-- 注释 -->
		<view class="zhushi">
			<text class="zhushi-mark">低价保证</text> <text class="zhushi-mark">入住免房费</text> <text class="zhushi-mark">提前选好房</text>
		</view>
		<!-- 支付框 -->
		<view class="fukuan">
			<view class="fu-price"><text style="font-size: 28rpx;">总计：</text>¥20.00</view>
			<view class="fu-zhifu">立即支付</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showCalendar: false,
				info: {
					lunar: true,
					range: true,
					insert: false
				},
				array: ['18:00前到店', '19:00前到店', '20:00前到店', '21:00前到店'],
				index: 0,
				textNum:0,//输入框当前字数
			}
		},
		onLoad() {
		},
		methods: {
			openCalendar() {
				this.$refs.calendar.open()
			},
			close(){
				console.log('弹窗关闭');
			},
			confirm(e) {
				console.log('confirm 返回:', e)
			},
			//选择器
			bindPickerChange: function(e) {
				// console.log('picker发送选择改变，携带值为', e.detail.value)
				this.index = e.detail.value
			},
			// 输入框
			bindTextAreaBlur: function (e) {
				// console.log(e.detail.cursor)
				// console.log(e.detail.value)
				this.textNum=e.detail.cursor
			}
		}
	}
</script>

<style>
	@import url("./css/order_room.css");
</style>
