隐藏视频优化

master
Lee 2022-10-11 17:49:39 +08:00
parent b31e488cfe
commit 3ab4416f34
3 changed files with 48 additions and 7 deletions

View File

@ -94,7 +94,7 @@
{
iconPath: "/static/tabbar/icon-mo-sp.png",
selectedIconPath: "/static/tabbar/icon-active-sp.png",
title:'视频'
title:''
},
{
iconPath: "/static/tabbar/icon-mo-wd.png",
@ -105,9 +105,20 @@
};
},
mounted() {
//
this.$requst.get('/api/index/base-config').then(res=>{
if(res.code==0){
this.show_video = res.data.show_video;
if(parseInt(this.show_video)!==0){
this.footList[3].title = '视频'
}else{
this.footList[3].title = '待定'
}
}
})
},
methods:{
//
choosefoot(index){
//
switch (index){

View File

@ -33,11 +33,11 @@
<list ref="refcourse" @goDetail="goCourseDetail"></list>
<!-- 两列列表 end -->
<!-- 推荐视频 start -->
<view class="disjb ae mar-s40 mar-x20">
<view class="disjb ae mar-s40 mar-x20" v-if="parseInt(show_video)!==0">
<view class="fon32 bold colb">推荐视频</view>
<view class="fon20" style="color: #bbb4b3;" @tap="goMore(0)">+</view>
</view>
<view class="radius8 bacf pad10 boxshow1 mar-x30" v-for="(item,index) in videoList" :key="index">
<view class="radius8 bacf pad10 boxshow1 mar-x30" v-for="(item,index) in videoList" :key="index" v-if="parseInt(show_video)!==0">
<view class="posir disjcac">
<image :src="item.cover" style="height: 388rpx;" mode="aspectFill" class="width100" lazy-load></image>
<image v-if="item.src.includes('.mp4')" @tap="palyVideo(index)" class="posia" src="/static/tabbar/icon-play.png" mode="" style="width: 70rpx;height: 70rpx;" lazy-load></image>
@ -88,11 +88,14 @@
videoList:[],//
ifLoading:false,
ifCount:0,
show_video:'', //
}
},
onShow() {
// banner
this.$store.commit('setAutoplay',true);
//
this.isVideoEv();
},
onHide() {
// banner
@ -118,6 +121,14 @@
this.getBanner();
},
methods: {
//
isVideoEv(){
this.$requst.get('/api/index/base-config').then(res=>{
if(res.code==0){
this.show_video = res.data.show_video;
}
})
},
// banner
getBanner(){
this.$requst.get('/api/common/slides',{position:'home-banner'}).then(res=>{

View File

@ -1,7 +1,7 @@
<template>
<view>
<status-container :ifReturn="false" titlet="视频列表">
<view slot="content" style="margin-top: -20rpx;" v-if="loading">
<status-container :ifReturn="false" :titlet="pageTitle">
<view slot="content" style="margin-top: -20rpx;" v-if="loading && parseInt(show_video)!==0">
<view class="posi-sticky" :style="{top:newtop+'px'}">
<view class="pad-sx26 pad-zy20" style="box-shadow: 0 3rpx 20rpx rgba(0, 0, 0, 0.1);">
<view class="radius40 pad-sx2 disjbac pad-zy20" style="background-color: #fff6f5;border: 2rpx solid #ece6e6;">
@ -50,13 +50,15 @@
data() {
return {
newtop:uni.getSystemInfoSync().statusBarHeight + 42,
pageTitle:'',
dataList:[],
page:1,
size:20,
total:0,
keyword:'',
noMore:false,
loading:false
loading:false,
show_video:'', //
}
},
onReachBottom() {
@ -68,7 +70,24 @@
onLoad() {
this.getVideoList();
},
onShow() {
//
this.isVideoEv();
},
methods: {
//
isVideoEv(){
this.$requst.get('/api/index/base-config').then(res=>{
if(res.code==0){
this.show_video = res.data.show_video;
if(parseInt(this.show_video)!==0){
this.pageTitle = '视频列表'
}else{
this.pageTitle = '待定'
}
}
})
},
//
getVideoList(){
this.loading = false;