From 9bf02628eb1c6253d886ee5ac2eba3eba1a2f4df Mon Sep 17 00:00:00 2001 From: Echo <1711788888@qq.com> Date: Mon, 1 Sep 2025 22:36:18 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=20=E5=AE=8C=E5=96=84=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=92=8C=E6=96=87=E7=AB=A0=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/article/index.js | 2 +- src/api/order/index.js | 14 +- src/components/richtext/rich-edit.vue | 31 ++- src/config.js | 200 +++++++++++++--- src/view/goods/article/edit.vue | 177 ++++++++++---- src/view/goods/article/index.vue | 269 ++++++++++++++++++--- src/view/order/order/index.vue | 328 +++++++++++++++++++++++--- 7 files changed, 862 insertions(+), 159 deletions(-) diff --git a/src/api/article/index.js b/src/api/article/index.js index 54f3bb0..006bbc7 100644 --- a/src/api/article/index.js +++ b/src/api/article/index.js @@ -1,7 +1,7 @@ import service from '@/utils/request' // @tag Order -// @summary 获取订单列表 +// @summary 获取文章列表 // @param {object} params // @return {object} data // @router get /order/list diff --git a/src/api/order/index.js b/src/api/order/index.js index 021faf8..ac84928 100644 --- a/src/api/order/index.js +++ b/src/api/order/index.js @@ -11,4 +11,16 @@ export const list = (params) => { method: 'get', params }) -} \ No newline at end of file +} + +// @tag Order +// @summary 获取订单详情 +// @param {object} params +// @return {object} data +// @router get /order/:id +export const detail = (id) => { + return service({ + url: '/order/' + id, + method: 'get', + }) +} diff --git a/src/components/richtext/rich-edit.vue b/src/components/richtext/rich-edit.vue index a2038c5..25158da 100644 --- a/src/components/richtext/rich-edit.vue +++ b/src/components/richtext/rich-edit.vue @@ -48,7 +48,36 @@ const toolbarConfig = {} const editorConfig = { placeholder: '请输入内容...', - MENU_CONF: {} + MENU_CONF: { + uploadImage: { + server: basePath + '/fileUploadAndDownload/upload?noSave=1', + fieldName: 'file', + maxFileSize: 1024 * 1024 * 10, // 限制图片大小为10MB + maxNumberOfFiles: 1, + customInsert(res, insertFn) { + if (res.code === 0) { + const urlPath = getUrl(res.data.file.url) + insertFn(urlPath, res.data.file.name) + return + } + ElMessage.error(res.msg) + } + }, + uploadVideo: { + server: basePath + '/fileUploadAndDownload/upload?noSave=1', + fieldName: 'file', + maxFileSize: 1024 * 1024 * 100, // 限制视频大小为100MB + maxNumberOfFiles: 1, + customInsert(res, insertFn) { + if (res.code === 0) { + const urlPath = getUrl(res.data.file.url) + insertFn(urlPath, res.data.file.name) + return + } + ElMessage.error(res.msg) + } + } + } } editorConfig.MENU_CONF['uploadImage','uploadVideo'] = { fieldName: 'file', diff --git a/src/config.js b/src/config.js index 63d2a3f..109f4f2 100644 --- a/src/config.js +++ b/src/config.js @@ -3,16 +3,102 @@ export let userStatus = await getDict('user-status') export const ORDER_SEARCH_CONFIG = [ { type: 'input', - prop:'orderId', + prop:'order_no', label: '订单号', - placeholder: '请输入', + placeholder: '请输入订单号', + }, + { + type: 'input', + prop:'title', + label: '商品名称', + placeholder: '请输入商品名称', + }, + { + type: 'input', + prop:'name', + label: '用户姓名', + placeholder: '请输入用户姓名', + }, + { + type: 'select', + prop:'order_type', + label: '订单类型', + placeholder: '请选择订单类型', + children:{ + list: [ + { + label: '全部', + value: '' + }, + { + label: '课程', + value: 1 + }, + { + label: 'VIP', + value: 2 + } + ] + }, + }, + { + type: 'select', + prop:'pay_type', + label: '支付方式', + placeholder: '请选择支付方式', + children:{ + list: [ + { + label: '全部', + value: '' + }, + { + label: '微信', + value: 1 + }, + { + label: '支付宝', + value: 2 + }, + { + label: '余额', + value: 3 + } + ] + }, + }, + { + type: 'select', + prop:'status', + label: '订单状态', + placeholder: '请选择订单状态', + children:{ + list: [ + { + label: '全部', + value: '' + }, + { + label: '未付款', + value: 1 + }, + { + label: '已付款', + value: 2 + }, + { + label: '已过期', + value: 3 + } + ] + }, }, { type: 'daterange', prop: 'times', - label: '申请时间', + label: '创建时间', valueFormat: 'YYYY-MM-DD', - placeholder: '请选择申请时间', + placeholder: '请选择创建时间', startPlaceholder: '开始日期', endPlaceholder: '结束日期', rangeSeparator: '-' @@ -92,26 +178,40 @@ export const USER_SEARCH_CONFIG = [ export const ARTICLE_SEARCH_CONFIG = [ { type: 'input', - prop:'name', - label: '名称', - placeholder: '请输入', + prop:'title', + label: '文章标题', + placeholder: '请输入文章标题', }, { type: 'select', - prop:'status', - label: '状态', - placeholder: '请选择', + prop:'categoryId', + label: '文章分类', + placeholder: '请选择分类', children:{ list: [ { label: '全部', value: '' - }, - ...userStatus + } ] }, - } + }, + { + type: 'select', + prop:'teacherId', + label: '讲师', + placeholder: '请选择讲师', + children:{ + list: [ + { + label: '全部', + value: '' + } + ] + }, + }, ] + // 订单列表 export const ORDER_TABLE_CONFIG = { index: true, @@ -126,6 +226,13 @@ export const ORDER_TABLE_CONFIG = { { attrs: { label: '商品名称', + prop: 'title', + align: 'center' + } + }, + { + attrs: { + label: '用户姓名', prop: 'name', align: 'center' } @@ -134,37 +241,41 @@ export const ORDER_TABLE_CONFIG = { attrs: { label: '价格', align: 'center', - prop: 'price' + prop: 'price', + slot: 'price' } }, { attrs: { - label: '类型', + label: '订单类型', align: 'center', - prop: 'order_type' + prop: 'order_type', + slot: 'order_type' } }, { attrs: { - label: '状态', + label: '支付方式', + align: 'center', + prop: 'pay_type', + slot: 'pay_type' + } + }, + { + attrs: { + label: '订单状态', prop: 'status', - align: 'center' - }, - slot: 'status' - },{ + align: 'center', + slot: 'status' + } + }, + { attrs: { label: '创建时间', prop: 'CreatedAt', - align: 'center' - }, - slot: 'CreatedAt' - },{ - attrs: { - label: '更新时间', - prop: 'UpdatedAt', - align: 'center' - }, - slot: 'UpdatedAt' + align: 'center', + slot: 'CreatedAt' + } }, { attrs: { @@ -264,24 +375,35 @@ export const ARTICLE_TABLE_CONFIG = { }, { attrs: { - label: '名称', + label: '标题', prop: 'title', align: 'center' } - },{ + }, + { + attrs: { + label: '讲师', + prop: 'teacherName', + align: 'center' + } + }, + { attrs: { label: '价格', prop: 'price', align: 'center' - } - },{ + }, + slot: 'price' + }, + { attrs: { - label: '创建时间', - prop: 'CreatedAt', + label: '是否免费', + prop: 'isFree', align: 'center' }, - slot: 'CreatedAt' - },{ + slot: 'isFree' + }, + { attrs: { label: '更新时间', prop: 'UpdatedAt', diff --git a/src/view/goods/article/edit.vue b/src/view/goods/article/edit.vue index 5104609..c6ea226 100644 --- a/src/view/goods/article/edit.vue +++ b/src/view/goods/article/edit.vue @@ -9,43 +9,69 @@ > - + - + - - - - - - - - - - - - - - - - + + + + + - - + + + + + + + + + 免费 + 付费 + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -56,8 +82,6 @@ 返回 提交 - - - diff --git a/src/view/goods/article/index.vue b/src/view/goods/article/index.vue index 754851d..6a83d03 100644 --- a/src/view/goods/article/index.vue +++ b/src/view/goods/article/index.vue @@ -2,7 +2,8 @@
-