123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- <template>
- <view class="container">
- <div class="top">
- <div class="header">
- <img class="logo" src="/static/logo_big.png" alt="">
- <u--image
- class="border"
- :showLoading="true"
- :src="info.avatar || '/static/image/match/teams_avatar_ico@2x.png'"
- @click="go('/pages/Match/member/usermanger', true)"
- width="24px"
- height="24px"
- shape="circle"
- ></u--image>
- </div>
- <div class="title-box">
- <div class="flex" @click="stepBack">
- <u-icon name="arrow-left" color="#ffffff" size="16px" bold></u-icon>
- {{ type }}
- </div>
- </div>
- </div>
- <view class="" style="padding: 12px 0;">
- <view class="left">
- <view class="waterfall-item" @click="onTap(params.id)" v-for="(params) in list" :key="params.id">
- <view class="waterfall-item-img">
- <u--image
- :showLoading="true"
- :src="params.flie[0].img"
- width="100%"
- height="348rpx"
- >
- <template v-slot:loading>
- <image class="loading-banner-img" src="/static/image/common/video-list-bg.png" mode="aspectFill"></image>
- </template>
- </u--image>
- <div class="bg"></div>
- <div class="content">
- <div class="text-clamp2">{{ params.title }}</div>
- </div>
- <img class="play" src="/static/image/live/play-icon.png" alt="">
- </view>
- </view>
- </view>
- </view>
- <u-loadmore
- :status="status"
- fontSize="28"
- :line="true"
- :loading-text="statusType.loadingText"
- :loadmore-text="statusType.loadmoreText"
- :nomore-text="statusType.nomoreText"
- />
- <u-empty v-if="obj.total == 0" mode="data" width="474" height="312" textSize="28" marginTop="100"
- :text="$t('common.nodata')" icon="/static/image/common/nodata.png">
- </u-empty>
- <div class="news-install">
- <install></install>
- </div>
- </view>
- </template>
- <script>
- import { numberToK } from '@/utils/util'
- import install from '@/components/install/install.vue'
- export default {
- components: {
- install
- },
- data() {
- return {
- // 初始化左右盒子
- list: [],
- type: '',
- obj: {
- total: 1
- },
- page: 1,
- status: 'loadmore',
- statusType:{
- loadingText: this.$t('common.lab'),
- loadmoreText: this.$t('common.lab1'),
- nomoreText: this.$t('common.lab2')
- },
- }
- },
- computed: {
- info() {
- return this.$store.state.info;
- },
- isLogin() {
- return this.$store.state.isLogin;
- },
- },
- onLoad(option) {
- this.type = option.type;
- },
- onReady() {
- this.getList();
- },
- // 触底触发
- onReachBottom() {
- if (this.status == 'loadmore') {
- this.page++;
- this.getList();
- }
- },
- // 下拉刷新
- onPullDownRefresh() {
- // 正常情况下接口返回应该很会很快。故意延迟调用,让用户有在刷新的体验感
- this.page = 1;
- this.list = [];
- this.getList();
- },
- methods: {
- onTap(id) {
- this.$toUrl('./live?id=' + id+'&tournament=' + this.type)
- },
- toUrl() {
- this.$toUrl('./publish')
- },
- // 获取数据
- getList() {
- // 设置状态为加载中
- this.status = 'loading';
- uni.$u.http.get('/api/Video/getTournamentVideoList', {
- params: {
- page: this.page,
- name: this.type
- }
- }).then(res => {
- // 获取到的数据,请注意数据结构
- // 第一页数据执行以下代码
- if (this.page == 1) {
- // 关闭下拉
- this.list=res.data || []
- uni.stopPullDownRefresh();
- // 设置组件状态为 重置,可供下拉刷新这类需要重置列表功能时使用
- } else {
- this.list = this.list.concat(res.data || [])
- }
- this.obj = res
- this.status = this.list.length == res.total ? 'nomore' : 'loadmore'
- }).catch(res => {})
- },
- numberToK(v) {
- return numberToK(v)
- },
- stepBack() {
- uni.switchTab({
- url: '/pages/Videos/index'
- })
- },
- go(url, login) {
- if (this.isLogin == 2 && login) {
- this.$toUrl('/pages/login/login')
- return
- }
- this.$toUrl(url)
- },
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #f3f3f3;
- }
- .container {
- padding-bottom: 140rpx;
- }
- .top {
- position: sticky;
- top: 0;
- z-index: 999;
- .header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 8rpx 16px 16rpx;
- background-color: #10044A;
- }
- .logo {
- height: 24px;
- }
- .border {
- border: 1px solid #CC2900;
- border-radius: 50%;
- }
- .title-box {
- height: 40px;
- background-color: #262E4A;
- padding: 0 16px;
- display: flex;
- align-items: center;
- color: #fff;
- font-weight: 500;
- font-size: 16px;
- .u-icon {
- margin-right: 10px;
- }
- }
- }
- .waterfall-item {
- background-color: #fff;
- overflow: hidden;
- font-size: 28rpx;
- color: #fff;
- font-weight: 500;
- margin-bottom: 20rpx;
- .waterfall-title {
- padding: 20rpx 10rpx;
- font-weight: 700;
- }
- .waterfall-item-img {
- position: relative;
- height: 348rpx;
- .loading-banner-img {
- width: 100%;
- height: 348rpx;
- }
- .bg {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: linear-gradient(180deg, rgba(16, 4, 74, 0) 0%, #080031 100%);
- }
- .content {
- position: absolute;
- left: 0;
- right: 0;
- bottom: 0;
- padding: 11px 72px 11px 16px;
- }
- .play {
- position: absolute;
- right: 16px;
- bottom: 19px;
- width: 28px;
- }
- }
- }
- .load-txt {
- padding: 0 0 20rpx 0;
- text-align: center;
- color: #999;
- font-size: 24rpx;
- }
- .publishicon {
- position: fixed;
- right: 32rpx;
- bottom: 220rpx;
- width: 94rpx;
- height: 94rpx;
- z-index: 99;
- }
- .news-install {
- position: fixed;
- left: 0;
- right: 0;
- bottom: var(--window-bottom);
- z-index: 200;
- }
- </style>
|