Article.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <template>
  2. <section class="video-alias section">
  3. <div class="video-alias__wrapper section-wrapper" v-if="podcastItem">
  4. <div class="video-alias-body">
  5. <div class="video-alias-main">
  6. <div class="admin-button-in-news" v-if="userPermissionGroup == 3 || userPermissionGroup == 5">
  7. <a class="copy" :href="'/admin/publications/' + podcastItem.id" target="_blank">Редактирование новости</a>
  8. <a class="inject" @click="inject(podcastItem)">Инжект</a>
  9. </div>
  10. <div class="main-title">
  11. <h1 v-html="podcastItem.title"></h1>
  12. </div>
  13. <div class="main-description" v-html="podcastItem.description"></div>
  14. <div class="podcast-detail-top">
  15. <div class="detail-top__date">
  16. {{ convertDate(podcastItem.start_activity)
  17. }}{{
  18. podcastItem.show_author && podcastItem.author
  19. ? ", " + podcastItem.author.name
  20. : ""
  21. }}
  22. </div>
  23. <aside class="detail-top__header-side">
  24. <div class="detail-top__actions">
  25. <div class="detail-top__share">
  26. <div class="socials-share">
  27. <ul class="socials-share__list">
  28. <li class="socials-share__item">
  29. <ShareNetwork
  30. network="Odnoklassniki"
  31. :url="'https://www.amic.ru' + $route.fullPath"
  32. :title="podcastItem.title"
  33. class="socials-share__link"
  34. :hashtags="
  35. podcastItem.hash_tags.length
  36. ? podcastItem.hash_tags.join(' ')
  37. : ''
  38. "
  39. >
  40. <BaseIcon :name="'ok'" clear
  41. /></ShareNetwork>
  42. </li>
  43. <li class="socials-share__item">
  44. <ShareNetwork
  45. network="twitter"
  46. :url="'https://www.amic.ru' + $route.fullPath"
  47. :title="podcastItem.title"
  48. class="socials-share__link"
  49. :hashtags="
  50. podcastItem.hash_tags.length
  51. ? podcastItem.hash_tags.join(' ')
  52. : ''
  53. "
  54. >
  55. <BaseIcon :name="'tw'" clear
  56. /></ShareNetwork>
  57. </li>
  58. <li class="socials-share__item">
  59. <ShareNetwork
  60. network="vk"
  61. :url="'https://www.amic.ru' + $route.fullPath"
  62. :title="podcastItem.title"
  63. :description="podcastItem.description"
  64. class="socials-share__link"
  65. :hashtags="
  66. podcastItem.hash_tags.length
  67. ? podcastItem.hash_tags.join(' ')
  68. : ''
  69. "
  70. >
  71. <BaseIcon :name="'vk'" clear
  72. /></ShareNetwork>
  73. </li>
  74. </ul>
  75. </div>
  76. </div>
  77. </div>
  78. <a
  79. class="
  80. detail-top__action detail-top__comments-button
  81. button button_grey-dark
  82. "
  83. href="#comment_form"
  84. >
  85. <span class="button__text">Комментировать</span>
  86. </a>
  87. </aside>
  88. </div>
  89. <div class="main-content">
  90. <NewsContent :rawHtml="podcastItem.content" ref="newsContent" />
  91. </div>
  92. <div class="main-banner">
  93. <BannersW960H90 />
  94. </div>
  95. <div class="main-comments">
  96. <ArticleCommentsList
  97. :pull_id="podcastItem.comment_pull_id"
  98. @commentResponse="commentResponseData"
  99. :newCommentsList="commentsList"
  100. />
  101. <ArticleCommentsForm
  102. :pull_id="podcastItem.comment_pull_id"
  103. :response_user_name="comment.response_user_name"
  104. :response_user_id="comment.response_user_id"
  105. @clearCommentResponse="clearCommentResponse"
  106. @commentsResponseData="commentsResponseData"
  107. />
  108. </div>
  109. </div>
  110. <div class="video-alias-aside">
  111. <div class="aside-list" v-if="filteredPodcasts.length > 0">
  112. <PodcastItem
  113. class="aside-item"
  114. v-for="podcast in filteredPodcasts"
  115. :key="podcast.id"
  116. :item="podcast"
  117. ></PodcastItem>
  118. </div>
  119. <div class="aside-banner">
  120. <BannersW240H400 />
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </section>
  126. </template>
  127. <script>
  128. export default {
  129. props: {
  130. podcastItem: {
  131. type: Object,
  132. required: true
  133. },
  134. filteredPodcasts: {
  135. type: Array,
  136. default: () => []
  137. }
  138. },
  139. data() {
  140. return {
  141. userPermissionGroup: null,
  142. comment: {
  143. response_user_id: "",
  144. response_user_name: ""
  145. },
  146. commentsList: {}
  147. };
  148. },
  149. mounted() {
  150. if(this.$store.state.auth.user){
  151. this.userPermissionGroup = this.$store.state.auth.user.user_permission_group;
  152. }
  153. },
  154. methods: {
  155. commentResponseData(data) {
  156. this.comment.response_user_id = data.user_id;
  157. this.comment.response_user_name = data.user_name;
  158. },
  159. commentsResponseData(data){
  160. this.commentsList = data;
  161. },
  162. clearCommentResponse() {
  163. this.comment.response_user_id = "";
  164. this.comment.response_user_name = "";
  165. },
  166. convertDate(dateTampstamp) {
  167. const date = new Date(dateTampstamp * 1000);
  168. const dateString =
  169. date.toLocaleString("ru", {
  170. day: "numeric",
  171. month: "long",
  172. }) +
  173. " " +
  174. date.getFullYear() +
  175. ", " +
  176. ("0" + date.getHours()).slice(-2) +
  177. ":" +
  178. ("0" + date.getMinutes()).slice(-2);
  179. return dateString;
  180. },
  181. inject(item) {
  182. let res = "##news_" + item.id + "##";
  183. this.$clipboard(res);
  184. alert('Инжект скопирован в буфер обмена');
  185. },
  186. },
  187. computed: {
  188. }
  189. };
  190. </script>
  191. <style lang="less" scoped>
  192. .section {
  193. padding-top: 20px;
  194. }
  195. .podcast{
  196. &-detail{
  197. &-top{
  198. margin-top: 30px;
  199. }
  200. }
  201. }
  202. .video-alias {
  203. padding-bottom: 50px;
  204. &-header {
  205. position: relative;
  206. box-shadow: 0px 26px 38px -11px rgba(255, 0, 214, 0.25);
  207. }
  208. &-body {
  209. margin-top: 35px;
  210. display: flex;
  211. justify-content: space-between;
  212. }
  213. &-main {
  214. color: white;
  215. flex: 0 1 815px;
  216. }
  217. &-aside {
  218. margin-left: 10px;
  219. flex: 0 1 420px;
  220. max-width: 420px;
  221. }
  222. @media screen and(max-width: 1000px) {
  223. &-body {
  224. flex-direction: column;
  225. margin-top: 30px;
  226. }
  227. &-main {
  228. flex: auto;
  229. }
  230. &-aside {
  231. flex: auto;
  232. max-width: 100%;
  233. margin: 40px auto 0;
  234. }
  235. }
  236. }
  237. .header {
  238. &-video {
  239. position: relative;
  240. z-index: 1;
  241. width: 100%;
  242. aspect-ratio: 16 / 9;
  243. iframe {
  244. width: 100%;
  245. height: 100%;
  246. }
  247. }
  248. &-bg {
  249. z-index: 0;
  250. position: absolute;
  251. bottom: 0;
  252. transform: translateY(50%);
  253. img {
  254. width: 100%;
  255. height: auto;
  256. }
  257. }
  258. }
  259. .main {
  260. &-title {
  261. h1 {
  262. font-size: 48px;
  263. line-height: 120%;
  264. color: #000;
  265. }
  266. }
  267. &-description {
  268. margin-top: 20px;
  269. font-size: 24px;
  270. color: #737373;
  271. }
  272. &-content {
  273. margin-top: 40px;
  274. }
  275. @media screen and(max-width: 768px) {
  276. &-title {
  277. h1 {
  278. font-size: 22px;
  279. }
  280. }
  281. &-description {
  282. font-size: 18px;
  283. }
  284. }
  285. }
  286. .aside {
  287. &-list {
  288. display: flex;
  289. flex-direction: column;
  290. }
  291. &-item {
  292. margin-bottom: 28px;
  293. }
  294. }
  295. .admin-button-in-news{
  296. margin-bottom: 30px;
  297. a{
  298. background-color: #000;
  299. color: #fff;
  300. font-size: 14px;
  301. padding: 8px 19px;
  302. cursor: pointer;
  303. }
  304. .inject{
  305. background-color: #1976d2;
  306. }
  307. .copy{
  308. background-color: #4caf50;
  309. }
  310. }
  311. </style>