From 08dbfed46fea626ebd5c543eff86a403e5300549 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期五, 24 十月 2025 11:42:11 +0800
Subject: [PATCH] 隐藏推荐活动
---
pages/tabbar/index/home.vue | 84 +++++++++++++++++++++++++++--------------
1 files changed, 55 insertions(+), 29 deletions(-)
diff --git a/pages/tabbar/index/home.vue b/pages/tabbar/index/home.vue
index 00fd2d7..88cfd7e 100644
--- a/pages/tabbar/index/home.vue
+++ b/pages/tabbar/index/home.vue
@@ -15,12 +15,13 @@
mode="aspectFit"></image>
</view>
<video v-if="index >= currentIndex - videoLiveOffset && index <= currentIndex + videoLiveOffset"
- :id="'video' + index" :ref="'video' + index" :src="item.videoUrl" :autoplay="index === currentIndex"
- :controls="isControls" :loop="true" :object-fit="item.videoFit" :enable-progress-gesture="false"
- :show-center-play-btn="false" :show-progress="false" :show-fullscreen-btn="isControls"
- :show-play-btn="isControls" :show-mute-btn="false" class="video-item"
- @fullscreenchange="onFullscreenChange" @play="onPlay(item.id, index)" @pause="onPause(index)"
- @ended="onEnded(index)" @click="togglePlay(index)" @timeupdate="onTimeUpdate($event)"
+ :id="'video' + index" :ref="'video' + index" :src="item.videoUrl"
+ :autoplay="index === currentIndex" :controls="isControls" :loop="true"
+ :object-fit="item.videoFit" :enable-progress-gesture="false" :show-center-play-btn="false"
+ :show-progress="false" :show-fullscreen-btn="isControls" :show-play-btn="isControls"
+ :show-mute-btn="false" class="video-item" @fullscreenchange="onFullscreenChange"
+ @play="onPlay(item.id, index)" @pause="onPause(index)" @ended="onEnded(index)"
+ @click="togglePlay(index)" @timeupdate="onTimeUpdate($event)"
@loadedmetadata="onLoadedMetadata($event)" @waiting="videoWaiting(index)"></video>
<view class="fullscreen-btn">
<image class="fullscreen-icon" :src="isFullScreen ? off_screen : on_screen" mode="aspectFit"
@@ -61,7 +62,8 @@
<!-- 鎮寕鍟嗗搧閾炬帴灞� -->
- <view class="goods-link-warp" :style="{ bottom: marginBottom + 55 + 'px' }" 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">
@@ -74,8 +76,8 @@
<text class="goods-name">{{ goods.goodsName }}</text>
<view class="price-section">
<text class="current-price">楼{{ goods.price }}</text>
- <text class="original-price"
- v-if="goods.originalPrice">楼{{ goods.originalPrice }}</text>
+ <text class="original-price" v-if="goods.originalPrice">楼{{
+ goods.originalPrice }}</text>
</view>
</view>
</view>
@@ -94,8 +96,8 @@
</view>
<view style="width: 100%;word-wrap: break-word;white-space: normal;overflow-wrap: break-word;">
<text class="video-title">{{ item.title }}</text>
- <text class="video-tag" v-for="(tag, index) in item.tagList"
- :key="tag.id">#{{ tag.tagName }}</text>
+ <text class="video-tag" v-for="(tag, index) in item.tagList" :key="tag.id">#{{ tag.tagName
+ }}</text>
</view>
</view>
@@ -171,12 +173,12 @@
<text @click="openReply(comment)" class="reply-btu time">鍥炲</text>
<text v-if="!comment.hasThumbsUp" class="thumbs-up time iconfont"
@click="thubmsUp(comment.id, index, null)"><text
- v-show="comment.thumbsUpNum > 0"
- class="thumbs-num">{{ comment.thumbsUpNum }}</text></text>
+ v-show="comment.thumbsUpNum > 0" class="thumbs-num">{{ comment.thumbsUpNum
+ }}</text></text>
<text v-else class="thumbs-up time iconfont"
@click="cancelThumbsUp(comment.id, index, null)"><text
- v-show="comment.thumbsUpNum > 0"
- class="thumbs-num">{{ comment.thumbsUpNum }}</text></text>
+ v-show="comment.thumbsUpNum > 0" class="thumbs-num">{{ comment.thumbsUpNum
+ }}</text></text>
</view>
</view>
</view>
@@ -200,12 +202,12 @@
<text @click="openReply(comment, reply)" class="reply-btu time">鍥炲</text>
<text v-if="!reply.hasThumbsUp" class="thumbs-up time iconfont"
@click="thubmsUp(reply.id, index, replyIndex)"><text
- v-show="reply.thumbsUpNum > 0"
- class="thumbs-num">{{ reply.thumbsUpNum }}</text></text>
+ v-show="reply.thumbsUpNum > 0" class="thumbs-num">{{ reply.thumbsUpNum
+ }}</text></text>
<text v-else class="thumbs-up time iconfont"
@click="cancelThumbsUp(reply.id, index, replyIndex)"><text
- v-show="reply.thumbsUpNum > 0"
- class="thumbs-num">{{ reply.thumbsUpNum }}</text></text>
+ v-show="reply.thumbsUpNum > 0" class="thumbs-num">{{ reply.thumbsUpNum
+ }}</text></text>
</view>
</view>
</view>
@@ -263,7 +265,7 @@
import ActivityPopup from '@/pages/ActivityPopup/ActivityPopup.vue'
import { mapState, mapMutations } from 'vuex'
-import { setPopupRedisTime, getPopupAcitivty } from '@/api/popup.js'
+import { setPopupRedisTime, getPopupAcitivty,hideActivityPopupToday } from '@/api/popup.js'
import { changeCollect } from "@/api/collect.js";
import { saveShare, saveShareClickRecord} from "@/api/share.js";
import { getSessionId, userAction,userShare } from "@/api/userAction.js";
@@ -356,12 +358,12 @@
loading: false, // 鏄惁姝e湪鍔犺浇
videoQuery: {
pageNumber: 1,
- pageSize: 10,
+ pageSize: 3,
videoFrom: 'recommend'
},
goodsSimilarlyQuery: { // 鐩镐技瑙嗛鏌ヨ
pageNumber: 1,
- pageSize: 10,
+ pageSize: 3,
videoFrom: 'goodsSimilarly',
goodsIds: [],
currentVideoId: ''
@@ -441,7 +443,18 @@
userAction(param)
},
onLoad(option) {
-
+ if(option.shareId){
+ console.log('瑙﹀彂onLoad')
+ this.actionParam.shareId = option.shareId;
+ this.actionParam.joinType = 'SHARE'
+ uni.setStorage({
+ key: 'shareId',
+ data: option.shareId,
+ success: function () {
+ console.log('缂撳瓨shareId鎴愬姛');
+ }
+ });
+ }
console.log('-----------鍒嗕韩鍑虹殑鏁版嵁---------->', option)
//澶勭悊鎵爜鍑烘潵鐨勮棰�
this.marginBottom = uni.getSystemInfoSync().safeAreaInsets.bottom
@@ -513,13 +526,15 @@
// })
// 淇濆瓨鍒嗕韩璁板綍
-
+
// 杩斿洖涓�涓狿romise
return new Promise((resolve) => {
this.shareId = '';
- this.shareParam.shareOption = JSON.stringify({
- id:this.activityId
- })
+ let shareObj ={
+ videoId:videoInfo.id,
+ userId:userInfo.id
+ }
+ this.shareParam.shareOption = JSON.stringify(shareObj)
userShare(this.shareParam).then(res => {
this.shareId = res.data.data;
let param = {
@@ -553,6 +568,11 @@
});
},
methods: {
+ hideActivityPopupToday(){
+ //寮圭獥鍏抽棴
+ hideActivityPopupToday().then(res =>{
+ })
+ },
async openActivityPopup() {
await getPopupAcitivty().then(res => {
if (res.statusCode === 200) {
@@ -581,7 +601,11 @@
},
...mapMutations(['showActivityPopup', 'hideActivityPopup']), // 寮曞叆Vuex鐨勬柟娉�
+
+
onClosePopup() {
+ //
+ this.hideActivityPopupToday()
this.hideActivityPopup()
},
replyClick(reply) {
@@ -1040,7 +1064,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) {
@@ -1070,7 +1095,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) {
--
Gitblit v1.8.0