顶部轮播图

This commit is contained in:
1173117610@qq.com 2026-05-12 13:17:23 +08:00
parent 5ae276cfeb
commit 5b588efa67
2 changed files with 22 additions and 10 deletions

View File

@ -310,10 +310,10 @@
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
/* 去掉阴影让头部更轻 */
right: 0; right: 0;
background-color: #ffffff; background-color: #ffffff;
z-index: 100; z-index: 100;
box-shadow: 0 2rpx 10rpx rgba(0,0,0,0.05);
} }
.header-content { .header-content {
@ -340,12 +340,13 @@
text-align: center; text-align: center;
} }
.title-text { .nav-header .title-text {
font-size: 32rpx; font-size: 36rpx;
color: #333; color: #333;
font-weight: bold; font-weight: bold;
} }
.placeholder-area { .placeholder-area {
width: 60rpx; width: 60rpx;
} }
@ -363,9 +364,8 @@
.filter-bar { .filter-bar {
display: flex; display: flex;
background: #ffffff; background: #ffffff;
height: 88rpx; height: 76rpx;
align-items: center; align-items: center;
border-bottom: 1rpx solid #f1f1f1;
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 90; z-index: 90;
@ -390,16 +390,17 @@
.sub-filter-row { .sub-filter-row {
display: flex; display: flex;
background: #ffffff; background: #ffffff;
padding: 10rpx 20rpx 20rpx; padding: 0 20rpx 16rpx;
align-items: center; align-items: center;
border-bottom: 1rpx solid #f1f1f1;
} }
.sub-filter-item { .sub-filter-item {
padding: 6rpx 20rpx; padding: 8rpx 26rpx;
background: #f5f6f8; background: #f5f6f8;
color: #333; color: #333;
font-size: 24rpx; font-size: 24rpx;
border-radius: 8rpx; border-radius: 28rpx;
margin-right: 16rpx; margin-right: 16rpx;
transition: all 0.2s; transition: all 0.2s;
} }

View File

@ -347,8 +347,19 @@
uni.request({ uni.request({
url: 'https://api.cmspro.haodanku.com/index/index?cid=YsWZ21tx', url: 'https://api.cmspro.haodanku.com/index/index?cid=YsWZ21tx',
success: (res) => { success: (res) => {
if (res.data && res.data.code === 200 && res.data.data.navs) { if (res.data && res.data.code === 200 && res.data.data) {
this.menus = res.data.data.navs; const d = res.data.data;
if (Array.isArray(d.navs)) {
this.menus = d.navs;
}
//
if (Array.isArray(d.banners) && d.banners.length > 0) {
this.banners = d.banners.map(b => b.img).filter(Boolean);
}
//
if (Array.isArray(d.tile_long) && d.tile_long.length > 0) {
this.adList = d.tile_long.map(t => t.img).filter(Boolean);
}
} }
} }
}); });