|
|
@@ -389,11 +389,25 @@
|
|
|
></el-time-picker>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" align="center" width="100px" fixed="right">
|
|
|
+ <el-table-column label="热卖标签" align="center" prop="hotSaleTags" min-width="140">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag
|
|
|
+ v-for="(tag, tagIdx) in getHotSaleTagList(scope.row)"
|
|
|
+ :key="tagIdx"
|
|
|
+ size="mini"
|
|
|
+ type="danger"
|
|
|
+ style="margin: 2px;"
|
|
|
+ >{{ tag }}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" width="160px" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete"
|
|
|
@click="handleCourseProductDelete(scope.row)">删除
|
|
|
</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-price-tag"
|
|
|
+ @click="handleOpenHotSaleTagDialog(scope.row, scope.$index)">添加热卖标签
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -426,6 +440,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="精选留言">
|
|
|
<el-button size="small" type="primary" @click="openCommentImportDialog">导入留言</el-button>
|
|
|
+ <el-button size="small" style="margin-left: 8px;" @click="openUserCommentDialog">用户留言</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@@ -492,6 +507,21 @@
|
|
|
<el-dialog :title="courseProduct.title" :visible.sync="courseProduct.open" width="1000px" append-to-body>
|
|
|
<course-product ref="courseProduct" @courseProductResult="courseProductResult"></course-product>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="热卖标签" :visible.sync="hotSaleTagDialog.visible" width="480px" append-to-body>
|
|
|
+ <p v-if="hotSaleTagDialog.productName" style="margin-bottom: 10px; color: #606266;">
|
|
|
+ 商品:{{ hotSaleTagDialog.productName }}
|
|
|
+ </p>
|
|
|
+ <el-input
|
|
|
+ v-model="hotSaleTagDialog.tagInput"
|
|
|
+ type="textarea"
|
|
|
+ :rows="3"
|
|
|
+ placeholder="多个标签用逗号分隔;留空表示清除标签"
|
|
|
+ />
|
|
|
+ <template slot="footer">
|
|
|
+ <el-button @click="hotSaleTagDialog.visible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="confirmHotSaleTag">确 定</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
<el-dialog title="视频库选择" :visible.sync="addBatchData.open" width="900px" append-to-body>
|
|
|
<!-- 搜索条件 -->
|
|
|
<el-form :inline="true" :model="addBatchData.queryParams" class="library-search">
|
|
|
@@ -581,6 +611,15 @@
|
|
|
v-if="commentDialog.open">
|
|
|
</course-watch-comment>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog :title="userCommentDialog.title" :visible.sync="userCommentDialog.open" width="1000px" append-to-body
|
|
|
+ :close-on-click-modal="false" @opened="onUserCommentDialogOpened">
|
|
|
+ <user-course-section-comment
|
|
|
+ v-if="userCommentDialog.open"
|
|
|
+ ref="userCourseSectionComment"
|
|
|
+ :course-id="userCommentDialog.courseId"
|
|
|
+ :video-id="userCommentDialog.videoId"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
|
|
|
|
|
|
<el-dialog title="修改课节排序" :visible.sync="openVideoSort" style="width: 1600px;" append-to-body>
|
|
|
@@ -645,6 +684,7 @@ import VideoUpload from "@/components/VideoUpload/index.vue";
|
|
|
import {listVideoResource} from '@/api/course/videoResource';
|
|
|
import {getByIds} from '@/api/course/courseQuestionBank'
|
|
|
import CourseWatchComment from "./courseWatchComment.vue";
|
|
|
+import UserCourseSectionComment from "./userCourseSectionComment.vue";
|
|
|
import {getCateListByPid, getCatePidList} from '@/api/course/userCourseCategory'
|
|
|
import {downloadCommentImportTemplate, importComments, listFeaturedComments, delUserCourseComment} from '@/api/course/userCourseComment'
|
|
|
import draggable from 'vuedraggable'
|
|
|
@@ -652,7 +692,7 @@ import { getConfigByKey } from '@/api/system/config'
|
|
|
|
|
|
export default {
|
|
|
name: "userCourseCatalog",
|
|
|
- components: {VideoUpload, QuestionBank, CourseWatchComment, CourseProduct, draggable},
|
|
|
+ components: {VideoUpload, QuestionBank, CourseWatchComment, UserCourseSectionComment, CourseProduct, draggable},
|
|
|
props: {
|
|
|
usePublicVideoLibrary: {
|
|
|
type: Boolean,
|
|
|
@@ -688,6 +728,12 @@ export default {
|
|
|
title: '',
|
|
|
open: false,
|
|
|
},
|
|
|
+ hotSaleTagDialog: {
|
|
|
+ visible: false,
|
|
|
+ index: -1,
|
|
|
+ productName: '',
|
|
|
+ tagInput: ''
|
|
|
+ },
|
|
|
isPrivate: null,
|
|
|
videoUrl: "",
|
|
|
uploadTypeOptions: [
|
|
|
@@ -798,6 +844,12 @@ export default {
|
|
|
videoId: null,
|
|
|
title: ""
|
|
|
},
|
|
|
+ userCommentDialog: {
|
|
|
+ open: false,
|
|
|
+ courseId: null,
|
|
|
+ videoId: null,
|
|
|
+ title: ""
|
|
|
+ },
|
|
|
enableRandomRedPacket:false,
|
|
|
// 精选留言导入弹窗
|
|
|
commentImportDialog: {
|
|
|
@@ -929,6 +981,7 @@ export default {
|
|
|
cardPopupTime: val.cardPopupTime || '00:00:00', // 卡片弹出时间,默认 00:00:00
|
|
|
cardCloseTime: val.cardCloseTime || '00:00:00', // 卡片关闭时间,默认 00:00:00
|
|
|
offShelfTime: val.offShelfTime || '00:00:00', // 下架时间,默认 00:00:00
|
|
|
+ hotSaleTags: val.hotSaleTags || '',
|
|
|
};
|
|
|
// 检查商品是否已存在
|
|
|
const exists = this.form.courseProducts.some(item => item.productId === val.productId);
|
|
|
@@ -1122,6 +1175,29 @@ export default {
|
|
|
this.form.questionBankList.splice(this.form.questionBankList.findIndex(item => item.id === row.id), 1)
|
|
|
},
|
|
|
|
|
|
+ getHotSaleTagList(row) {
|
|
|
+ if (!row || !row.hotSaleTags) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ return row.hotSaleTags.split(/[,,]/).map(t => t.trim()).filter(t => t);
|
|
|
+ },
|
|
|
+ handleOpenHotSaleTagDialog(row, index) {
|
|
|
+ this.hotSaleTagDialog.index = index;
|
|
|
+ this.hotSaleTagDialog.productName = row.productName || '';
|
|
|
+ this.hotSaleTagDialog.tagInput = row.hotSaleTags || '';
|
|
|
+ this.hotSaleTagDialog.visible = true;
|
|
|
+ },
|
|
|
+ confirmHotSaleTag() {
|
|
|
+ const tags = (this.hotSaleTagDialog.tagInput || '')
|
|
|
+ .split(/[,,]/)
|
|
|
+ .map(t => t.trim())
|
|
|
+ .filter(t => t);
|
|
|
+ const index = this.hotSaleTagDialog.index;
|
|
|
+ if (index >= 0 && this.form.courseProducts[index]) {
|
|
|
+ this.$set(this.form.courseProducts[index], 'hotSaleTags', tags.length ? tags.join(',') : '');
|
|
|
+ }
|
|
|
+ this.hotSaleTagDialog.visible = false;
|
|
|
+ },
|
|
|
//删除商品
|
|
|
handleCourseProductDelete(row) {
|
|
|
// 优先使用 productId 查找
|
|
|
@@ -1376,7 +1452,8 @@ export default {
|
|
|
onShelfTime: product.onShelfTime || '00:00:00',
|
|
|
cardPopupTime: product.cardPopupTime || '00:00:00',
|
|
|
cardCloseTime: product.cardCloseTime || '00:00:00',
|
|
|
- offShelfTime: product.offShelfTime || '00:00:00'
|
|
|
+ offShelfTime: product.offShelfTime || '00:00:00',
|
|
|
+ hotSaleTags: product.hotSaleTags || ''
|
|
|
}));
|
|
|
} else {
|
|
|
// 否则按照原有逻辑设置到 packageList
|
|
|
@@ -1825,6 +1902,23 @@ export default {
|
|
|
}
|
|
|
return isLt10M && isImage;
|
|
|
},
|
|
|
+ openUserCommentDialog() {
|
|
|
+ if (!this.form.courseId || !this.form.videoId) {
|
|
|
+ this.$message.warning('请先保存课节后再查看用户留言')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.userCommentDialog.courseId = this.form.courseId
|
|
|
+ this.userCommentDialog.videoId = this.form.videoId
|
|
|
+ this.userCommentDialog.title = `用户留言 - ${this.form.title || ''}`
|
|
|
+ this.userCommentDialog.open = true
|
|
|
+ },
|
|
|
+ onUserCommentDialogOpened() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.userCourseSectionComment) {
|
|
|
+ this.$refs.userCourseSectionComment.handleQuery()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 打开精选留言导入弹窗
|
|
|
openCommentImportDialog() {
|
|
|
this.commentImportDialog.visible = true;
|