serverSearch.vue
5.32 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<template>
<div>
<div class="box">
<el-card class="mt20 mb20" :body-style="{'padding':'0'}">
<div class="lineHead">
<h3>{{ language == 0 ? '服务查询' : 'Service Search' }}</h3>
</div>
<div class="pd20">
<div class="topsearch">
<el-input :placeholder="language==0?'请输入手机号或邮箱搜索':'Please enter phone or email to search'"
v-model="query.remarks" @keyup.enter="search"/>
<el-button class="btn-lineG" type="primary" @click="search">
<el-icon class="mr20">
<Search/>
</el-icon>
{{ language == 0 ? '搜索' : 'Search' }}
</el-button>
</div>
<div class="stab">
<div :class="activeTab==0?'active':''" @click="changeActiveTab('0')">
<img v-show="activeTab!=0" src="@/assets/img/tag01@2x.png"/>
<img v-show="activeTab==0" src="@/assets/img/tag01_dwn@2x.png"/>
{{ language == 0 ? '签证服务' : 'Visa Services' }}
</div>
<div :class="activeTab==1?'active':''" @click="changeActiveTab('1')">
<img v-show="activeTab!=1" src="@/assets/img/tag02@2x.png"/>
<img v-show="activeTab==1" src="@/assets/img/tag02_dwn@2x.png"/>
{{ language == 0 ? '酒店预定' : 'Hotel Reservation' }}
</div>
<div :class="activeTab==2?'active':''" @click="changeActiveTab('2')">
<img v-show="activeTab!=2" src="@/assets/img/tag03@2x.png"/>
<img v-show="activeTab==2" src="@/assets/img/tag03_dwn@2x.png"/>
{{ language == 0 ? '接送服务' : 'Pick-up Service' }}
</div>
</div>
<div>
<div v-if="activeTab==0">
<el-empty v-if="list1.length==0"/>
<visa-info v-else :list="list1" min></visa-info>
</div>
<div v-if="activeTab==1">
<el-empty v-if="list2.length==0"/>
<reservation-info v-else :list="list2" min></reservation-info>
</div>
<div v-if="activeTab==2">
<el-empty v-if="list3.length==0"/>
<pickup-info v-else :list="list3"></pickup-info>
</div>
</div>
</div>
</el-card>
</div>
</div>
</template>
<script setup>
import {ref, onMounted} from 'vue'
import { getHomeInviteQuery, getHomeRoomQuery} from "@/apiPc/common";
import {ElMessage} from "element-plus";
import {useStorage} from "@vueuse/core/index";
import VisaInfo from "/src/viewsPc/center/info/visaInfo.vue";
import ReservationInfo from "/@/viewsPc/center/info/reservationInfo.vue";
import {useRouteQuery} from '@vueuse/router'
import PickupInfo from "/@/viewsPc/center/info/pickupInfo.vue";
import { getHomePickQuery} from "/@/apiPc/match";
const language = useStorage('language', 0)
const activeTab = useRouteQuery('n', 0)
const searchVal = useRouteQuery('s')
const form = ref({})
const list1 = ref([])
const list2 = ref([])
const list3 = ref([])
const query = ref({
status: 1,
remarks: ''
})
const loading = ref(false)
function changeActiveTab(n) {
activeTab.value = n
if (query.value.remarks) {
search()
}
}
onMounted(() => {
if (searchVal.value) {
query.value.remarks = searchVal.value
search()
}
})
function search() {
if (!query.value.remarks) {
ElMessage.warning(language.value == 0 ? '请输入手机号或邮箱搜索' : 'Please enter phone or email to search')
return
}
if (activeTab.value == 0) {
delete query.value.status
}else{
query.value.status = 1
}
searchVal.value = query.value.remarks
loading.value = true
if (activeTab.value == 0) {
// 签证服务
getHomeInviteQuery(query.value).then(res => {
if (!res.data || res.data.length == 0) {
list1.value = []
ElMessage.warning(language.value == 0 ? '未查到预定信息' : 'No reservation information found.')
return
}
list1.value = res.data
})
}
if (activeTab.value == 1) {
// 酒店预定
getHomeRoomQuery(query.value).then(res => {
if (!res.data || res.data.length == 0) {
list2.value = []
ElMessage.warning(language.value == 0 ? '未查到预定信息' : 'No reservation information found.')
return
}
list2.value = res.data
})
}
if (activeTab.value == 2) {
// 接送服务
getHomePickQuery(query.value).then(res => {
if (!res.data || res.data.length == 0) {
list3.value = []
ElMessage.warning(language.value == 0 ? '未查到预定信息' : 'No reservation information found.')
return
}
list3.value = res.data
})
}
}
</script>
<style scoped lang="scss">
.highlight {
background: yellow;
}
.topsearch {
display: flex;
gap: 10px;
.el-input {
--el-input-bg-color: #F5F7F9;
height: 50px;
--el-input-border-radius: 10px;
}
.btn-lineG {
border-radius: 10px;
height: 50px;
width: 130px;
font-size: 20px;
}
}
.stab {
display: flex;
gap: 20px;
margin: 20px 0 0;
div {
font-weight: 400;
padding: 10px 0;
display: flex;
align-items: center;
font-size: 18px;
cursor: pointer;
color: #4C5359;
img {
height: 30px;
}
}
.active {
color: #030303;
border-bottom: 2px solid #030303;
}
}
</style>