123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343 |
- <template>
- <section class="video-alias section">
- <div class="video-alias__wrapper section-wrapper" v-if="videoItem">
- <div class="admin-button-in-news" v-if="userPermissionGroup == 3 || userPermissionGroup == 5">
- <a class="copy" :href="'/admin/publications/' + videoItem.id" target="_blank">Редактирование новости</a>
- <a class="inject" @click="inject(videoItem)">Инжект</a>
- </div>
- <div class="video-alias-header" v-if="videoItem.video">
- <div class="header-video">
- <iframe frameborder="0" :src="videoLink"></iframe>
- </div>
- <div class="header-bg">
- <img :src="require('~/assets/img/slider-video/bg.png')" />
- </div>
- </div>
- <div class="video-alias-body">
- <div class="video-alias-main">
- <div class="main-title">
- <h1 v-html="videoItem.title"></h1>
- </div>
- <div class="main-description" v-html="videoItem.description"></div>
- <aside class="detail-top__header-side">
- <div class="detail-top__actions">
- <div class="detail-top__share">
- <div class="socials-share">
- <ul class="socials-share__list">
- <li class="socials-share__item">
- <ShareNetwork
- network="Odnoklassniki"
- :url="'https://www.amic.ru' + $route.fullPath"
- :title="videoItem.title"
- class="socials-share__link"
- :hashtags="
- videoItem.hash_tags.length
- ? videoItem.hash_tags.join(' ')
- : ''
- "
- >
- <BaseIcon :name="'ok'" clear
- /></ShareNetwork>
- </li>
- <li class="socials-share__item">
- <ShareNetwork
- network="twitter"
- :url="'https://www.amic.ru' + $route.fullPath"
- :title="videoItem.title"
- class="socials-share__link"
- :hashtags="
- videoItem.hash_tags.length
- ? videoItem.hash_tags.join(' ')
- : ''
- "
- >
- <BaseIcon :name="'tw'" clear
- /></ShareNetwork>
- </li>
- <li class="socials-share__item">
- <ShareNetwork
- network="vk"
- :url="'https://www.amic.ru' + $route.fullPath"
- :title="videoItem.title"
- :description="videoItem.description"
- class="socials-share__link"
- :hashtags="
- videoItem.hash_tags.length
- ? videoItem.hash_tags.join(' ')
- : ''
- "
- >
- <BaseIcon :name="'vk'" clear
- /></ShareNetwork>
- </li>
- </ul>
- </div>
- </div>
- </div>
- <a
- class="
- detail-top__action detail-top__comments-button
- button button_grey-dark
- "
- href="#comment_form"
- >
- <span class="button__text">Комментировать</span>
- </a>
- </aside>
- <div class="main-content">
- <VideoContent :html="videoItem.content"></VideoContent>
- <div class="detail-main__properties mt-5">
- <span
- v-for="property in properties"
- :key="property.id"
- :class="property.code"
- :ref="property.code"
- >
- {{ property.title }}
- </span>
- </div>
- </div>
- <div class="main-banner">
- <BannersW960H90 />
- </div>
- <div v-if="videoItem.show_pull" class="main-comments">
- <ArticleCommentsList
- :pull_id="videoItem.comment_pull_id"
- @commentResponse="commentResponseData"
- :newCommentsList="commentsList"
- />
- <ArticleCommentsForm
- :pull_id="videoItem.comment_pull_id"
- :response_user_name="comment.response_user_name"
- :response_user_id="comment.response_user_id"
- @clearCommentResponse="clearCommentResponse"
- @commentsResponseData="commentsResponseData"
- />
- </div>
- </div>
- <div class="video-alias-aside">
- <div class="aside-list" v-if="filteredVideos.length">
- <VideoItem
- class="aside-item"
- v-for="item in filteredVideos"
- :key="item.id"
- :item="item"
- ></VideoItem>
- </div>
- <div class="aside-banner">
- <BannersW240H400 />
- </div>
- </div>
- </div>
- </div>
- </section>
- </template>
- <script>
- export default {
- props: {
- videoItem: {
- type: Object,
- required: true
- },
- filteredVideos: {
- type: Array,
- default: () => []
- }
- },
- data() {
- return {
- userPermissionGroup: null,
- comment: {
- response_user_id: "",
- response_user_name: ""
- },
- commentsList: {}
- };
- },
- mounted() {
- if(this.$store.state.auth.user){
- this.userPermissionGroup = this.$store.state.auth.user.user_permission_group;
- }
- },
- methods: {
- commentResponseData(data) {
- this.comment.response_user_id = data.user_id;
- this.comment.response_user_name = data.user_name;
- },
- clearCommentResponse() {
- this.comment.response_user_id = "";
- this.comment.response_user_name = "";
- },
- inject(item) {
- let res = "##news_" + item.id + "##";
- this.$clipboard(res);
- alert('Инжект скопирован в буфер обмена');
- },
- commentsResponseData(data){
- this.commentsList = data;
- },
- },
- computed: {
- properties () {
- return Object.values(this.videoItem.properties).filter(property =>
- Number(property.value)
- )
- },
- videoLink() {
- if (this.videoItem.video.match("(www.)?youtube|youtu.be")) {
- const youtubeId = this.videoItem.video
- .split(/v\/|v=|youtu\.be\//)[1]
- .split(/[?&]/)[0];
- return `https://www.youtube.com/embed/${youtubeId}`;
- }
- return this.videoItem.video;
- }
- }
- };
- </script>
- <style lang="less" scoped>
- .section {
- padding-top: 20px;
- }
- .video-alias {
- padding-bottom: 50px;
- &-header {
- position: relative;
- box-shadow: 0px 26px 38px -11px rgba(255, 0, 214, 0.25);
- }
- &-body {
- margin-top: 80px;
- display: flex;
- justify-content: space-between;
- background: #8d9697;
- padding: 0 0 0 15px;
- }
- &-main {
- color: white;
- flex: 0 1 815px;
- }
- &-aside {
- margin-left: 10px;
- flex: 0 1 420px;
- max-width: 420px;
- }
- @media screen and(max-width: 1000px) {
- &-body {
- flex-direction: column;
- margin-top: 30px;
- }
- &-main {
- flex: auto;
- }
- &-aside {
- flex: auto;
- max-width: 100%;
- margin: 40px auto 0;
- }
- }
- }
- .header {
- &-video {
- position: relative;
- z-index: 1;
- width: 100%;
- aspect-ratio: 16 / 9;
- iframe {
- width: 100%;
- height: 100%;
- }
- }
- &-bg {
- z-index: 0;
- position: absolute;
- bottom: 0;
- transform: translateY(50%);
- img {
- width: 100%;
- height: auto;
- }
- }
- }
- .main {
- &-title {
- h1 {
- font-size: 48px;
- line-height: 120%;
- }
- }
- &-description {
- margin-top: 20px;
- font-size: 24px;
- }
- @media screen and(max-width: 768px) {
- &-title {
- h1 {
- font-size: 22px;
- }
- }
- &-description {
- font-size: 18px;
- }
- }
- }
- .aside {
- &-list {
- display: flex;
- flex-direction: column;
- }
- &-item {
- margin-bottom: 28px;
- }
- }
- .socials-share__link .icon {
- html.dark-mode & {
- color: #fff;
- fill: #fff;
- }
- }
- .socials-share__link {
- html.dark-mode & {
- background-color: rgba(90, 116, 139, 0.5);
- }
- }
- .detail-top__header-side {
- html.dark-mode & {
- margin-top: 30px;
- }
- }
- .admin-button-in-news{
- margin-bottom: 30px;
- a{
- background-color: #000;
- color: #fff;
- font-size: 14px;
- padding: 8px 19px;
- cursor: pointer;
- }
- .inject{
- background-color: #1976d2;
- }
- .copy{
- background-color: #4caf50;
- }
- }
- </style>
|