dinner.vue
4.07 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<template>
<div>
<div class="banner">
<img v-if="language==0" src="@/assets/booking/cy_text_c.png">
<img v-else src="@/assets/booking/cy_text_e.png">
</div>
<div class="box">
<div class="searchBar">
<el-input v-model="query.name" :placeholder="language==0?'请输入关键字搜索':'Search'" class="no-border" />
<el-button class="btn-lineG" icon="search" size="large" type="primary" @click="getList">
{{ language == 0 ? '搜索' : 'Search' }}
</el-button>
</div>
</div>
<div class="box">
<el-row :gutter="20">
<el-col v-for="(h,index) in list" :span="12" class="mb20">
<el-card>
<el-row :gutter="20" align="middle" class="hotel">
<el-col :span="12">
<el-image :src="fillImgUrl(h.photos?.split(',')[0])" class="w100 as16_9" fit="cover" />
</el-col>
<el-col :span="12">
<h3 class="esp m0">{{ h.name }}</h3>
<p class="esp addr">
<el-icon color="#929AA0">
<LocationFilled />
</el-icon>
{{ h.addName }}
</p>
<div v-if="language==0" class="price mb10"><i class="text-warning">¥</i><span
class="text-warning"
>{{ h.price || 0 }}</span>起
</div>
<div v-else class="price mb10"><i class="text-warning">€</i><span class="text-warning">{{
h.price || 0
}}</span>start
</div>
<el-button class="btn-lineG" round size="large" type="primary" @click="goDetail(h)">
{{ language == 0 ? '立即预约' : 'Select' }} ⇀
</el-button>
</el-col>
</el-row>
</el-card>
</el-col>
</el-row>
</div>
</div>
</template>
<script setup>
import { onMounted } from '@vue/runtime-core'
import * as booking from '@/apiPc/booking'
import { useRoute, useRouter } from 'vue-router'
import { getActivityRestaurantList, getBaseInfoByActiveId } from '@/apiPc/booking'
import { useStorage } from '@vueuse/core/index'
import { getCurrentInstance, ref } from 'vue'
const { proxy } = getCurrentInstance()
const route = useRoute()
const router = useRouter()
const language = useStorage('language', 0)
const query = ref({
name: ''
})
const list = ref([''])
onMounted(() => {
getList()
})
function getList() {
query.value.activityId = route.params.cptId
getActivityRestaurantList(query.value).then(res => {
list.value = res.rows
})
}
async function goDetail(n) {
const { data } = await getBaseInfoByActiveId(route.params.cptId)
if (data.isJdView == 0) {
return proxy.$modal.confirm(language.value == 0 ? '感谢您对本次比赛的关注,该服务暂无可预订信息,敬请期待。' : 'Thank you for your attention to this competition. The service is currently unavailable for booking. Please stay tuned.')
}
await router.push({
name: 'dinnerDetail',
params: {
id: n.id
},
query: {
detail: encodeURIComponent(JSON.stringify(n))
}
})
}
</script>
<style lang="scss" scoped>
.hotel {
}
.banner {
height: 140px;
background-size: cover;
text-align: center;
background: url("@/assets/booking/cy_bg.png") center;
display: flex;
align-items: center;
justify-content: center;
img {
display: block;
margin: -30px auto 0;
width: auto;
}
}
.searchBar {
position: relative;
top: -30px;
background: #FFFFFF;
display: flex;
padding: 20px;
border-radius: 10px;
}
.no-border {
border: none;
background: #F5F7F9;
:deep(.el-input__wrapper) {
border: none;
box-shadow: none;
background: #F5F7F9;
}
}
.addr {
font-weight: 400;
font-size: 16px;
color: #929AA0;
}
.price {
font-weight: 400;
font-size: 18px;
color: #929AA0;
i {
font-size: 24px;
font-style: normal;
}
span {
font-weight: 600;
font-size: 36px;
font-family: "DIN Alternate";
margin: 0 6px;
}
}
</style>