宴会厅预订

✓ 资质
💎 买贵退差保障
宴会厅
商务会议
庆典活动
团建聚会
生日派对
年会庆典
全部
寿宴
周岁宴
升学宴
婚宴
商务宴
北京
当前位置
12月15日 周五
宴会日期
18:00
开始时间
搜索附近宴会厅 支持按位置 / 品牌 / 宴会厅名称
10桌 · 100人
黄金会员享预订9折起、免费升级等7项权益
宴会厅
4.8

金碧辉煌宴会厅

朝阳区 · 可容纳50桌

¥1,288 /桌起
已订123单
宴会厅
4.9

盛世华庭宴会中心

海淀区 · 可容纳80桌

¥1,588 /桌起
已订256单
宴会厅
4.7

雅致宴会厅

西城区 · 可容纳30桌

¥988 /桌起
已订89单
首页
地图
3
消息
订单
我的
// 合伙人收益显示(页面加载时检查) document.addEventListener('DOMContentLoaded', function() { checkPartnerStatus(); // 每30秒更新一次收益数据 setInterval(updatePartnerEarnings, 30000); }); // 检查合伙人状态 function checkPartnerStatus() { // 模拟:检查用户是否是合伙人(实际应从后端获取) const isPartner = localStorage.getItem('isPartner') === 'true' || false; // 默认false,可以手动设置为true测试 if (isPartner) { document.getElementById('partnerEarningsCard').classList.remove('hidden'); updatePartnerEarnings(); } } // 更新合伙人收益数据 function updatePartnerEarnings() { // 模拟股票价值数据(实际应从后端获取) const stockValue = 8.56 + (Math.random() - 0.5) * 0.1; const stockChange = ((stockValue - 8.56) / 8.56 * 100).toFixed(2); const todayEarnings = 328 + Math.floor(Math.random() * 50); const totalEarnings = 12580 + Math.floor(Math.random() * 100); document.getElementById('homeStockValue').textContent = `¥${stockValue.toFixed(2)}`; const changeEl = document.getElementById('homeStockChange'); changeEl.textContent = `${stockChange >= 0 ? '+' : ''}${stockChange}%`; changeEl.className = stockChange >= 0 ? 'text-green-200' : 'text-red-200'; document.getElementById('homeTodayEarnings').textContent = `+¥${todayEarnings}`; document.getElementById('homeTotalEarnings').textContent = `¥${totalEarnings.toLocaleString()}`; } function switchSearchMode(mode) { if (mode === currentSearchMode) return; currentSearchMode = mode; const hallTab = document.getElementById('searchModeHallTab'); const packageTab = document.getElementById('searchModePackageTab'); const titleEl = document.getElementById('searchCardTitle'); const subEl = document.getElementById('searchCardSub'); const inputEl = document.getElementById('searchInput'); const card = document.getElementById('searchCard'); // 先加一点"下沉"的粘滞动画 card.classList.add('mode-switching'); // 文案与占位符切换(略带延迟,形成"迟滞感") setTimeout(() => { if (mode === 'hall') { hallTab.classList.add('bg-gray-900', 'bg-opacity-5', 'text-gray-900', 'font-medium'); packageTab.classList.remove('bg-gray-900', 'bg-opacity-5', 'text-gray-900', 'font-medium'); packageTab.classList.add('text-gray-500'); titleEl.textContent = '搜索附近宴会厅'; subEl.textContent = '支持按位置 / 品牌 / 宴会厅名称'; inputEl.placeholder = '位置/品牌/宴会厅'; } else { packageTab.classList.add('bg-gray-900', 'bg-opacity-5', 'text-gray-900', 'font-medium'); hallTab.classList.remove('bg-gray-900', 'bg-opacity-5', 'text-gray-900', 'font-medium'); hallTab.classList.add('text-gray-500'); titleEl.textContent = '查找宴会套餐'; subEl.textContent = '按人均预算 / 菜品特色 / 桌数筛选'; inputEl.placeholder = '人均预算/菜品/套餐名称'; } }, 90); // 再回弹回原位 setTimeout(() => { card.classList.remove('mode-switching'); }, 220); } // 主分类导航切换 function switchMainCategory(element, linkUrl) { // 更新选中状态 document.querySelectorAll('.main-category').forEach(cat => { cat.classList.remove('border-b-2', 'border-orange-500'); cat.classList.add('text-gray-600'); cat.querySelector('i').classList.remove('text-orange-500'); cat.querySelector('span').classList.remove('font-semibold', 'text-orange-500'); }); element.classList.add('border-b-2', 'border-orange-500'); element.classList.remove('text-gray-600'); element.querySelector('i').classList.add('text-orange-500'); element.querySelector('span').classList.add('font-semibold', 'text-orange-500'); // 获取链接URL(从参数或onclick属性中提取) if (!linkUrl && element.onclick) { // 从onclick属性中提取URL const onclickStr = element.getAttribute('onclick'); const match = onclickStr.match(/pages\/search-results\.html[^']*/); if (match) { linkUrl = match[0]; } } // 如果没有linkUrl,尝试从data属性获取 if (!linkUrl) { const category = element.getAttribute('data-category'); if (category) { linkUrl = `pages/search-results.html?category=${category}`; } } // 跳转到对应的搜索结果页 if (linkUrl) { // 获取当前搜索条件 const city = document.getElementById('currentCity').textContent; const date = document.getElementById('selectedDate').textContent; const time = document.getElementById('selectedTime').textContent; const tableCount = document.getElementById('tableCount').textContent; const category = element.getAttribute('data-category'); // 构建URL参数 try { const url = new URL(linkUrl, window.location.href); url.searchParams.set('city', city); url.searchParams.set('date', date); url.searchParams.set('time', time); url.searchParams.set('tableCount', tableCount); if (category) { url.searchParams.set('category', category); } // 跳转 window.parent.loadPage(url.pathname + url.search); } catch (e) { // 如果URL解析失败,使用简单拼接 const separator = linkUrl.includes('?') ? '&' : '?'; window.parent.loadPage(`${linkUrl}${separator}city=${encodeURIComponent(city)}&date=${encodeURIComponent(date)}&time=${encodeURIComponent(time)}&tableCount=${encodeURIComponent(tableCount)}${category ? '&category=' + encodeURIComponent(category) : ''}`); } } } // 子分类标签切换 function switchSubCategory(element) { document.querySelectorAll('.sub-category').forEach(cat => { cat.classList.remove('bg-gray-100', 'font-semibold', 'text-gray-800'); cat.classList.add('text-gray-600'); }); element.classList.add('bg-gray-100', 'font-semibold', 'text-gray-800'); element.classList.remove('text-gray-600'); } // 顶部标签左右滑动(主分类和子分类) function enableSwipe(containerSelector, itemSelector, switchFnName) { const container = document.querySelector(containerSelector); if (!container) return; let startX = 0; let startY = 0; container.addEventListener('touchstart', (e) => { const touch = e.touches[0]; startX = touch.clientX; startY = touch.clientY; }, { passive: true }); container.addEventListener('touchend', (e) => { const touch = e.changedTouches[0]; const dx = touch.clientX - startX; const dy = touch.clientY - startY; if (Math.abs(dx) < 30 || Math.abs(dx) < Math.abs(dy)) return; // 过滤小滑动和竖向滑动 const items = Array.from(container.querySelectorAll(itemSelector)); if (!items.length) return; let currentIndex = items.findIndex(el => el.querySelector('span')?.classList.contains('font-semibold') || el.classList.contains('bg-gray-100')); if (currentIndex < 0) currentIndex = 0; if (dx < 0 && currentIndex < items.length - 1) { // 向左滑,下一项 const target = items[currentIndex + 1]; window[switchFnName](target); target.scrollIntoView({ behavior: 'smooth', inline: 'center' }); } else if (dx > 0 && currentIndex > 0) { // 向右滑,上一项 const target = items[currentIndex - 1]; window[switchFnName](target); target.scrollIntoView({ behavior: 'smooth', inline: 'center' }); } }, { passive: true }); } // 城市选择 function selectCity() { const cities = ['北京', '上海', '广州', '深圳', '杭州', '成都', '武汉', '西安']; const currentCity = document.getElementById('currentCity').textContent; const index = cities.indexOf(currentCity); const nextCity = cities[(index + 1) % cities.length]; document.getElementById('currentCity').textContent = nextCity; } // === 日期选择弹层 === let tempSelectedDate = new Date(); function openDatePicker() { const mask = document.getElementById('datePickerMask'); mask.classList.remove('hidden'); renderCalendar(tempSelectedDate); } function closeDatePicker() { document.getElementById('datePickerMask').classList.add('hidden'); } function renderCalendar(baseDate) { const baseYear = baseDate.getFullYear(); const baseMonth = baseDate.getMonth(); // 0-11 const grid = document.getElementById('datePickerGrid'); grid.innerHTML = ''; const today = new Date(); const isSameDay = (d1, d2) => d1.getFullYear() === d2.getFullYear() && d1.getMonth() === d2.getMonth() && d1.getDate() === d2.getDate(); // 渲染当前月和下一个月,两个月可以上下滑动 for (let offset = 0; offset < 2; offset++) { const date = new Date(baseYear, baseMonth + offset, 1); const year = date.getFullYear(); const month = date.getMonth(); if (offset === 0) { document.getElementById('datePickerMonth').textContent = `${year}年${month + 1}月`; } const firstDay = new Date(year, month, 1); const firstWeekday = firstDay.getDay(); const daysInMonth = new Date(year, month + 1, 0).getDate(); const section = document.createElement('div'); section.className = 'space-y-1'; // 月份标题(例如:2025年12月 / 2026年1月) const title = document.createElement('div'); title.className = 'text-sm text-gray-700 font-medium px-1'; title.textContent = `${year}年${month + 1}月`; section.appendChild(title); // 日期网格 const monthGrid = document.createElement('div'); monthGrid.className = 'grid grid-cols-7 text-center text-sm gap-y-1'; // 前置空白 for (let i = 0; i < firstWeekday; i++) { const empty = document.createElement('div'); monthGrid.appendChild(empty); } for (let d = 1; d <= daysInMonth; d++) { const btn = document.createElement('button'); btn.className = 'mx-auto my-1 w-10 h-10 rounded-full flex flex-col items-center justify-center text-xs text-gray-800'; const current = new Date(year, month, d); let label = d; let subLabel = ''; if (isSameDay(current, today)) { label = '今天'; } else { const weekdays = ['日', '一', '二', '三', '四', '五', '六']; subLabel = '周' + weekdays[current.getDay()]; } // 当前选中高亮 if (isSameDay(current, tempSelectedDate)) { btn.classList.add('bg-yellow-400', 'text-black', 'font-semibold'); } btn.innerHTML = `${label}${subLabel}`; btn.onclick = function () { tempSelectedDate = current; document.querySelectorAll('#datePickerGrid button').forEach(b => { b.classList.remove('bg-yellow-400', 'text-black', 'font-semibold'); b.classList.add('text-gray-800'); }); btn.classList.add('bg-yellow-400', 'text-black', 'font-semibold'); }; monthGrid.appendChild(btn); } section.appendChild(monthGrid); grid.appendChild(section); } } function confirmDate() { const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; const month = tempSelectedDate.getMonth() + 1; const day = tempSelectedDate.getDate(); const week = weekdays[tempSelectedDate.getDay()]; document.getElementById('selectedDate').textContent = `${month}月${day}日 ${week}`; closeDatePicker(); } // === 时间选择弹层(滚轮) === let tempHour = '18'; let tempMinute = '00'; function fillTimeColumns() { const hourCol = document.getElementById('hourColumn'); const minuteCol = document.getElementById('minuteColumn'); if (!hourCol || hourCol.children.length > 0) return; // 添加上下空白占位,使选中项居中 const addPadding = (col) => { for (let i = 0; i < 3; i++) { const blank = document.createElement('div'); blank.style.height = '56px'; col.appendChild(blank.cloneNode()); } }; addPadding(hourCol); for (let h = 0; h < 24; h++) { const div = document.createElement('div'); const val = h.toString().padStart(2, '0'); div.textContent = val; div.className = 'text-gray-300 transition-all duration-200'; div.style.height = '56px'; div.style.lineHeight = '56px'; div.style.fontSize = '26px'; div.style.fontWeight = '400'; div.style.scrollSnapAlign = 'center'; hourCol.appendChild(div); } addPadding(hourCol); addPadding(minuteCol); for (let m = 0; m < 60; m++) { const div = document.createElement('div'); const val = m.toString().padStart(2, '0'); div.textContent = val; div.className = 'text-gray-300 transition-all duration-200'; div.style.height = '56px'; div.style.lineHeight = '56px'; div.style.fontSize = '26px'; div.style.fontWeight = '400'; div.style.scrollSnapAlign = 'center'; minuteCol.appendChild(div); } addPadding(minuteCol); } function openTimePicker() { fillTimeColumns(); const mask = document.getElementById('timePickerMask'); mask.classList.remove('hidden'); const current = document.getElementById('selectedTime').textContent.trim(); const [h, m] = current.split(':'); tempHour = h; tempMinute = m; const hourCol = document.getElementById('hourColumn'); const minuteCol = document.getElementById('minuteColumn'); hourCol.scrollTop = (parseInt(h, 10) - 2) * 40; minuteCol.scrollTop = (parseInt(m, 10) - 2) * 40; // 初始高亮 updateTimeHighlight(hourCol, 'hour'); updateTimeHighlight(minuteCol, 'minute'); hourCol.onscroll = () => handleTimeScroll(hourCol, 'hour'); minuteCol.onscroll = () => handleTimeScroll(minuteCol, 'minute'); } function closeTimePicker() { document.getElementById('timePickerMask').classList.add('hidden'); } function handleTimeScroll(column, type) { clearTimeout(column._scrollTimer); column._scrollTimer = setTimeout(() => { // 计算最近的索引(考虑上方3个空白 + 56px高度) const index = Math.round(column.scrollTop / 56); column.scrollTop = index * 56; // 获取实际值(跳过前3个空白) const actualIndex = index; if (actualIndex >= 0) { const val = actualIndex.toString().padStart(2, '0'); if (type === 'hour' && actualIndex < 24) tempHour = val; if (type === 'minute' && actualIndex < 60) tempMinute = val; updateTimeHighlight(column, type); } }, 80); } function updateTimeHighlight(column, type) { const children = Array.from(column.children); children.forEach((child, idx) => { // 跳过前3个和后3个空白元素 if (idx < 3 || idx >= children.length - 3) return; const actualIdx = idx - 3; const val = actualIdx.toString().padStart(2, '0'); child.style.color = '#CCCCCC'; child.style.fontWeight = '400'; child.style.fontSize = '22px'; if ((type === 'hour' && val === tempHour) || (type === 'minute' && val === tempMinute)) { child.style.color = '#222222'; child.style.fontWeight = '600'; child.style.fontSize = '28px'; } }); } function confirmTime() { document.getElementById('selectedTime').textContent = `${tempHour}:${tempMinute}`; closeTimePicker(); } // 桌数和人数选择弹层(人数/桌数分组) let tempPeople = '1人'; let tempTables = '1桌'; function openTablePicker() { const mask = document.getElementById('tablePickerMask'); const label = document.getElementById('tableCount').textContent.trim(); // 例如 "10桌 · 100人" const match = label.match(/(\d+)桌\s*·\s*(\d+)人/); if (match) { tempTables = `${match[1]}桌`; tempPeople = `${match[2]}人`; } // 恢复高亮状态 document.querySelectorAll('.people-option').forEach(btn => { btn.classList.remove('bg-blue-50', 'text-blue-600', 'font-semibold'); btn.classList.add('bg-gray-100', 'text-gray-700'); if (btn.textContent.trim() === tempPeople) { btn.classList.add('bg-blue-50', 'text-blue-600', 'font-semibold'); } }); document.querySelectorAll('.table-option').forEach(btn => { btn.classList.remove('bg-blue-50', 'text-blue-600', 'font-semibold'); btn.classList.add('bg-gray-100', 'text-gray-700'); if (btn.textContent.trim() === tempTables) { btn.classList.add('bg-blue-50', 'text-blue-600', 'font-semibold'); } }); mask.classList.remove('hidden'); } function closeTablePicker() { document.getElementById('tablePickerMask').classList.add('hidden'); } function selectPeople(element, value) { document.querySelectorAll('.people-option').forEach(btn => { btn.classList.remove('bg-blue-50', 'text-blue-600', 'font-semibold'); btn.classList.add('bg-gray-100', 'text-gray-700'); }); element.classList.add('bg-blue-50', 'text-blue-600', 'font-semibold'); tempPeople = value; } function selectTableOption(element, value) { document.querySelectorAll('.table-option').forEach(btn => { btn.classList.remove('bg-blue-50', 'text-blue-600', 'font-semibold'); btn.classList.add('bg-gray-100', 'text-gray-700'); }); element.classList.add('bg-blue-50', 'text-blue-600', 'font-semibold'); tempTables = value; } function resetTablePicker() { tempPeople = '10人'; tempTables = '10桌'; document.querySelectorAll('.people-option, .table-option').forEach(btn => { btn.classList.remove('bg-blue-50', 'text-blue-600', 'font-semibold'); btn.classList.add('bg-gray-100', 'text-gray-700'); }); } function confirmTableCount() { const label = `${tempTables} · ${tempPeople}`; document.getElementById('tableCount').textContent = label; closeTablePicker(); } // 搜索功能 function searchVenue() { const keyword = document.getElementById('searchInput').value || '位置/品牌/宴会厅'; if (keyword && keyword !== '位置/品牌/宴会厅') { alert(`搜索:${keyword}`); // 这里可以跳转到搜索结果页 } else { alert('请输入搜索关键词'); } } // 跳转到搜索结果页 function goToSearchResults() { const city = document.getElementById('currentCity').textContent; const keyword = document.getElementById('searchInput').value || '位置/品牌/宴会厅'; const date = document.getElementById('selectedDate').textContent; const time = document.getElementById('selectedTime').textContent; const tableCount = document.getElementById('tableCount').textContent; // 构建URL参数 const params = new URLSearchParams({ city: city, keyword: keyword, date: date, time: time, tableCount: tableCount }); window.parent.loadPage(`pages/search-results.html?${params.toString()}`); } // 定位当前位置 function locateCurrent() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition( function(position) { alert('定位成功!正在加载附近宴会厅...'); window.parent.loadPage('pages/map-search.html'); }, function(error) { alert('定位失败,请手动选择城市'); } ); } else { alert('您的浏览器不支持定位功能'); } } // 会员权益点击 function showMemberBenefits() { // 跳转到会员页面或显示会员权益弹窗 window.parent.loadPage('pages/points.html'); } // 买贵退差保障 function showPriceGuarantee() { if (confirm('买贵退差保障:如发现同款商品在其他平台价格更低,我们将退还差价!\n\n是否查看详情?')) { window.parent.loadPage('pages/about.html'); } } // 切换夜间模式 function toggleDarkMode() { document.body.classList.toggle('dark-mode'); const isDark = document.body.classList.contains('dark-mode'); localStorage.setItem('darkMode', isDark); // 可以添加更多夜间模式样式 } // 初始化手势 enableSwipe('#mainCategoryScroll', '.main-category', 'switchMainCategory'); enableSwipe('#subCategoryScroll', '.sub-category', 'switchSubCategory');