|
|
@@ -8,22 +8,23 @@
|
|
|
|
|
|
<view class="recommend-layout">
|
|
|
<!-- 左侧:直播卡片轮播,自动滚动 + 可手动左右滑动,右上角 当前index/总数量 -->
|
|
|
- <view class="block-left-wrap" v-if="liveList.length > 0">
|
|
|
- <swiper
|
|
|
- class="live-swiper"
|
|
|
- :current="liveCurrent"
|
|
|
- circular :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000"
|
|
|
- indicator-color="rgba(255, 255, 255, 0.6)" indicator-active-color="#ffffff"
|
|
|
- @change="onLiveSwiperChange"
|
|
|
- >
|
|
|
+ <view class="block-left-wrap" v-if="liveList.length > 0" @click="onLive">
|
|
|
+ <swiper class="live-swiper" :current="liveCurrent" circular :indicator-dots="false" :autoplay="true"
|
|
|
+ :interval="3000" :duration="1000" indicator-color="rgba(255, 255, 255, 0.6)"
|
|
|
+ indicator-active-color="#ffffff" @change="onLiveSwiperChange">
|
|
|
<!-- <swiper-item v-for="(item, idx) in liveList" :key="idx" @click="onLiveClick(item)">
|
|
|
<view class="block-left">
|
|
|
<view class="x-c" :class="['block-label', isLiving(item) ? 'live' : 'replay']">
|
|
|
- <image class="w24 h24" :src="isLiving(item)?'/static/images/live.gif':'/static/images/replay.png'" mode="aspectFill"></image>
|
|
|
- {{ isLiving(item) ? '直播中' : '回放中' }}
|
|
|
+ <image class="w24 h24"
|
|
|
+ :src="isLiving(item) ? '/static/images/live.gif' : '/static/images/replay.png'"
|
|
|
+ mode="aspectFill"></image>
|
|
|
+ {{ isLiving(item) ? '直播中' : '回放' }}
|
|
|
</view>
|
|
|
<image class="block-img" :src="item.liveImgUrl" mode="aspectFill"></image>
|
|
|
- <view class="block-title one-t">{{ item.liveName }}</view>
|
|
|
+ <view class="block-tit">
|
|
|
+ <image class="item-avatar" src="/static/logo.png" mode="aspectFill"></image>
|
|
|
+ <view class="item-title one-t">{{ item.liveName }}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</swiper-item> -->
|
|
|
<swiper-item>
|
|
|
@@ -33,6 +34,10 @@
|
|
|
</view>
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
|
+ <!-- <view class="swiper-dots" v-if="liveList.length > 1">
|
|
|
+ <text v-for="(dot, index) in liveList.length" :key="'live-dot-' + index"
|
|
|
+ :class="liveCurrent === index ? 'dot-active' : 'dot'"></text>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
|
|
|
<!-- 右侧:上 绿色有机,下 上新推荐 -->
|
|
|
@@ -46,16 +51,13 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="block-small-body">
|
|
|
- <view
|
|
|
- class="small-item"
|
|
|
- v-for="(item, i) in (green || []).slice(0, 2)"
|
|
|
- :key="'g'+i"
|
|
|
- @click.stop="onItemClick(item, 'green')"
|
|
|
- >
|
|
|
+ <view class="small-item" v-for="(item, i) in (green || []).slice(0, 2)" :key="'g' + i"
|
|
|
+ @click.stop="onItemClick(item, 'green')">
|
|
|
<image class="small-thumb" :src="item.image || item.imageUrl" mode="aspectFill"></image>
|
|
|
<view>
|
|
|
<text class="unit">¥</text>
|
|
|
- <text class="small-price" v-if="item.price != null">{{ Number(item.price).toFixed(2) }}</text>
|
|
|
+ <text class="small-price" v-if="item.price != null">{{ Number(item.price).toFixed(2)
|
|
|
+ }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -69,18 +71,15 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="block-small-body">
|
|
|
- <view
|
|
|
- class="small-item"
|
|
|
- v-for="(item, i) in (hot || []).slice(0, 2)"
|
|
|
- :key="'h'+i"
|
|
|
- @click.stop="onItemClick(item, 'hot')"
|
|
|
- >
|
|
|
+ <view class="small-item" v-for="(item, i) in (hot || []).slice(0, 2)" :key="'h' + i"
|
|
|
+ @click.stop="onItemClick(item, 'hot')">
|
|
|
<image class="small-thumb" :src="item.image || item.imageUrl" mode="aspectFill"></image>
|
|
|
<view>
|
|
|
<text class="unit">¥</text>
|
|
|
- <text class="small-price" v-if="item.price != null">{{ Number(item.price).toFixed(2) }}</text>
|
|
|
+ <text class="small-price" v-if="item.price != null">{{ Number(item.price).toFixed(2)
|
|
|
+ }}</text>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -116,6 +115,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ onLive(){
|
|
|
+ uni.showToast({
|
|
|
+ title: '暂无课程',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ },
|
|
|
onLiveSwiperChange(e) {
|
|
|
this.liveCurrent = e.detail.current
|
|
|
},
|
|
|
@@ -142,57 +147,66 @@ export default {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.recommend-section {
|
|
|
- margin: 24rpx;
|
|
|
+ margin: 30rpx 24rpx 40rpx;
|
|
|
}
|
|
|
+
|
|
|
.score-row {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
margin-bottom: 16rpx;
|
|
|
font-size: 26rpx;
|
|
|
}
|
|
|
+
|
|
|
.score-label {
|
|
|
color: #666;
|
|
|
margin-right: 12rpx;
|
|
|
}
|
|
|
+
|
|
|
.score-value {
|
|
|
color: #333;
|
|
|
font-weight: 600;
|
|
|
}
|
|
|
+
|
|
|
.recommend-layout {
|
|
|
display: flex;
|
|
|
gap: 20rpx;
|
|
|
}
|
|
|
+
|
|
|
.block-left-wrap {
|
|
|
- flex:1;
|
|
|
+ flex: 1;
|
|
|
// width: 340rpx;
|
|
|
flex-shrink: 0;
|
|
|
// height: 420rpx;
|
|
|
- border-radius: 16rpx;
|
|
|
+ border-radius: 24rpx;
|
|
|
overflow: hidden;
|
|
|
+ position: relative;
|
|
|
}
|
|
|
+
|
|
|
.live-swiper {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
+
|
|
|
.block-left {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
- border-radius: 16rpx;
|
|
|
overflow: hidden;
|
|
|
background: #f5f5f5;
|
|
|
position: relative;
|
|
|
}
|
|
|
+
|
|
|
.live-index-badge {
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
right: 0;
|
|
|
z-index: 2;
|
|
|
- background: rgba(0,0,0,0.5);
|
|
|
+ background: rgba(0, 0, 0, 0.5);
|
|
|
color: #fff;
|
|
|
font-size: 22rpx;
|
|
|
padding: 8rpx 16rpx;
|
|
|
border-radius: 0 0 0 12rpx;
|
|
|
}
|
|
|
+
|
|
|
.block-label {
|
|
|
position: absolute;
|
|
|
top: 20rpx;
|
|
|
@@ -201,12 +215,14 @@ export default {
|
|
|
color: #fff;
|
|
|
font-size: 24rpx;
|
|
|
padding: 8rpx 20rpx;
|
|
|
- background: linear-gradient( 135deg, #FF5267 0%, #FF233C 100%);
|
|
|
+ background: linear-gradient(135deg, #FF5267 0%, #FF233C 100%);
|
|
|
border-radius: 0rpx 8rpx 8rpx 0rpx;
|
|
|
- image{
|
|
|
+
|
|
|
+ image {
|
|
|
margin-right: 4rpx;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// .block-label.live {
|
|
|
// background: #E5212B;
|
|
|
// }
|
|
|
@@ -218,16 +234,67 @@ export default {
|
|
|
height: 100%;
|
|
|
display: block;
|
|
|
}
|
|
|
+
|
|
|
.block-title {
|
|
|
position: absolute;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
- background: rgba(0,0,0,0.45);
|
|
|
+ background: rgba(0, 0, 0, 0.45);
|
|
|
color: #fff;
|
|
|
font-size: 26rpx;
|
|
|
padding: 16rpx 16rpx 50rpx;
|
|
|
}
|
|
|
+.block-tit {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ background: rgba(0, 0, 0, 0.45);
|
|
|
+ color: #fff;
|
|
|
+ font-size: 26rpx;
|
|
|
+ padding: 16rpx 16rpx 50rpx;
|
|
|
+
|
|
|
+ .item-avatar {
|
|
|
+ width: 40rpx;
|
|
|
+ height: 40rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+ margin-right: 10rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .item-title {
|
|
|
+ font-size: 32rpx;
|
|
|
+ color: #FFFFFF;
|
|
|
+ line-height: 44rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
+.swiper-dots {
|
|
|
+ display: flex;
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ bottom: 12rpx;
|
|
|
+ z-index: 3;
|
|
|
+ gap: 6rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.dot {
|
|
|
+ width: 8rpx;
|
|
|
+ height: 8rpx;
|
|
|
+ background: #FFFFFF;
|
|
|
+ opacity: 0.7;
|
|
|
+ border-radius: 4rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.dot-active {
|
|
|
+ width: 16rpx;
|
|
|
+ height: 8rpx;
|
|
|
+ background: #FFFFFF;
|
|
|
+ border-radius: 4rpx;
|
|
|
+}
|
|
|
+
|
|
|
.block-right {
|
|
|
flex: 1;
|
|
|
display: flex;
|
|
|
@@ -235,65 +302,82 @@ export default {
|
|
|
gap: 20rpx;
|
|
|
min-width: 0;
|
|
|
}
|
|
|
+
|
|
|
.block-small {
|
|
|
flex: 1;
|
|
|
- background: linear-gradient( 180deg, #FFC7A7 0%, #FFF8F3 36.36%, #FFFFFF 100%);
|
|
|
- border-radius: 16rpx;
|
|
|
+ background: linear-gradient(180deg, #FFC7A7 0%, #FFF8F3 36.36%, #FFFFFF 100%);
|
|
|
+ border-radius: 24rpx;
|
|
|
overflow: hidden;
|
|
|
padding: 16rpx;
|
|
|
- &:last-child{
|
|
|
- background: linear-gradient( 180deg, #FFC5C5 0%, #FFF5F5 36.36%, #FFFFFF 100%);
|
|
|
+
|
|
|
+ &:last-child {
|
|
|
+ background: linear-gradient(180deg, #FFC5C5 0%, #FFF5F5 36.36%, #FFFFFF 100%);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.block-small-head {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
margin-bottom: 18rpx;
|
|
|
}
|
|
|
+
|
|
|
.block-small-title {
|
|
|
font-size: 28rpx;
|
|
|
font-weight: 600;
|
|
|
}
|
|
|
+
|
|
|
.green {
|
|
|
color: #FF5B25;
|
|
|
}
|
|
|
+
|
|
|
.hot {
|
|
|
color: #FF485D;
|
|
|
}
|
|
|
+
|
|
|
.more {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
font-size: 28rpx;
|
|
|
- text{
|
|
|
+
|
|
|
+ text {
|
|
|
margin-right: 5rpx;
|
|
|
}
|
|
|
+
|
|
|
// color: #999;
|
|
|
}
|
|
|
+
|
|
|
.arrow {
|
|
|
margin-left: 4rpx;
|
|
|
font-size: 28rpx;
|
|
|
}
|
|
|
+
|
|
|
.block-small-body {
|
|
|
display: flex;
|
|
|
// gap: 16rpx;
|
|
|
}
|
|
|
+
|
|
|
.small-item {
|
|
|
flex: 1;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
|
}
|
|
|
+
|
|
|
.small-thumb {
|
|
|
width: 110rpx;
|
|
|
height: 110rpx;
|
|
|
border-radius: 10rpx;
|
|
|
}
|
|
|
+
|
|
|
.unit {
|
|
|
+ font-weight: 600;
|
|
|
font-size: 20rpx;
|
|
|
color: #FF233C;
|
|
|
margin-top: 8rpx;
|
|
|
+ margin-right: 4rpx;
|
|
|
}
|
|
|
+
|
|
|
.small-price {
|
|
|
font-size: 32rpx;
|
|
|
font-weight: 600;
|