Files
video_mini/pagesA/index/charts.vue
T
2026-07-24 11:56:12 +08:00

144 lines
4.6 KiB
Vue

<template>
<view>
<image src="/static/image/icon11.png" class="w-100 u-h-166"></image>
<view class="u-relative u-b-f u-radius-30 u-p-30" style="margin-top: -30rpx;">
<u-tabs :list="videoMenuList" IconShow keyName="name" lineWidth="0" :curennt="curennt"
:activeStyle="{padding:'0rpx 20rpx',fontSize:'30rpx'}"
:inactiveStyle="{padding:'0rpx 20rpx',color:'#86909C',fontSize:'24rpx'}" @click="TabsClick"></u-tabs>
<view class="u-m-t-40 u-flex u-col-top" v-for="(item,index) in recommendList" :key="index"
@click.stop="govideo(item.id)">
<view class="u-relative u-m-r-16">
<u-image :src="apiUrl+item.img" width="130rpx" height="170rpx" radius="5"></u-image>
<image v-show="index==0 " src="/static/image/icon8.png" class="u-w-40 u-h-40 u-absolute u-index-1"
style="top: 0px;left:-2px;"></image>
<image v-show="index==1 " src="/static/image/icon9.png" class="u-w-40 u-h-40 u-absolute u-index-1"
style="top: 0px;left:-2px;"></image>
<image v-show="index==2 " src="/static/image/icon10.png" class="u-w-40 u-h-40 u-absolute u-index-1"
style="top: 0px;left:-2px;"></image>
<view v-show="index>2"
class="u-w-40 u-h-40 u-b-F9E1E9 u-text-center u-lh-40 u-font-20 u-absolute u-index-1"
style="border-radius:0 0 20rpx 0 ;top: 0px;left:0px;">{{index+1}}</view>
</view>
<view class="u-flex-1 u-flex-col u-h-170 u-row-between">
<view class="u-flex u-row-between">
<view class="u-word-break u-line-1 u-font-26">{{item.name}}</view>
<view class="u-flex">
<image src="/static/image/icon12.png" class="u-w-30 u-h-30"></image>
<view class="u-m-l-10 u-font-22 u-color-666">{{item.views}}</view>
</view>
</view>
<view class="u-word-break u-font-20 u-color-999 u-line-2">
{{item.story}}
</view>
<view class="u-color-999 u-font-24">
<!-- {{item.album_status == 1?'未上映':item.album_status == 2?'更新中':'已完结'}} -->
共{{item.sum}}集
</view>
</view>
</view>
<empty v-if="recommendList.length<1"></empty>
<u-loadmore v-if="recommendList.length>0" :status="status" icon-color="#999999" color="#999999"
icon-type="circle" margin-top="30" margin-bottom="30" />
</view>
</view>
</template>
<script>
export default {
data() {
return {
videoMenuList: [], //剧栏目
curennt: 0, //当前栏目索引
recommendList: [], //剧栏目列表数据
apiUrl: getApp().globalData.oss_url, //域名
status: 'loadmore', //加载更多
parameter: {
limit: 15, //每页的总条数
page: 1, //页码
menu_id: '', //剧栏目id
},
}
},
onLoad(opt) {
this.curennt = opt.curennt
this.videoMenu()
},
// 下拉到底事件
onReachBottom() {
//避免多次触发
if (this.status == 'loading' || this.status == 'nomore') {
return;
}
this.videoGroupList()
},
methods: {
// 剧栏目
videoMenu() {
this.$httpRequest({
url: '/api/pno/videoMenu',
method: 'GET',
isLoading: true,
}).then(res => {
if (res.code == 1) {
res.data[0].after_image = require('@/static/image/icon2.png')
res.data[0].before_image = require('@/static/image/icon1.png')
res.data[1].after_image = require('@/static/image/icon4.png')
res.data[1].before_image = require('@/static/image/icon3.png')
res.data[2].after_image = require('@/static/image/icon6.png')
res.data[2].before_image = require('@/static/image/icon5.png')
this.videoMenuList = res.data
this.clear()
}
})
},
// 剧栏目tab切换事件
TabsClick(e) {
this.curennt = e.index
this.clear()
},
clear() {
this.parameter.menu_id = this.videoMenuList[this.curennt].id
this.recommendList = []
this.parameter.page = 1
this.videoGroupList()
},
// 剧栏目列表数据
videoGroupList() {
this.$httpRequest({
url: '/api/pno/videoGroupList',
method: 'GET',
data: {
...this.parameter
},
isLoading: true,
}).then(res => {
if (res.code == 1) {
if (res.data.data.length < this.parameter.limit) {
this.status = 'nomore';
} else {
this.parameter.page = this.parameter.page + 1;
this.status = 'loadmore';
}
this.recommendList = this.recommendList.concat(res.data.data);
uni.stopPullDownRefresh();
}
})
}, // 进入短剧播放页面
govideo(vlid) {
if (tt.canIUse('video-player')) {
uni.navigateTo({
url: '/pagesA/index/VideoPlayer?vl_id=' + vlid
})
} else {
this.$getMsg('当前版本过低,请升级抖音后观看')
}
}
}
}
</script>
<style>
page {
background: #fff;
}
</style>