feat: 分类改为必填项
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Agent
2026-04-01 14:36:48 +00:00
parent 3d827c0033
commit 0772a91c26

View File

@@ -58,7 +58,7 @@
</view>
<view class="modal-body">
<view class="form-item">
<text class="label">分类</text>
<text class="label"><text class="required">*</text>分类</text>
<picker :range="categories" range-key="name" @change="onCategoryChange">
<view class="picker">
{{ form.categoryId ? getCategoryName(form.categoryId) : '请选择分类' }}
@@ -218,6 +218,10 @@ export default {
return cat ? cat.name : ''
},
async saveProduct() {
if (!this.form.categoryId) {
uni.showToast({ title: '请选择分类', icon: 'none' })
return
}
if (!this.form.name) {
uni.showToast({ title: '请输入商品名称', icon: 'none' })
return