hejianhao
2026-08-20 8adff1576d322f1095d35dad5fd7bec17417f0e7
feat0806: 项目介绍样式完善
9个文件已修改
41 ■■■■■ 已修改文件
tcm-training-admin-backend/sql/20260806_admin.sql 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/app/projectintroduction/service/AppProjectIntroductionService.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/live/dto/ProjectIntroductionSaveRequest.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/live/entity/ProjectIntroduction.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/live/service/ProjectIntroductionAppService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/live/vo/AppProjectIntroductionDetailVO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/live/vo/ProjectIntroductionDetailVO.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tcm-training-admin/src/pages/live/project-introduction/manage.tsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
traditionalApp/pages/good/projectDetail.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tcm-training-admin-backend/sql/20260806_admin.sql
@@ -111,6 +111,7 @@
  `content` MEDIUMTEXT COMMENT '图文内容(富文本HTML)',
  `video_url` VARCHAR(512) DEFAULT NULL COMMENT '视频地址',
  `video_file_name` VARCHAR(255) DEFAULT NULL COMMENT '视频文件名',
  `video_description` VARCHAR(255) DEFAULT NULL COMMENT '视频介绍',
  `click_count` INT NOT NULL DEFAULT 0 COMMENT '点击量',
  `status` TINYINT NOT NULL DEFAULT 1 COMMENT '状态:1启用 0禁用',
  `deleted` TINYINT(1) NOT NULL DEFAULT 0,
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/app/projectintroduction/service/AppProjectIntroductionService.java
@@ -81,6 +81,7 @@
        vo.setContent(entity.getContent());
        vo.setVideoUrl(entity.getVideoUrl());
        vo.setVideoFileName(entity.getVideoFileName());
        vo.setVideoDescription(entity.getVideoDescription());
        vo.setClickCount(entity.getClickCount());
        return vo;
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/live/dto/ProjectIntroductionSaveRequest.java
@@ -36,6 +36,9 @@
    @Size(max = 255, message = "视频文件名长度不能超过255个字符")
    private String videoFileName;
    @Size(max = 255, message = "视频介绍长度不能超过255个字符")
    private String videoDescription;
    @NotNull(message = "请选择是否启用")
    private Integer status;
}
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/live/entity/ProjectIntroduction.java
@@ -46,6 +46,9 @@
    @TableField("video_file_name")
    private String videoFileName;
    @TableField("video_description")
    private String videoDescription;
    @TableField("click_count")
    private Integer clickCount;
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/live/service/ProjectIntroductionAppService.java
@@ -102,6 +102,7 @@
            item.setContent(content);
            item.setVideoUrl(null);
            item.setVideoFileName(null);
            item.setVideoDescription(null);
            return;
        }
@@ -109,9 +110,14 @@
        if (videoUrl == null) {
            throw new IllegalArgumentException("请填写视频地址或上传本地视频");
        }
        String videoDescription = trimToNull(req.getVideoDescription());
        if (videoDescription == null) {
            throw new IllegalArgumentException("请输入视频介绍");
        }
        item.setContent(null);
        item.setVideoUrl(videoUrl);
        item.setVideoFileName(trimToNull(req.getVideoFileName()));
        item.setVideoDescription(videoDescription);
    }
    private int validateContentType(Integer contentType) {
@@ -172,6 +178,7 @@
        vo.setContent(item.getContent());
        vo.setVideoUrl(item.getVideoUrl());
        vo.setVideoFileName(item.getVideoFileName());
        vo.setVideoDescription(item.getVideoDescription());
        vo.setStatus(item.getStatus());
        vo.setClickCount(defaultNumber(item.getClickCount()));
        vo.setCreatedAt(item.getCreatedAt());
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/live/vo/AppProjectIntroductionDetailVO.java
@@ -47,6 +47,11 @@
    private String videoFileName;
    /**
     * 视频介绍
     */
    private String videoDescription;
    /**
     * 点击量
     */
    private Integer clickCount;
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/live/vo/ProjectIntroductionDetailVO.java
@@ -18,6 +18,7 @@
    private String content;
    private String videoUrl;
    private String videoFileName;
    private String videoDescription;
    private Integer status;
    private Integer clickCount;
    private LocalDateTime createdAt;
tcm-training-admin/src/pages/live/project-introduction/manage.tsx
@@ -96,6 +96,7 @@
      content: values.contentType === 1 ? values.content : undefined,
      videoUrl: values.contentType === 2 ? values.videoUrl?.trim() : undefined,
      videoFileName: values.contentType === 2 ? values.videoFileName?.trim() : undefined,
      videoDescription: values.contentType === 2 ? values.videoDescription?.trim() : undefined,
      status: values.status ? 1 : 0,
    };
    setSubmitting(true);
@@ -184,6 +185,13 @@
                >
                  <Input placeholder="请输入" disabled={loading} />
                </Form.Item>
                <Form.Item
                  label="视频介绍"
                  name="videoDescription"
                  rules={[{ required: true, message: '请输入视频介绍' }]}
                >
                  <Input.TextArea placeholder="请输入视频介绍" maxLength={255} rows={3} disabled={loading} />
                </Form.Item>
                <Form.Item label="本地视频" extra="本地视频和视频地址必须填一个">
                  <div className="project-introduction-edit-form__video-upload">
                    <Upload
traditionalApp/pages/good/projectDetail.vue
@@ -27,6 +27,10 @@
                        :show-center-play-btn="true"
                        :enable-progress-gesture="true"
                    ></video>
                    <!-- 视频介绍 -->
                    <view v-if="detail.videoDescription" class="video-description">
                        {{ detail.videoDescription }}
                    </view>
                </view>
                <!-- 图文内容 -->
@@ -182,6 +186,14 @@
    overflow: hidden;
}
.video-description {
    margin-top: 24rpx;
    font-size: 28rpx;
    line-height: 44rpx;
    color: #666;
    text-align: justify;
}
.html-content {
    font-size: 30rpx;
    line-height: 48rpx;