wangfukang 3 weeks ago
parent
commit
963595cebd
  1. 51
      pages/index/index.vue

51
pages/index/index.vue

@ -139,7 +139,7 @@
</view> </view>
</view> </view>
<view class="like-box"> <view class="like-box">
<view class="like-content-box"> <view class="like-content-box" :class="{'like-content-box--ad-closed': !homeCenterAdEnabled}">
<view class="brand-memory-strip"> <view class="brand-memory-strip">
<view class="campus-switch campus-switch--strip" @tap.stop="checkArea"> <view class="campus-switch campus-switch--strip" @tap.stop="checkArea">
<text class="campus-switch-name">{{areaName || '选择区域'}}</text> <text class="campus-switch-name">{{areaName || '选择区域'}}</text>
@ -151,11 +151,11 @@
<view class="heat-dot heat-dot-b"></view> <view class="heat-dot heat-dot-b"></view>
<view class="seckill-entry-light"></view> <view class="seckill-entry-light"></view>
<view class="seckill-entry-info" style="padding-left: 20rpx;"> <view class="seckill-entry-info" style="padding-left: 20rpx;">
<view class="seckill-entry-title">极速团</view> <view class="seckill-entry-title">参与拼团</view>
</view> </view>
<view class="seckill-entry-btn">抢</view> <view class="seckill-entry-btn">省</view>
</view> </view>
<swiper v-if="homeCenterAds.length > 4" class="group-flat-row group-flat-row--swiper" <swiper v-if="homeCenterAdEnabled && homeCenterAds.length > 4" class="group-flat-row group-flat-row--swiper"
circular :autoplay="true" :interval="2600" :duration="500" :display-multiple-items="4" circular :autoplay="true" :interval="2600" :duration="500" :display-multiple-items="4"
:indicator-dots="false"> :indicator-dots="false">
<swiper-item class="flat-card-swiper-item" v-for="(item,index) in homeCenterAds" :key="index"> <swiper-item class="flat-card-swiper-item" v-for="(item,index) in homeCenterAds" :key="index">
@ -165,6 +165,7 @@
<view class="flat-card-tag">🔥 <text class="flat-card-origin-price">¥{{item.productList && item.productList[0] ? item.productList[0].originalPrice : ''}}</text></view> <view class="flat-card-tag">🔥 <text class="flat-card-origin-price">¥{{item.productList && item.productList[0] ? item.productList[0].originalPrice : ''}}</text></view>
</view> </view>
<view class="flat-card-name">{{item.title}}</view> <view class="flat-card-name">{{item.title}}</view>
<view class="flat-card-merchant" v-if="item.merchantName">{{item.merchantName}}</view>
<view class="flat-card-price">¥{{item.productList && item.productList[0] ? item.productList[0].groupPrice : ''}}</view> <view class="flat-card-price">¥{{item.productList && item.productList[0] ? item.productList[0].groupPrice : ''}}</view>
<view class="flat-card-foot"> <view class="flat-card-foot">
<text>{{item.productList && item.productList[0] ? item.productList[0].groupMembers : ''}}人团</text> <text>{{item.productList && item.productList[0] ? item.productList[0].groupMembers : ''}}人团</text>
@ -173,13 +174,14 @@
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
<view v-else class="group-flat-row"> <view v-else-if="homeCenterAdEnabled" class="group-flat-row">
<view class="flat-card" v-for="(item,index) in homeCenterAds" :key="index" @tap="goAdPage(item)"> <view class="flat-card" v-for="(item,index) in homeCenterAds" :key="index" @tap="goAdPage(item)">
<view class="flat-card-img"> <view class="flat-card-img">
<img :src="item.adDisplayImage" alt=""> <img :src="item.adDisplayImage" alt="">
<view class="flat-card-tag">🔥 <text class="flat-card-origin-price">¥{{item.productList && item.productList[0] ? item.productList[0].originalPrice : ''}}</text></view> <view class="flat-card-tag">🔥 <text class="flat-card-origin-price">¥{{item.productList && item.productList[0] ? item.productList[0].originalPrice : ''}}</text></view>
</view> </view>
<view class="flat-card-name">{{item.title}}</view> <view class="flat-card-name">{{item.title}}</view>
<view class="flat-card-merchant" v-if="item.merchantName">{{item.merchantName}}</view>
<view class="flat-card-price">¥{{item.productList && item.productList[0] ? item.productList[0].groupPrice : ''}}</view> <view class="flat-card-price">¥{{item.productList && item.productList[0] ? item.productList[0].groupPrice : ''}}</view>
<view class="flat-card-foot"> <view class="flat-card-foot">
<text>{{item.productList && item.productList[0] ? item.productList[0].groupMembers : ''}}人团</text> <text>{{item.productList && item.productList[0] ? item.productList[0].groupMembers : ''}}人团</text>
@ -720,6 +722,7 @@
indicatorDots: false, indicatorDots: false,
autoplay: true, autoplay: true,
mallAds: [], mallAds: [],
homeCenterAdEnabled: true,
homePopupAd: {}, homePopupAd: {},
deliveryItem: [], deliveryItem: [],
rejectOrderSubmittingMap: {}, rejectOrderSubmittingMap: {},
@ -1947,6 +1950,7 @@
if (res.code == 200) { if (res.code == 200) {
that.homeReminders = res.result.homeReminders || {} that.homeReminders = res.result.homeReminders || {}
that.handleHomePopupAd(res.result.homePopupAd) that.handleHomePopupAd(res.result.homePopupAd)
that.homeCenterAdEnabled = res.result.homeCenterAdEnabled !== false
that.mallAds = res.result.mallAds || [] that.mallAds = res.result.mallAds || []
that.applyCachedAdImages(that.mallAds) that.applyCachedAdImages(that.mallAds)
for(let i=0;i<that.mallAds.length;i++){ for(let i=0;i<that.mallAds.length;i++){
@ -3735,7 +3739,7 @@
} }
.seckill-entry { .seckill-entry {
width: 198rpx; width: 220rpx;
height: 56rpx; height: 56rpx;
padding: 0 10rpx; padding: 0 10rpx;
box-sizing: border-box; box-sizing: border-box;
@ -3862,6 +3866,10 @@
position: relative; position: relative;
} }
.like-content-box--ad-closed {
height: 96rpx;
}
.brand-memory-strip { .brand-memory-strip {
position: absolute; position: absolute;
left: 20rpx; left: 20rpx;
@ -3925,7 +3933,7 @@
min-width: 0; min-width: 0;
height: 95%; height: 95%;
margin: 0 6rpx; margin: 0 6rpx;
padding: 12rpx 12rpx 16rpx; padding: 12rpx 12rpx 12rpx;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -3977,9 +3985,9 @@
} }
.flat-card-name { .flat-card-name {
margin-top: 12rpx; margin-top: 8rpx;
height: 34rpx; height: 30rpx;
line-height: 34rpx; line-height: 30rpx;
font-size: 23rpx; font-size: 23rpx;
font-weight: 900; font-weight: 900;
color: #173f36; color: #173f36;
@ -3989,11 +3997,24 @@
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.flat-card-merchant {
margin-top: 8rpx;
height: 22rpx;
line-height: 22rpx;
font-size: 18rpx;
font-weight: 700;
color: rgba(23, 63, 54, 0.56);
text-align: left;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.flat-card-price { .flat-card-price {
height: 40rpx; height: 34rpx;
line-height: 40rpx; line-height: 34rpx;
margin-top: 4rpx; margin-top: 6rpx;
font-size: 27rpx; font-size: 29rpx;
font-weight: 900; font-weight: 900;
color: #ff6a23; color: #ff6a23;
text-align: left; text-align: left;
@ -4026,7 +4047,7 @@
justify-content: center; justify-content: center;
flex: 0 0 60rpx; flex: 0 0 60rpx;
width: 60rpx; width: 60rpx;
height: 36rpx; height: 32rpx;
margin-left: 8rpx; margin-left: 8rpx;
border-radius: 999rpx; border-radius: 999rpx;
border: 1px solid rgba(165, 255, 226, 0.9); border: 1px solid rgba(165, 255, 226, 0.9);

Loading…
Cancel
Save