-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
85 lines (85 loc) · 4.11 KB
/
index.html
File metadata and controls
85 lines (85 loc) · 4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css"><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<title>Alan's Hotel</title>
</head>
<body>
<div id="app">
<div class="container">
<div class="row">
<div class="col-sm-3 col-edit">
<h1>飯店資料</h1>
<hr>
<label>總折數</label>
<input class="form-control" v-model="discount">
<label>服務費</label>
<input class="form-control" v-model="service_fee"><br>
<h1>房間編輯</h1>
<select class="form-control" v-model="edit_id">
<option :value="-1"></option>
<option v-for="(room, index) in rooms" :value="index">{{room.name}}</option>
</select>
<button class="btn btn-secondary room_edit" @click="addroom">+ 新增房間</button>
<hr>
<div class="room_edit" v-if="rooms.length > 0 && rooms[edit_id]">
<h4>{{ rooms[edit_id].name }}</h4>
<label>房間名稱<i class="fa fa-trash cursor_pointer" @click="delete_room(edit_id)"></i></label>
<input class="form-control" v-model="rooms[edit_id].name">
<label>價格</label>
<input class="form-control" v-model="rooms[edit_id].price">
<label>折價</label>
<input class="form-control" v-model="rooms[edit_id].discount">
<label>英文名稱</label>
<input class="form-control" v-model="rooms[edit_id].eng">
<label>圖片網址</label>
<input class="form-control" v-model="rooms[edit_id].cover">
<label>房間設備
<label>早餐</label>
<input class="form check-input" type="checkbox" v-model="rooms[edit_id].equipment.breakfast">
<label>浴缸</label>
<input class="form check-input" type="checkbox" v-model="rooms[edit_id].equipment.bathtub">
<label>Wifi</label>
<input class="form check-input" type="checkbox" v-model="rooms[edit_id].equipment.wifi">
</label>
</div>
</div>
<div class="col-sm-9">
<h1>房間列表</h1>
<hr>
<div class="row">
<div class="col-sm-4 col-room" v-if="edit_id === -1" v-for="(room, index) in rooms">
<room :room_data="room" :id="index" :hotel_discount="discount" :hotel_fee="service_fee" :delete_room="delete_room"></room>
</div>
<div class="col-sm-4 col-room" v-if="edit_id !== -1 && rooms.length > 0 && rooms[edit_id]">
<room :room_data="rooms[edit_id]" :id="edit_id" :hotel_discount="discount" :hotel_fee="service_fee" :delete_room="delete_room"></room>
</div>
</div>
</div>
</div>
</div>
</div>
<template id="room">
<div class="room_container">
<div class="cover" v-bind:style="bg_css">
<h3>{{ room_data.name }}</h3><i class="fa fa-times" @click="delete_room(id)"></i>
</div>
<div class="info">
<h5>{{ room_data.eng }}
<div class="icons"> <span v-if="room_data.equipment.breakfast"> <i class="fa fa-coffee"> </i></span><span v-if="room_data.equipment.bathtub"><i class="fa fa-bath"> </i></span><span v-if="room_data.equipment.wifi"><i class="fa fa-wifi"> </i></span></div>
</h5>
<h5>{{ room_data.discount}} * {{ hotel_discount}} = {{ final_discount_show}} 折</h5>
<h4>TWD
<del>{{ room_data.price}}</del>
<div class="final_price">{{ final_price}}</div>
</h4>
</div>
</div>
</template>
<script src="script.js"></script>
</body>
</html>