diff --git a/pages/activityList/details.vue b/pages/activityList/details.vue index 87bbe36..3ad0627 100644 --- a/pages/activityList/details.vue +++ b/pages/activityList/details.vue @@ -6,51 +6,30 @@ 探索啤酒风味新边界 --> - - - TasteRoom 风味屋 · 风味之旅系列 - - - 探索啤酒风味新边界 - - - - - {{it.beerName}} - 西打酒 - - - TasteRoom风味屋 - - 4.9 - - - + + + {{activityInfo.title || 'TasteRoom 风味屋 · 风味之旅系列'}} + {{activityInfo.description || '探索啤酒风味新边界'}} + + + + + + + + {{item.beerName}} + {{item.beerStyles}} + {{item.brandName}} + + {{item.avgOverallRating || '4.9'}} + + + - - - - 更多新品发布信息,敬请关注更新~ + 更多新品发布信息,敬请关注更新~ - - + + + + + + + - - - - - - 热门厂牌 - - | - - 我的关注 + + + + + + + + - - - - - - - - - - - - - 风味屋 - - - - - - {{ letter }} - - - 只看在售 - - - + + + + + + + {{letter}} + + + + {{brewery.breweryName}} + {{brewery.beerCount || 0}}款在售 + - - - - - {{ item.name }} - + + + + + + 暂无相关品牌 - - - - {{ letter }} + + + + + {{letter}} @@ -77,268 +83,410 @@ - \ No newline at end of file diff --git a/pages/activityList/styleSelection.vue b/pages/activityList/styleSelection.vue index c922ae9..714c85c 100644 --- a/pages/activityList/styleSelection.vue +++ b/pages/activityList/styleSelection.vue @@ -1,33 +1,14 @@ @@ -125,14 +77,13 @@ popularStyle, getBrands, getBeerStyles, + getBeerByStyle } from "@/api/platform.js" - import CustomNavBar from '@/components/CustomNavBar.vue' import Sieving from '@/components/sieving/index.vue' export default { name: 'StyleSelection', components: { - CustomNavBar, Sieving }, data() { @@ -145,15 +96,13 @@ hasMore: true, // 筛选相关 - selectedStyle: '', - popularStyleList: [], + activeTab: '', // 查询参数 queryParams: { pageNum: 1, pageSize: 10, - sortType: 'latest', - style: '' + styleId: '' }, // 筛选配置 @@ -212,9 +161,10 @@ async initData() { try { await Promise.all([ - this.getPopularStyles(), - this.getBeerList() + this.getBrandOptions(), + this.getStyleOptions() ]) + await this.getBeerList() } catch (error) { console.error('初始化数据失败:', error) uni.showToast({ @@ -224,13 +174,31 @@ } }, - // 获取热门风格 - async getPopularStyles() { + // 获取品牌选项 + async getBrandOptions() { try { - const res = await popularStyle() - this.popularStyleList = res.data || [] + const res = await getBrands() + const brands = res.data || [] + this.dropdownMenuList[0].options = brands.map(brand => ({ + label: brand.brandName, + value: brand.id + })) } catch (error) { - console.error('获取热门风格失败:', error) + console.error('获取品牌列表失败:', error) + } + }, + + // 获取风格选项 + async getStyleOptions() { + try { + const res = await getBeerStyles() + const styles = res.data || [] + this.dropdownMenuList[1].options = styles.map(style => ({ + label: style.beerStyles, + value: style.id + })) + } catch (error) { + console.error('获取风格列表失败:', error) } }, @@ -245,7 +213,7 @@ this.beerList = [] } - const res = await getNewBeerListByMonth(this.queryParams) + const res = await getBeerByStyle(this.queryParams) const newList = res.data || [] this.beerList = isRefresh ? @@ -278,39 +246,15 @@ sortType: sort } - if (sort === 'comprehensive') { - this.queryParams.weights = { - popular: 0.5, - rating: 0.3, - latest: 0.2 - } - } else { - delete this.queryParams.weights - } - this.getBeerList(true) }, handleFilterOpen(tabName) { - this.queryParams.style = tabName + this.activeTab = tabName }, handleFilterClose() { - this.queryParams.style = '' - }, - - selectStyle(style) { - this.selectedStyle = style.beerStyles - this.queryParams.style = style.beerStyles - this.getBeerList(true) - this.$refs.stylePopup.close() - }, - - clearFilter() { - this.selectedStyle = '' - this.queryParams.style = '' - this.getBeerList(true) - this.$refs.stylePopup.close() + this.activeTab = '' }, // 列表相关方法 @@ -336,152 +280,167 @@ \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index e3ce775..5356e07 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -6,12 +6,12 @@ --> - + - + @@ -19,7 +19,7 @@ - + 搜索酒款名称,品牌名称,啤酒风格 @@ -29,29 +29,11 @@ - + - + - 新酒上市 - - - - - - 生成酒单 - - - - - - 酒币换购 - - - - - - 关注厂牌 + {{item}} @@ -143,6 +125,7 @@ total: 0, loading: false, finished: false, + navItems: ['新酒上市', '生成酒单', '酒币换购', '关注厂牌'], }; }, created() { @@ -643,4 +626,70 @@ .activity-item { display: block; } + + .hover-effect { + transition: all 0.2s ease; + + &:active { + transform: scale(0.96); + opacity: 0.8; + } + } + + .search-box { + // ... existing code ... + &:active { + transform: scale(0.98); + opacity: 0.9; + } + } + + .nav-item { + // ... existing code ... + &:active { + transform: scale(0.95); + opacity: 0.8; + } + } + + .more-btn-box { + // ... existing code ... + &:active { + transform: scale(0.98); + opacity: 0.9; + } + } + + .activity-item { + // ... existing code ... + &:active { + transform: scale(0.98); + opacity: 0.9; + } + } + + // 添加图片加载优化相关样式 + .img { + width: 100%; + height: 100%; + will-change: transform; + backface-visibility: hidden; + transform: translateZ(0); + } + + // 添加骨架屏样式 + .skeleton { + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + background-size: 400% 100%; + animation: skeleton-loading 1.4s ease infinite; + } + + @keyframes skeleton-loading { + 0% { + background-position: 100% 50%; + } + 100% { + background-position: 0 50%; + } + } \ No newline at end of file