zhaoxiaohai 3 years ago
parent
commit
416d330bb3

+ 7 - 11
css/form.wxss

@@ -57,22 +57,18 @@
     width: 420rpx !important;
 }
 
+.input-class-textarea {
+    height: 230rpx !important;
+    width: 420rpx !important;
+    background-color: #ffffff;
+    margin-top: -5rpx !important;
+}
+
 /* 商户 */
 .firm .input-class {
     width: 450rpx !important;
 }
 
-/* 文本域 */
-.textarea {
-    height: 230rpx;
-}
-
-.textarea>textarea {
-    margin-top: 100rpx;
-    font-size: 28rpx;
-    color: #323233;
-}
-
 /* 左侧无图标使用 */
 .marLeft {
     margin-left: 0rpx;

+ 9 - 13
pages/login/index.js

@@ -51,7 +51,15 @@ Page({
         countDownTime: 60, //倒计时
         dataList: ["暂无分类"], //分类列表
     },
-
+    /* input事件剔除特殊字符 */
+    eliminate(value) {
+        const {
+            name
+        } = value.target.dataset;
+        this.setData({
+            [name]: _Verify.Eliminate(value.detail)
+        })
+    },
     /**
      * 生命周期函数--监听页面加载
      */
@@ -124,7 +132,6 @@ Page({
             "password": utilMd5.hexMD5(this.data.password),
             "client": "wechat_customer"
         }).then(res => {
-            console.log(res)
             /* 结果验证 */
             if (res.msg != '成功') {
                 this.setData({
@@ -138,12 +145,10 @@ Page({
             };
             //账号列表保存到全局变量中
             getApp().globalData.account_list = res.account_list;
-            console.log(getApp().globalData.account_list)
             getApp().globalData.servicehotline = res.servicehotline;
             /* 判断账号 新 单 多  isnewregister*/
             if (res.account_list.length == 1 && res.account_list[0].isnewregister == 1) {
                 //新账号
-                console.log('新账号')
                 this.retentionOfCriticalData(0)
                 //跳转到个人注册
                 this.setData({
@@ -153,13 +158,11 @@ Page({
                 this.changeButText()
             } else if (res.account_list.length == 1 && res.account_list[0].isnewregister == 0) {
                 //单账号
-                console.log('单账号')
                 this.retentionOfCriticalData(0)
                 //跳转到首页
                 this.jumpOverToIndex()
             } else if (res.account_list.length > 1) {
                 //多账号
-                console.log('多账号')
                 //跳转到账号选择
                 this.setData({
                     pageType: 'changeUser'
@@ -193,7 +196,6 @@ Page({
                 "method": "query_typeselectList",
                 "content": {}
             }).then(res => {
-                console.log(res)
                 if (res.msg != '成功') return;
                 let dataList = [];
                 for (let i = 0; i < res.data.length; i++) {
@@ -473,12 +475,6 @@ Page({
             })
         }
     },
-    /* 公司介绍 */
-    fintroductionInput(e) {
-        this.setData({
-            fintroduction: e.detail.value
-        })
-    },
     /* 修改按钮内容 */
     changeButText() {
         const {

+ 12 - 13
pages/login/index.wxml

@@ -10,7 +10,7 @@
             <view class="input_text_box">
                 <image class="input_text_img" src="../../static/login/Phone.png" mode="aspectFill"></image>
                 <view class="input_text_input">
-                    <van-field autosize model:value="{{ fphonenumber }}" data-name="fphonenumber" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fphonenumber}}" type="number" input-class="input-class" placeholder="请输入手机号" border="{{ false }}" />
+                    <van-field model:value="{{ fphonenumber }}" data-name="fphonenumber" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fphonenumber}}" type="number" input-class="input-class" placeholder="请输入手机号" border="{{ false }}" />
                 </view>
             </view>
             <!-- 验证码 -->
@@ -34,14 +34,14 @@
             <view class="input_text_box">
                 <image class="input_text_img" src="../../static/login/username.png" mode="aspectFit"></image>
                 <view class="input_text_input">
-                    <van-field autosize model:value="{{ fname }}" input-class="input-class" placeholder="请输入账号名" border="{{ false }}" />
+                    <van-field value="{{ fname }}" data-name="fname" bind:input='eliminate' input-class="input-class" placeholder="请输入账号名" border="{{ false }}" />
                 </view>
             </view>
             <!-- 身份 -->
             <view class="input_text_box">
                 <image class="input_text_img" src="../../static/login/identity.png" mode="aspectFill"></image>
                 <view class="input_text_input">
-                    <van-field autosize model:value="{{ frole }}" input-class="input-class" placeholder="请填写身份/职位" border="{{ false }}" />
+                    <van-field value="{{ frole }}" data-name="frole" bind:input='eliminate' input-class="input-class" placeholder="请填写身份/职位" border="{{ false }}" />
                 </view>
             </view>
         </view>
@@ -55,7 +55,7 @@
             <view class="input_text_title">品牌名<text>*</text></view>
             <view class="input_text_box box_mar_bot">
                 <view class="input_text_input marLeft">
-                    <van-field autosize model:value="{{ fbrand }}" data-name="fbrand" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fbrand}}" input-class="input-class" placeholder="请输入品牌名" border="{{ false }}" />
+                    <van-field value="{{ fbrand }}" bind:input='eliminate' data-name="fbrand" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fbrand}}" input-class="input-class" placeholder="请输入品牌名" border="{{ false }}" />
                 </view>
             </view>
             <!-- 品牌LOGO -->
@@ -74,7 +74,7 @@
                 <view style="width: 100%; height: 50%; z-index: 999; position: absolute;" bindtap="showPop"></view>
                 <view class="input_text_box box_mar_bot">
                     <view class="input_text_input marLeft">
-                        <van-field autosize model:value="{{ showSaleprodclass }}" data-name="showSaleprod" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.showSaleprod}}" input-class="input-class" placeholder="请输入经营类目" border="{{ false }}" />
+                        <van-field model:value="{{ showSaleprodclass }}" data-name="showSaleprod" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.showSaleprod}}" input-class="input-class" placeholder="请输入经营类目" border="{{ false }}" />
                     </view>
                 </view>
             </view>
@@ -82,41 +82,40 @@
             <view class="input_text_title">注册公司名<text>*</text></view>
             <view class="input_text_box box_mar_bot">
                 <view class="input_text_input marLeft">
-                    <van-field autosize model:value="{{ fagentname }}" data-name="fagentname" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fagentname}}" input-class="input-class" placeholder="请输入公司名称" border="{{ false }}" />
+                    <van-field value="{{ fagentname }}" bind:input='eliminate' data-name="fagentname" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fagentname}}" input-class="input-class" placeholder="请输入公司名称" border="{{ false }}" />
                 </view>
             </view>
             <!-- 联系人 -->
             <view class="input_text_title">联系人<text>*</text></view>
             <view class="input_text_box box_mar_bot">
                 <view class="input_text_input marLeft">
-                    <van-field autosize model:value="{{ fcontact }}" data-name="fcontact" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fcontact}}" input-class="input-class" placeholder="请输入联系人" border="{{ false }}" />
+                    <van-field model:value="{{ fcontact }}" bind:input='eliminate' data-name="fcontact" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fcontact}}" input-class="input-class" placeholder="请输入联系人" border="{{ false }}" />
                 </view>
             </view>
             <!-- 联系方式 -->
             <view class="input_text_title">联系方式<text>*</text></view>
             <view class="input_text_box box_mar_bot">
                 <view class="input_text_input marLeft">
-                    <van-field autosize model:value="{{ fphonenumber }}" data-name="fphonenumber" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fphonenumber}}" input-class="input-class" placeholder="请输入联系方式" border="{{ false }}" />
+                    <van-field model:value="{{ fphonenumber }}" data-name="fphonenumber" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.fphonenumber}}" input-class="input-class" placeholder="请输入联系方式" border="{{ false }}" />
                 </view>
             </view>
             <!-- 公司介绍 -->
             <view class="input_text_title">公司介绍<text>*</text></view>
-            <view class="input_text_box box_mar_bot textarea">
-                <!-- 未做数据绑定 -->
-                <textarea value="{{fintroduction}}" placeholder="请填写公司介绍" placeholder-style="color:#DAD9DB; font-size:30rpx;" bindinput="fintroductionInput"></textarea>
+            <view class="input_text_box box_mar_bot" style="height: 230rpx; align-items: flex-start;">
+                <van-field value="{{ fintroduction }}" data-name="fintroduction" bind:input='eliminate' type="textarea" placeholder="请填写公司介绍" autosize border="{{ false }}" input-class="input-class-textarea" />
             </view>
             <!-- 地址 -->
             <view class="input_text_title">地址<text>*</text></view>
             <view class="input_text_box box_mar_bot">
                 <view class="input_text_input marLeft">
-                    <van-field autosize model:value="{{ faddress }}" data-name="faddress" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.faddress}}" input-class="input-class" placeholder="请输入地址" border="{{ false }}" />
+                    <van-field value="{{ faddress }}" bind:input='eliminate' data-name="faddress" bind:focus='inputFocus' bindblur='inputBlur' error="{{errTips.faddress}}" input-class="input-class" placeholder="请输入地址" border="{{ false }}" />
                 </view>
             </view>
             <!-- 统一社会代码 -->
             <view class="input_text_title">统一社会代码</view>
             <view class="input_text_box box_mar_bot">
                 <view class="input_text_input marLeft">
-                    <van-field autosize model:value="{{ fdutyparagraph }}" input-class="input-class" placeholder="请输入统一社会代码" border="{{ false }}" />
+                    <van-field value="{{ fdutyparagraph }}" bind:input='eliminate' data-name="fdutyparagraph" input-class="input-class" placeholder="请输入统一社会代码" border="{{ false }}" />
                 </view>
             </view>
         </view>

+ 3 - 3
pages/tabbar-pages/home/index.js

@@ -84,14 +84,14 @@ Page({
                 }
             }
         }).then(res => {
+            console.log(res)
             if (res.msg != '成功') return wx.showToast({
                 title: res.data,
                 icon: "none"
             });
-            const data = handleList.getYTD(res.data)
-            const productList = handleList.listOrdering(data);
+            const data = handleList.getYTD(res.data);
             this.setData({
-                productList
+                productList:data
             })
         });
         /* 获取合作商家 */

+ 0 - 3
pages/tabbar-pages/message/index.js

@@ -81,9 +81,6 @@ Page({
                 type = "商户";
                 break;
             case 2:
-                type = "公共";
-                break;
-            case 3:
                 type = "团队";
                 break;
             default:

+ 1 - 0
pages/tabbar-pages/supplyAndDemand/index.js

@@ -34,6 +34,7 @@ Page({
             "method": "query_typeselectList",
             "content": {}
         }).then(res => {
+            console.log("分类", res)
             if (res.msg != '成功') return;
             this.setData({
                 ftypeList: res.data

+ 0 - 14
utils/processingData.js

@@ -39,22 +39,8 @@ function getYTD(data) {
     return data;
 }
 
-/* 供需列表数据排序 */
-function listOrdering(data) {
-    /* 处理排序 */
-    const typeList = ['待对接', '正在对接', '已解决', '已过期'];
-    let productList = [];
-    for (let i = 0; i < typeList.length; i++) {
-        for (let k = 0; k < data.length; k++) {
-            if (typeList[i] == data[k].fstatus) productList[productList.length] = data[k];
-        }
-    };
-    return productList;
-}
-
 module.exports = {
     checkdate,
-    listOrdering,
     getYTD,
     twoDimensionalArr,
     imageType

+ 8 - 9
utils/verify.js

@@ -42,15 +42,14 @@ class TestVerify {
         }
         return true;
     }
-
-    /* 删除特殊字符 */
-    removeSpecialCharacters(val) {
-        let reg = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]"); 
-        let rs = ""; 
-        for (let i = 0, l = val.length; i < val.length; i++) { 
-            rs = rs + val.substr(i, 1).replace(reg, ''); 
-        } 
-        return rs; 
+    
+    /* 剔除特殊字符 */
+    Eliminate(value) {
+        if (value != '') {
+            const pattern = /[`~!@#$^&*()=|{}':;',\\\[\]\.<>\/?~!@#¥……&*()——|{}【】';:""'。,、?\s]/g;
+            return value.replace(pattern, "");
+        };
+        return "";
     }
 
     /* 附件格式,大小校验 */