diff --git a/api/dashboard.js b/api/dashboard.js index 6d1624a..ef4a298 100644 --- a/api/dashboard.js +++ b/api/dashboard.js @@ -133,3 +133,33 @@ export const createNotice = (payload) => { }); }; +/** + * 修改公告 + * 对应接口:PUT bst/notice + * @param {Object} payload 公告数据,必须包含 id + * @returns {Promise} + */ +export const updateNotice = (payload) => { + return uni.$uv.http.put('bst/notice', payload, { + custom: { + auth: true + } + }); +}; + +/** + * 删除公告 + * 对应接口:DELETE bst/notice/{id} + * 支持单个 ID 或多个 ID(数组,逗号分隔) + * @param {string|string[]} ids 公告ID或ID数组 + * @returns {Promise} + */ +export const deleteNotice = (ids) => { + const idParam = Array.isArray(ids) ? ids.join(',') : ids; + return uni.$uv.http.delete(`bst/notice/${idParam}`, {},{ + custom: { + auth: true + } + }); +}; + diff --git a/pages.json b/pages.json index 09a8c98..4139ac0 100644 --- a/pages.json +++ b/pages.json @@ -163,6 +163,12 @@ "navigationBarTitleText": "新增公告" } }, + { + "path": "pages/notice/edit/index", + "style": { + "navigationBarTitleText": "修改公告" + } + }, { "path": "pages/notice/detail/index", "style": { diff --git a/pages/notice/edit/index.vue b/pages/notice/edit/index.vue new file mode 100644 index 0000000..24df02d --- /dev/null +++ b/pages/notice/edit/index.vue @@ -0,0 +1,896 @@ +