Bladeren bron

商户管理

zhaoxiaohai 3 jaren geleden
bovenliggende
commit
c98f4729cf
2 gewijzigde bestanden met toevoegingen van 14 en 8 verwijderingen
  1. 9 3
      pages/storeMessage/index.js
  2. 5 5
      pages/storeMessage/index.wxml

+ 9 - 3
pages/storeMessage/index.js

@@ -6,9 +6,7 @@ import {
     TestVerify
 } from "../../utils/verify";
 const _Verify = new TestVerify();
-var WxParse = require('../../wxParse/wxParse.js')
 Page({
-
     /**
      * 页面的初始数据
      */
@@ -42,7 +40,15 @@ Page({
             faddress: false,
         }
     },
-
+    /* input事件剔除特殊字符 */
+    eliminate(value) {
+        const {
+            name
+        } = value.target.dataset;
+        this.setData({
+            [name]: _Verify.Eliminate(value.detail)
+        })
+    },
     /**
      * 生命周期函数--监听页面加载
      */

+ 5 - 5
pages/storeMessage/index.wxml

@@ -2,7 +2,7 @@
 <My_GeneralTemplate padBot="20rpx">
     <view class="store_message">
         <My_GreyRectangleForm title="品牌名" required>
-            <van-field disabled="{{isDisabled}}" model:value="{{ fbrand }}" data-name="fbrand" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fbrand}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
+            <van-field disabled="{{isDisabled}}" value="{{ fbrand }}" bind:input='eliminate' data-name="fbrand" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fbrand}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
         </My_GreyRectangleForm>
 
         <My_GreyRectangleForm title="品牌LOGO" required>
@@ -18,7 +18,7 @@
         </My_GreyRectangleForm>
 
         <My_GreyRectangleForm title="联系人" required>
-            <van-field disabled="{{isDisabled}}" model:value="{{ fcontact }}" data-name="fcontact" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fcontact}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
+            <van-field disabled="{{isDisabled}}" value="{{ fcontact }}" bind:input='eliminate' data-name="fcontact" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fcontact}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
         </My_GreyRectangleForm>
 
         <My_GreyRectangleForm title="联系方式" required>
@@ -26,7 +26,7 @@
         </My_GreyRectangleForm>
 
         <My_GreyRectangleForm title="注册公司名" required>
-            <van-field disabled="{{isDisabled}}" model:value="{{ fagentname }}" data-name="fagentname" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fagentname}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
+            <van-field disabled="{{isDisabled}}" value="{{ fagentname }}" bind:input='eliminate' data-name="fagentname" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fagentname}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
         </My_GreyRectangleForm>
         <import src="/wxParse/wxParse" />
         <My_GreyRectangleForm title="公司介绍" required>
@@ -36,10 +36,10 @@
         </My_GreyRectangleForm>
 
         <My_GreyRectangleForm title="地址" required>
-            <van-field autosize type="textarea" disabled="{{isDisabled}}" model:value="{{ faddress }}" data-name="faddress" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.faddress}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
+            <van-field autosize type="textarea" disabled="{{isDisabled}}" value="{{ faddress }}" bind:input='eliminate' data-name="faddress" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.faddress}}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
         </My_GreyRectangleForm>
         <My_GreyRectangleForm title="统一社会代码">
-            <van-field disabled="{{isDisabled}}" model:value="{{ fdutyparagraph }}" input-class="input-class" placeholder="点击填写" border="{{ false }}" />
+            <van-field disabled="{{isDisabled}}" value="{{ fdutyparagraph }}" data-name="fdutyparagraph" bind:input='eliminate' input-class="input-class" placeholder="点击填写" border="{{ false }}" />
         </My_GreyRectangleForm>
     </view>
 </My_GeneralTemplate>