refactor: improve code formatting and structure in product index view

- Enhanced readability by adjusting indentation and spacing in the template.
- Consolidated repeated code blocks for better maintainability.
- Added functionality for changing product status (上架/下架) with confirmation prompts.
- Updated the handleDelete function to maintain consistent formatting.
- Ensured all API calls and data handling are properly formatted for clarity.
This commit is contained in:
2026-03-08 02:38:43 +07:00
parent a8fab3e765
commit 0e0b856edb
3 changed files with 1036 additions and 916 deletions

View File

@@ -42,3 +42,16 @@ export function delProduct(id) {
method: 'delete'
})
}
// 上架/下架商品
export function changeProductStatus(id, status) {
const data = {
id,
status
}
return request({
url: '/service/product/status',
method: 'put',
data: data
})
}