diff --git a/api/project.js b/api/project.js index 1af6abd..66cb8d4 100644 --- a/api/project.js +++ b/api/project.js @@ -100,3 +100,29 @@ export const getProjectDetail = (id) => { }); }; +/** + * 创建项目 + * @param {Object} data 项目数据 + * @returns {Promise} 创建结果 + */ +export const createProject = (data) => { + return uni.$uv.http.post('bst/project', data, { + custom: { + auth: true + } + }); +}; + +/** + * 更新项目 + * @param {Object} data 项目数据(需包含 id) + * @returns {Promise} 更新结果 + */ +export const updateProject = (data) => { + return uni.$uv.http.put('bst/project', data, { + custom: { + auth: true + } + }); +}; + diff --git a/pages.json b/pages.json index a06ec67..b9edee3 100644 --- a/pages.json +++ b/pages.json @@ -138,6 +138,13 @@ "navigationStyle": "custom" } }, + { + "path": "pages/project/form/index", + "style": { + "navigationBarTitleText": "项目编辑", + "navigationStyle": "custom" + } + }, { "path": "pages/project/list/index", "style": { diff --git a/pages/project/form/index.vue b/pages/project/form/index.vue new file mode 100644 index 0000000..86cb32f --- /dev/null +++ b/pages/project/form/index.vue @@ -0,0 +1,1071 @@ +