zhaoxiaohai 4 лет назад
Родитель
Сommit
44ddbf8cfa
2 измененных файлов с 11 добавлено и 3 удалено
  1. 9 1
      pages/announceDemand/index.js
  2. 2 2
      pages/announceDemand/index.wxml

+ 9 - 1
pages/announceDemand/index.js

@@ -82,7 +82,15 @@ Page({
             })
         };
     },
-
+    /* input事件剔除特殊字符 */
+    eliminate(value) {
+        const {
+            name
+        } = value.target.dataset;
+        this.setData({
+            [name]: _Verify.Eliminate(value.detail)
+        })
+    },
     /* 日期选择 */
     dateChange({
         detail

+ 2 - 2
pages/announceDemand/index.wxml

@@ -4,10 +4,10 @@
             <view class="clickPop {{ftype==''?'':'selected'}} {{errTips.ftype?'selected':''}}" style="color: {{errTips.ftype?'#EF2C48':'#000'}};" bindtap="showPop">{{ftype?ftype:"点击选择"}}</view>
         </My_GreyRectangleForm>
         <My_GreyRectangleForm title="需求标题" required>
-            <van-field model:value="{{ ftitle }}" data-name="ftitle" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.ftitle}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
+            <van-field value="{{ ftitle }}" bind:input='eliminate' data-name="ftitle" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.ftitle}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
         </My_GreyRectangleForm>
         <My_GreyRectangleForm title="需求内容" required>
-            <van-field model:value="{{ fcontent }}" data-name="fcontent" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fcontent}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
+            <van-field value="{{ fcontent }}" bind:input='eliminate' data-name="fcontent" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fcontent}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
         </My_GreyRectangleForm>
         <My_GreyRectangleForm title="图片">
             <My_UploadFiles id="UploadFiles" fileList="{{attinfos}}" upType="SupplyAndDemand" UploadShow="2" previewSize="60px" maxCount="3" tsupplyanddemand="{{tsupplyanddemand}}" previewSize="65px" bindimageChange="imageChange"></My_UploadFiles>