Jelajahi Sumber

delete SiteNotice

reghao 2 minggu lalu
induk
melakukan
c347f591b2

+ 1 - 10
src/api/admin.js

@@ -14,8 +14,7 @@ const adminApi = {
   getNotifyConfigApi: '/api/admin/message/notify/webhook',
   getAlbumsApi: '/api/admin/content/video/all',
   getArticlesApi: '/api/admin/content/video/all',
-  getVideosApi: '/api/admin/content/vod/list',
-  getSiteNoticeApi: '/api/admin/content/site_notice'
+  getVideosApi: '/api/admin/content/vod/list'
 }
 
 export function getAccountRegistry() {
@@ -77,11 +76,3 @@ export function getNotifyConfig() {
 export function getVipPlan() {
   return get(adminApi.getVipPlanApi)
 }
-
-export function getSiteNotice() {
-  return get(adminApi.getSiteNoticeApi)
-}
-
-export function updateSiteNotice(payload) {
-  return post(adminApi.getSiteNoticeApi, payload)
-}

+ 0 - 6
src/api/content.js

@@ -5,7 +5,6 @@ const videoApi = {
   contentAccessCodeApi: '/api/content/userdata',
   ossServerApi: '/api/file/oss/serverinfo',
   ossServerApi1: '/api/content/oss/serverinfo',
-  siteNoticeApi: '/api/content/site/notice',
   userRcmdApi: '/api/content/rcmd/user',
   dislikeVideoApi: '/api/content/rcmd/dislike'
 }
@@ -25,11 +24,6 @@ export function getServerInfo(channelId) {
   return post(videoApi.ossServerApi + '?channelId=' + channelId)
 }
 
-// 获取站点公告
-export function getSiteNotice() {
-  return get(videoApi.siteNoticeApi)
-}
-
 // 获取用户的推荐模式
 export function getUserRcmd() {
   return get(videoApi.userRcmdApi)

+ 0 - 136
src/components/card/SiteNotice.vue

@@ -1,136 +0,0 @@
-<template>
-  <el-card class="notice-card" shadow="never">
-    <div slot="header" class="notice-header">
-      <div class="header-left">
-        <img src="@/assets/img/speaker.png" alt="icon" class="notice-icon">
-        <span class="notice-title">站点公告</span>
-      </div>
-    </div>
-
-    <div class="notice-body">
-      <el-skeleton :loading="loading" :rows="5" animated>
-        <template>
-          <el-scrollbar class="custom-scrollbar" ref="scrollbar">
-            <div class="html-container" v-html="content || '暂无公告'" />
-          </el-scrollbar>
-        </template>
-      </el-skeleton>
-    </div>
-  </el-card>
-</template>
-
-<script>
-import { getSiteNotice } from '@/api/content'
-
-export default {
-  name: 'SiteNotice',
-  data() {
-    return {
-      content: '',
-      loading: true
-    }
-  },
-  created() {
-    this.fetchNotice()
-  },
-  methods: {
-    async fetchNotice() {
-      this.loading = true
-      try {
-        const resp = await getSiteNotice()
-        if (resp.code === 0) {
-          this.content = resp.data
-        }
-      } catch (error) {
-        this.$message.error('获取公告失败')
-      } finally {
-        this.loading = false
-      }
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.notice-card {
-  height: 100%;
-  display: flex;
-  flex-direction: column;
-  border-radius: 12px;
-  border: none;
-  overflow: hidden; // 防止内容溢出卡片圆角
-
-  ::v-deep .el-card__header {
-    padding: 12px 16px;
-    flex-shrink: 0; // 头部高度固定,不参与压缩
-    border-bottom: 1px solid #f0f2f5;
-  }
-
-  ::v-deep .el-card__body {
-    flex: 1;           // 占据剩余所有空间
-    display: flex;     // 开启 flex 模式
-    flex-direction: column;
-    overflow: hidden;  // 关键:body 不能溢出,才能让里面的 scrollbar 滚动
-    padding: 15px !important;
-  }
-}
-
-.notice-header {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  .header-left {
-    display: flex;
-    align-items: center;
-    gap: 10px;
-  }
-  .notice-icon { width: 22px; height: 22px; }
-  .notice-title { font-size: 16px; font-weight: 600; color: #303133; }
-}
-
-.notice-body {
-  flex: 1;             // 填满卡片 body
-  height: 100%;
-  position: relative;  // 为 scrollbar 提供参考高度
-  overflow: hidden;
-
-  .custom-scrollbar {
-    height: 100%;      // 强制充满容器
-
-    ::v-deep .el-scrollbar__wrap {
-      overflow-x: hidden; // 彻底禁用横向滚动
-      margin-bottom: 0 !important; // 修复 Element UI 可能出现的原生滚动条间隙
-    }
-
-    // 让内容区平滑滚动
-    ::v-deep .el-scrollbar__view {
-      padding-right: 10px; // 为右侧滚动条留出一点呼吸感
-    }
-  }
-}
-
-.html-container {
-  font-size: 14px;
-  line-height: 1.8;
-  color: #606266;
-  word-break: break-all;
-
-  ::v-deep img {
-    max-width: 100%;
-    height: auto;
-    border-radius: 4px;
-    margin: 8px 0;
-  }
-
-  ::v-deep p { margin-bottom: 12px; }
-  ::v-deep a { color: #409EFF; text-decoration: none; &:hover { text-underline: underline; } }
-}
-
-/* 响应式:在 PC 端跟随轮播图高度,在移动端固定高度 */
-@media screen and (max-width: 991px) {
-  .notice-card {
-    height: 250px; // 轮播图下方显示的公告高度
-    margin-top: 10px;
-  }
-}
-</style>

+ 1 - 1
src/views/admin/aaa/AdminVideoList.vue

@@ -156,7 +156,7 @@
           <template slot-scope="scope">
             <el-tag v-if="scope.row.scope === 1" type="info" size="mini" effect="light">本人可见</el-tag>
             <el-tag v-else-if="scope.row.scope === 2" type="success" size="mini" effect="light">所有人可见</el-tag>
-            <el-tag v-else-if="scope.row.scope === 3" v-slot-scope="scope" type="warning" size="mini" effect="light">VIP 可见</el-tag>
+            <el-tag v-else-if="scope.row.scope === 3" type="warning" size="mini" effect="light">VIP 可见</el-tag>
             <el-tag v-else type="info" size="mini">未知: {{ scope.row.scope }}</el-tag>
           </template>
         </el-table-column>

+ 1 - 71
src/views/admin/site/AdminCategory.vue

@@ -22,17 +22,6 @@
           </div>
         </el-card>
       </el-col>
-      <el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
-        <el-card class="box-card">
-          <div slot="header" class="clearfix">
-            <span>站点公告</span>
-            <el-button style="float: right; padding: 3px 0" type="text" @click="handleUpdateNotice">更新</el-button>
-          </div>
-          <div class="text item">
-            {{ siteNotice }}
-          </div>
-        </el-card>
-      </el-col>
     </el-row>
     <el-row class="movie-list">
       <el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
@@ -68,37 +57,6 @@
       </el-col>
     </el-row>
 
-    <el-dialog
-      append-to-body
-      :visible.sync="updateDialog"
-      width="30%"
-      center
-    >
-      <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px; text-align: center">
-        <el-form ref="form" :model="updateForm" label-width="100px">
-          <el-form-item label="新公告" label-width="90px">
-            <el-input
-              v-model="updateForm.content"
-              type="textarea"
-              maxlength="200"
-              :rows="3"
-              placeholder="请输入新公告"
-              style="padding: 5px"
-            />
-          </el-form-item>
-          <el-form-item>
-            <el-button
-              type="primary"
-              @click.native="onUpdateNotice"
-            >更新</el-button>
-            <el-button
-              type="primary"
-              @click.native="updateDialog = false"
-            >取消</el-button>
-          </el-form-item>
-        </el-form>
-      </el-row>
-    </el-dialog>
     <el-dialog
       append-to-body
       :visible.sync="addCategoryDialog"
@@ -137,7 +95,7 @@
 
 <script>
 import { userMixin } from 'assets/js/mixin'
-import { getSiteNotice, getVipPlan, updateSiteNotice } from '@/api/admin'
+import { getVipPlan } from '@/api/admin'
 import { videoCategories } from '@/api/vod'
 
 export default {
@@ -151,11 +109,6 @@ export default {
         label: 'label',
         value: 'value'
       },
-      siteNotice: null,
-      updateDialog: false,
-      updateForm: {
-        content: null
-      },
       addCategoryDialog: false,
       categoryForm: {
         pid: null,
@@ -189,34 +142,11 @@ export default {
       }).catch(error => {
         this.$message.error(error.message)
       })
-
-      getSiteNotice().then(resp => {
-        if (resp.code === 0) {
-          this.siteNotice = resp.data
-        } else {
-          this.$message.warning(resp.msg)
-        }
-      }).catch(error => {
-        this.$message.error(error.message)
-      })
     },
     // ****************************************************************************************************************
     handleNodeClick() {
       this.$message.info('handleNodeClick')
     },
-    handleUpdateNotice() {
-      this.updateDialog = true
-    },
-    onUpdateNotice() {
-      updateSiteNotice(this.updateForm).then(resp => {
-        if (resp.code === 0) {
-          this.$message.warning(resp.msg)
-          this.updateDialog = false
-        }
-      }).catch(error => {
-        this.$message.error(error.message)
-      })
-    },
     onAddCategory() {
       this.addCategoryDialog = true
     },

+ 1 - 35
src/views/home/Home.vue

@@ -1,38 +1,5 @@
 <template>
   <div class="home-container">
-    <el-row class="recommend-section top-recommend-row" type="flex">
-      <el-col :xs="24" :sm="24" :md="15" :lg="17" class="carousel-col">
-        <div class="carousel-full-height-container">
-          <el-carousel
-            v-if="carouselList.length > 0"
-            :interval="5000"
-            arrow="hover"
-            class="custom-carousel shadow-hover"
-            :height="carouselHeight"
-          >
-            <el-carousel-item v-for="(item, index) in carouselList" :key="'banner-'+index">
-              <router-link :to="`/video/${item.videoId}`">
-                <div class="carousel-item-wrapper">
-                  <img class="carousel-img" :src="item.coverUrl" alt="banner">
-                  <div class="carousel-mask" />
-                  <div class="carousel-info">
-                    <h3 class="carousel-title">{{ item.title || '精彩内容' }}</h3>
-                  </div>
-                </div>
-              </router-link>
-            </el-carousel-item>
-          </el-carousel>
-          <div v-else class="carousel-placeholder" :style="{height: carouselHeight}">
-            <i class="el-icon-loading" />
-          </div>
-        </div>
-      </el-col>
-
-      <el-col :xs="24" :sm="24" :md="9" :lg="7" class="notice-col">
-        <site-notice class="equal-height-component shadow-hover" />
-      </el-col>
-    </el-row>
-
     <div
       v-infinite-scroll="load"
       class="video-grid-container"
@@ -68,12 +35,11 @@
 
 <script>
 import VideoCard from '@/components/card/VideoCard'
-import SiteNotice from '@/components/card/SiteNotice'
 import { getBannerVideo, videoRecommend } from '@/api/vod'
 
 export default {
   name: 'Home',
-  components: { VideoCard, SiteNotice },
+  components: { VideoCard },
   data() {
     return {
       nextId: 0,

+ 1 - 2
src/views/home/Index.vue

@@ -53,12 +53,11 @@
 
 <script>
 import VideoCard from '@/components/card/VideoCard'
-import SiteNotice from '@/components/card/SiteNotice'
 import { getHotVideo, videoRecommend } from '@/api/vod'
 
 export default {
   name: 'Index',
-  components: { VideoCard, SiteNotice },
+  components: { VideoCard },
   data() {
     return {
       // 屏幕宽度, 为了控制分页条的大小