<template>
	<view class="content">
		<!-- 背景图 -->
		<view class="index_bg">
			<view class="welcome"><image class="welcome_img" src="../../static/index/welcome.png"></image></view>
		</view>
		<!-- 第一层公寓名称卡片 -->
		<uni-card style="margin-top: -40px;margin-bottom:0px; width:660rpx;height: 254rpx;" title="墨轩湖姬子公寓（南昌交通学院）" sub-title="2021年装修 | 智能门锁 | 房间wifi | 免费停车" extra="设施/详情＞" @click="navigateToXiangqing">
			<text class="uni-body">宜春市靖安县北高速路口什么路899号</text>
			<image class="uni-phone" src="../../static/index/index_phone.svg"></image>
			<image class="uni-map" src="../../static/index/index_map.svg"></image>
			<br><text class="uni-body2">距离我520km</text>
		</uni-card>
		<!-- 第二层工具 -->
		<view class="item-list">
		  <view class="item-list-one" @click="navigateToXuzhi">
		    <image src="../../static/index/index_xuzhi.svg" class="img-btn"></image>
		    <text class="list-txt">入住须知</text>
		  </view>
		  <view class="item-list-one" @click="navigateToCard">
		    <image src="../../static/index/index_ruzhu.svg" class="img-btn"></image>
		    <text class="list-txt">办理入住</text>
		  </view>
		  <view class="item-list-one" @click="navigateToPay">
		    <image src="../../static/index/index_xuzhu.svg" class="img-btn"></image>
		    <text class="list-txt">办理续住</text>
		  </view>
		  <view class="item-list-one" @click="navigateToPay">
		    <image src="../../static/index/index_tuifang.svg" class="img-btn"></image>
		    <text class="list-txt">办理退房</text>
		  </view>
		</view>
		<!-- 第三层订房 -->
		<view class="room-list">
			<!-- 选择住房日期 -->
			<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" :selected="info.selected" 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="room-kuang">
				<view class="room-xinxi" v-for="(item,index) in room" :key="index">
					<image class="room-image" src="../../static/index/room_image.svg" @click="inputDialogToggle"></image>
					<view class="room-name">{{item.name}}</view>
					<view class="room-mark">{{item.mark1}} {{item.mark2}} {{item.mark3}}</view>
					<view class="room-icon">
						<image src="../../static/index/index_wifi.svg" style="width: 30rpx;height: 30rpx;"></image>
						<image src="../../static/index/index_kongtiao.svg" style="width: 26rpx;height: 26rpx;margin-left: 10rpx;"></image>
						<image src="../../static/index/index_nosmoking.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
						<image src="../../static/index/index_lock.svg" style="width: 30rpx;height: 30rpx;margin-left: 10rpx;"></image>
					</view>
					<view class="before-price"><strike>{{item.before_price}}</strike></view>
					<view class="room-price">{{item.price}}</view>
					<view class="room-button" @click="navigateToOrderRoom"><text>订</text></view>
					<view class="room-line"  v-if="index<(room.length-1)"></view>
				</view>
			</view>
			
		</view>
		<!-- 房间样式弹窗页面 -->
		<uni-popup ref="inputDialog" type="dialog">
			<view class="popup_bg">
				<text class="popup_title">户型详情</text>
				<text class="popup_error" @confirm="dialogInputConfirm"></text>
				<!-- 轮播图 -->
				<swiper class="swiper" circular :indicator-dots="indicatorDots">
					<swiper-item v-for="(item, index) in img" :key="index">
						<view class="swiper-item">
							<image :src="item.srcUrl" class="swiper-img"></image>
						</view>
					</swiper-item>
				</swiper>
				<text class="popup_title2">便利设施</text>
				<view class="popup_txt">尤其是刚上线的产品，很难通过产品的内部体系来实现快速的用户增长，所以会更加依赖于分享来达到广泛的传播，获取目标用户。
所以监听用户的截图操作，提示用户进行分享，既缩短了以前分享截...</view>
			</view>
			<!-- <uni-popup-dialog ref="baseClose"  mode="base" title="输入内容" value="对话框预置提示内容!"
				placeholder="请输入内容" @confirm="dialogInputConfirm"></uni-popup-dialog> -->
		</uni-popup>
			
	</view>
</template>

<script>
	// 导入图片
	import room1 from '../../static/index/swiper_img1.svg'
	import room2 from '../../static/index/swiper_img1.svg'
	export default {
		data() {
			return {
				showCalendar: false,
				info: {
					lunar: true,
					range: true,
					insert: false,
					selected: []
				},
				room:[
					{id:1,room_img:({ url: "../../static/index/room_image.svg" }),name:'01户型',before_price:'¥419',price:'¥0.00',mark1:'22m',mark2:'无早',mark3:'大床'},
					{id:2,room_img:'url(../../static/index/index_bg.svg)',name:'02户型',before_price:'¥419',price:'¥0.00',mark1:'22m',mark2:'无早',mark3:'大床'},
					{id:3,room_img:({ url: "../../static/index/room_image.svg" }),name:'01户型',before_price:'¥419',price:'¥0.00',mark1:'22m',mark2:'无早',mark3:'大床'},
					{id:4,room_img:'url(../../static/index/index_bg.svg)',name:'02户型',before_price:'¥419',price:'¥0.00',mark1:'22m',mark2:'无早',mark3:'大床'},
				],
				indicatorDots: true,//滚动图片提示条默认出现
				img:[
					{
						value: '1',
						srcUrl:room1,
						name: '图1'
					},
					{
						value: '2',
						srcUrl:room2,
						name: '图2'
					},
				]
			}
		},
		onLoad() {
			
		},
		methods: {
			// 跳转到入住须知
			navigateToXuzhi(){
				uni.navigateTo({
				  url: "../ruzhuxuzhi/ruzhuxuzhi",
				});
			},
			// 跳转到公寓详情
			navigateToXiangqing(){
				uni.navigateTo({
				  url: "../gongyuxiangqing/gongyuxiangqing",
				});
			},
			// 订房间 
			navigateToOrderRoom() {
				uni.navigateTo({
				  url: "../order_room/order_room",
				});
			},
			//弹窗
			inputDialogToggle() {
				this.$refs.inputDialog.open()
			},
			dialogInputConfirm() {
				console.log(1)
				// 关闭窗口后，恢复默认内容
				this.$refs.inputDialog.close()
			},
			
			openCalendar() {
				this.$refs.calendar.open()
			},
			close(){
				console.log('弹窗关闭');
			},
			confirm(e) {
				console.log('confirm 返回:', e)
			},
		}
	}
</script>

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