|
@@ -1,82 +1,92 @@
|
|
|
<template>
|
|
|
<div class="page">
|
|
|
- <div class="page-top"></div>
|
|
|
- <div class="page-content">
|
|
|
- <div class="control">
|
|
|
- <div class="search">
|
|
|
- <el-input
|
|
|
- placeholder="搜索登录账户后四位或所属机构"
|
|
|
- @keyup.enter="getList"
|
|
|
- v-model="listQuery.clubUserName"
|
|
|
- >
|
|
|
- <i slot="prefix" class="el-input__icon el-icon-search"></i>
|
|
|
- </el-input>
|
|
|
+ <van-list
|
|
|
+ v-model="loadingMore"
|
|
|
+ :finished="finished"
|
|
|
+ :immediate-check="false"
|
|
|
+ :finished-text="total ? '没有更多了' : ''"
|
|
|
+ @load="fetchVideoList"
|
|
|
+ >
|
|
|
+ <div class="page-top"></div>
|
|
|
+ <div class="page-content">
|
|
|
+ <!-- 操作区域 -->
|
|
|
+ <div class="control">
|
|
|
+ <div class="search">
|
|
|
+ <el-input
|
|
|
+ placeholder="搜索登录账户后四位或所属机构"
|
|
|
+ @keyup.enter.native="getList"
|
|
|
+ v-model="listQuery.clubUserName"
|
|
|
+ clearable
|
|
|
+ @clear="getList"
|
|
|
+ >
|
|
|
+ <i slot="prefix" class="el-input__icon el-icon-search"></i>
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ <div class="publish" @click="onPublish">发布视频</div>
|
|
|
</div>
|
|
|
- <div class="publish" @click="onPublish">发布视频</div>
|
|
|
- </div>
|
|
|
- <div class="video-content">
|
|
|
- <div class="title">视频排名</div>
|
|
|
- <div class="video-list">
|
|
|
- <div
|
|
|
- class="video"
|
|
|
- v-for="(item, index) in list"
|
|
|
- :key="index"
|
|
|
- @click="onPlay(item)"
|
|
|
- >
|
|
|
- <div class="cover">
|
|
|
- <img :src="item.cover" alt="" />
|
|
|
- <div class="name">{{ item.title }}</div>
|
|
|
- <div class="rank" :class="'rank-0' + (index + 1)">
|
|
|
- {{ index + 1 }}
|
|
|
+ <!-- 视频列表区域 -->
|
|
|
+ <div class="video-content">
|
|
|
+ <div class="title">视频排名</div>
|
|
|
+ <div class="video-list">
|
|
|
+ <div
|
|
|
+ class="video"
|
|
|
+ v-for="(item, index) in list"
|
|
|
+ :key="index"
|
|
|
+ @click="onPlay(item)"
|
|
|
+ >
|
|
|
+ <div class="cover">
|
|
|
+ <img :src="item.cover" alt="" />
|
|
|
+ <div class="name">{{ item.title }}</div>
|
|
|
+ <div class="rank" :class="'rank-0' + (index + 1)">
|
|
|
+ {{ index + 1 }}
|
|
|
+ </div>
|
|
|
+ <div class="play" @click="onPlay(item)"></div>
|
|
|
+ </div>
|
|
|
+ <div class="info">
|
|
|
+ <div class="club-name">{{ item.authParty }}</div>
|
|
|
+ <div class="mobile">{{ item.userName | mobileFormat }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="foot">
|
|
|
+ <div class="date">{{ item.releaseTime | dateFormat }}</div>
|
|
|
+ <div class="praise">{{ item.diggCount }}</div>
|
|
|
+ <div class="pv">{{ item.diggCount }}</div>
|
|
|
</div>
|
|
|
- <div class="play" @click="onPlay(item)"></div>
|
|
|
- </div>
|
|
|
- <div class="info">
|
|
|
- <div class="club-name">{{ item.authParty }}</div>
|
|
|
- <div class="mobile">{{ item.userName | mobileFormat }}</div>
|
|
|
- </div>
|
|
|
- <div class="foot">
|
|
|
- <div class="date">{{ item.releaseTime | dateFormat }}</div>
|
|
|
- <div class="praise">{{ item.diggCount }}</div>
|
|
|
- <div class="pv">{{ item.diggCount }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!-- 列表为空 -->
|
|
|
+ <SimpleEmpty
|
|
|
+ v-if="!total && !isRequest"
|
|
|
+ name="icon-empty-video.png"
|
|
|
+ description="暂无视频~"
|
|
|
+ ></SimpleEmpty>
|
|
|
</div>
|
|
|
- <!-- 列表为空 -->
|
|
|
- <SimpleEmpty
|
|
|
- v-if="!total"
|
|
|
- name="icon-empty-video.png"
|
|
|
- description="敬请期待~"
|
|
|
- ></SimpleEmpty>
|
|
|
-
|
|
|
- <SimpleDialog
|
|
|
- v-model="dialog"
|
|
|
- :confirmText="dialogOption.confirmText"
|
|
|
- :description="dialogOption.description"
|
|
|
- :cancel="dialogOption.cancel"
|
|
|
- @confirm="onConfirm"
|
|
|
- @cancel="onCancel"
|
|
|
- ></SimpleDialog>
|
|
|
-
|
|
|
- <SimpleVideoPlayer
|
|
|
- :videoSrc="videoUrl"
|
|
|
- ref="videoPlayer"
|
|
|
- ></SimpleVideoPlayer>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </van-list>
|
|
|
+
|
|
|
+ <div class="publish" @click="onPublish">发布视频</div>
|
|
|
+
|
|
|
+ <!-- 发布提示对话框 -->
|
|
|
+ <SimpleDialog
|
|
|
+ v-model="dialog"
|
|
|
+ :confirmText="dialogOption.confirmText"
|
|
|
+ :description="dialogOption.description"
|
|
|
+ :cancel="dialogOption.cancel"
|
|
|
+ @confirm="onConfirm"
|
|
|
+ @cancel="onCancel"
|
|
|
+ ></SimpleDialog>
|
|
|
+
|
|
|
+ <!-- 视频播放组件 -->
|
|
|
+ <SimpleVideoPlayer
|
|
|
+ :videoSrc="videoUrl"
|
|
|
+ :description="description"
|
|
|
+ ref="videoPlayer"
|
|
|
+ ></SimpleVideoPlayer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-/**
|
|
|
- * 抱歉,活动已结束,暂无法发布视频!
|
|
|
- * 抱歉,由于您未认证机构,无法参与!
|
|
|
- * 抱歉,平台规定每个用户只能发布一个视频,由于您已发布过视频,请勿再次发布!
|
|
|
- *
|
|
|
- * 确认证
|
|
|
- */
|
|
|
-
|
|
|
import { mapGetters } from 'vuex'
|
|
|
+import { debounce } from '~/utils'
|
|
|
export default {
|
|
|
layout: 'app-ross',
|
|
|
filters: {
|
|
@@ -86,10 +96,13 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ isRequest: true,
|
|
|
+ finished: true, // 列表加载是否完毕(加载完了所有数据)
|
|
|
+ loadingMore: false, // 是否正在加载
|
|
|
listQuery: {
|
|
|
clubUserName: '',
|
|
|
pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
+ pageSize: 20,
|
|
|
status: 1,
|
|
|
},
|
|
|
list: [],
|
|
@@ -100,37 +113,54 @@ export default {
|
|
|
description: '抱歉,活动已结束,暂无法发布视频!',
|
|
|
cancel: false,
|
|
|
},
|
|
|
- publishStatus: {},
|
|
|
publishInfo: {},
|
|
|
videoUrl: '',
|
|
|
+ description: '',
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(['routePrefix', 'accessToken', 'userInfo', 'authUserId']),
|
|
|
},
|
|
|
created() {
|
|
|
- this.checkActivityPublish()
|
|
|
this.getList()
|
|
|
},
|
|
|
+ beforeDestroy() {
|
|
|
+ this.$toast.clear()
|
|
|
+ },
|
|
|
methods: {
|
|
|
// 获取列表
|
|
|
getList() {
|
|
|
+ this.$toast.loading({
|
|
|
+ message: '正在获取视频列表...',
|
|
|
+ duration: 0,
|
|
|
+ })
|
|
|
this.listQuery.pageNum = 1
|
|
|
+ this.isRequest = true
|
|
|
this.list = []
|
|
|
this.fetchVideoList()
|
|
|
},
|
|
|
+
|
|
|
// 获取视频列表
|
|
|
- async fetchVideoList() {
|
|
|
+ fetchVideoList: debounce(async function () {
|
|
|
try {
|
|
|
+ this.loadingMore = true
|
|
|
+ this.isRequest = true
|
|
|
this.listQuery.authUserId = this.authUserId
|
|
|
const res = await this.$http.api.fetchVideoList(this.listQuery)
|
|
|
- this.list = res.data.list
|
|
|
+ this.list = [...this.list, ...res.data.list]
|
|
|
this.total = res.data.total
|
|
|
this.listQuery.pageNum++
|
|
|
+ this.finished = !res.data.hasNextPage
|
|
|
+ this.loadingMore = false
|
|
|
+ this.isRequest = false
|
|
|
} catch (error) {
|
|
|
console.log(error)
|
|
|
+ } finally {
|
|
|
+ this.$toast.clear()
|
|
|
}
|
|
|
- },
|
|
|
+ }, 500),
|
|
|
+
|
|
|
+ // 提示框确定
|
|
|
onConfirm() {
|
|
|
this.dialog = false
|
|
|
if (this.dialogOption.confirmText === '去认证') {
|
|
@@ -138,34 +168,40 @@ export default {
|
|
|
this.$router.push(path)
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ // 提示框取消
|
|
|
onCancel() {
|
|
|
this.dialog = false
|
|
|
},
|
|
|
+
|
|
|
// 去发布视频
|
|
|
- onPublish() {
|
|
|
+ async onPublish() {
|
|
|
if (!this.accessToken) {
|
|
|
this.$toast('请先登录')
|
|
|
this.formType = 'login'
|
|
|
this.$store.commit('app/SHOW_LOGIN')
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
if (!this.userInfo.authId) {
|
|
|
this.dialogOption.description = '抱歉,由于您未认证机构,无法参与!'
|
|
|
this.dialogOption.confirmText = '去认证'
|
|
|
this.dialog = true
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ // 查询活动状态
|
|
|
+ await this.checkActivityPublish()
|
|
|
+
|
|
|
if (this.publishInfo.activityState === 0) {
|
|
|
this.dialogOption.description = '抱歉,活动未开始!'
|
|
|
this.dialog = true
|
|
|
return
|
|
|
- }
|
|
|
- if (this.publishInfo.activityState === 2) {
|
|
|
+ } else if (this.publishInfo.activityState === 2) {
|
|
|
this.dialogOption.description = '抱歉,活动已结束,暂无法发布视频!'
|
|
|
this.dialog = true
|
|
|
return
|
|
|
- }
|
|
|
- if (this.publishInfo.releaseStatus === 1) {
|
|
|
+ } else if (this.publishInfo.releaseStatus === 1) {
|
|
|
this.dialogOption.description =
|
|
|
'抱歉,平台规定每个用户只能发布一个视频,由于您已发布过视频,请勿再次发布!'
|
|
|
this.dialog = true
|
|
@@ -174,12 +210,14 @@ export default {
|
|
|
const url = `${this.routePrefix}/activity/challenge/publish`
|
|
|
this.$router.push(url)
|
|
|
},
|
|
|
+
|
|
|
// 验证发布状态
|
|
|
async checkActivityPublish() {
|
|
|
if (!this.accessToken) return
|
|
|
const { authId, mobile } = this.userInfo
|
|
|
try {
|
|
|
const res = await this.$http.api.checkActivityPublish({
|
|
|
+ authUserId: this.authUserId,
|
|
|
authId,
|
|
|
userName: mobile,
|
|
|
})
|
|
@@ -188,9 +226,11 @@ export default {
|
|
|
console.log(error)
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
// 播放视频
|
|
|
onPlay(row) {
|
|
|
this.videoUrl = row.ossUrl
|
|
|
+ this.description = row.title
|
|
|
this.$refs.videoPlayer.open()
|
|
|
},
|
|
|
},
|
|
@@ -206,27 +246,41 @@ export default {
|
|
|
-webkit-box-orient: vertical;
|
|
|
}
|
|
|
|
|
|
+::v-deep {
|
|
|
+ .el-input.is-active .el-input__inner,
|
|
|
+ .el-input__inner:focus {
|
|
|
+ border-color: #f3920d;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
@media screen and (min-width: 768px) {
|
|
|
.page {
|
|
|
background: #fff;
|
|
|
min-height: calc(100vh - 80px - 80px);
|
|
|
+ padding-bottom: 20px;
|
|
|
+
|
|
|
.page-top {
|
|
|
width: 100%;
|
|
|
height: 530px;
|
|
|
- background-position: center;
|
|
|
- background: #ddd;
|
|
|
+ background: url(~assets/theme-images/ross/pc-banner-activity.png)
|
|
|
+ no-repeat center;
|
|
|
+ background-size: auto 530px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .publish {
|
|
|
+ display: none;
|
|
|
}
|
|
|
|
|
|
.page-content {
|
|
|
width: 1200px;
|
|
|
margin: 0 auto;
|
|
|
- padding-bottom: 80px;
|
|
|
|
|
|
.control {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
padding: 32px 0;
|
|
|
.publish {
|
|
|
+ display: block;
|
|
|
width: 120px;
|
|
|
height: 46px;
|
|
|
text-align: center;
|
|
@@ -479,17 +533,35 @@ export default {
|
|
|
@media screen and (max-width: 768px) {
|
|
|
.page {
|
|
|
background: #fff;
|
|
|
+ position: relative;
|
|
|
+ position: relative;
|
|
|
+ // padding-bottom: 20vw;
|
|
|
.page-top {
|
|
|
width: 100%;
|
|
|
height: 100vw;
|
|
|
- background-position: center;
|
|
|
- background: #ddd;
|
|
|
+ background: url(~assets/theme-images/ross/h5-banner-activity.png)
|
|
|
+ no-repeat center;
|
|
|
+ background-size: auto 100vw;
|
|
|
+ }
|
|
|
+
|
|
|
+ .publish {
|
|
|
+ // position: fixed;
|
|
|
+ // bottom: 14vw;
|
|
|
+ // left: 7.4vw;
|
|
|
+ width: 85.6vw;
|
|
|
+ margin: 4vw auto;
|
|
|
+ height: 12vw;
|
|
|
+ background: #f3920d;
|
|
|
+ color: #fff;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 3.6vw;
|
|
|
+ line-height: 12vw;
|
|
|
}
|
|
|
|
|
|
.page-content {
|
|
|
+ position: relative;
|
|
|
width: 93.6vw;
|
|
|
margin: 0 auto;
|
|
|
- padding-bottom: 6.5vw;
|
|
|
|
|
|
.control {
|
|
|
display: flex;
|
|
@@ -498,7 +570,6 @@ export default {
|
|
|
.publish {
|
|
|
display: none;
|
|
|
}
|
|
|
-
|
|
|
.search {
|
|
|
flex: 1;
|
|
|
flex-shrink: 0;
|
|
@@ -558,7 +629,7 @@ export default {
|
|
|
img {
|
|
|
display: block;
|
|
|
width: 100%;
|
|
|
- height: 100%;
|
|
|
+ height: 31.3vw;
|
|
|
}
|
|
|
|
|
|
&::after {
|
|
@@ -597,6 +668,7 @@ export default {
|
|
|
text-align: center;
|
|
|
width: 100%;
|
|
|
line-height: 6.4vw;
|
|
|
+ height: 6.4vw;
|
|
|
@include ellipsis(1);
|
|
|
box-sizing: border-box;
|
|
|
padding: 0 1.2vw;
|