Browse Source

fix:修改流量套餐的提示语判断问题

zeng.chen 2 months atrás
parent
commit
5a81a87e44
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/views/service/package/detail.vue
  2. 1 1
      src/views/service/vip/detail.vue

+ 2 - 2
src/views/service/package/detail.vue

@@ -238,7 +238,7 @@ export default {
 
       deviceGoodsList(1, businessType, deviceIds.join(",")).then((res) => {
         if (res.code === 0) {
-
+          console.log("获取到流量套餐:", this.form.freeActivityId);
           // 如果返回的数据为空数组,确保freeOptions也为空数组而不是null或undefined
           this.freeOptions = res.data || [];
           // console.log("获取到流量套餐:", this.freeOptions.length, this.form.freeActivityId);
@@ -249,7 +249,7 @@ export default {
             this.form.freeActivityId = null;
           }
           // 如果freeOptions有值且freeActivityId有值,检查是否存在对应的选项
-          else if (this.form.freeActivityId !== null) {
+          else if (!(this.form.freeActivityId === null || this.form.freeActivityId === undefined)) {
             const exists = this.freeOptions.some(item => {
               // console.log("item.id:", item.id, "freeActivityId:", this.form.freeActivityId);
               return String(item.id) === String(this.form.freeActivityId);

+ 1 - 1
src/views/service/vip/detail.vue

@@ -268,7 +268,7 @@ export default {
           }
           // 如果freeOptions有值且freeActivityId有值,检查是否存在对应的选项
 
-          else if (this.form.freeActivityId != null) {
+          else if (!(this.form.freeActivityId === null || this.form.freeActivityId === undefined)) {
             console.log("找匹配的流量套餐1:", this.form.freeActivityId);
 
             const exists = this.freeOptions.some(item => {