Browse Source

fix: 考生承诺书位置bug

zhangjie 10 months ago
parent
commit
db96d82556
1 changed files with 14 additions and 7 deletions
  1. 14 7
      card/mixins/exchange.js

+ 14 - 7
card/mixins/exchange.js

@@ -106,12 +106,16 @@ export default {
           exchange.fill_area = exchange.fill_area.concat(pnoInfo);
         }
 
-        // 课程代码条码,考生承诺书
+        // 课程代码条码
         const extraInfo = this.getExtraInfo(this.curPageDom);
         Object.entries(extraInfo).forEach(([key, vals]) => {
           exchange.extension[key] = exchange.extension[key].concat(vals);
         });
 
+        // 考生承诺书
+        const uAreas = this.getUndertakingInfo(this.curPageDom);
+        exchange.info_area.push(...uAreas);
+
         page.exchange = exchange;
       });
 
@@ -119,10 +123,18 @@ export default {
 
       return npages;
     },
+    getUndertakingInfo(pageDom) {
+      const areas = [];
+      const undertakingDom = pageDom.querySelector(".elem-undertaking");
+      if (undertakingDom) {
+        areas.push(this.getOffsetInfo(undertakingDom));
+      }
+
+      return areas;
+    },
     getExtraInfo(pageDom) {
       const info = {
         barcode: [],
-        info_area: [],
       };
       const courseBarDom = pageDom.querySelector(".course-barcode");
       if (courseBarDom) {
@@ -132,11 +144,6 @@ export default {
         });
       }
 
-      const undertakingDom = pageDom.querySelector(".elem-undertaking");
-      if (undertakingDom) {
-        info.info_area.push(this.getOffsetInfo(undertakingDom));
-      }
-
       return info;
     },
     getPageNumberInfo() {