|
@@ -26,11 +26,10 @@ class Product {
|
|
|
// 验证商品订制属性是否符合规则
|
|
|
checkDimension (dimensionData, schemeData) {
|
|
|
let requiredProperties = ['length', 'width'];
|
|
|
- if (schemeData.lengthschemedetails.length > 0) {
|
|
|
- requiredProperties = requiredProperties.filter(prop => prop !== 'length');
|
|
|
-
|
|
|
+ if (schemeData.lengthschemedetails && schemeData.lengthschemedetails.length > 0) {
|
|
|
+ requiredProperties = requiredProperties.filter(prop => prop !== 'length');
|
|
|
}
|
|
|
- if(schemeData.widthschemedetails.length > 0) {
|
|
|
+ if(schemeData.widthschemedetails && schemeData.widthschemedetails.length > 0) {
|
|
|
requiredProperties = requiredProperties.filter(prop => prop !== 'width');
|
|
|
}
|
|
|
for (const prop of ['length', 'width']) {
|