diff --git a/brand_res.json b/brand_res.json new file mode 100644 index 0000000..e69de29 diff --git a/pages/index/index.vue b/pages/index/index.vue index 3111da3..b212403 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -136,32 +136,32 @@ 更多 > - - - - - - - - - - {{ brandFeature.name }} - > - - {{ brandFeature.desc }} - - 抢限量大额券 - 霸榜天猫3大榜单 - - - - - - + - + + + + + + + + + + + {{ shop.name }} + > + + {{ shop.desc }} + + {{ tag }} + + + + + + - + 🎂 @@ -278,38 +278,7 @@ { logo: 'https://cdn-icons-png.flaticon.com/512/732/732244.png', image: 'https://images.unsplash.com/photo-1583743814966-8936f5b7be1a?w=400&q=80', price: '89.0', oldPrice: '299' }, { logo: 'https://cdn-icons-png.flaticon.com/512/732/732221.png', image: 'https://images.unsplash.com/photo-1511556532299-8f662fc26c06?w=400&q=80', price: '129', oldPrice: '499' } ], - brandFeature: { - bg: 'https://images.unsplash.com/photo-1556228720-195a672e8a03?w=800&q=80', - logo: 'https://images.unsplash.com/photo-1560155016-bd4879ae8f21?w=200&q=80', - name: '贝德美', - desc: '不只4.1折! 婴童洗护心选' - }, - brandGoods: [ - { - img: 'https://images.unsplash.com/photo-1556228453-efd6c1ff04f6?w=300&q=80', - sold: '1.0万', - title: '【6月+可用】...', - promo: '官方立减10元', - price: '19.9', - coupon: 30 - }, - { - img: 'https://images.unsplash.com/photo-1556228515-919086f6f273?w=300&q=80', - sold: '70.0万', - title: '【0岁+可用】...', - promo: '立减10元+领10', - price: '24', - coupon: 10 - }, - { - img: 'https://images.unsplash.com/photo-1594820878367-0676999d734f?w=300&q=80', - sold: '30.0万', - title: '【贝德美】婴...', - promo: '官方立减10元', - price: '24', - coupon: 10 - } - ], + brandSaleShops: [], platformActive: 0, goodsList: [] } @@ -405,26 +374,21 @@ uni.request({ url: 'https://api.cmspro.haodanku.com/brandItem/choiceness?cid=qOstW90', success: (res) => { - if (res.data && res.data.code === 200 && res.data.data.deserve_lists.length > 0) { - const firstItem = res.data.data.deserve_lists[0]; - const act = firstItem.activity_info || {}; - - // 映射主推位信息 - this.brandFeature = { - bg: act.long_img || 'https://images.unsplash.com/photo-1556228720-195a672e8a03?w=800&q=80', - logo: act.top_icon || firstItem.itempic, - name: act.name || firstItem.shopname, - desc: act.guide_article || '官方直降 爆款秒杀' - }; - - // 映射下方商品 (取前3个) - this.brandGoods = res.data.data.deserve_lists.slice(0, 3).map(item => ({ - img: item.itempic, - title: item.itemshorttitle, - sold: item.itemsale >= 10000 ? (item.itemsale / 10000).toFixed(1) + '万' : item.itemsale, - promo: item.activity_info ? item.activity_info.guide_article : '官方立减', - price: item.itemendprice, - coupon: item.couponmoney + if (res.data && res.data.code === 200 && res.data.data.brand_prefecture) { + this.brandSaleShops = res.data.data.brand_prefecture.map(shop => ({ + bg: shop.backimage || 'https://images.unsplash.com/photo-1556228720-195a672e8a03?w=800&q=80', + logo: shop.brand_logo || 'https://images.unsplash.com/photo-1560155016-bd4879ae8f21?w=200&q=80', + name: shop.fq_brand_name || '大牌特卖', + desc: shop.title || '官方直降 爆款秒杀', + tags: shop.label ? shop.label.slice(0, 2) : ['抢限量大额券', '霸榜天猫3大榜单'], + items: (shop.items || []).slice(0, 3).map(goods => ({ + img: goods.itempic, + title: goods.itemshorttitle, + sold: goods.itemsale >= 10000 ? (goods.itemsale / 10000).toFixed(1) + '万' : goods.itemsale, + promo: goods.couponmoney ? '领' + goods.couponmoney + '元券' : '官方直降', + price: goods.itemendprice, + coupon: goods.couponmoney + })) })); } } @@ -1126,11 +1090,11 @@ } .brand-highlight { - height: 220rpx; + height: 180rpx; position: relative; border-radius: 20rpx; overflow: hidden; - margin-bottom: 30rpx; + margin-bottom: 20rpx; } .highlight-bg { @@ -1152,8 +1116,8 @@ } .brand-logo-white-box { - width: 160rpx; - height: 160rpx; + width: 130rpx; + height: 130rpx; background: #ffffff; border-radius: 16rpx; display: flex; @@ -1164,8 +1128,8 @@ } .brand-logo-img { - width: 120rpx; - height: 120rpx; + width: 100rpx; + height: 100rpx; } .brand-feature-info { @@ -1207,7 +1171,7 @@ } .brand-goods-swiper { - height: 440rpx; + height: 700rpx; } .brand-goods-grid { diff --git a/raw.json b/raw.json new file mode 100644 index 0000000..88e5a08 Binary files /dev/null and b/raw.json differ