This commit is contained in:
parent
1a9e57c88f
commit
5160c52ad4
|
|
@ -136,32 +136,32 @@
|
|||
<text class="brand-more">更多 ></text>
|
||||
</view>
|
||||
|
||||
<!-- 品牌主推位 -->
|
||||
<view class="brand-highlight">
|
||||
<image class="highlight-bg" :src="brandFeature.bg" mode="aspectFill"></image>
|
||||
<view class="highlight-content">
|
||||
<view class="brand-logo-white-box">
|
||||
<image class="brand-logo-img" :src="brandFeature.logo" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="brand-feature-info">
|
||||
<view class="brand-name-row">
|
||||
<text>{{ brandFeature.name }}</text>
|
||||
<text class="arrow">></text>
|
||||
</view>
|
||||
<view class="brand-discount-text">{{ brandFeature.desc }}</view>
|
||||
<view class="brand-promo-tags">
|
||||
<text class="p-tag">抢限量大额券</text>
|
||||
<text class="p-tag">霸榜天猫3大榜单</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 品牌商品分页轮播 -->
|
||||
<!-- 品牌特卖分页轮播 (以店铺为单位整体翻页) -->
|
||||
<swiper class="brand-goods-swiper" :indicator-dots="true" indicator-active-color="#ff416c">
|
||||
<swiper-item v-for="(p, pIdx) in 1" :key="pIdx">
|
||||
<swiper-item v-for="(shop, sIdx) in brandSaleShops" :key="sIdx">
|
||||
<!-- 品牌主推位 -->
|
||||
<view class="brand-highlight">
|
||||
<image class="highlight-bg" :src="shop.bg" mode="aspectFill"></image>
|
||||
<view class="highlight-content">
|
||||
<view class="brand-logo-white-box">
|
||||
<image class="brand-logo-img" :src="shop.logo" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="brand-feature-info">
|
||||
<view class="brand-name-row">
|
||||
<text>{{ shop.name }}</text>
|
||||
<text class="arrow">></text>
|
||||
</view>
|
||||
<view class="brand-discount-text">{{ shop.desc }}</view>
|
||||
<view class="brand-promo-tags">
|
||||
<text class="p-tag" v-for="(tag, tIdx) in shop.tags" :key="tIdx">{{ tag }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 品牌商品格子 -->
|
||||
<view class="brand-goods-grid">
|
||||
<view class="brand-grid-item" v-for="(goods, gIdx) in brandGoods" :key="gIdx">
|
||||
<view class="brand-grid-item" v-for="(goods, gIdx) in shop.items" :key="gIdx">
|
||||
<view class="b-img-wrap">
|
||||
<view class="anniversary-tag">
|
||||
<text class="a-icon">🎂</text>
|
||||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue