Tang 2 anos atrás
pai
commit
c3edd49320

+ 2 - 2
src/axios.js

@@ -1,8 +1,8 @@
 import axios from 'axios'
 import store from './store'
 import { Notification, Message } from 'element-ui'
-export const BASE_URL = process.env.BASE_URL    //测试-外网
-// export const BASE_URL = "http://192.168.1.7:5055"    //测试-外网
+// export const BASE_URL = process.env.BASE_URL    //测试-外网
+export const BASE_URL = "http://192.168.1.7:5055"    //测试-外网
 export const tenantId = process.env.TENANT_ID
 import tools from './common/tools'
 import router from './router'

+ 121 - 161
src/components/buyCourseModal/index.vue

@@ -5,17 +5,22 @@
       class="select-class"
       :visible.sync="selectClassModal"
     >
-      <div class="select-class__content">
-        <div class="selection" v-if="goodsDetail.specialGoods">
+      <div
+        class="select-class__content"
+        v-for="(it, ik) in copyDetail"
+        :key="ik"
+      >
+        <h3>{{ it.name }}</h3>
+        <div class="selection" v-if="it.specialGoods || sign">
           <el-select
             class="select"
-            v-model="gradeId"
+            v-model="it.gradeId"
             placeholder="请选择班级"
             size="small"
-            @click.native="selectClick(goodsDetail, 'class')"
+            @click.native="selectClick(it, 'class')"
           >
             <el-option
-              v-for="item in gradeList"
+              v-for="item in it.gradeList"
               :key="item.gradeId"
               :disabled="
                 item.studentNum > 0 && item.studentNum == item.studentUpper
@@ -31,18 +36,16 @@
 
         <div
           class="selection"
-          v-if="
-            goodsDetail.templateType == 'apply' && goodsDetail.goodsType == 1
-          "
+          v-if="it.templateType == 'apply' && it.goodsType == 1"
         >
           <el-select
-            v-model="educationId"
+            v-model="it.educationId"
             placeholder="请选择考期"
             size="small"
-            @click.native="selectClick(goodsDetail, 'exam')"
+            @click.native="selectClick(it, 'exam')"
           >
             <el-option
-              v-for="item in examineList"
+              v-for="item in it.examineList"
               :key="item.educationId"
               :label="item.examineName"
               :value="item.educationId"
@@ -52,37 +55,14 @@
           <el-cascader
             size="small"
             :props="props"
-            ref="cascader"
+            :ref="'cascader' + ik"
             :options="provinceList"
-            v-model="examArea"
-            @change="areaChange(goodsDetail)"
+            v-model="it.area"
+            @change="areaChange(it, ik)"
             clearable
             placeholder="请选择报考地区"
           ></el-cascader>
         </div>
-        <div
-          class="selection"
-          v-if="goodsDetail.sevenYear && goodsDetail.goodsType == 1"
-        >
-          <el-form
-            :model="ruleForm"
-            status-icon
-            :rules="rules"
-            ref="ruleForm"
-            label-width="180px"
-            class="demo-ruleForm"
-          >
-            <el-form-item label="七大员继教可选年份:" prop="checkList">
-              <el-checkbox-group v-model="ruleForm.checkList">
-                <el-checkbox
-                  v-for="(item, index) in sevenYear"
-                  :key="index"
-                  :label="item"
-                ></el-checkbox>
-              </el-checkbox-group>
-            </el-form-item>
-          </el-form>
-        </div>
       </div>
 
       <div slot="footer" class="dialog-footer">
@@ -103,69 +83,64 @@ export default {
   data() {
     return {
       selectClassModal: false,
-      goodsDetail: {},
+      copyDetail: [], //备份
       provinceList: [],
       gradeList: [],
+      gradeMap: new Map(),
       gradeId: "",
       examineList: [],
       examArea: [],
-      sevenYear: [],
-      ruleForm: {
-        checkList: []
-      },
       educationId: "",
+      sign: 0, //是否继教七大员商品
       props: {
         lazy: true,
         lazyLoad: this.lazyLoad
-      },
-      rules: {
-        checkList: [
-          {
-            required: true,
-            message: "请选择七大员继教年份",
-            trigger: "change"
-          }
-        ]
       }
     };
   },
   mounted() {},
   methods: {
-    showModal(item) {
-      this.gradeId = "";
-      this.gradeList = [];
-      this.ruleForm.checkList = [];
+    showModal(item, sign) {
       this.selectClassModal = true;
-      this.goodsDetail = item;
-      if (this.goodsDetail.specialGoods) {
-        this.selectClick(this.goodsDetail, "class", true);
-      }
-      if (
-        this.goodsDetail.templateType == "apply" &&
-        this.goodsDetail.goodsType == 1
-      ) {
-        this.selectClick(this.goodsDetail, "exam", true);
+      this.getProvinceList();
+      if (Array.isArray(item)) {
+        this.copyDetail = JSON.parse(JSON.stringify(item));
+      } else {
+        this.copyDetail = JSON.parse(JSON.stringify([item]));
       }
-      if (this.goodsDetail.sevenYear) {
-        this.sevenYear = item.sevenYear.split(",") || [];
+      this.sign = sign || 0;
+      for (let i = 0; i < this.copyDetail.length; i++) {
+        this.copyDetail[i].gradeId = "";
+        this.copyDetail[i].gradeList = [];
+        this.copyDetail[i].educationId = "";
+        this.copyDetail[i].examineList = [];
+        if (this.copyDetail[i].specialGoods || this.sign) {
+          this.selectClick(this.copyDetail[i], "class", true);
+        }
+        if (
+          this.copyDetail[i].templateType == "apply" &&
+          this.copyDetail[i].goodsType == 1
+        ) {
+          this.selectClick(this.copyDetail[i], "exam", true);
+        }
       }
     },
     selectClick(goodsDetail, type, status) {
       if (type == "class") {
         //选择班级
-        if (!this.gradeList.length) {
+        if (!goodsDetail.gradeList.length) {
           this.$request
             .goodsGradeList({ goodsId: goodsDetail.goodsId })
             .then(res => {
-              this.gradeList = res.rows;
-              if (this.gradeList.length == 0) {
+              goodsDetail.gradeList = res.rows;
+              if (goodsDetail.gradeList.length == 0) {
                 let item = {
                   className: "系统分班",
                   gradeId: 0
                 };
-                this.gradeList.push(item);
+                goodsDetail.gradeList.push(item);
               } else {
-                let isGradeFull = this.gradeList.every(
+                let isGradeFull = goodsDetail.gradeList.every(
                   item =>
                     item.studentNum > 0 && item.studentNum == item.studentUpper
                 );
@@ -175,12 +150,13 @@ export default {
                     className: "系统分班",
                     gradeId: 0
                   };
-                  this.gradeList.unshift(item);
+                  goodsDetail.gradeList.unshift(item);
                 }
               }
               if (status) {
-                this.gradeId = this.gradeList[0].gradeId;
+                goodsDetail.gradeId = goodsDetail.gradeList[0].gradeId;
               }
+              this.$forceUpdate();
             });
         }
       } else if (type == "apply") {
@@ -190,99 +166,61 @@ export default {
         this.$request
           .getExamineList({ projectId: goodsDetail.projectId })
           .then(res => {
-            this.examineList = res.rows;
-            if (status) {
-              this.educationId = this.examineList[0].educationId;
+            goodsDetail.examineList = res.rows;
+            if (status && res.rows.length > 0) {
+              goodsDetail.educationId = res.rows[0].educationId;
             }
+            this.$forceUpdate();
           });
       }
     },
-    validateFunc() {
-      return new Promise((resolve, reject) => {
-        this.$refs["ruleForm"].validate(valid => {
-          if (valid) {
-            resolve(true);
-          } else {
-            resolve(false);
-            console.log("error submit!!");
-            return false;
+    async pay() {
+      try {
+        let itCopyDetail = JSON.parse(JSON.stringify(this.copyDetail));
+        itCopyDetail.forEach(i => {
+          if (
+            (i.specialGoods == 1 || this.sign) &&
+            !i.gradeId &&
+            i.gradeId !== 0
+          ) {
+            throw new Error("请选择班级");
+          }
+          if (i.templateType == "apply" && i.goodsType == 1 && !i.educationId) {
+            throw new Error("请选择考期");
+          }
+          if (i.goodsType == 1) {
+            if (i.specialGoods == 1 || this.sign) {
+              let goodsInputData = {
+                type: "class",
+                gradeId: i.gradeId,
+                gradeJson: JSON.stringify(
+                  i.gradeList.find(grade => grade.gradeId == i.gradeId)
+                )
+              };
+              i.goodsInputData = goodsInputData;
+            }
+            if (i.templateType == "apply") {
+              let goodsInputData = {
+                type: "apply",
+                applyAreasJson: JSON.stringify(i.applyAreas),
+                examDateJson: JSON.stringify(
+                  i.examineList.find(exam => exam.educationId == i.educationId)
+                )
+              };
+              i.goodsInputData = goodsInputData;
+            }
           }
         });
-      });
-    },
-    async pay() {
-      if (this.goodsDetail.specialGoods == 1) {
-        if (!this.gradeId && this.gradeId !== 0) {
-          this.$message({
-            message: "请选择班级",
-            type: "warning"
-          });
-          return;
-        }
-      }
-
-      if (
-        this.goodsDetail.templateType == "apply" &&
-        this.goodsDetail.goodsType == 1
-      ) {
-        // if (!item.applyAreas.areaName) {
-        // 	uni.showModal({
-        // 		title: '提示',
-        // 		content: '请选择报考地区',
-        // 		showCancel: false
-        // 	});
-        // 	return false;
-        // }
-        if (!this.educationId) {
-          this.$message({
-            message: "请选择考期",
-            type: "warning"
-          });
-          return false;
-        }
-      }
-      if (this.goodsDetail.sevenYear && this.goodsDetail.goodsType == 1) {
-        const A = await this.validateFunc();
-        if (!A) {
-          return;
-        }
-      }
-      let selectGoodsList = Object.assign({}, this.goodsDetail);
-      if (selectGoodsList.goodsType == 1) {
-        if (selectGoodsList.specialGoods == 1) {
-          let goodsInputData = {
-            type: "class",
-            gradeId: this.gradeId,
-            gradeJson: JSON.stringify(
-              this.gradeList.find(grade => grade.gradeId == this.gradeId)
-            )
-          };
-          selectGoodsList.goodsInputData = goodsInputData;
-        }
-        if (selectGoodsList.templateType == "apply") {
-          let goodsInputData = {
-            type: "apply",
-            applyAreasJson: JSON.stringify(this.applyAreas),
-            examDateJson: JSON.stringify(
-              this.examineList.find(
-                exam => exam.educationId == this.educationId
-              )
-            )
-          };
-          selectGoodsList.goodsInputData = goodsInputData;
-        }
-      }
-      var mas = [selectGoodsList];
-      if (this.goodsDetail.sevenYear && this.goodsDetail.goodsType == 1) {
-        mas = this.ruleForm.checkList.map(i => {
-          return { ...selectGoodsList, sevenYear: i };
+        localStorage.setItem("checkGoodsList", JSON.stringify(itCopyDetail));
+        this.$router.push({
+          path: "/payment"
+        });
+      } catch (error) {
+        this.$message({
+          message: error,
+          type: "warning"
         });
       }
-      localStorage.setItem("checkGoodsList", JSON.stringify(mas));
-
-      this.$router.push({
-        path: "/payment"
-      });
     },
     /**
      * 获取所有省份
@@ -296,15 +234,37 @@ export default {
         }));
       });
     },
-    areaChange() {
-      let node = this.$refs["cascader"].getCheckedNodes()[0]; //选中的根节点
+    areaChange(row, index) {
+      let node = this.$refs["cascader" + index][0].getCheckedNodes()[0]; //选中的根节点
       console.log(node);
-      this.applyAreas = {
+      row.applyAreas = {
         areaName: node.parent.label,
         areaId: node.parent.value,
         cityId: node.value,
         cityName: node.label
       };
+    },
+    lazyLoad(node, resolve) {
+      const { level } = node;
+      if (level == 0) {
+        // this.$request.getProvinceList().then((res) => {
+        //   const nodes = res.rows.map((item) => ({
+        //     value: item.areaId,
+        //     label: `${item.areaName}`,
+        //     leaf: level >= 1,
+        //   }));
+        //   resolve(nodes);
+        // });
+      } else if (level == 1) {
+        this.$request.getCityList({ parentId: node.value }).then(res => {
+          const nodes = res.rows.map(item => ({
+            value: item.areaId,
+            label: `${item.areaName}`,
+            leaf: level >= 1
+          }));
+          resolve(nodes);
+        });
+      }
     }
   },
   computed: {

+ 113 - 75
src/components/goodsItem/IndexSkuDialog.vue

@@ -1,26 +1,48 @@
 <template>
   <div class="check_sku">
-    <el-dialog title="选择需要购买的课程" :visible.sync="skuModal" width="680px" class="appoint-modal"
-      :close-on-click-modal="false" :close-on-press-escape="false" :before-close="cancel">
+    <el-dialog
+      title="选择需要购买的课程"
+      :visible.sync="skuModal"
+      width="680px"
+      class="appoint-modal"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      :before-close="cancel"
+    >
       <div v-loading="loading" class="contents">
         <div class="check_con">
-          <div v-for="(item, index) in specList" :key="index" class="check_items">
+          <div
+            v-for="(item, index) in specList"
+            :key="index"
+            class="check_items"
+          >
             <div class="grades" v-if="specList.length > 1">{{ item.name }}</div>
             <div class="mains" v-if="index == 0 && specList.length > 1">
               <div class="grade_names">
-                <div class="course_items" v-for="(child, c_index) in item.specAttrList" :key="c_index"
-                  :class="{ nactive: selectGoodIndex == c_index }" @click="selectGoodType(c_index)">
+                <div
+                  class="course_items"
+                  v-for="(child, c_index) in item.specAttrList"
+                  :key="c_index"
+                  :class="{ nactive: selectGoodIndex == c_index }"
+                  @click="selectGoodType(c_index)"
+                >
                   {{ child.name }}
                 </div>
               </div>
             </div>
             <div v-if="index == 1 || specList.length == 1" class="check_box">
               <el-checkbox-group v-model="checkedAttrs" @change="changeCheck">
-                <el-checkbox v-for="spec in specAttrList" :label="spec.specAttributeId" :key="spec.specAttributeId">
-                  <div class="box_centen">{{ spec.name }}<span>{{ spec.standPrice
-                      === 0 ?
-                      '免费' : `¥${spec.standPrice}`
-                  }}</span></div>
+                <el-checkbox
+                  v-for="spec in specAttrList"
+                  :label="spec.specAttributeId"
+                  :key="spec.specAttributeId"
+                >
+                  <div class="box_centen">
+                    {{ spec.name
+                    }}<span>{{
+                      spec.standPrice === 0 ? "免费" : `¥${spec.standPrice}`
+                    }}</span>
+                  </div>
                 </el-checkbox>
               </el-checkbox-group>
             </div>
@@ -34,10 +56,13 @@
           </div>
           <p>已选择{{ checkedAttrs.length }}个商品</p>
         </div>
-        <el-button :disabled="
-        checkedAttrs.length == 0" @click="confirms()" style="width: 136px" type="primary">{{ isCarOrBuy == 1 ?
-      "加入购物车" : "立即购买"
-  }}</el-button>
+        <el-button
+          :disabled="checkedAttrs.length == 0"
+          @click="confirms()"
+          style="width: 136px"
+          type="primary"
+          >{{ isCarOrBuy == 1 ? "加入购物车" : "立即购买" }}</el-button
+        >
       </div>
     </el-dialog>
     <BuyCourseModal ref="selectClassModal"></BuyCourseModal>
@@ -51,16 +76,16 @@ export default {
   props: {
     skuModal: {
       type: Boolean,
-      default: false,
+      default: false
     },
     specTemplateId: {
       type: [String, Number],
-      default: "",
+      default: ""
     },
     isCarOrBuy: {
       type: Number,
-      default: 1,
-    },
+      default: 1
+    }
   },
   data() {
     return {
@@ -68,73 +93,76 @@ export default {
       specList: [], // 规格列表
       checkedAttrs: [],
       selectGoodIndex: 0,
-      specAttrPriceList: []
+      specAttrPriceList: [],
+      sign: 0 //继教七大员选班判断
     };
   },
   watch: {
     skuModal(newV, oldV) {
       if (newV) {
-        this.selectGoodIndex = 0
-        this.checkedAttrs = []
+        this.sign = 0
+        this.selectGoodIndex = 0;
+        this.checkedAttrs = [];
         this.getSpecDetail();
       }
-    },
+    }
   },
   computed: {
     selectId() {
       if (this.specList.length < 2) {
-        return
+        return;
       }
-      return this.specList[0].specAttrList[this.selectGoodIndex].specAttributeId
+      return this.specList[0].specAttrList[this.selectGoodIndex]
+        .specAttributeId;
     },
     specAttrList() {
-      let arr = []
-      let data = this.specList.slice(-1)
+      let arr = [];
+      let data = this.specList.slice(-1);
       data[0].specAttrList.forEach(ele => {
-        let id = ele.specAttributeId
+        let id = ele.specAttributeId;
         if (this.specList.length > 1) {
-          id = this.selectId + ',' + id
+          id = this.selectId + "," + id;
         }
-        let item = this.specAttrPriceList.find(e => e.specAttrIds == id)
+        let item = this.specAttrPriceList.find(e => e.specAttrIds == id);
         if (item) {
-          ele.goodsId = item.goodsId
-          ele.standPrice = item.standPrice
-          arr.push(ele)
+          ele.goodsId = item.goodsId;
+          ele.standPrice = item.standPrice;
+          arr.push(ele);
         }
       });
-      return arr
+      return arr;
     },
     allPrice() {
       if (!this.checkedAttrs.length) {
-        return 0
+        return 0;
       }
       return this.specAttrList.reduce((a, b) => {
         if (this.checkedAttrs.includes(b.specAttributeId)) {
-          return a + b.standPrice
+          return a + b.standPrice;
         }
-        return a
-      }, 0)
+        return a;
+      }, 0);
     },
     isSingleChoice() {
       if (!this.specAttrPriceList.length) {
-        return false
+        return false;
       }
-      return this.specAttrPriceList[0].specialGoods
+      return this.specAttrPriceList[0].specialGoods;
     }
   },
   methods: {
     changeCheck(val) {
       // 二建变单选
       if (this.isSingleChoice) {
-        this.checkedAttrs = val.slice(-1)
+        this.checkedAttrs = val.slice(-1);
       }
     },
     selectGoodType(index) {
       if (index == this.selectGoodIndex) {
-        return
+        return;
       }
-      this.selectGoodIndex = index
-      this.checkedAttrs = []
+      this.selectGoodIndex = index;
+      this.checkedAttrs = [];
     },
     cancel() {
       this.$emit("update:skuModal", false);
@@ -144,15 +172,16 @@ export default {
       this.$axios({
         url: `/app/common/spec/${this.specTemplateId}`,
         method: "get",
-        noToken: true,
+        noToken: true
       })
-        .then((res) => {
+        .then(res => {
           this.loading = false;
           if (res.code == 200) {
             let data = res.data;
             if (data) {
-              this.specAttrPriceList = data.specAttrPriceList
+              this.specAttrPriceList = data.specAttrPriceList;
               this.specList = data && (data.specList || []);
+              this.sign = data.sign || 0;
             }
           }
         })
@@ -161,45 +190,54 @@ export default {
         });
     },
     confirms() {
-      let goodsIds = []
-      let goodList = []
+      let goodsIds = [];
+      let goodList = [];
       this.specAttrList.forEach(e => {
-        if (this.checkedAttrs.includes(e.specAttributeId) && !goodsIds.includes(e.goodsId)) {
-          goodsIds.push(e.goodsId)
-          goodList.push(this.specAttrPriceList.find(ele => ele.goodsId == e.goodsId))
+        if (
+          this.checkedAttrs.includes(e.specAttributeId) &&
+          !goodsIds.includes(e.goodsId)
+        ) {
+          goodsIds.push(e.goodsId);
+          goodList.push(
+            this.specAttrPriceList.find(ele => {
+              if(ele.goodsId == e.goodsId){
+                ele.name = e.name
+                return ele
+              }
+            })
+          );
         }
-      })
-      this.$request.checkGoodsStatus({ goodsIds }).then((res) => {
-        if (this.isCarOrBuy == 1) {
-          // 加入购物车
-          this.$emit("toShopCart", goodsIds);
-        } else {
-          if(this.isSingleChoice){
-            this.$refs.selectClassModal.showModal(goodList[0]);
-          }else{
-            this.goPayment(goodList)
+      });
+      this.$request
+        .checkGoodsStatus({ goodsIds })
+        .then(res => {
+          if (this.isCarOrBuy == 1) {
+            // 加入购物车
+            this.$emit("toShopCart", goodsIds);
+          } else {
+            if (this.isSingleChoice || this.sign) {
+              this.$refs.selectClassModal.showModal(goodList,this.sign);
+            } else {
+              this.goPayment(goodList);
+            }
           }
-        }
-        this.cancel();
-      }).catch((e) => {
-        this.$message.warning(e.msg);
-      })
-
+          this.cancel();
+        })
+        .catch(e => {
+          this.$message.warning(e.msg);
+        });
     },
     goPayment(data) {
       let selectGoodsList = JSON.parse(JSON.stringify(data));
-      localStorage.setItem(
-        "checkGoodsList",
-        JSON.stringify(selectGoodsList)
-      );
+      localStorage.setItem("checkGoodsList", JSON.stringify(selectGoodsList));
       this.$router.push({
-        path: "/payment",
+        path: "/payment"
       });
-    },
+    }
   },
   components: {
     BuyCourseModal
-  },
+  }
 };
 </script>
 
@@ -355,4 +393,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 26 - 52
src/pages/cart/index.vue

@@ -61,6 +61,9 @@
                         >{{ scope.row.classHours }}学时</span
                       >
                       <span class="note">{{ scope.row.educationName }}</span>
+                      <span class="note" v-if="scope.row.sevenYear">{{
+                        scope.row.sevenYear
+                      }}</span>
                     </div>
                     <div class="desc">
                       {{ scope.row.projectName }}-{{ scope.row.businessName }}
@@ -89,24 +92,6 @@
                         </el-option>
                       </el-select>
                     </div>
-                    <div
-                      class="selection dis_flex"
-                      v-if="scope.row.sevenYear && scope.row.goodsType == 1"
-                    >
-                      <span>七大员继教可选年份:</span>
-                      <el-checkbox-group
-                        v-model="scope.row.checkList"
-                        @change="checkFunc"
-                      >
-                        <el-checkbox
-                          v-for="(item, index) in computedSevenYear(
-                            scope.row.sevenYear
-                          )"
-                          :key="index"
-                          :label="item"
-                        ></el-checkbox>
-                      </el-checkbox-group>
-                    </div>
 
                     <div
                       class="selection"
@@ -239,14 +224,6 @@ export default {
     this.getProvinceList();
     this.cartList();
   },
-  computed: {
-    computedSevenYear: function() {
-      return function(item) {
-        var ary = (item && item.split(",")) || [];
-        return ary;
-      };
-    }
-  },
   methods: {
     ...mapMutations(["getCartCount"]),
     checkFunc() {
@@ -392,11 +369,7 @@ export default {
     caculate() {
       this.total = 0;
       this.multipleSelection.forEach(item => {
-        if (item.sevenYear) {
-          this.total += item.standPrice * item.checkList.length;
-        } else {
-          this.total += item.standPrice;
-        }
+        this.total += item.standPrice;
       });
     },
     pay() {
@@ -421,15 +394,15 @@ export default {
             return;
           }
         }
-        if (item.sevenYear && item.goodsType == 1) {
-          if (item.checkList.length == 0) {
-            this.$message({
-              message: "请选择七大员继教年份",
-              type: "warning"
-            });
-            return;
-          }
-        }
+        // if (item.sevenYear && item.goodsType == 1) {
+        //   if (item.checkList.length == 0) {
+        //     this.$message({
+        //       message: "请选择七大员继教年份",
+        //       type: "warning"
+        //     });
+        //     return;
+        //   }
+        // }
 
         if (item.templateType == "apply" && item.goodsType == 1) {
           // if (!item.applyAreas.areaName) {
@@ -479,18 +452,19 @@ export default {
             item.goodsInputData = goodsInputData;
           }
         }
-        if (
-          item.goodsType == 1 &&
-          item.sevenYear &&
-          item.checkList.length > 0
-        ) {
-          let A = item.checkList.map(i => {
-            return { ...item, sevenYear: i };
-          });
-          arrayBox.push(...A);
-        } else {
-          arrayBox.push(item);
-        }
+        arrayBox.push(item);
+        // if (
+        //   item.goodsType == 1 &&
+        //   item.sevenYear &&
+        //   item.checkList.length > 0
+        // ) {
+        //   let A = item.checkList.map(i => {
+        //     return { ...item, sevenYear: i };
+        //   });
+        //   arrayBox.push(...A);
+        // } else {
+        //   arrayBox.push(item);
+        // }
       });
 
       localStorage.setItem("checkGoodsList", JSON.stringify(arrayBox));