diff --git a/src/api/ad.js b/src/api/ad.js new file mode 100644 index 0000000..80c0123 --- /dev/null +++ b/src/api/ad.js @@ -0,0 +1,81 @@ +/* + * @Description: + * @version: v1 + * @Author: zhangjiabao + * @Date: 2024-02-24 23:38:16 + */ +import request from "@/utils/request"; +export default { + getList(data, page, size) { + return request({ + url: `/luoo-music/cms/ad/search/${page}/${size}`, + method: "post", + data: data + }); + }, + getDetail(id) { + return request({ + url: `/luoo-music/cms/ad/${id}`, + method: "get" + }); + }, + /** + * 删除 + * @param {*} id + * @returns + */ + delete(id) { + return request({ + url: `/luoo-music/cms/ad/${id}`, + method: "delete" + }); + }, + /** + * 发布 + * @param {*} id + * @returns + */ + publish(id, type, time) { + return request({ + url: `/luoo-music/cms/ad/publish/${id}`, + method: "put", + data: { + isScheduled: type, + pubTime: time + } + }); + }, + /** + * 更新状态 + * @param {*} id + * @param {*} state + * @returns + */ + updateStatus(id, state) { + return request({ + url: `/luoo-music/cms/ad/update/state/${id}`, + method: "put", + data: state + }); + }, + /** + * 更新 + * @param {*} id + * @param {*} data + * @returns + */ + update(id, data) { + return request({ + url: `/luoo-music/cms/ad/${id}`, + method: "put", + data: data + }); + }, + add(data) { + return request({ + url: `/luoo-music/cms/ad/add`, + method: "post", + data: data + }); + } +}; diff --git a/src/router/index.js b/src/router/index.js index 26e4fd0..c96841f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2,7 +2,7 @@ * @Author: zhangjiabao * @Date: 2024-01-25 11:05:17 * @LastEditors: zhangjiabao - * @LastEditTime: 2024-02-24 20:59:42 + * @LastEditTime: 2024-02-25 11:12:29 * @FilePath: /luoo_manage_fe/src/router/index.js */ import Vue from "vue"; @@ -197,8 +197,15 @@ export const constantRouterMap = [ { path: "ad", name: "Ad", - component: () => import("@/views/common/unfinished"), + component: () => import("@/views/ad/index"), meta: { title: "广告管理" } + }, + { + path: "adModify", + name: "AdDetail", + hidden: true, + component: () => import("@/views/ad/adModifyPage"), + meta: { title: "文章详情" } } ] }, diff --git a/src/views/ad/adModify.vue b/src/views/ad/adModify.vue new file mode 100644 index 0000000..1512a4d --- /dev/null +++ b/src/views/ad/adModify.vue @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 是否显示 + + + + + 上传图片 + + 支持格式:.jpg, .png 单个文件不能超过5MB 建议图片分辨率640*520 + + + + + + + + + + + + + diff --git a/src/views/ad/adModifyPage.vue b/src/views/ad/adModifyPage.vue new file mode 100644 index 0000000..b4bf25c --- /dev/null +++ b/src/views/ad/adModifyPage.vue @@ -0,0 +1,271 @@ + + + + + + {{ + ["广告发布", "广告编辑"][type] + }} + + 返回列表 + 保存广告 + + + + + 返回广告列表 + 新建广告 + + + + + + + + + diff --git a/src/views/ad/index.vue b/src/views/ad/index.vue new file mode 100644 index 0000000..0170c1b --- /dev/null +++ b/src/views/ad/index.vue @@ -0,0 +1,526 @@ + + + + + + + 广告管理 + + + + + + + + + + + + + + + + + + + + + + 查询 + + + 重置 + + + + + 新增广告 + + + + + + + + {{ scope.$index + 1 }} + + + + + + + + + + + + + + + + 编辑 + + 删除 + + + + + + + + + + + + +