diff --git a/src/components/service-info/service-info.vue b/src/components/service-info/service-info.vue index 0c95d4a5ef04095202f36398134a8ab4b271f9e5..9b9e2c4c2565805f138cc0369dacb9b65c934759 100644 --- a/src/components/service-info/service-info.vue +++ b/src/components/service-info/service-info.vue @@ -82,8 +82,9 @@ 计次收费规格: 暂无时长收费规格: 暂无 ({ types: [], - type: 0, // 购买方式 1:按月,2:按年 + type: 1, // 购买方式 1:按月,2:按年 specification: {}, // 规格 duration: 1, // 时长 showTime: false, @@ -193,7 +195,13 @@ export default { computed: { actionDisabled() { let a = this.data.serviceRequestSpcs; - return a.spcs_type_1.length == 0 && a.spcs_type_2.length == 0; + return ( + a && + a.spcs_type_1 && + a.spcs_type_1.length == 0 && + a.spcs_type_2 && + a.spcs_type_2.length == 0 + ); }, }, watch: {}, @@ -294,9 +302,17 @@ export default { } // 初始化规格 - if (this.data.serviceRequestSpcs.spcs_type_1.length > 0) { + if ( + this.data.serviceRequestSpcs && + this.data.serviceRequestSpcs.spcs_type_1 && + this.data.serviceRequestSpcs.spcs_type_1.length > 0 + ) { this.specification = this.data.serviceRequestSpcs.spcs_type_1[0]; - } else if (this.data.serviceRequestSpcs.spcs_type_2.length > 0) { + } else if ( + this.data.serviceRequestSpcs && + this.data.serviceRequestSpcs.spcs_type_2 && + this.data.serviceRequestSpcs.spcs_type_2.length > 0 + ) { this.specification = this.data.serviceRequestSpcs.spcs_type_2[0]; } }, diff --git a/src/components/shop-cloud/shop-cloud.vue b/src/components/shop-cloud/shop-cloud.vue index f5943b86b194ed99bb3c487f77aebcfed9c94a2d..2cb6c83df710a010a81fb0e5d4994d8e3ac25a66 100644 --- a/src/components/shop-cloud/shop-cloud.vue +++ b/src/components/shop-cloud/shop-cloud.vue @@ -639,7 +639,7 @@