From 0270abc763a1a2ca1162f2fd49b1734d6c5652b2 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期三, 15 十月 2025 00:42:24 +0800
Subject: [PATCH] 首页视频优化
---
pages/tabbar/index/home.vue | 28 ++++++++++++++++++----------
1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/pages/tabbar/index/home.vue b/pages/tabbar/index/home.vue
index b827c82..d4d323e 100644
--- a/pages/tabbar/index/home.vue
+++ b/pages/tabbar/index/home.vue
@@ -62,7 +62,8 @@
<!-- 鎮寕鍟嗗搧閾炬帴灞� -->
- <view class="goods-link-warp" v-if="item.goodsList.length > 0">
+ <view class="goods-link-warp" :style="{ bottom: marginBottom + 55 + 'px' }"
+ v-if="item.goodsList.length > 0">
<view class="goods-link">
<swiper @change="goodsChange" :autoplay="true" :interval="4000" style="height: 120rpx;">
<swiper-item v-for="goods in item.goodsList" :key="goods.goodsId">
@@ -88,9 +89,10 @@
<!-- 瑙嗛淇℃伅灞� -->
<view class="video-info" :style="{ bottom: marginBottom + 20 + 'px' }">
- <view style="width: 100%; position: relative;" @click="jumpToSearch">
+ <view style="width: 100%; position: relative;">
<text class="video-author">@{{ item.authorName }}</text>
- <text class="iconfont" style="position: absolute;right: 42px;bottom: 50rpx;"></text>
+ <text class="iconfont" @click="jumpToSearch"
+ style="position: absolute;right: 42px;bottom: 50rpx;"></text>
</view>
<view style="width: 100%;word-wrap: break-word;white-space: normal;overflow-wrap: break-word;">
<text class="video-title">{{ item.title }}</text>
@@ -354,12 +356,12 @@
loading: false, // 鏄惁姝e湪鍔犺浇
videoQuery: {
pageNumber: 1,
- pageSize: 10,
+ pageSize: 3,
videoFrom: 'recommend'
},
goodsSimilarlyQuery: { // 鐩镐技瑙嗛鏌ヨ
pageNumber: 1,
- pageSize: 10,
+ pageSize: 3,
videoFrom: 'goodsSimilarly',
goodsIds: [],
currentVideoId: ''
@@ -965,7 +967,8 @@
const data = res.data.data.map(item => {
return {
...item,
- updateKey: item.id
+ updateKey: item.id,
+ videoUrl: item.videoUrl.replace('https://lmk-1356772813.cos.ap-chengdu.myqcloud.com/', 'https://media.meiyikuang.com/')
}
})
if (this.videoQuery.pageNumber === 1) {
@@ -984,7 +987,9 @@
this.videoNoMore = true;
return;
}
- this.videoQuery.pageNumber++;
+ if (res.data.code === 200) {
+ this.videoQuery.pageNumber++;
+ }
})
} else {
@@ -993,7 +998,8 @@
const data = res.data.data.map(item => {
return {
...item,
- updateKey: item.id
+ updateKey: item.id,
+ videoUrl: item.videoUrl.replace('https://lmk-1356772813.cos.ap-chengdu.myqcloud.com/', 'https://media.meiyikuang.com/')
}
})
if (this.videoQuery.pageNumber === 1) {
@@ -1012,7 +1018,9 @@
this.videoNoMore = true;
return;
}
- this.videoQuery.pageNumber++;
+ if (res.data.code === 200) {
+ this.videoQuery.pageNumber++;
+ }
})
}
@@ -1472,7 +1480,7 @@
/* 鍟嗗搧閾炬帴鎮寕灞傛牱寮� */
.goods-link-warp {
position: absolute;
- bottom: 160px;
+ bottom: 100px;
left: 20px;
color: #f8f8f8;
z-index: 10;
--
Gitblit v1.8.0