Commit 30a15305 by 李伟康

feat(OrderPopup): 为选择器组件添加空值提示

- 在 config.js 中为多个组件添加 nullTips 属性,用于显示空值提示信息
- 在 index.vue 中修改 confirm 方法,增加空值校验逻辑
- 当选择器为空且配置了 nullTips 时,弹出相应的提示信息
1 parent b689b6c3
......@@ -27,6 +27,7 @@ const componentConfig = {
name: 'EmployeeList',
title: '交付专员',
placeholder: '请输入姓名',
nullTips: '请选择交付专员',
idKey: 'deliveryUserId'
},
2: {
......@@ -51,13 +52,15 @@ const componentConfig = {
name: 'CouponList',
title: '选择礼券',
placeholder: '查找',
idKey: 'customerCouponCode'
idKey: 'customerCouponCode',
nullTips: '优惠券不能为空'
},
6: {
name: 'GoodsList',
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
nullTips: '请勾选商品',
goodsType: [1]//前档
},
7: {
......@@ -65,6 +68,7 @@ const componentConfig = {
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
nullTips: '请勾选商品',
goodsType: [2] // 前侧窗玻璃
},
8: {
......@@ -72,6 +76,7 @@ const componentConfig = {
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
nullTips: '请勾选商品',
goodsType: [3] // 后侧窗玻璃
},
9: {
......@@ -79,6 +84,7 @@ const componentConfig = {
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
nullTips: '请勾选商品',
goodsType: [4] // 后档
},
10: {
......@@ -86,17 +92,20 @@ const componentConfig = {
title: '选择商品(可多选)',
placeholder: '请输入名称',
idKey: 'goodsId',
nullTips: '请勾选商品',
goodsType: [5, 6, 7] // 天窗
},
11: {
name: 'PackageList',
title: '选择套餐',
placeholder: '查找',
nullTips: '请勾选套餐',
idKey: 'packageCode'
},
12: {
name: 'SkuGoodsList',
title: '选择商品',
nullTips: '请勾选商品',
placeholder: '查找',
},
......
......@@ -184,7 +184,7 @@ export default {
else componentRef.handleSearch(this.componentObject.searchValue)
},
confirm () {
let { chooseContent, popupType } = this
let { chooseContent, popupType, componentObject } = this
if (popupType === 13) {
chooseContent = this.componentRef().getResult()
}
......@@ -194,6 +194,11 @@ export default {
popupType
})
this.$refs.popup.close()
} else {
if (componentObject.nullTips) uni.showToast({
title: componentObject.nullTips,
icon: 'none'
})
}
},
openSkuPopup (data) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!