123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- <template>
- <div class="video-container">
- <div class="video-list">
- <div class="video" v-for="(item, index) in list" :key="index" @click="onPlay(item)">
- <div class="cover">
- <video :src="item.ossUrl"></video>
- <div class="name">
- <span>{{ item.title }}</span>
- </div>
- <div class="play"></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" :class="{ active: item.diggStatus === 1 }" @click.stop="$emit('praise', item)">
- {{ item.diggCount }}
- </div>
- </div>
- </div>
- </div>
- <!-- 视频播放组件 -->
- <SimpleVideoPlayer :videoSrc="videoUrl" :description="description" ref="videoPlayer"></SimpleVideoPlayer>
- </div>
- </template>
- <script>
- export default {
- filters: {
- mobileFormat(mobile) {
- return mobile ? mobile.replace(/^(\w{3})\w+(\w{4})$/, '$1****$2') : ''
- },
- },
- props: {
- list: {
- type: Array,
- default: () => [],
- },
- },
- data() {
- return {
- videoUrl: '',
- description: '',
- }
- },
- methods: {
- // 播放视频
- onPlay(row) {
- this.videoUrl = row.ossUrl
- this.description = row.title
- this.$refs.videoPlayer.open()
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- @media screen and (min-width: 768px) {
- .video-list {
- display: grid;
- grid-template-columns: repeat(6, 1fr);
- grid-column-gap: 16px;
- grid-row-gap: 16px;
- .video {
- height: 358px;
- background: #fff;
- box-sizing: border-box;
- border: 1px solid #efefef;
- &:hover {
- .info {
- .club-name {
- color: #f3920d;
- }
- }
- }
- &:nth-child(4n) {
- margin-right: 0;
- }
- .cover {
- height: 248px;
- position: relative;
- video {
- display: block;
- width: 100%;
- height: 100%;
- background: #fff;
- }
- .play {
- position: absolute;
- z-index: 2;
- width: 32px;
- height: 32px;
- background: url(~assets/theme-images/common/pc-icon-play.png) no-repeat center;
- background-size: 32px;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- cursor: pointer;
- }
- .name {
- display: flex;
- align-items: flex-end;
- width: 100%;
- height: 75px;
- padding: 17px 16px;
- box-sizing: border-box;
- position: absolute;
- left: 0;
- bottom: 0;
- background: linear-gradient(180deg, rgba(51, 51, 51, 0) 0%, #333333 100%);
- span {
- color: #fff;
- font-size: 14px;
- line-height: 20px;
- max-height: 40px;
- @include ellipsis(2);
- }
- }
- }
- .info {
- padding: 10px;
- .club-name {
- font-size: 14px;
- color: #282828;
- @include ellipsis(1);
- cursor: pointer;
- height: 18px;
- }
- .mobile {
- font-size: 14px;
- color: #666;
- margin-top: 8px;
- }
- }
- .foot {
- color: #999999;
- font-size: 14px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- border-top: 1px solid #efefef;
- margin: 0 10px;
- padding-top: 8px;
- .praise {
- flex-shrink: 0;
- line-height: 16px;
- cursor: pointer;
- }
- .praise {
- position: relative;
- padding-left: 22px;
- &::after {
- content: '';
- display: block;
- width: 16px;
- height: 16px;
- background-size: 16px;
- position: absolute;
- left: 0;
- top: 50%;
- transform: translateY(-50%);
- background-repeat: no-repeat;
- background-position: center;
- background-image: url(~assets/theme-images/common/icon-praise.png);
- }
- &.active {
- color: #f3920d;
- &::after {
- background-image: url(~assets/theme-images/common/icon-praise-active.png);
- }
- }
- }
- }
- }
- }
- }
- @media screen and (max-width: 768px) {
- .video-list {
- display: grid;
- grid-template-columns: repeat(2, 1fr);
- grid-column-gap: 2.4vw;
- grid-row-gap: 2.4vw;
- .video {
- height: 89.2vw;
- background: #fff;
- box-sizing: border-box;
- border: 0.1vw solid #efefef;
- &:hover {
- .info {
- .club-name {
- color: #f3920d;
- }
- }
- }
- &:nth-child(4n) {
- margin-right: 0;
- }
- .cover {
- height: 64.4vw;
- position: relative;
- video {
- display: block;
- width: 100%;
- height: 100%;
- background: #fff;
- }
- .play {
- position: absolute;
- z-index: 2;
- width: 7.2vw;
- height: 7.2vw;
- background: url(~assets/theme-images/common/h5-icon-play.png) no-repeat center;
- background-size: 7.2vw;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- cursor: pointer;
- }
- .name {
- display: flex;
- align-items: flex-end;
- width: 100%;
- height: 16vw;
- padding: 4.4vw 3vw;
- box-sizing: border-box;
- position: absolute;
- left: 0;
- bottom: 0;
- background: linear-gradient(180deg, rgba(51, 51, 51, 0) 0%, #333333 100%);
- span {
- color: #fff;
- font-size: 3vw;
- line-height: 3.6vw;
- max-height: 7.2vw;
- @include ellipsis(2);
- }
- }
- }
- .info {
- padding: 2.4vw;
- .club-name {
- font-size: 3.4vw;
- color: #282828;
- @include ellipsis(1);
- cursor: pointer;
- height: 3.6vw;
- }
- .mobile {
- font-size: 3vw;
- color: #666;
- margin-top: 1.6vw;
- }
- }
- .foot {
- color: #999999;
- font-size: 14px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- border-top: 1px solid #efefef;
- margin: 0 2.4vw;
- padding-top: 2.4vw;
- line-height: 3.6vw;
- .praise {
- flex-shrink: 0;
- cursor: pointer;
- }
- .praise {
- position: relative;
- padding-left: 4.4vw;
- &::after {
- content: '';
- display: block;
- width: 3.6vw;
- height: 3.6vw;
- background-size: 3.6vw;
- position: absolute;
- left: 0;
- top: 50%;
- transform: translateY(-50%);
- background-image: url(~assets/theme-images/common/icon-praise.png);
- background-position: center;
- background-repeat: no-repeat;
- }
- &.active {
- color: #f3920d;
- &::after {
- background-image: url(~assets/theme-images/common/icon-praise-active.png);
- }
- }
- }
- }
- }
- }
- }
- </style>
|