Explorar o código

排除部分特殊字符

xiaohaizhao %!s(int64=2) %!d(string=hai) anos
pai
achega
9042b063d5
Modificáronse 1 ficheiros con 8 adicións e 4 borrados
  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)
             }
         },