瀏覽代碼

排除部分特殊字符

xiaohaizhao 2 年之前
父節點
當前提交
9042b063d5
共有 1 個文件被更改,包括 8 次插入4 次删除
  1. 8 4
      Eservice/components/form/form.js

+ 8 - 4
Eservice/components/form/form.js

@@ -2,6 +2,9 @@
 import api from '../../api/api'
 import util from '../../../utils/util'
 
+const verify = require('../../../utils/Check');
+
+
 const app = getApp()
 Component({
     /**
@@ -53,13 +56,14 @@ Component({
             let data = detail.currentTarget.dataset.item
 
             let index = detail.currentTarget.dataset.index
-
-            this.data.formLayoutData.formInfo[index].inputValue = detail.detail.value
+            //添加排除特殊字符
+            this.data.formLayoutData.formInfo[index].inputValue = verify.queryStr(detail.detail.value);
+            this.setData({
+                formLayoutData: this.data.formLayoutData
+            })
 
             if (data.role.formatter) {
-
                 let regStatus = data.role.formatter(detail.detail.value)
-
                 this.setErrorMsg(regStatus, index)
             }
         },